Created model to recognise UFO sightings #8
Created model to recognise UFO sightings #8KhyatiGanatra wants to merge 2 commits intoUSCDataScience:masterfrom
Conversation
Signed-off-by: Khyati Ganatra <khyati.ganatra@gmail.com>
| ## Steps for UFO sightings: | ||
| 1. Create directory structure such that images of given class are in single folder. all these folders are within main folder. | ||
|
|
||
| 2. Next run the steps mentioned in tutorial using retraining.py |
There was a problem hiding this comment.
retrain.py we run this script on our classes folder to retrain the last layer using this command
python retrain.py --image_dir Path-To-UFO-new-classes-folder
Note: retrain.py throws an error if GIF, TIFF images are used. Hence it is suggested to use JPEG or PNG Images.
| 2. Next run the steps mentioned in tutorial using retraining.py | ||
|
|
||
| 3. This will give you output_labels.txt and output_graph.pb | ||
|
|
There was a problem hiding this comment.
We used this command to test the retrained model:
python label_image.py --graph=/tmp/output_graph.pb --labels=/tmp/output_labels.txt --input_layer=Mul --output_layer=final_result --input_mean=128 --input_std=128 --image=/Users/prerana/Desktop/image2.JPG
Note: Command in the tutorial needs to be modified as above to use the default input layer name since we have not specified it explicitly. Otherwise Tensorflow will throw the follwoing error:
KeyError: "The name 'import/Placeholder' refers to an Operation not in the graph."
The image used is to test is taken from the following URL from ufo-stalker.com:
https://www.mufoncms.com/files_jeud8334j/91316_submitter_file1__IMG0414.JPG [I have saved it as image2.JPG]
These were the results obtained:
spotlight 0.9694056
roundworm 0.021185338
nematode 0.009408991
| 3. This will give you output_labels.txt and output_graph.pb | ||
|
|
||
| After this you can use the model to test on a new image. Sample command is: | ||
| python label_image.py \ |
There was a problem hiding this comment.
This command has been changed. Please refer above

The model is able to classify UFO soghting among spotlight, roundworm, nematode.
Done as a part of TEAM03 Extra Credit