Closed neilachr closed 1 year ago
I was able to get it working by making some very simple changes.
I had watched this video tutorial on YouTube and remembered he mentioned something about changing the parameters of the image that you were using as input. Once I did this, the error disappeared and I was able to Execute and log output.
I also was able to remove the shape srcData step.
Now I just need to figure out how to pass video from the AR camera.
Hope this helps someone else in the future.
Hi neiachr, So grateful for your exploration and share! I am also deploying yolo models with barracuda and I have made that on Android. The model I used is yolov5. However, The inference time on Android with Vulkan is too long, only 3fps. Have you successfully tried the inference speed on mobiles, like Android and IPad ? How about their speed? Thank you !
Did you manage to solve Yolov7 through barracuda? @neilachr
No, we ended up using YOLOv4. It works, but is slow.
I recently found this repo that works with YOLOv5 [4] and our ML dev says that 7 is based on 5 so it should work.
I will update if we get it working!
Neil Christensen razorbackmedia.com [5]
On 2023-01-24 06:11, dragan07-07 wrote:
Did you manage to solve Yolov7 through barracuda? @neilachr [1]
-- Reply to this email directly, view it on GitHub [2], or unsubscribe [3]. You are receiving this because you were mentioned.Message ID: @.***>
[1] https://github.com/neilachr [2] https://github.com/Unity-Technologies/barracuda-release/issues/303#issuecomment-1401927198 [3] https://github.com/notifications/unsubscribe-auth/AACKN5MDKRL7LNOE5WU5ECTWT7IJJANCNFSM6AAAAAAREUJE6M [4] https://github.com/egor-ulianov/yolov5-unity [5] http://www.razorbackmedia.com
@neilachr Thanks. Please inform me if you manage it.
Hey, we fixed the the issues for the provided Yolov7 model, it should be available in the next release.
Hi @Aurimasp , do you have information about a date of the next release?
Hi,
I know that Barracuda doesn't officially support YOLOv7, but I've read of successful implementations of YOLOv5 and was told v7 is based on 5, so I thought I'd give it a shot.
I'm using Unity 2021.2.18f and Barracuda 3.0.0.
I'm not 100% sure I'm passing the image properly in my C# code as I was getting a Reshape error creating a new Tensor when passing an image as a Texture2D. I found other code in these issues that transforms the Texture2D into a passable shape srcdata, but now I get the following error:
AssertionException: Assertion failure. Value was False Expected: True UnityEngine.Assertions.Assert.Fail (System.String message, System.String userMessage) (at <8b27195d2ee14da7b6fd1e5435850f80>:0) UnityEngine.Assertions.Assert.IsTrue (System.Boolean condition, System.String message) (at <8b27195d2ee14da7b6fd1e5435850f80>:0) UnityEngine.Assertions.Assert.IsTrue (System.Boolean condition) (at <8b27195d2ee14da7b6fd1e5435850f80>:0) Unity.Barracuda.Tensor..ctor (Unity.Barracuda.TensorShape shape, System.Single[] srcData, System.String name) (at Library/PackageCache/com.unity.barracuda@3.0.0/Barracuda/Runtime/Core/Tensor.cs:1696) Unity.Barracuda.Tensor..ctor (System.Int32 n, System.Int32 h, System.Int32 w, System.Int32 c, System.Single[] srcData, System.String name) (at Library/PackageCache/com.unity.barracuda@3.0.0/Barracuda/Runtime/Core/Tensor.cs:1672) MLModelController.Start () (at Assets/Scripts/MLModelController.cs:34)
Here is my model class code:
yolov7-tiny.onnx.zip
The error appears to be on instantiation of the Tensor as I've remmed out the worker Execute call.
I have also included my ONNX model.
Any help is greatly appreciated!