集成对象检测Jupyter笔记本与Android Studio Kotlin应用程序

发布于 2025-02-04 13:55:12 字数 536 浏览 1 评论 0原文

我在使用OpenCV的木星笔记本中有一个对象模型。使用自定义数据集和Yolov3训练此模型。现在,我想将此模型与我的Android Kotlin应用程序集成在一起。我为Kotlin应用程序创建了基本页面。

应用程序的想法

必须使用摄像头打开应用程序,并用相机检测对象。然后,用户将单击下一步,将其重定向到应用程序中的另一个活动。

对象检测

我有yolov3_custom.cfg和yolov3_custom.ueights。在我的Jupyter笔记本电脑中,我使用CV2打开计算机的网络摄像头。 Videocapture(0)。 这将使用边界框检测图像。

Kotlin应用程序

我创建了一个具有不同活动的基本Kotlin应用程序。

需要做什么 Kotlin应用程序必须打开相机并检测对象。检测到接下来的单击后,必须转到下一个活动。请帮助执行此步骤。我知道需要张量,但我没有使用它的想法。

I have an object model in my jupiter notebook which uses opencv. This model is trained using custom dataset and YOLOv3. Now I want to integrate this model with my android Kotlin application. I have create basic pages for the kotlin app.

The idea of the appliccation

The app must be opened with a camera detect the object with the camera. Then the user will click on next which will redirect to another activity in the app.

The object detection

I have the YOLOV3_custom.cfg and yolov3_custom.weights. In my jupyter notebook I open the webcam of my computer using cv2. VideoCapture(0).
This will detect the image with bounding boxes.

The Kotlin app

I have created a basic kotlin app with different activities.

What needs to be done
The kotlin application must open a camera and detect the object. After detection on clicking next it must go to the next activity. Please help in doing this step. I know there is a need for tensorflow but I do not have an idea for using it.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

萌辣 2025-02-11 13:55:12

步骤1:将。重量转换为.tflite文件
Step2:部署.tflite到Kotlin应用程序

资源1:

resource2: step2

但这仍然给出以下给出的错误:

org.tensorflow.codelabs.objectdetection E/TaskJniUtils: Error getting native address of native library: task_vision_jni
java.lang.IllegalArgumentException: Error occurred when initializing ObjectDetector: Mobile SSD models are expected to have exactly 4 outputs, found 1

无法弄清楚如何解决此问题,但是这些资源确实有助于构建基本结构。

step1: convert .weights to .tflite file
step2: Deploy .tflite to kotlin app

resource1:step1

resource2: step2

But this still gives the following error:

org.tensorflow.codelabs.objectdetection E/TaskJniUtils: Error getting native address of native library: task_vision_jni
java.lang.IllegalArgumentException: Error occurred when initializing ObjectDetector: Mobile SSD models are expected to have exactly 4 outputs, found 1

Unable to figure out how to solve this but these resource are really helpful in building a basic structure.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文