Giter Site home page Giter Site logo

tflitedemo's People

Contributors

khanhlvg avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

tflitedemo's Issues

Report Bug - Build and deploy custom object detection model with TensorFlow Lite

@khanhlvg Dear Khanh Le Viet,

I found your workshop for Build and deploy custom object detection model with TensorFlow Lite https://developers.google.com/codelabs/tflite-object-detection-android#0 I tested on different models that you mentioned https://tfhub.dev/tensorflow/collections/lite/task-library/object-detector/1 and it worked fine.
I have my dataset with different 4 labels (not like in COCO) which I trained with yolov5s model and then I converted my pt model to tflite format by using python export.py --weights yolov5s.pt --include tflite
https://github.com/ultralytics/yolov5/blob/master/export.py

I tested the tflite with detect.py script and it works fine on inference mode. It means there is no issue with the converted file.
Then I put my model in assets folder, I change the name of model in MainActivity.kt file inside of val detector = ObjectDetector.createFromFileAndOptions and app goes down when I try to do a detection. In attached you can find a report bug description while I was trying the app with my converted model. I was thinking maybe the error is due to different labels I have, normally there should be place where I can declare txt file with my labels, but I could not find in your MainActivity.kt.

This is my converted model in case if you would like to test on Android Studio, it detects delivery packages and pallets.
https://github.com/HripsimeS/Projects/blob/main/model.tflite

Can you help me to figure our what is the issue and why it does not work with my model. Look forward to hearing from you!

image

Segmentation with Deeplabv3 Cityscape Model

Dear Khanh,

Thanks for sharing your sample code! The android and colab code are very useful!

My question is related to the configuration to other segmentation models.

More specifically, I’d like to test with the deeplabv3 model on cityscapes data and have identified the following model on TF model Zoo mobilenetv3_small_cityscapes_trainfine.

To convert the model to TF lite, I’ve used the following command:

tflite_convert \
  --output_file=./deeplabv3_city.tflite \
  --graph_def_file=./frozen_inference_graph.pb \
  --input_arrays=ImageTensor \
  --output_arrays=ExpandDims_1 \
  --input_shapes=1,257,257,3 \
  --inference_input_type=QUANTIZED_UINT8 \
  --inference_type=FLOAT \
  --mean_values=128 \
  --std_dev_values=127

My question is two-fold:

  1. When testing the converted model with your Colab, I get a ‘set tensor error’ with the following message Got tensor of type 0 but expected type 3 for input 3 regardless of the data type that I input (uint8, float32, int32, etc.) Do you have an intuition in terms of where the error could lie?


  2. The goal would be to run the model on android with your sample code on segmentation. Do you have any advice on how the sample code should to be modified in order to run a different model like this?

Thank you for your time.

Sincerely,
Johan

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.