Skip to content
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

Support yolo v8 #21

Open
KhoaVo opened this issue Jan 13, 2023 · 2 comments
Open

Support yolo v8 #21

KhoaVo opened this issue Jan 13, 2023 · 2 comments

Comments

@KhoaVo
Copy link

KhoaVo commented Jan 13, 2023

It seems Yolo v8 is out and quite a bit better.

https://docs.ultralytics.com/tasks/detection/

Is it possible this repo would just work with an exported tfjs YOLO v8 model?

@zldrobit
Copy link
Owner

TFLite/tf.js is not supported by YOLOv8 at the moment. I'll see what I can do. By the way, the post process may be different. Maybe some code has to be tweaked to adapt to YOLOv8, but I believe it won't be too complicated.

@QMjnh
Copy link

QMjnh commented Jun 18, 2023

YOLOv8 now supports tfjs but when I tried running this GitHub repo with my YOLOv8 model.json, I got the following error:

Uncaught (in promise) Error: Failed to parse model JSON of response from /web_model/model.json. Please make sure the server is serving valid JSON for this request.
    at HTTPRequest._callee2$ (http.ts:167:1)
    at tryCatch (regeneratorRuntime.js:44:1)
    at Generator.<anonymous> (regeneratorRuntime.js:125:1)
    at Generator.throw (regeneratorRuntime.js:69:1)
    at asyncGeneratorStep (asyncToGenerator.js:3:1)
    at _throw (asyncToGenerator.js:25:1)

manifest.json:1  Manifest: Line: 1, column: 1, Syntax error.

I thought this was because something went wrong when I tried to link the weights to the public directory (I don't really sure how to do that in Windows), so I tried hosting the JSON file and changing the const weights to const weights = 'http://localhost:8080/best_web_model/model.json. This time, the code was able to parse the JSON but I still got this error:

ERROR
Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.
TypeError: Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.
    at _nonIterableRest (http://localhost:3000/tfjs-yolov5-example/static/js/bundle.js:168365:9)
    at _slicedToArray (http://localhost:3000/tfjs-yolov5-example/static/js/bundle.js:168772:310)
    at http://localhost:3000/tfjs-yolov5-example/static/js/bundle.js:96:154

Sorry for the long comment, but how can I fix this?
And can you please check whether the code works for YOLOv8 or if this error comes from my side?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants