
Set up your python environment and install the necessary free software across Windows, Mac, and Linux, then follow the recommended installation resources to be ready for the course.
Set up your environment with the cocosynth repo, Anaconda, and Visual Studio Code, then configure TensorFlow GPU, CUDA, and cuDNN for Mask R-CNN on synthetic data.
Navigate the end-to-end flow of creating COCO datasets: view COCO JSON data and segmentation outlines in a Jupyter notebook, generate masks, convert to COCO instances, and train a Mask R-CNN.
Explore the COCO image viewer in a Jupyter notebook to open COCO datasets, view the json annotations, run-length encoding, and bounding boxes, and inspect images with info, licenses, and categories.
Open the coco_image_viewer.ipynb in a Jupyter notebook to explore a COCO dataset json, view descriptions, categories, images, and bounding boxes, and learn how the viewer displays outlines and regions.
Initialize cocoa dataset class by loading cocoa instances json and images from annotation path and image directory, storing paths, and defining colors (red, green, blue, yellow) sections info and segmentation.
Open the image, calculate an adjusted display size with a 600-pixel max width, and overlay colored segmentation regions while preparing dictionaries for bounding boxes, polygons, run-length encoding regions, and colors.
Display image polygon segmentations for coco datasets by mapping colors, converting segmentation points to polygons, and overlaying them with adjustable bounding boxes using svg.
Apply run length encoding to COCO segmentation by turning shaded image regions into a counts array. Note that odd values denote unshaded runs, and even values denote shaded ones.
Decode run-length encoding for Coco segmentation by iterating the counts array, computing x and y from the pixel index, and drawing vertical one-pixel-wide rectangles to render the crowds.
Run COCO notebook to explore dataset descriptions, licenses, and category annotations, using the cocoa image viewer to inspect an example with elephants and people, and compare synthetic versus human outlines.
Create a small dataset by photographing boxes, generate color-coded masks with a unique color per box on a black background, and build a mask definitions JSON for COCO conversion.
Create a mask by drawing solid color shapes on a black background using the lasso and polygon tools, disable anti aliasing and feather edges, then export the mask.
Use layers to build a second mask by outlining colored boxes on separate layers, leveraging overlaps to reduce edge work, then export the original image and the masks.
Soundtrack by Silk Music: http://www.youtube.com/SilkMusic
Track name: LTN - Thunderball
Define mask definitions json for coco dataset by sampling colors for cardboard and plastic boxes, updating categories and super categories across four images.
Learn how coco_json_utils.py converts mask definitions and a dataset info file into a complete coco instances json, generating licenses, images, categories, and annotations.
Learn to convert mask definitions into a COCO dataset using a Python script, with command-line arguments for mask definition and dataset info, and assemble licenses, categories, images, and annotations.
Validate and process command line arguments to ensure mask definition and dataset info files exist, load JSON configurations, and build a COCO info dictionary for dataset creation.
Generate license and category entries for the coco dataset by building license and category objects, mapping category ids by name, and assembling the coco instances section for annotation processing.
Create images and annotations from color masks, mapping colors to category IDs and names. Generate COCO json structures with image objects, annotations, and category data.
Split a multicolored COCO mask into separate color masks by iterating over pixels, creating padded binary masks for green, blue, red, and magenta, and storing them in a dictionary.
Create annotations for COCO datasets by iterating over isolated masks, extracting contours with image measures, converting to polygons, and assembling segmentation and bounding boxes.
Learn to create synthetic COCO datasets by generating foreground objects on transparent backgrounds, pasting them onto varied backgrounds, and using automatic processing or manual cutouts.
Use the foreground select tool to cut out the foreground. Scale to 640 by 480, apply feather edges, draw foreground, background, and unknown, then paste on a new layer.
Master the foreground select tool to accurately isolate objects, apply feathered edges, and export transparent PNGs by cropping to content for robust COCO dataset training images.
Use the free select tool with feather edges to cut box-like images, fade with a small feather radius, then copy, paste on a new layer, crop, and export.
Paste foregrounds onto backgrounds to create images with transparent areas using a Python script. Automatically generate masks and a JSON mask file to produce transformed image combinations for neural network training.
Use image composition to generate synthetic coco datasets by placing foregrounds on backgrounds to produce images and masks, with a mask json detailing color categories and super categories.
Extract and serialize masks and super categories by converting sets to lists, then write a json file containing masks, colors, and category data for each image.
the image composition class fuses foregrounds and backgrounds by random placement and transformations to generate synthetic combined images, controlled by input/output directories, count, width, height, and output type.
Validate and process foregrounds and backgrounds for COCO datasets by traversing the foreground directory into super categories and categories, validating PNG images for transparency, and building a structured foreground dictionary.
Learn to compose COCO dataset images by cropping a background, randomly positioning crops, and transforming foregrounds with rotation, scaling, and brightness adjustments to create a valid segmentation mask.
Compose images by pasting a foreground onto a background at a random position. Create an alpha mask from the alpha channel and apply a threshold for a COCO datasets mask.
Create and save composite and mask images with a standardized file naming scheme, generate color categories for each foreground, and build the mask json for COCO datasets.
Generate dataset info automatically for coco datasets by prompting for description, url, version, contributor, and date created, optionally adding an image license, and writing json output.
Run the image composition script to generate a synthetic dataset with specified input and output directories, count, width, height, and output type, then create coco annotations from the mask definitions.
Train a mask rcnn in Jupiter notebook to detect and outline objects, creating thousands of training images and hundreds of validation images for a model that recognizes your custom objects.
Explore how mask r-cnn produces bounding boxes and pixel masks, and learn to create, train, and evaluate a coco-style dataset with training and validation splits.
Clone the mask rcnn repository, install requirements, and configure paths and class counts for training with a synthetic coco dataset, then load and preview samples.
Initialize a new model in training mode with the coco dataset pretrained networks and transfer learning. Train the heads for four epochs, monitor loss progress, and run inference.
Run inference on test images with a trained model, loading pretrained weights and using an 85–90% confidence threshold. See detections of X Box One, Google Wi-Fi box, and keyboard box.
Create your own Coco image dataset from scratch with custom categories and explore real-world applications, including cigarette butt detection and potential robot vision.
In this course, you'll learn how to create your own COCO dataset with images containing custom object categories. You'll learn how to use the GIMP image editor and Python code to automatically generate thousands of realistic, synthetic images with minimal manual effort. I'll walk you through all of the code, which is available on GitHub, so that you can understand it at a fundamental level and modify it for your own needs.
(Important: If you only want to do manual image annotation, this course is not for you. Google "coco annotator" for a great tool you can use. This course teaches how to generate datasets automatically.)
By the end of this course, you will:
Have a full understanding of how COCO datasets work
Know how to use GIMP to create the components that go into a synthetic image dataset
Understand how to use code to generate COCO Instances Annotations in JSON format
Create your own custom training dataset with thousands of images, automatically
Train a Mask R-CNN to spot and mark the exact pixels of custom object categories
Be able to apply this knowledge to real world problems
I've saved weeks of my precious time using this method because I'm not doing the tedious task of manual image labeling, which can easily take a full 40 hour work week to create 1000 images. You should value your time too. After all, how are you going to solve the world's problems if you're busy clicking outlines on images for the next couple weeks?
Soundtrack by Silk Music
Track name: Shingo Nakamura - Hakodate