Comments (1)
Hi,
First of all, I am very glad that you reused this little example project for developing your drone object detection application. The process to capture the video stream and to transform into the required sizes is a little bit complicated, but let me try to explain it shortly.
The main component for the video capturing is the CameraConnectionFragment, which uses the camera2 API to get the video stream. It uses the ImageFormat.YUV_420_888 format, which has several advantages over the standard RGB representation. For more information about the YUV representation please see this article: https://en.wikipedia.org/wiki/YUV.
The second most important class for the video stream processing is the ClassifierActivity which uses the CameraConnectionFragment by extending the TextToSpeechActivity, which extends the CameraActivity.
Inside the onPreviewSizeChosen() method a bitmap is created, named croppedBitmap, which it is used for storing temporarly each frames. This method also defines the transformations to resize and rotate the input image: frameToCropTransform.
The ClassifierActivity.onImageAvailable method is called when an input image arrives through the camera2 API and it executes the fillCroppedBitmap() method, which is the most important method.
It converts the YUV input bytes to bitmap format by using the ImageUtils.convertYUVToARGB() method, then executes the transformation which is defined in the frameToCropTransformation variable. Finally, the result is copied to the croppedBitmap which is forwarded to the YOLOv2 classifier. The transformations mentioned above are executed for each frames.
I also had problems with the quality of the images and with the accuracy of the tiny yolov2. Unfortunately, I could only resolve it by creating a client-server architecture. This way I could process larger images, and I could use more accurate models than the tiny yolov2. If you are interested in the solution please see this repository: https://github.com/szaza/set-detector. This way you can stream a video for the server, which processes your request and sends back the results.
I hope that these information help you and I wish all the best for your further work!
Best regards,
Zoltan
from android-yolo-v2.
Related Issues (20)
- About misjudgment measures HOT 6
- Black Screen HOT 2
- Do you have no intention of making android-yolo-v3? HOT 2
- Crashing when using yolo v2 HOT 1
- How do I convert my yolov3 weights file to .pb? HOT 2
- java.lang.StackOverflowError: stack size 8MB
- App crash on the simulator HOT 2
- GPU support for android HOT 1
- .tflite HOT 1
- Not getting predictions for custom model. HOT 1
- use new pb file problem.
- Unable to load the pb file from Custom training model HOT 16
- Node Output does not exist in model HOT 4
- different input size not working HOT 1
- The problem about app‘s interface HOT 5
- Is there any way to use it for Yolov3 till now in 2020? HOT 1
- Unable to locate .pb file in custom model
- Can't Compile it
- Unable to find method 'org.gradle.api/Lorg/gradle/api/tasks/TaskInputs;'.
- Add more feature for Camera Capture HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from android-yolo-v2.