zkmkarlsruhe / ofxTensorFlow2

TensorFlow 2 AI/ML library wrapper for openFrameworks
Other
109 stars 16 forks source link

Yolo v4 example #26

Closed Jonathhhan closed 1 year ago

Jonathhhan commented 1 year ago

I posted it already in the OF forum. Here is a Yolo v4 example: https://forum.openframeworks.cc/t/yolo-v4-example-with-ofxtensorflow2/40040

bytosaur commented 1 year ago

ah ok didnt see that but I figured it out anyway :P update coming soon.

Jonathhhan commented 1 year ago

Hey @bytosaur, Here I calculate and draw the bounding boxes directly with cppflow: https://github.com/Jonathhhan/ofxTensorFlow2/blob/example_yolo_v4/example_yolo_v4_v2 (actually the old version isnt as accurate...) I like the cppflow non max regression, but not sure about drawing boxes with cppflow, maybe OF is more flexible for tasks like that...

danomatika commented 1 year ago

I wouldn't render the bounding boxes into the output image. What if you want to style them differently, use them as masks, etc. This is better done in OF as with the previous version of the example.

danomatika commented 1 year ago

I am currently doing a refactor of the currently merged example. Once I'm farther along, we can look into updating/integrating any new changes.

Jonathhhan commented 1 year ago

@danomatika alright :) and i had a similar feeling with the bounding boxes and changed it accordingly (not render them into the image)...

danomatika commented 1 year ago

@Jonathhhan Also, the example is missing the input image. Can you include it, either in the v2 example or as a separate PR to our feature/new_examples branch?

danomatika commented 1 year ago

Thanks for the update. It's good to use the cppflow nms implementation since it's built in. I have also refactored the model handling into a separate class as I found it pretty complicated on it's own within the ofApp.

Please check the current version of the example in the feature/new_examples branch.

UPDATE: Also, I added the pytorch dog.jpg test image. You will need to rerun the download models script to get it.

bytosaur commented 1 year ago

included in #29

danomatika commented 1 year ago

Just a note: I took the updated example as used it as a basis for a new YoloOSC app: https://github.com/zkmkarlsruhe/YoloOSC

Like FaceOSC, it streams detected objects over OSC (and the camera image via Spyhon on macOS). Thanks again, you are listed as one of the source authors.

danomatika commented 1 year ago

@Jonathhhan Should we keep attribution to as "Jonathhhan" or should we change to a full name: "Jonathan Frank" or "Jano Frank" or? I would suggest a full name. We could also use a combination such as "Jonathan Frank (Jonathhhan)" for further disambiguation.

Jonathhhan commented 1 year ago

@danomatika Yes, I also guess the full name is the best. Was just choosing Jonathhhan because Jonathan was not available anymore. Thanks.

danomatika commented 1 year ago

Done. Thanks