I have pretrained .pt extension file and I want to use it with opencv
What should I do ? How can I implement .pt file into opencv to get real time video ?
Related
So me and my team are making an audio classification app for android. We used a python backend for classification, then connected it to the flutter app, but now we want to get rid of that and do it all in flutter with tflite. Problem is, we relied on librosa for our data preprocessing (getting a mel spectrogram) and we can't find any libraries to get mel spectrograms in flutter. Does anyone here know of one? Or can recommend another way to preprocess audio input for our tflite model?
Basically, is there a flutter library that can do this:
mels = np.mean(librosa.feature.melspectrogram(y=X, sr=sample_rate).T,axis=0)
I want to make a real-time audio classification using python. I have a trained deep learning model but I only only give it wav file as an input. I want to make it real-time where it will use microphone as an input. Is that possible? If so, how will I do it?
I've created a traffic sign classification model. I need to use it in OpenCV for Video traffic sign detection.
How can I do that using a .h5 file
Thanks in advance!
In openCV you can read weights with
cv2.dnn.readNetFromCaffe
cv2.dnn.readNetFromTensorFlow
cv2.dnn.readNetFromTorch
cv2.dnn.readhTorchBlob
Because you can not read with opencv without manipulations and you need:
You can read frames with OpenCV and put the frames to run in Keras
Or you can convert keras model to tensorflow model and run with Opencv cv2.dnn.readNetFromTensorFlow
I need to train from scratch a CNN over a COCO dataset with a specific configuration: https://github.com/tensorflow/models/blob/master/research/object_detection/samples/configs/embedded_ssd_mobilenet_v1_coco.config
Thus, I installed TF Object Detection API and I downloaded the COCO dataset. However the dataset is in .h5 extension.
Is it possible to run the training with this kind of file or do I need to convert it in images in someway? If that is possible, what would the command be?
PS: I was not able to find a pre-trained model with that config, this is why I need to train a cnn from scratch.
My suggestion would be to convert the .hdf5 file to a .tfrecord file, you can find examples of how to do this here.
I have a working app with TFlite using tensorflow for poets. It works with a labels.txt and graph.lite pair files. I have downloaded another model in .tflite file format and wanted to use in my application. I wanted to ask what are the differences between .lite and .tflite files and are there any ways to convert tflite format to lite?
Thanks
There is no difference in ".lite" and ".tflite" format (as long as they can be correctly consumed by Tensonflow Lite). And there is no need to convert them.