Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

COCO格式输出报错:KeyError: 'x' #160

Open
sherryren0623 opened this issue Sep 8, 2023 · 4 comments
Open

COCO格式输出报错:KeyError: 'x' #160

sherryren0623 opened this issue Sep 8, 2023 · 4 comments

Comments

@sherryren0623
Copy link

sherryren0623 commented Sep 8, 2023

1

完整报错:
Traceback (most recent call last):
File "D:\Anaconda\envs\rtmdet-sam\lib\site-packages\rest_framework\views.py", line 506, in dispatch
response = handler(request, *args, **kwargs)
File "D:\Anaconda\envs\rtmdet-sam\lib\site-packages\django\utils\decorators.py", line 43, in _wrapper
return bound_method(*args, **kwargs)
File "D:\Anaconda\envs\rtmdet-sam\lib\site-packages\label_studio\data_export\api.py", line 183, in get
export_stream, content_type, filename = DataExport.generate_export_file(
File "D:\Anaconda\envs\rtmdet-sam\lib\site-packages\label_studio\data_export\models.py", line 161, in generate_export_file
converter.convert(input_json, tmp_dir, output_format, is_dir=False)
File "D:\Anaconda\envs\rtmdet-sam\lib\site-packages\label_studio_converter\converter.py", line 209, in convert
self.convert_to_coco(
File "D:\Anaconda\envs\rtmdet-sam\lib\site-packages\label_studio_converter\converter.py", line 679, in convert_to_coco
x, y, w, h = self.rotated_rectangle(label)
File "D:\Anaconda\envs\rtmdet-sam\lib\site-packages\label_studio_converter\converter.py", line 916, in rotated_rectangle
label["x"],
KeyError: 'x'
请问如何解决

@Lacacy
Copy link

Lacacy commented Oct 31, 2023

你解决了吗?

@liuquangao
Copy link

我也遇到了这个问题,发现是一张图片同时存在RectangleLabels和BrushLabels。然后我把所有的BrushLabels删除就好了

@liuquangao
Copy link

如果是和我一样只需要标注矩形框,在启动后端推理服务的时候把out_mask改为False,这样默认就不会出现BrushLabels了,不然一个个删真的太麻烦了

label-studio-ml start sam --port 8003 --with \
model_name=mobile_sam  \
sam_config=vit_t \
sam_checkpoint_file=./mobile_sam.pt \
out_mask=False \
out_bbox=True \
device=cuda:0 

@cabbage404
Copy link

我也遇到了这个问题,我需要导出out_poly和out_mask,请问是哪里出问题了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants