{"id":22264871,"url":"https://github.com/xza85hrf/coco-annotation-mask-generator","last_synced_at":"2026-05-15T20:31:38.112Z","repository":{"id":170162989,"uuid":"646282073","full_name":"Xza85hrf/COCO-Annotation-Mask-Generator","owner":"Xza85hrf","description":"Python script generates colored masks from COCO-style annotations. It reads the COCO annotation files, creates masks for each annotation, colors the masks based on the annotation's category, and saves the colored masks as images. The script is designed to handle multiple categories and can be easily extended to support more categories if needed.","archived":false,"fork":false,"pushed_at":"2023-05-27T22:14:01.000Z","size":6453,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-16T07:12:36.848Z","etag":null,"topics":["coco-annotations","colored-masks","computer-vision","data-annotation","image-labeling","image-masks","image-processing","makesense-ai","mask-generation","object-detection","opencv","parallel-processing","pycocotools","python","segmentation"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Xza85hrf.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-05-27T21:52:44.000Z","updated_at":"2024-10-11T13:54:48.000Z","dependencies_parsed_at":null,"dependency_job_id":"d460918f-c98b-48fb-8bf3-f293b986cc52","html_url":"https://github.com/Xza85hrf/COCO-Annotation-Mask-Generator","commit_stats":null,"previous_names":["xza85hrf/coco-annotation-mask-generator"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Xza85hrf/COCO-Annotation-Mask-Generator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Xza85hrf%2FCOCO-Annotation-Mask-Generator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Xza85hrf%2FCOCO-Annotation-Mask-Generator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Xza85hrf%2FCOCO-Annotation-Mask-Generator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Xza85hrf%2FCOCO-Annotation-Mask-Generator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Xza85hrf","download_url":"https://codeload.github.com/Xza85hrf/COCO-Annotation-Mask-Generator/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Xza85hrf%2FCOCO-Annotation-Mask-Generator/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33078898,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-15T20:25:35.270Z","status":"ssl_error","status_checked_at":"2026-05-15T20:25:34.732Z","response_time":103,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["coco-annotations","colored-masks","computer-vision","data-annotation","image-labeling","image-masks","image-processing","makesense-ai","mask-generation","object-detection","opencv","parallel-processing","pycocotools","python","segmentation"],"created_at":"2024-12-03T10:12:27.638Z","updated_at":"2026-05-15T20:31:38.085Z","avatar_url":"https://github.com/Xza85hrf.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# COCO-Annotation-Mask-Generator\nPython script generates colored masks from COCO-style annotations. It reads the COCO annotation files, creates masks for each annotation, colors the masks based on the annotation's category, and saves the colored masks as images. The script is designed to handle multiple categories and can be easily extended to support more categories if needed.\n\nFeatures:\nSupports multiple categories with different colors for each category.\nProcesses images in parallel using multiple workers to speed up the mask generation.\nHandles errors gracefully and skips over images or annotations that cause problems.\nOutputs colored masks as PNG images.\n\nUsage:\nTo run this script, you need to provide three positional arguments: \ncoco_dir, image_dir, and output_dir. Additionally, you can provide an optional argument --num-workers \nto specify the number of parallel workers for processing images.\n\nHere is an example of how to run this script from the command line:\npython3 mask_generator.py /path/to/coco_dir /path/to/image_dir /path/to/output_dir --num-workers 4\n\nReplace mask_generator.py with the name of your Python script, and replace /path/to/coco_dir, /path/to/image_dir, and /path/to/output_dir with the actual paths to your COCO annotations directory, image directory, and output directory, respectively. The --num-workers 4 part is optional and specifies that 4 workers should be used for parallel processing. If you don't provide this argument, the script will use 4 workers by default.\n\nRequirements:\nPython 3,\nOpenCV,\nNumPy,\npycocotools,\nYou can install the required Python packages using pip:\npip install opencv-python numpy pycocotools\n\nLimitations:\nThis script assumes that the COCO annotations are correct and complete. If there are errors or missing data in the annotations, the script may not generate the masks correctly.\n\n\nGenerating COCO Files and Adding Annotations Using makesense.ai\nmakesense.ai is an online tool that allows you to easily add annotations to your images and export them in various formats, including COCO JSON format.\n\nHere are the steps to generate COCO files and add annotations to your images using makesense.ai:\n\n1. Upload Your Images\nGo to makesense.ai.\nClick on the + Select Images button.\nSelect the images you want to annotate and click Open.\n\n2. Label Your Images\nClick on the + Add new label button to create a new label.\nEnter the name of the label and click Add.\nRepeat this process for all the labels you need.\nTo label an image, select the label you want to use, then click and drag on the image to create a bounding box or polygon around the object you want to label.\nRepeat this process for all the objects you want to label in each image.\n\n3. Export Your Annotations\nOnce you've labeled all your images, click on the Export button in the top right corner.\nSelect COCO (JSON) as the export format.\nClick on the Download button to download your annotations in COCO JSON format.\n\n4. Use the COCO JSON File\nThe downloaded COCO JSON file can be used directly with the Python script provided in this repository. Just specify the path to the COCO JSON file when running the script.\n\nPlease note that makesense.ai is a third-party tool, and its interface or functionality may change over time. If you encounter any issues or have any questions about using makesense.ai, please refer to their official documentation or contact their support.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxza85hrf%2Fcoco-annotation-mask-generator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxza85hrf%2Fcoco-annotation-mask-generator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxza85hrf%2Fcoco-annotation-mask-generator/lists"}