derenlei / Unity_Detection2AR

Localize 2D image object detection in 3D Scene with Yolo in Unity Barracuda and ARFoundation.
https://derenlei.medium.com/object-detection-with-localization-using-unity-barracuda-and-arfoundation-794b4eff02f8
MIT License
222 stars 61 forks source link

Which Tools did you use to convert Darknet to Tensorflow and ONNX? + model does not detect anything #28

Closed DaphiFluffi closed 3 years ago

DaphiFluffi commented 3 years ago

Hi @derenlei,

thank you very much for creating this repository. I got everything set up, but, I am struggeling to import the .onnx model into Unity. It isn't recognized.

I used this repository https://github.com/hunglc007/tensorflow-yolov4-tflite to convert the .weights file to .pb. Then I used this repository https://github.com/onnx/tensorflow-onnx to convert .pb to .onnx, I used opset 10 because it would fail with anything lower than that.

Which Tools did you use?

Thank you in advance!

derenlei commented 3 years ago

Hi @DaphiFluffi,

You can check issue #16. Hope it helps!

DaphiFluffi commented 3 years ago

Hi @derenlei,

Thank you for your quick answer! I wil try it out and report back :)

DaphiFluffi commented 3 years ago

It worked! The model imported. However, after changing the anchor and detector values and exporting it as an .apk file, I get the following error in the build: JobTempAlloc has allocations that are more than 4 frames old Do you know what this might come from?

derenlei commented 3 years ago

@DaphiFluffi Great to hear it worked! Haven't seen this error before. Looks like a system environment issue?

DaphiFluffi commented 3 years ago

I don't think it is an environment issue because when I export your yolov3 example everything is working perfectly fine. I assume it has something to do with the parameters I put into the detector. I only have one output node and I commented out all the parts with output_m because of that. The error has something to do with Unity's Job system that you used to read the model's data. I can supply you with screenshots as well. warnings after build detector settings model

DaphiFluffi commented 3 years ago

Hi @derenlei,

apparently it is just a warning according to barracuda themselves: https://github.com/Unity-Technologies/barracuda-release/issues/171#issuecomment-846319493. It just seems like my model won't detect anything for some reason. Judging from the screenshots, did I put in the right values? What could I test for?

Thank you in advance!