PINTO0309 / tflite2tensorflow

Generate saved_model, tfjs, tf-trt, EdgeTPU, CoreML, quantized tflite, ONNX, OpenVINO, Myriad Inference Engine blob and .pb from .tflite. Support for building environments with Docker. It is possible to directly access the host PC GUI and the camera to verify the operation. NVIDIA GPU (dGPU) support. Intel iHD GPU (iGPU) support. Supports inverse quantization of INT8 quantization model.
https://qiita.com/PINTO
MIT License
258 stars 38 forks source link

Objectron 3D tfjs models: chair and cup are not correct #5

Closed luannd closed 3 years ago

luannd commented 3 years ago

1. OS you are using: Mac OS

2. OS Architecture: Mac OS

3. Version of OpenVINO: same as your Docker

4. Version of TensorFlow: same as your Docker

5. Version of TensorRT: same as your Docker

6. Version of TFJS: 2.7.0

7. Version of coremltools: same as your Docker

8. Version of ONNX: same as your Docker

9. Download URL for .tflite IR model: directly from Mediapipe repo: https://github.com/google/mediapipe/tree/master/mediapipe/models

10. URL of the repository from which the transformed model was taken: use your Docker command

11. URL or source code for simple inference testing code

let image_tf = tf.browser.fromPixels(inputCanvasElement).asType('float32');  
let image_tf_resized = tf.image.resizeBilinear(image_tf, [224, 224]).expandDims(0).div(255.0);
prediction = model.predict(image_tf_resized);

[prediction_keypoints] = prediction[0].arraySync();
[prediction_prob] = prediction[1].arraySync();

12. Issue Details

I can convert the tflite models to tfjs but they seem to predict wrong results while testing by tfjs. The 9 points are kind of random and cannot be detected [correctly.] My preprocessing is the same as https://github.com/sfsrd/objectron. Not sure what's wrong in the conversion pipeline.

PINTO0309 commented 3 years ago

Here are the inference results in tflite, converted by my tool. There doesn't seem to be any particular problem, so if there is a problem with the inference results when converting to tfjs, it may be a bug in tfjsconverter.

https://user-images.githubusercontent.com/33194443/109388909-4874f800-794d-11eb-8760-6c263b913935.mp4

PINTO0309 commented 3 years ago

This is the model of CUP that I converted. saved_model.zip

https://youtu.be/LHCazNkr8uk

PINTO0309 commented 3 years ago

Closed due to lack of progress.