明明是正确的啊
def upload_data():
access_token=get_accesstoken()
url="https://aip.baidubce.com/rpc/2.0/easydl/dataset/addentity?access_token="+access_token
headers={}
headers['Content-Type']="application/json"
rets=get_img_data()
for i,entity_name in enumerate(rets):
datas = {}
datas['type'] = "OBJECT_DETECTION"
datas['dataset_id'] =45138
datas['entity_name']=entity_name
imgpth=r"E:/download/guangdong1_round1_train1_20190818/guangdong1_round1_train1_20190818/defect_Images/"+entity_name
bs64data=base64.b64encode(open(imgpth, 'rb').read())
datas['entity_content']=bs64data
datas['labels'] = []
for lb in rets[entity_name]:
tmp={}
tmp['label_name']=lb['label_name']
tmp['left']=lb['left']
tmp['top']=lb['top']
tmp['width']=lb['width']
tmp['height']=lb['height']
datas['labels'].append(tmp)
#print(datas)
txt=requests.post(url,data=datas,headers=headers).text
print(txt)
return txt
收藏
点赞
0
个赞
请登录后评论
TOP
切换版块
您好,后台查了下您的操作记录,您在10点多的时候删了数据集。10点之前没有收到您添加图片的请求。
中间,我们收到了几个您的请求,但是没传参数。由于第一个验证的参数是dataset_id,所以就给了这个错误。