New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bird-Model with index-error. How to resolve? #3
Comments
loading like this works. does doods2 support this? |
The main issue here is that you are using an image classification model vs what DOODS uses is an object detection model. Image classification looks at the whole image and then gives you it's estimation for each class that is matches that class. So you get a number for every value in your labels file that it's that type of bird. Presumably you pick the top one. Object detection models take an image and then provide bounding boxes within an image of the class/label and a percentage. The inputs and outputs are different shapes and thus doods doesn't know how to process the image classification models. I can look at adding support for it though. It doesn't look too terrible. There's a few other things I want to get done first though. |
GREAT news! i assumed the difference of that models would have been handled the same, by code. would be really great, if doods2 could be used with that object-model. i will be patiently listening here for the next development step.... 👂 thx!! 💐 |
Okay, I just made the change. It wasn't too bad. Essentially it will tag the entire image so if you want to filter by confidence, do not put anything in the regions section, just make a broad config. This will return anything with greater than 50% confidence. FWIW, the birds model seems to return numbers between 0-100 and not 0-1 like other models. So take the confidence you want and multiply by 100. (That's why I have 5000 to detect at 50%)
|
will try out instantly.. 😺 |
seems somehow to work, no error. by the way: million thanks for putting this in that fast! 🥇 https://upload.wikimedia.org/wikipedia/commons/thumb/2/29/ParusCaeruleus.jpg/300px-ParusCaeruleus.jpg |
It was working, since it's a image classifier, the detection box was the entire picture and thus the label, usually being in the upper left corner, was out of the frame of view. I made a change that moves the label to the inside bottom left corner if it's too tall. I may just move the detection labels to the bottom left corner permanently. Oh, as a side note, I believe the detection range on that model goes from 0-255 and not 0-100 so use 0-25500 for your detection percentage. |
somehow working with my bird, would love to see the response-json on the gui, sidenote: as i am not that used to docker i am really supprised that pulling the new image only was a millisecond. |
after a second look, (the node-red response from doods on my detection was instead correct with the whole birdname) |
It has all detections that match your confidence threshold. Try raising it to something like 5000. As long as you do pull the latest image like you did, you'll have the latest version. |
sometime i get results with probablity-values, could this come from an index-error in handling the label-files.csv? the probabilty values seems correct (with map 0-255 to 0-100% values) and is above the threshold .... |
ugly: that results in a list with 965 rows, so prediction in that special case is background, what sounds reasonable on that dark image, still puzzled why the google-online-detections comes to a named result... |
some investigation: compare tensorflow-lite docu here: https://www.tensorflow.org/lite/examples/image_classification/overview?hl=en https://www.tensorflow.org/lite/inference_with_metadata/task_library/image_classifier?hl=en not experienced enough to read-out the models output-tensor... |
It really depends on how many labels the model is configured to detect. The issue is that the model is returning a number that is not in the labels file. I am working on pushing a new image.. hopefully today with PyTorch support and it will show you what number it is when it's unknown. |
GREAT! really appreciate this, dont know if you can query the models metadata for possible detection-range? (0-964 or 0-1001) maybe it needs version 3 of the model to fix a bug mentioned in the changelog?
also with my tensorflow-code, but on the google gui-page with that model it works i will test with the new image... thanks a lot up to now..., ✋ |
stumbled on tensorflow-page about a model-inspector. this all tells me nothing. |
I honestly don't know how to build the detectors. I just know you can define labels and detect on the labels be it 10 or 1000. I think 1000 is just the max. |
i found on the tensorflow-pages, that the tflite-file can include the labels-files. and gotcha... label-file was included. and extracted if you rename .tflite to .zip did you use the bird-label from the tflite-file, (the first 2 line from the strange .csv-file must be deleted still wondering why the google-hub-gui has some other results than my code.. |
Ahhh good detective work, I didn't realize they were bundled in. I might actually try to see if I can extract those. |
now with pytorch/torch-hub support: |
not working.. |
The metadata in tflite images doesn't seem to be a specific format. Since it's working otherwise, I'm closing this one. |
Great Happiness for the new dood2!!
hoped that it solved my problem with the bird-model.
https://tfhub.dev/google/lite-model/aiy/vision/classifier/birds_V1/3
as is spent the whole day to get it succesfull running in a bad python script - the new doods2 arrived.
great. 🌹
doods 2 loads the model and the label-file
(csv-format with comma, but also error without commas)
but throws an error on detections in the index
some googling said: convert the model to "newer" tf-lite ?
both label-files dont work:
The text was updated successfully, but these errors were encountered: