Code Monkey home page Code Monkey logo

densedepth's Issues

tflite pretrained model not working properly

I tried to test the tflite model using a little python script that calls the model, inputs an image and shows the output. Here is the code

import tensorflow as tf
import numpy as np
import cv2

interpreter = tf.lite.Interpreter(model_path="nyu2tflite.tflite")
interpreter.allocate_tensors()
input_details = interpreter.get_input_details()
output_details = interpreter.get_output_details()
print(input_details,output_details)

input_data=cv2.resize(cv2.imread('../a/sss.JPG'),(640,480)) #shape is 640 X 480 X 3
input_data=input_data.astype(np.float32)
input_data=np.expand_dims(input_data,axis=0) #shape is 1 X 640 X 480 X 3

interpreter.set_tensor(input_details[0]['index'], input_data)
interpreter.invoke()

output_data = interpreter.get_tensor(output_details[0]['index']) 
output_data = np.squeeze(output_data,axis=0)
output_data = output_data.astype(np.uint8)

cv2.imshow('final',output_data)
cv2.imshow('input',input_data)
cv2.waitKey(0)

Heres one of the results, the depth calculations are totally off. If I'm doing something wrong here, please tell me.

Screenshot 2021-03-30 170902

[UPDATE] I tried to run the other provided trained model with the '.pb' extension too. But got the exact same output.

Full Integer Quantization

Hi, I was wondering if you had attempted to complete full integer quantization on this model. I am currently attempting to run the model on an EdgeTPU to improve performance but am struggling with the quantization. Do you have any tips on how this can be achieved? I am currently following the TF guide (https://www.tensorflow.org/lite/performance/post_training_integer_quant) but when I try to parse the representative_data_gen the memory overflows.

Thanks in advance for any help.

Cannot load nyu2.pb in TF2

Hi

I am trying to load the model from nyu2.pb file in TF2 with following code.

model = load_model("nyu2.pb", custom_objects=custom_objects, compile=False)

I am getting this error
OSError: SavedModel file does not exist at: nyu2.pb/{saved_model.pbtxt|saved_model.pb}

It seems I need more files along with .pb file as TF2 saves the model in a folder and there are more files saved in there. Can you please help me with this? I am new to TF (I mainly work in PyTorch before). How can I load the model (nyu2.pb file) in TF2? Is there a sample code?

How to make the model inference faster?

Hi, i'm using the converted tflite model with android system , but it takes about 3.x seconds to obtain the depth png. Is there any way to accelerate it? thx

add GPU support

Hi,
it's a very nice project.
is it possible to add GPU support ?

thanks for all

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.