Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: THEend8_
MMAI 5500 Assignment 3
DIY candy counter
In this assignment you will teach an object detector to count candy.
Data
Data labelling
You will label your own dataset using Label Studio. Install it on your local machine by following the instructions on Label Studio
Quick Start.
Label the 10 images in candy_images.zip with the following 8 candy types:
{
'Moon': 1,
'Insect': 2,
'Black_star': 3,
'Grey_star': 4,
'Unicorn_whole': 5,
'Unicorn_head': 6,
'Owl': 7,
'Cat': 8
}
More labelling examples are included in the ZIP file MMAI5500_Assignment3.zip . Make the bounding boxes as tight around the
objects as possible.
Export the images and annotations in the Pascal VOC XML format. The export should return a ZIP archive containing two
folders, images and Annotations . The former contains the images and the latter one XML file with annotations per image.
Train and test split
Extract the exported archive and put 8 images and their corresponding annotations in a folder named train , and the remaining
images and matching annotations in a folder called test . Both train and test should have the same sub-folders ( images
and Annotations ) as the original archive. That is, the training images should be in train/images and the corresponding XML
files (annotations) in train/Annotations . The test data should be structure in the same way. ZIP the two folders train and
test so that you have train.zip and test.zip . These two archives will be uploaded to Google Colab when fine-tuning the
object detector.
Training and evaluation
You will fine-tune a pre-trained model from TensorFlow 2 Detection Model Zoo. However, the process is rather complicated. To
make it a little bit easier the you can use the notebook Fine_tune_and_test_candy_detector.ipynb . Run the notebook on
Google Colab and make sure to enable GPU. I recommend you to carefully follow it step by step, verifying that each step
executes successfully.
Save the model
Freeze the graph
Deliverables
You need to submit two files, the notebook ( IPYNB ) with all the cell correctly executed, including a test image with predicted
boundary boxes (section 9. Detect from an Image in Fine_tune_and_test_candy_detector.ipynb ) and a PY that loads the
trained candy detector, and has a method ( candy_counter() ), that takes a picture of candy (same shape as the original
images) and returns a dictionary with the counts of the different types of candies.
Example output:
In [6]: candy_counter(image)
Out[6]:
{'Moon': 5,
'Insect': 0,
'Black_star': 0,
'Grey_star': 6,
'Unicorn_whole': 2,
'Unicorn_head': 1,
'Owl': 0,
'Cat': 4}
The PY file should follow the PEP 8 style guide and could either run on a local machine or on Colab.
See the original PEP 8 style guide, an easier to read version, or a short PEP 8 YouTube intro. Practically, adding a PEP 8 plugin
to your text editor (e.g. Falke8) will make it easier to follow to style guide.
Grading
For full marks the submitted code needs to be bug free, include every thing described Deliverables, follow the PEP 8 style
guide, and the candy_counter has to have a mAP score above 0.5 on unseen test data.