Pydroid 3 --IDE for Python 3 is Python that runs on Android, but is compatible with Python on your PC. Highly GUI programs such as tkinter can use the same source. It is recommended because you can write an app that can be used reasonably with just a smartphone. Furthermore, it seems to work with OpenCV and TensorFlow. Unfortunately, these libraries are paid options, but I applied for a 3-day trial.
There are two types of paid options: ・ Purchase ¥ 1160 ・ Monthly ¥ 110 Free for the first 3 days I decided to give it a try for 3 days. You can apply from the product. Click the icon on the upper left to open the side menu, and you will find the paid option application menu at the top. When you enter the application menu, you will see the above two option selection menus. Click "3 DAY FREE TRIAL" below. When you press the subscription, a personal authentication dialog will appear, so you can authenticate with your fingerprint. This completes the application.
When the application is completed, the one grayed out in the library menu can be installed. I installed everything. tensorflow-2.2.0, opencv-python-4.3.0, torch-1.5.0 have been installed.
You can download the sample program from Samples in the side menu. The ones that were grayed out can now be selected. Tensorflow MNIST It's a common one. It is a guy who downloads sample data and trains it. It's so slow that it's set to epoch = 5. It's hard just to turn it 5 times. The model seems to be able to use ordinary Keras sources. Image Classification Text classification It seems to identify the clothing image. Finally, matplotlib will display the images and graphs. When I took this sample source to Windows and ran it, I was able to run it without changing a single line. Regression Is the fuel consumption estimated from the specifications of the car and compared with the true value? The same source works on Windows as well. OpenCV Some older models could not download OpenCV. There are problems with the camera function, such as the camera not working on another model, or the operation is not stable even on a model that can use the camera. Hello camera The camera is not stable. It worked only once, but forgot to take a capture. When I tried it with Zenfone3 Max, the following message appeared and it did not work. It seems that the model must support the Camera NDK API.
When I run it on Windows, I get the following error.
[ WARN:0] global C:\projects\opencv-python\opencv\modules\videoio\src\cap_msmf.cpp (374) `anonymous-namespace'::SourceReaderCB::OnReadSample videoio(MSMF): OnReadSample() is called with error status: -1072875772
[ WARN:0] global C:\projects\opencv-python\opencv\modules\videoio\src\cap_msmf.cpp (386) `anonymous-namespace'::SourceReaderCB::OnReadSample videoio(MSMF): async ReadSample() call is failed with error status: -1072875772
[ WARN:1] global C:\projects\opencv-python\opencv\modules\videoio\src\cap_msmf.cpp (906) CvCapture_MSMF::grabFrame videoio(MSMF): can't grab frame. Error: -1072875772
[ WARN:1] global C:\projects\opencv-python\opencv\modules\videoio\src\cap_msmf.cpp (906) CvCapture_MSMF::grabFrame videoio(MSMF): can't grab frame. Error: -2147483638
[ WARN:1] global C:\projects\opencv-python\opencv\modules\videoio\src\cap_msmf.cpp (906) CvCapture_MSMF::grabFrame videoio(MSMF): can't grab frame. Error: -2147483638
Laplacian Again, the camera is not stable. It worked after doing it several times. Extract contours in real time.
Face detector This is stable because the capture method is different from the others. Detects faces in real time. The sample uses the front camera (1) for selfies, but if you set the camera number to (0), it will work on your PC. You need to install PyQt5. ASCII camera Again, the camera is not stable. If you take the doll on the right, it will be displayed in ASCII characters as shown on the left.
Camera options It seems to set the camera, but I'm not sure.
PyTorch Tensors Something seems to be working. MNIST It seems to be working, but it takes a lot of time. Epoch = 5, but it took about 30 minutes.
Pretrained model Download the image and determine what is in it. It took tens of seconds to judge even the downloaded image.
Quantized model This camera seems to be stable. Identifies what is captured by the camera in real time. The stainless steel tumbler was judged to be a cocktail shaker, but it may be similar.
It's highly compatible and most samples work just fine on a PC. I'm worried that some OpenCV samples have unstable cameras, but there are some samples that move stably, so there seems to be a way to avoid them. If you want to use the camera with Pydroid3, you can shoot with another app and switch it immediately, or you can use this paid option to use the camera image in real time. However, if the model does not support it, nothing will happen.
You can learn models, but I don't think it will be practical because smartphones are slow. Taking a large amount of data and letting it learn in batch is not suitable for smartphones that take pictures, browse the net, receive calls, or have a lot of interruptions when they feel like it. It may be better to take data and photos on the go instead of at home and let them learn immediately.
It seems to be fun to be able to assemble a program on a smartphone. I have created such an environment (Android app for making apps, "PineVentor") before. However, it was quite difficult to develop with only a smartphone. Pydroid3 can use the same script on a PC, so it may be good to make it while going back and forth. However, at the moment there is no mechanism to easily walk around the script in various places, so it seems necessary to devise various things.
It's not enough to take a laptop with you on the go, but is it for people who want to program in their spare time to play puzzles or play games? It may be possible to collect deeper data if we can take data in the field and immediately make a time series graph. You can play a lot with the free Pydroid 3, so if you don't need to use the camera in real time, you definitely don't need the paid option, but I think it's worth a free 3-day trial. Depending on the model, the camera may not work, or if it is an old model, the entire OpenCV may not work, so even if you purchase it, you should try it.
Recommended Posts