Object Detection + TFLite 💥

4 views
Skip to first unread message

Sayak Paul

unread,
Sep 10, 2020, 7:18:57 AM9/10/20
to Khanh LeViet, George Soloupis, ML on Mobile OS Working Group
Hi Khanh and George,

As I had mentioned during the call, here's the repository showing object detection capabilities with TensorFlow Lite (of course, it's nothing new). The repository contains the following notebooks:
  • Training_a_pets_detector_model_within_minutes_with_TFOD_API.ipynb: Shows how to train a custom object detection model on the Pets dataset (non-eager mode).
  • Running_inference_with_a_custom_TFOD_API_model.ipynb: Shows how to export a SavedModel graph from the trained checkpoint files, and run inference.
  • Object_Detection_in_TFLite.ipynb: Shows how to quantize the original model, generate a TFLite model, and run inference.
My next plan is to generate TFLite models with different quantization recipes (the current one's done with dynamic-range). 

Let's keep up with the collaboration. 

Sayak Paul | sayak.dev

Khanh LeViet

unread,
Sep 10, 2020, 7:57:29 AM9/10/20
to Sayak Paul, Sachin Joglekar, Lu Wang, Tian LIN, George Soloupis, ML on Mobile OS Working Group
+Sachin Joglekar +Lu Wang +Tian LIN FYI

This is awesome. Thanks Sayak!

Re: the training step, can you write a notebook that trains on Colab?
I'm curious how long it would take to train the same model on a Colab GPU.

Thanks,
Khanh

--
    
Le Viet Gia Khanh (カン)
TensorFlow Developer Advocate

tel: +81 3-6384-6867 

Shibuya Stream 
3-21-3 Shibuya, Shibuya-ku, Tokyo
150-0002, Japan

Sayak Paul

unread,
Sep 10, 2020, 7:59:09 AM9/10/20
to Khanh LeViet, Sachin Joglekar, Lu Wang, Tian LIN, George Soloupis, ML on Mobile OS Working Group
Sure, Khanh. In my previous experience, it has been around 6 hours (P1000). 

Next, I will try out the few-shot example we discussed today. 

Sayak Paul | sayak.dev


Khanh LeViet

unread,
Sep 10, 2020, 8:31:30 AM9/10/20
to Sayak Paul, Sachin Joglekar, Lu Wang, Tian LIN, George Soloupis, ML on Mobile OS Working Group
Hi Sayak,

Could you also try out the MobileDet models with the pet dataset and convert it to TFLite?

It is apparently only available in TF1 right now but the output model is compatible with both GPU. EdgeTPU and DSP so it's very promising.

Thanks,
Khanh

Sayak Paul

unread,
Sep 10, 2020, 8:34:23 AM9/10/20
to Khanh LeViet, Sachin Joglekar, Lu Wang, Tian LIN, George Soloupis, ML on Mobile OS Working Group
Sure. Could you create two issues over the E2E tutorial project board to help track this better? 

Quick question: Is it fine to directly convert the pre-trained checkpoints of MobileDet first?  

Sayak Paul | sayak.dev


Khanh LeViet

unread,
Sep 10, 2020, 9:44:58 PM9/10/20
to Sayak Paul, Sachin Joglekar, Lu Wang, Tian LIN, George Soloupis, ML on Mobile OS Working Group
Sure thing, I've filed the issue on GitHub.

Quick question: Is it fine to directly convert the pre-trained checkpoints of MobileDet first?  
Sure. I think there's already a TFLite model in the checkpoint archive so we can compare our converted model with that model for certainty. 
Reply all
Reply to author
Forward
0 new messages