在easydl平台上传已经标注好的数据,怎么按照要求进行json和图片格式配置。是用labellmg图片标注工具生成的xml文件。

在这里插入代码片1.可以参考百度al社区的这个帖子https://ai.baidu.com/forum/topic/show/942310
2。不过他说的太笼统了,我进行一下补充:
client_id、client_secret是EasyDL定制训练平台 - 应用列表创建apl的API Key,Secret Key
在这里插入图片描述
test.py中的labelImg数据目录只能是英文和数字,不能有汉字和其他符号,里面的数据是图片和xml放一起。
而且他的工程有点小问题,我是师兄帮忙调试的。把里面的easydl模块参考我的换一下就行了,稍微修改后easydl模块代码

#coding=utf-8
#baidu ai easydl toolkit by kooky126
import urllib.request
import configparser
import os
import json
import re
import time
import base64
import cv2
import glob
from xml.etree import ElementTree as ET

#初始化token
def inittoken():
	cf = configparser.ConfigParser()
	a = cf.read("easydl.conf")
	client_id = cf.get("token","client_id")
	client_secret = cf.get("token","client_secret")
	host = 'https://aip.baidubce.com/oauth/2.0/token?grant_type=client_credentials&client_id='+client_id+'&client_secret='+client_secret
	request = urllib.request.Request(host)
	request.add_header('Content-Type', 'application/json; charset=UTF-8')
	response = urllib.request.urlopen(request)
	content = response.read()
	if (content):
		date = json.loads(content.decode('utf-8'))
		if date['access_token']:
			with open("token.json","w") as f:
				json.dump(date,f)
			return date['access_token']
		else:
			return None
	else:
		return
  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值