dannypadilla / label-lens

Android image labeling app for computer vision and machine learning applications
0 stars 3 forks source link

init #1

Closed dannypadilla closed 4 years ago

dannypadilla commented 4 years ago

I pushed the code labs tutorial I went through. https://codelabs.developers.google.com/codelabs/camerax-getting-started/index.html

This is using the new jetpack CameraX lib; https://developer.android.com/training/camera

dannypadilla commented 4 years ago

So there's Camera2 then CameraX. CameraX still uses Camera2 stuff, but with what sounds like an easier API (preview/analysis/capture). Read up a bit. https://developer.android.com/training/camerax/architecture?#structure

We would just need to convert this to handle fragments, then create the individual fragments. I can do it maybe later tonight.

So the Q is: Do we want to use Camera X over Camera2? This starter code practically has everything we would need to start with (already uses fragments too)... https://github.com/android/camera-samples/tree/master/CameraXBasic

dannypadilla commented 4 years ago

I converted it to handle fragments. Is should look like our HW now. We can just create fragments for any additional functionality. This could be our baseline?

dannypadilla commented 4 years ago

There is a tiny bug..... FIXED BELOW When you initially run the app and are prompted to give permission to access the Camera, after you agree; the camera view doesn't display anything..... But after you reload the app, it functions as intended.. and never has that issue again.

There may've been something I was suppose to update when converting this to a Fragment. I moved everything from MainActivity to CameraDisplay.

dannypadilla commented 4 years ago

I suggest separating the Permission logic from CameraDisplay to it's own fragment. I saw in the cameraX code that it does this too:

https://github.com/android/camera-samples/tree/master/CameraXBasic/app/src/main/java/com/android/example/cameraxbasic/fragments

Maybe we should just use this instead... It also has a image gallery view which we would need. Which would transition to the labeling part.

dannypadilla commented 4 years ago

Fixed the bug.. should've made a separate pr...but this hasn't been merged yet... so RIP

https://stackoverflow.com/a/46046597/6052770

Noticed that after permission had to be requested, it wasn't reloading the fragment, so it had to be with the way we were passing the fragment to the request (was Activity)... hence why it would work after reloading the app.. the if hasPermission conditional uses the fragment correctly.... die

dannypadilla commented 4 years ago

I'm going to merge and close since it seems like a good baseline and there hasn't been any objections... I'll create issues for separating the permissions and camera in to separate fragments..