Purple-Kernel-Eater-Monster-Ideation
This is task to detect the yellow seeds that will turn into black monster seeds. For more information visit this documentations
Prerequisites
- Python 3.6.8
- OpenCV 4.0.0
- Scikit-learn
- Download the dataset. Store it in project directory folder under
images
folder.
Goal
You can see the sample pair of image below. Goal is to achive the best accuracy for the prediction of which seeds will turn to black.
Day One | Day Two | Predicted Image |
---|---|---|
How to run the code
To train images and train model run following code
python train.py
or
python train.py --datasetPath 'PATH_OF_DATASET' --outputPath 'PATH_OF_OUTPUT_DIR'
In above code both datasetPath
and outputPath
are optional.
To test and create model with predicted result file run following command
python test.py
or
python test.py --datasetPath 'PATH_OF_DATASET' --outputPath 'PATH_OF_OUTPUT_DIR'
Insights
Training data
- First
indexed_images.csv
will be generated, it seperated the both 24 hours before and after images by it's name. - Training file will crop the circles in
cropped
folder, both images folderbefore
andafter
will be created insidecropped
folder. - Then the seeds are seperated from above folders. In root directory of project two folders will created named as
before
andafter
- Store the
seeds_converted.csv
inside foldersaved_csv
where the seeds that are converted into purple monster will be saved. - Now the size and position will be captured in
final_data.csv
. If the seeds conveted or not that detail will be stored inmaindf.csv
- It's time to train model. Model will be created based on the images.
Testing data
- File will be cropped and will find the seeds details.
- Seeds details will act as an input for saved model
- If the seed detected as monster it will draw ellipse around it.