surendramaran / YOLOv8-TfLite-Object-Detector

A sample android application of live object detection for any YOLOv8 detection model
https://www.surendramaran.com/
71 stars 22 forks source link

BufferQueue has been abandoned #14

Open inambutt487 opened 5 months ago

inambutt487 commented 5 months ago

Hi @surendramaran I hope you are fine. First of all, your hard work and contribution are appreciated within this repo.

I am facing an issue in which I need your guidance. When the picture is captured and Camera Activity closes, Camera Activity closing or reopening again the app crashes, or the camera's live detection doesn't work when we launch Camera Activity second time.

you can download model and test images here: https://github.com/inambutt487/Bottle/tree/master/app/src/main/assets Here is text file for error log when crash occur bottle detections error.txt

2(BLAST Consumer)2](id:141e00000006,api:4,p:1522,c:5150) queueBuffer: BufferQueue has been abandoned

aaa

Issue produced: Step 1: Create an activity before launching MainActivity. Step 2: Launch MainActivity on the button from the newly created activity to capture images of object detections and close the activity. Step 3: Reopen the MainActivity from the newly created activity.

surendramaran commented 5 months ago

Are you using camera2?

It seems like the buffer (image) supposed to have a surface view but it couldn't get.

10Johannes commented 5 months ago

Same, problem. I have a different main activity that has a button. When I click that button I run the detector, but it can't detect anything. When I stopped the application, it shows BufferQueue error.

surendramaran commented 5 months ago

How can I reproduce this error, can you send sample code ?

10Johannes commented 5 months ago

You can try to run the MainActivity.kt on a different .kt file. Like how @inambutt487 did it, he created a TestActivity.kt to run the MainActivity.kt using the:

    binding.start.setOnClickListener {
        startActivity(Intent(this@TestActivity, MainActivity::class.java))
    }
inambutt487 commented 5 months ago

Yes I am using the update for CameraX the same libraries that Up is using The problem within this repo is that when we launch the second camera throw intent, it does not detect or throw an exception. If you launch the camera with a throw intent, it doesn't detect or throw an exception. You can download repo https://github.com/inambutt487/Bottle

surendramaran commented 3 months ago

@inambutt487 Using a different fragment can help in "BufferQueue has been abandoned".

And about no detection: I tried to create a new fragment for camera and I thought maybe the detection will show but it didn't. I have no idea how but later it started working, I don't remember what exactly I changed.

Here is the code, can you also try.

Bottle-master 2.zip

clideo_editor_6c0e948d309d4145a16ad8d34e93ffe3-ezgif com-crop

ashutosh3ojha2007 commented 2 months ago

Hi @surendramaran I hope you are doing good. How can i add some more labels( cctv, spy camera, mobile camera, normal camera) in labels file which will detect by given your code.

Can you guide me to generate new .tflite file ?

Thankyou.