Update labelstudio2coco.py , 1. image_name changed 2. can't get category_id #2930
+2
−2
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
…ory_id
拿图片名的时候 , 数据结构变成这样了 "data": {
"img": "images/20231116154137_1-1.jpg"
}
另外导入 如下配置的时候
初始化只 取了关键点 labels = root.findall('.//KeyPointLabels/Label')
但是 category_name 是取所有的,
for key in [
'rectanglelabels', 'polygonlabels', 'labels',
'keypointlabels'
]:
if key == label['type'] and len(label['value'][key]) > 0:
category_name = label['value'][key][0]
break
所以导致如下语句报错, 如下语句应该移到关键点的处理逻辑
category_id = self.category_name_to_id[category_name]
I have read the CLA Document and I sign the CLA
Motivation
Modification
BC-breaking (Optional)
Use cases (Optional)
Checklist
Before PR:
After PR: