cm107 / annotation_utils Goto Github PK
View Code? Open in Web Editor NEWUtilities that are used for assisting with making annotated data.
License: MIT License
Utilities that are used for assisting with making annotated data.
License: MIT License
Hello,
I looked at your github profile and I realized that you have written several convert for Labelme to COCO. I know that we can generate oriented bounding box using polygon using labelme tool.
Do you know how to convert polygon bounding box to rectangle bounding box (you can find more information here:labelmeai/labelme#542)? Do you have written any script for this type of converter?
Thanking you!
Hi,
I hope to convert COCO to labelme format.
After install pyclay-annotation_utils via pip,
pip uninstall typing -y
pip install cython
pip install pyclay-annotation_utils
I wanna load COCO dataset
from annotation_utils.coco.structs import COCO_Dataset
dataset = COCO_Dataset.load_from_path(
json_path='/dataset/cocodataset/annotations/instances_val2014.json',
img_dir='/dataset/cocodataset/val2014',
)
then I got this KeyError:
---------------------------------------------------------------------------
KeyError Traceback (most recent call last)
<ipython-input-16-e72b8906eed7> in <module>
2
3 dataset = COCO_Dataset.load_from_path(
----> 4 json_path='/dataset/cocodataset/annotations/instances_val2014.json',
5 img_dir='/dataset/cocodataset/val2017',
6 )
/usr/local/lib/python3.7/dist-packages/annotation_utils/coco/structs/dataset.py in load_from_path(cls, json_path, img_dir, check_paths, strict)
306 check_file_exists(json_path)
307 json_dict = json.load(open(json_path, 'r'))
--> 308 dataset = COCO_Dataset.from_dict(json_dict, strict=strict)
309 if img_dir is not None:
310 check_dir_exists(img_dir)
/usr/local/lib/python3.7/dist-packages/annotation_utils/coco/structs/dataset.py in from_dict(cls, dataset_dict, strict)
180 licenses=COCO_License_Handler.from_dict_list(dataset_dict['licenses']),
181 images=COCO_Image_Handler.from_dict_list(dataset_dict['images']),
--> 182 annotations=COCO_Annotation_Handler.from_dict_list(dataset_dict['annotations'], strict=strict),
183 categories=COCO_Category_Handler.from_dict_list(dataset_dict['categories'], strict=strict)
184 )
/usr/local/lib/python3.7/dist-packages/annotation_utils/coco/structs/handlers.py in from_dict_list(cls, dict_list, strict)
269 def from_dict_list(cls, dict_list: List[dict], strict: bool=True) -> COCO_Annotation_Handler:
270 return COCO_Annotation_Handler(
--> 271 annotation_list=[COCO_Annotation.from_dict(ann_dict, strict=strict) for ann_dict in dict_list]
272 )
273
/usr/local/lib/python3.7/dist-packages/annotation_utils/coco/structs/handlers.py in <listcomp>(.0)
269 def from_dict_list(cls, dict_list: List[dict], strict: bool=True) -> COCO_Annotation_Handler:
270 return COCO_Annotation_Handler(
--> 271 annotation_list=[COCO_Annotation.from_dict(ann_dict, strict=strict) for ann_dict in dict_list]
272 )
273
/usr/local/lib/python3.7/dist-packages/annotation_utils/coco/structs/objects.py in from_dict(cls, ann_dict, strict)
318 'segmentation', 'num_keypoints', 'area',
319 'iscrowd', 'keypoints', 'image_id',
--> 320 'bbox', 'category_id', 'id'
321 ]
322 )
/usr/local/lib/python3.7/dist-packages/common_utils/check_utils/check_utils.py in check_required_keys(item_dict, required_keys, var_name)
130 logger.error(f"provided_keys: {provided_keys}")
131 logger.error(f"missing_keys: {missing_keys}")
--> 132 raise KeyError
KeyError:
Could you help me to resolve it?
Thx.
When visualizing segmentation, I want to change the transparency level. How can I do that?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.