For my 40th birthday I got from my friends a very special present, an USB Accelerator that brings machine learning inferencing to existing systems:

https://coral.ai/products/accelerator

From its website:

> The on-board Edge TPU coprocessor is capable of performing 4 trillion operations (tera-operations) per second (TOPS), using 0.5 watts for each TOPS (2 TOPS per watt). For example, it can execute state-of-the-art mobile vision models such as MobileNet v2 at 400 FPS, in a power efficient manner. See more performance benchmarks.

So I am going to connect this through the USB port to my NAS system:

https://www.qnap.com/en/product/ts-231p

Then, using the container station:

https://www.qnap.com/solution/container_station/en-us/

I will install this container:

https://hub.docker.com/r/lemariva/raspbian-edgetpu

So that I will have a jupyter notebook available to run on the TPU this Machine Learning algorithm:

https://github.com/jantic/DeOldify

From its webpage:

>Simply put, the mission of this project is to colorize and restore old images and film footage.

And finally, I have some old photos from "la Selva del Camp" that I would like to colorify.

Sounds fun, doesn't it?

Looking for hackers with the skills:

machinelearning

This project is part of:

Hack Week 19

Activity

  • almost 5 years ago: jordimassaguerpla started this project.
  • almost 5 years ago: jordimassaguerpla added keyword "machinelearning" to this project.
  • almost 5 years ago: jordimassaguerpla originated this project.

  • Comments

    • jordimassaguerpla
      almost 5 years ago by jordimassaguerpla | Reply

      How to run the container:

      docker run -d --privileged -p 2222:22 -p 3333:8080 -p 4444:8888 -e PASSWORD=secret --restart unless-stopped -v /dev/bus/usb:/dev/bus/usb lemariva/raspbian-edgetpu

    • jordimassaguerpla
      almost 5 years ago by jordimassaguerpla | Reply

      How to test it works

      ssh -p 2222 root@NAS
      password: root
      mkdir tmp
      cd tmp && git clone https://github.com/google-coral/tflite.git
      cd tflite/python/examples/classification
      ./install_requirements.sh
      python3 classify_image.py --model models/mobilenet_v2_1.0_224_inat_bird_quant_edgetpu.tflite --labels models/inat_bird_labels.txt --input images/parrot.jpg
      

      And you should see

      INFO: Initialized TensorFlow Lite runtime.
      

      Otherwise, if you see

      ValueError: Failed to load delegate from libedgetpu.so.1
      

      Means the USB is either not connected or not detected.

    • jordimassaguerpla
      almost 5 years ago by jordimassaguerpla | Reply

      Next step, connect to the jupyter notebook at:

      https://192.168.1.32:4444

      then, as a test, I uploaded the classification files and created a new jupyter notebook based on the classify_image example.

    • jordimassaguerpla
      almost 5 years ago by jordimassaguerpla | Reply

      After a day compiling python native extensions for arm or PyTorch and other math python extensions, cause the NAS has an arm processor, I was able to have all dependencies installed and try to run the ImageColorizer notebook.

      Unfortunately, I got this error message

      RuntimeError: [enforce fail at CPUAllocator.cpp:64] . DefaultCPUAllocator: can't allocate memory: you tried to allocate 37632 bytes. Error code 12 (Cannot allocate memory)

      So, not enough memory in my NAS to run this algorithm :(

      I also suspect that PyTorch is not using the TPU, as the TPU works with tensorflow lite libraries...

      Thus, I will try to run this algorithm on a workstation with an nvidia card ... and for this project... we can considered it done :(

    Similar Projects

    FamilyTrip Planner: A Personalized Travel Planning Platform for Families by pherranz

    Description

    FamilyTrip Planner is an innovative travel planning application designed to optimize travel experiences for families with children. By integrating APIs for flights, accommodations, and local activities, the app generates complete itineraries tailored to each family’s unique interests and needs. Recommendations are based on customizable parameters such as destination, trip duration, children’s ages, and personal preferences. FamilyTrip Planner not only simplifies the travel planning process but also offers a comprehensive, personalized experience for families.

    Goals

    This project aims to: - Create a user-friendly platform that assists families in planning complete trips, from flight and accommodation options to recommended family-friendly activities. - Provide intelligent, personalized travel itineraries using artificial intelligence to enhance travel enjoyment and minimize time and cost. - Serve as an educational project for exploring Go programming and artificial intelligence, with the goal of building proficiency in both.

    Resources

    To develop FamilyTrip Planner, the project will leverage: - APIs such as Skyscanner, Google Places, and TripAdvisor to source real-time information on flights, accommodations, and activities. - Go programming language to manage data integration, API connections, and backend development. - Basic machine learning libraries to implement AI-driven itinerary suggestions tailored to family needs and preferences.