matpalm / bnn

bee detection tensorflow conv net for a rasp pi on side of a hive
http://matpalm.com/blog/counting_bees/
MIT License
405 stars 67 forks source link

Train.py error: looking for the same images in test as in labels ? #9

Closed klorydryk closed 6 years ago

klorydryk commented 6 years ago

Hello,

I'm in the training step. I've put some

python3.6 ./train.py --run r12 --steps 300 --train-steps 50 --train-image-dir sample_data/training/ --test-image-dir sample_data/test/ --label-dir sample_data/labels/ --width 720 --height 480

and I got an error like it is looking for the same files in the test directory as in the train directory:

Exception: label bitmap img [sample_data/labels//frelons17.png] doesn't exist for training example [sample_data/test//frelons17.jpg]. did you run materialise_label_db.py?

If it is a training, shouldn't be new images? And in your dataset, they are different, so... what kind of pictures should be in this directory?

Thanks!

squeakus commented 6 years ago

Hi Klorydryk, the train and test folders should contain pictures with actual bees and the labels folder should contain black and white images with white dots where the bees should be.

In order to create the labels you must first use the GUI to mark the locations and then use materialise_label_db.py to turn the xy coordinates in the database into images.

I hope this helps!

klorydryk commented 6 years ago

Hi @squeakus , Oh! You say prior to to launch train.py, I should apply label/materialise/data(.py) to the "test" folder the same way I did for the "training" folder?

squeakus commented 6 years ago

exactly, so there are labels for both the test images and training images

klorydryk commented 6 years ago

Ok, I missed this point, thanks :)