Apparence-io / CamerAwesome

📸 Embedding a camera experience within your own app shouldn't be that hard. A flutter plugin to integrate awesome Android / iOS camera experience.
https://ApparenceKit.dev
MIT License
949 stars 240 forks source link

How to run ai_analysis_faces? #167

Closed hoonkai closed 1 year ago

hoonkai commented 1 year ago

Hi all I'm having trouble running ai_analysis_barcode and ai_analysis_faces. I've tried running both ai_analysis_faces and ai_analysis_barcode.dart but only a camera preview screen is shown and there's no response when given a face or a barcode. With ai_analysis_faces, analyzeImage doesn't seem to be run.

Does anyone know how these are meant to be invoked?

Thanks

g-apparence commented 1 year ago

Hi, You should make a try with a real device. I doubt it works on simulator.

hoonkai commented 1 year ago

Hi, You should make a try with a real device. I doubt it works on simulator.

I have but to no avail:

Tapping the capture button just takes and saves a photo.

Here's the log:

D/CameraStateMachine( 4417): New public camera state CameraState{type=OPEN, error=null} from OPEN and null D/CameraStateMachine( 4417): Publishing new public camera state CameraState{type=OPEN, error=null} D/UseCaseAttachState( 4417): All use case: [androidx.camera.core.Preview-8f577f87-1859-4587-b609-a3389d626e6b1306317, androidx.camera.core.ImageCapture-60217753-e1da-4640-9c57-7fbb335dc3eb181228418] for camera: 0 D/UseCaseAttachState( 4417): Active and attached use case: [androidx.camera.core.Preview-8f577f87-1859-4587-b609-a3389d626e6b1306317, androidx.camera.core.ImageCapture-60217753-e1da-4640-9c57-7fbb335dc3eb181228418] for camera: 0 D/SyncCaptureSessionBase( 4417): [androidx.camera.camera2.internal.SynchronizedCaptureSessionBaseImpl@22ee5f9] getSurface...done D/CaptureSession( 4417): Opening capture session. D/DeferrableSurface( 4417): New surface in use[total_surfaces=2, used_surfaces=1](androidx.camera.core.SurfaceRequest$2@b8125ce} D/DeferrableSurface( 4417): use count+1, useCount=1 androidx.camera.core.SurfaceRequest$2@b8125ce D/DeferrableSurface( 4417): New surface in use[total_surfaces=2, used_surfaces=2](androidx.camera.core.impl.ImmediateSurface@6ad2a85} D/DeferrableSurface( 4417): use count+1, useCount=1 androidx.camera.core.impl.ImmediateSurface@6ad2a85 D/CaptureSession( 4417): Attempting to send capture request onConfigured D/CaptureSession( 4417): Issuing request for session. D/CaptureSession( 4417): CameraCaptureSession.onConfigured() mState=OPENED D/CaptureSession( 4417): CameraCaptureSession.onReady() OPENED

I think the onImageListener of the analysisController isn't being triggered. If my take is correct, AnalysisController sets the listener for the image stream, but start() isn't invoked.

g-apparence commented 1 year ago

Hi we're looking at this. 👌

apalala-dev commented 1 year ago

Hi @hoonkai You were right, we missed a start() call. It should be fixed on master now 👍 Also note that the capture button is just there to take pictures, it doesn't involve image analysis in this example. :)