Update labelstudio2coco.py , 1. image_name changed 2. can't get category_id #2930
Open
gs80140 wants to merge 1 commit intoopen-mmlab:mainfrom
Open
Update labelstudio2coco.py , 1. image_name changed 2. can't get category_id #2930gs80140 wants to merge 1 commit intoopen-mmlab:mainfrom
gs80140 wants to merge 1 commit intoopen-mmlab:mainfrom
Conversation
…ory_id
拿图片名的时候 , 数据结构变成这样了 "data": {
"img": "images/20231116154137_1-1.jpg"
}
另外导入 如下配置的时候
<View>
<KeyPointLabels name="kp-1" toName="img-1">
<Label value="head" background="#FFA39E"/>
<Label value="left" background="#D4380D"/>
<Label value="right" background="#FFC069"/>
<Label value="bottom" background="#AD8B00"/>
<Label value="leftbottom" background="#FFA39E"/>
<Label value="rightbottom" background="#D4380D"/>
<Label value="tail1" background="#FFC069"/>
<Label value="tail2" background="#AD8B00"/>
<Label value="tail3" background="#D3F261"/>
</KeyPointLabels>
<PolygonLabels name="polygonlabel" toName="img-1">
<Label value="radish" background="#0DA39E"/>
</PolygonLabels>
<RectangleLabels name="label" toName="img-1">
<Label value="radish" background="#DDA0EE"/>
</RectangleLabels>
<Image name="img-1" value="$img"/>
</View>
初始化只 取了关键点 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]
|
|
Collaborator
Author
|
I have read the CLA Document and I sign the CLA |
1 similar comment
Author
|
I have read the CLA Document and I sign the CLA |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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: