6.June progress - jmvega/tfg-icebollada Wiki

First and second weeks

  • Write chapter 4 of the project and rewrite the first, second and third.

  • Modify all the servers to be HTTPS.

    • For Node-Red, it has been necessary change the file settings.js enabling the https conection by adding the certificates. The certificates obtained have been self signed certificates obtained with openssl. Based in this video to make it work. IMAGE ALT TEXT
  • Try to solve a problem existing before.

    • Problem: When try to acced to flask servers form other devices than the Raspberry, the servers did not work.
    • After different tries, found that the solution was open the ports to the firewall with the commands "ufw allow number", where number is the port of the server. To make it persistent, a file has been added to /etc/init.d configuration to autolaunch everytime the Raspberry is turned on to enable the ports permanently. Here can be seen the access to the server from a MacBook and an iPhone.
  • Try to train a model correctly with the Dataset obtained. Instead of try with TFLite, this time I have tried with Yolo.

    • Tried different examples found in internet (for exmaple, here) but there were errors in Raspberry.

    • Found this example and follow it to create a model in the computer. it has been trained with the weight YOLOv5m.pt.

      • The train of the model has been in google colab with the Dataset obtained previously. After two hours and a half, the model has been trained. IMAGE ALT TEXT

      • The metrics had good results: IMAGE ALT TEXT

      • Even though these values, the results tried in the computer weren't precise at all: IMAGE ALT TEXT

    • At this point, the decision has been to create a dataset, since the problem from my point of view has been to have images with no background if not a white one. The images obtained in the previous dataset were not different ones from others, so may be the reason to that dataset to not work properly is that the images detected in real life differ too much.

      • At the time to try this model on Raspberry, it gives errors related with Torch. IMAGE ALT TEXT

Third week

  • Torch in Raspberry: Found in this web that 32-bit Raspberry Pi OS does not work with torch.

    • Created a new image with an Arm 64bit (aarch64) of Raspberry Pi OS, since is the only that works with Torch.
    • Migrate all the system created to this new image.
    • In this new OS is possible to install Torch, so we can now try the model.
    • The model has been trained with four different weights: YOLOv5x, YOLOv5m, YOLOv5s and YOLOv5n. The results of the experiments can be seen in the next images:

    YOLOv5x:

    YOLOv5m:

    YOLOv5s:

    The results obtained are that the first model is the most precise one. The experiments have been done in a computer, so once tried in the Raspberry, the flow of the images was slow. The model YOLOv5n has been tried, but was less precise than YOLOv5s and there was not an improvement with the speed. So the decision has been to chose the model YOLOv5s, that is not the best in precision but is the only one that is not too slow, even though the images flow are not in real time.