mediapipe
mediapipe copied to clipboard
customize Object detect
Have I written custom code (as opposed to using a stock example script provided in MediaPipe)
None
OS Platform and Distribution
ubuntu20
MediaPipe Tasks SDK version
0.10.7
Task name (e.g. Image classification, Gesture recognition etc.)
object detection
Programming Language and version (e.g. C++, Python, Java)
C++
Describe the actual behavior
object_detection_desktop_live.pbtxt only work with ssdlite_object_detection.tflite
Describe the expected behaviour
replace ssdlite_object_detection.tflite with other model
Standalone code/steps you may have used to try to get what you need
1. I found in vision tasks, such as object detect only has cpu mode, but in the example of "mediapipe/graphs/object_detection", we can see "object_detection_mobile_cpu.pbtxt" and "object_detection_mobile_gpu.pbtxt", there are both modes, why vision task only has cpu mode.
2. In object detect task, the parameters of Detect is mediapipe::Image, but in graph "object_detection_mobile_cpu.pbtxt", image type is mediapipe::ImageFrame, How can I convert mediapipe::ImageFrame to mediapipe::Image
Other info / Complete Logs
No response
The detail is that, I want retrain object detection, than followd https://developers.google.com/mediapipe/solutions/customization/object_detector, there are 4 architectures, so I choose MOBILENET_V2, then I get the model.tflite、model_int8_qat.tflite、model_fp16.tflite, When I replace ssdlite_object_detection.tflite by them in "object_detection_desktop_live.pbtxt", after modifying the parameters of num_classes、num_boxes ... , there is no error, but results of detections are wrong. When I use the code "mediapipe/tasks/cc/vision/object_detector/object_detector_test.cc", the result is right. MOBILENET_V2 MOBILENET_V2_I320 MOBILENET_MULTI_AVG MOBILENET_MULTI_AVG_I384
Now, I tried to replace "ssdlite_object_detection.tflite" with EfficientDet-Lite0 (int8), but an error occured, if I want to use EfficientDet-Lite0 (int8), how to set the parameters.
Check failed: raw_box_tensor->dims->data[1] == num_boxes_ (19206 vs. 2034)
@kuaashish hello, SOS
@kuaashish It has been several weeks ...
Hi @ly0303521,
We are closing this issue as a duplicate of https://github.com/google-ai-edge/mediapipe/issues/5389. Please follow that thread for further updates.
Thank you!!