How do you use real-time object detection in a video in YOLOv5 Collab Notebooks? - google-colaboratory

I've recently started teaching myself YOLO and made some tests with the collab notebook provided by ultralytics. I've been able to save videos, but is there any way to do real time detection in collab notebooks akin to what is done with opencv locally?
Basically, I want to detect and show the frames simultaneously, like what opencv would do.

Related

How to get preprocess/postprocess steps from model created using Google Vertex AI?

A client of mine wants to run their Google Vertex AI model on NVIDIA Jetson boards using TensorRT as accelerator. The problem with this is that their model uses certain operators (DecodeJpeg) that are not supported by ONNX. I've been able to isolate the feature extrator subgraph from the model, so everything supported by ONNX is being used, while the preprocess and postprocess will be written separate from the model.
I'm asking because I need to be provided the pre/postprocess of the model so I could implement them separately, so is there a way to get pre/postprocess from Google Vertex AI console?
I've tried running a loop that rescales the image to a squared tile from 0 to 512, but none of those gave the adequate result.

running word2vec by using google's Colab with TPU

Now I am trying to run word2vec with skipgram on Google's Colab by using tensorflow. Before running the model on my dataset, I am trying to practice the model with a practice example (https://github.com/aymericdamien/TensorFlow-Examples/blob/master/tensorflow_v2/notebooks/2_BasicModels/word2vec.ipynb), but I have found that running the word2vec with CPU or GPU on Colab is not the best choice - it's too slow, even for the relatively small example dataset.
That said, I am wondering if and how specifically I need to do in order to use TPU strategy for running the word2vec on Colab by using tensorflow. I have searched for relevant examples or tutorials for that, but could not find any on the Internet. Thank you in advance!

To train an object/images using TensorFlow

I am working on how to train an object/images using TensorFlow on Raspberry pi and on Windows. I have run the object detection program to 50,000 steps. Once the training is complete, I have created the inference graph file and downloaded it. I copied my own object detection files into the raspberry pi, and I run the TensorFlow object detection program. I have also generated XML files that contain the label data for each image, I have also installed python, Anaconda, and all other necessary packages on my laptop and COCO mode to train the objection detection. The trained images were working, but not all the objects. I have collected some 20 different classes of objects. But when I run the program, only four images were detected, the remaining 16 images were not detected. So I am looking into these issues like why the rest of the images were not detecting.

Distributed retraining (TF & Google Coral)

Assuming I have tens of Google Coral devices doing object detection (using same trained model), every once in awhile we will retraining a device for new object (transfer learning), lets say this device is Coral1, now I wonder how would I transfer learning, what Coral1 learned to all devices (without the need to retrain those devices)?
for sure devices can be Google Coral or any other device
Since what we are assuming is that, all the devices will inference on the same model at start,
whenever there is a new learning done by any device, the updated trained model should be pushed to all other devices, helping them to start recognizing the new objects.
Every device does not need to train individually, if we can maintain synchronization among the devices.
For further information, go through this link
You shouldn't be "retraining a device", but rather retraining a model. Take a look at this guide on how to re-train a model:
https://coral.withgoogle.com/docs/edgetpu/retrain-detection/
Once you've finished retraining a model, you can scp it into the other board and reload.

Real Time Object detection using TensorFlow

I have just started experimenting with Deep Learning and Computer Vision technologies. I came across this awesome tutorial. I have setup the TensorFlow environment using docker and trained my own sets of objects and it provided greater accuracy when I tested it out.
Now I want to make the same more real-time. For example, instead of giving an image of an object as the input, I want to utilize a webcam and make it recognize the object with the help of TensorFlow. Can you guys guide me with the right place to start with this work?
You may want to look at TensorFlow Serving so that you can decouple compute from sensors (and distribute the computation), or our C++ api. Beyond that, tensorflow was written emphasizing throughput rather than latency, so batch samples as much as you can. You don't need to run tensorflow at every frame, so input from a webcam should definitely be in the realm of possibilities. Making the network smaller, and buying better hardware are popular options.