This project is about identification the colors of cars. It is based on CNN architecture.
It is implemented with using python 3.7
.
dataset_builder.py
parses XML annotations and creates images in specific dirs accordingImageDataGenerator
andtrainDataGen.flow_from_directory(...)
. More precisely, it cuts off sub images according bounding boxes from XML annotations and puts them in dirs, matching to few colors.color_net.py
contains the CNN architecture and the main functions to train net and predict on images.test_net.py
loads weightscolor_weights.hdf5
from this (or trains net) ant tests it making videos from original images and predicted labels.image_checker.py
is intended for checking annotations - is it bad or good. It helps to detect wrong labels on the image.
Keras 2.0.0
Tensorflow 1.14.0
OpenCV 4.1.0
Numpy 1.16.2
- Some colors (green, brown and grey) are missed at both data sets.
- Some annotations are distorted: bounding boxes of not cars are labeled as cars,
for example: images
vlcsnap-2019-08-07-22h56m06s489.png
andvlcsnap-2019-08-07-23h09m17s466.png
contain bad annotations. To check this just run scriptimage_checker.py
. - Versions of python packages above don't allow me to save neural network to use it again.
Apparently saving functions from
model.save()
andModelCheckpoint()
don't work. See many related issues here:
So, to see how net works use script test_net.py
: it loads color_weights.hdf5
via loadWeights()
(or trains the net) and then test it,
producing videos with predicted colors on bounding boxes.