DAY 4+5: TENSORFLOW LITE

Xcode successfully recognized my phone and the TensorFlow image classification model now runs on my phone. I began researching how to get my model/images loaded onto the phone application. Right now, the object recognition runs successfully but it does not have the dataset of student photos.

I saved my model to a .tflite file, but now I need to add my model to the Xcode program that can run on my phone.

I also converted JPG to BMP as the file output in my java program since that is the file type recognized by HPCC.

DAY 3: MODEL TESTING

I retrained the “transfer_learning_with_hub” with 12 of my sample images. I manually changed the image sizes for the 12 images to match the model image dimension requirements.

With the small dataset, the model achieved a 100% accuracy.

After organizing 3 folders for “cropped”, “original”, and “others”, the next step was to use a java program to automatically change the size and dimensions of the photos so that I could test the model with over 1,000 photos instead of just 12.

All files are currently either 366 x 366 or 710 x 710. The java program automatically resizes.

The next step is to make all images 224 x 224 to fit the model’s requirements.

I then retrained Jupyter Notebook with the full dataset, which also returned a 100% accuracy.

Update on the Xcode issue from yesterday: After contacting the developers, there was a new update. With this update, Xcode now recognizes my phone with no error message. However, there is a new error message when I attempt to run the model on my phone. I will troubleshoot this.

DAY 2: TENSORFLOW LITE

Following the TensorFlow Lite Image Classification iOS tutorial (https://github.com/tensorflow/examples/tree/master/lite/examples/image_classification/ios), I set up my workstation to build and run the example model. The initial set up was successful, but Xcode showed an error message when I attempted to connect my phone. The goal is for the model to run on the TFL Classify app on my phone so that when the phone camera is pointed to an object, the app will display a result for what it thinks the object is.

Xcode displays this error message when I attempt to run and build the program with my phone (connected by USB) as the output.

An online forum suggested to update Xcode as a solution. In order to do so, my computer required for me to update my Mac OS system. After updating both, there was no error message anymore but the simulator still only showed a white screen, and my phone wasn’t recognized by Xcode. The new error message says that my phone’s OS is not supported.

At this point, I decided to use a simulator instead of my phone. The simulator ran and built the program successfully, but it has no camera feed and only outputs a black screen.

I found out that this is the furthest the simulator can go, so I will still have to go back to the original plan and get the phone iOS to be compatible with Xcode

The problem I encountered with using my phone and Xcode was that Xcode wasn’t compatible with iOS 14.6 but my devices are all iOS 14.6. Since I already upgraded Xcode and that didn’t solve the compatibility issue, my last possible solution was to downgrade my phone’s iOS. I began backing up my phone to my Mac, but then realized that my phone couldn’t be downgraded.

I will continue to troubleshoot so that the model can be loaded onto TensorFlow Lite.

DAY 1: DATASET

I decided on “s123450, s123451, s123452, etc.” as the consistent naming convention. The filename prefix must be renamed before closing VLC and running it again with a new video.

Videos saved as WEBM on my desktop → open VLC → Help → Preferences → show all → video → filters → scene filter

I testing the resizing feature with a tutorial (https://www.makeuseof.com/tag/batch-convert-resize-images-mac/) but then decided to keep the original 1280×720.

Next, I began looking into tutorials to get TensorFlow Lite on a phone.

In Xcode, it says to go to the “General” tab but my Xcode wasn’t compatible after this step. I then followed a different tutorial (https://www.youtube.com/watch?v=0SBtAjUauOc) which I will continue tomorrow.