zlqhem / mlapi

https://mlapi-livid.vercel.app
MIT License
1 stars 3 forks source link

survey how to draw bounding box #3

Open zlqhem opened 6 months ago

zlqhem commented 6 months ago

Adapting backend result into pytorch lite's input format seems not simple.

Draw bounding box directly.

zlqhem commented 6 months ago

https://blog.codemagic.io/live-object-detection-on-image-stream-in-flutter/

zlqhem commented 6 months ago

reusing exisiting pytorch_lite ui. It has already implemented rendering bounding box for object detection result.

https://github.com/zezo357/pytorch_lite/blob/master/lib%2Fpytorch_lite.dart#L643 https://github.com/zezo357/pytorch_lite/blob/master/example/lib/run_model_by_image_demo.dart#L231C38-L231C56 https://github.com/zezo357/pytorch_lite/blob/master/lib/pytorch_lite.dart#L411 https://github.com/zezo357/pytorch_lite/blob/8c7bb693dabf181f7c03398a46bf8b58410f5f63/lib/pigeon.dart#L57

class ResultObjectDetection {
  ResultObjectDetection({
    required this.classIndex,
    this.className,
    required this.score,
    required this.rect,
  });
zlqhem commented 5 months ago

https://github.com/ibaiGorordo/ONNX-YOLOv8-Object-Detection/blob/main/video_object_detection.py#L37

https://github.com/ibaiGorordo/ONNX-YOLOv8-Object-Detection/blob/main/yolov8%2FYOLOv8.py#L66