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

customize Object detect #5308

Closed
ly0303521 opened this issue Apr 10, 2024 · 6 comments
Closed

customize Object detect #5308

ly0303521 opened this issue Apr 10, 2024 · 6 comments
Assignees
Labels
legacy:object detection Issues related to Object Detection os:linux-non-arm Issues on linux distributions which run on x86-64 architecture. DOES NOT include ARM devices. platform:c++ Issues specific to C++ framework in mediapipe status:duplicate This issue or pull request already exists type:support General questions

Comments

@ly0303521
Copy link

ly0303521 commented Apr 10, 2024

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

@ly0303521
Copy link
Author

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

@ly0303521 ly0303521 changed the title Object detect only cpu mode customize Object detect Apr 11, 2024
@ly0303521
Copy link
Author

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 kuaashish added os:linux-non-arm Issues on linux distributions which run on x86-64 architecture. DOES NOT include ARM devices. platform:c++ Issues specific to C++ framework in mediapipe legacy:object detection Issues related to Object Detection type:support General questions labels Apr 12, 2024
@ly0303521
Copy link
Author

@kuaashish hello, SOS

@ly0303521
Copy link
Author

@kuaashish It has been several weeks ...

@kuaashish
Copy link
Collaborator

Hi @ly0303521,

We are closing this issue as a duplicate of #5389. Please follow that thread for further updates.

Thank you!!

Copy link

Are you satisfied with the resolution of your issue?
Yes
No

@kuaashish kuaashish added the status:duplicate This issue or pull request already exists label May 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
legacy:object detection Issues related to Object Detection os:linux-non-arm Issues on linux distributions which run on x86-64 architecture. DOES NOT include ARM devices. platform:c++ Issues specific to C++ framework in mediapipe status:duplicate This issue or pull request already exists type:support General questions
Projects
None yet
Development

No branches or pull requests

2 participants