csharpseattle / tensorflowiOS

A Real Time Object Detection application on iOS using Tensorflow and pre-trained COCO dataset models. Video frames are captured and inference is done locally using the provided mobilenet models. Both Swift and Objective-C projects.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

No bounding boxes around the object!

nirmalaagash opened this issue · comments

I am using frozen_inference_graph generated after training with my dataset.
The same frozen_inference_graph.pb works fine with my Android Device. But in iOS I do not see any boxes around my objects.

I used your repository and executed it with the ssd_mobilenet_v1_coco_11_06_2017 model. It works fine. But my frozen_inference_graph is not working fine.

My files are added to the folders correctly and removed other models from the models folder. References are created accordingly. Also, changed my label_map file according to my trainig set. I don't know where I am going wrong.

Please help with this.

Thanks in advance.

When running while attached to Xcode do you see errors in the Xcode console? Also, make sure that predictions coming out of your own graph are not all getting ignored. Do a search for the variable kPredictionThreshold. Inference values below this value will be ignored.

So how do I change the kPredictionThreshold value?!

It is at the top of TensorflowGraph.mm, line 15, and set to 50%. Inference scores below that value are ignored. The actual logic of ignoring anything below the threshold is on line 240 of that same file. You could inspect your scores coming out of your graph there.

I tried to change the threshold value. Seems like the error is with loading the model file.

2018-05-18 10:44:02.784622+0530 tensorflowiOS[3924:1996601] [MC] System group container for systemgroup.com.apple.configurationprofiles path is /private/var/containers/Shared/SystemGroup/systemgroup.com.apple.configurationprofiles 2018-05-18 10:44:02.785697+0530 tensorflowiOS[3924:1996601] [MC] Reading from public effective user settings. 2018-05-18 10:44:03.665824: E /Users/oraclechatbot/Desktop/tensorflowiOS/swift/Tensorflow/TensorflowUtils.mm:99] Could not create TensorFlow Graph: Not found: Op type not registered 'GatherV2' in binary running on iPhone. Make sure the Op and Kernel are registered in the binary running in this process. 2018-05-18 10:44:03.675079+0530 tensorflowiOS[3924:1996748] Failed to load model

This is the message from the console.

Sorry for the delay, Did you ever figure this out? Please verify that you built the iOS libs with ANDROID_TYPES_FULL . I have seen errors similar to yours when loading a graph using a Tensorflow build where i've forgotten to set that.