from flask import Flask, Response
import cv2app = Flask(__name__)
video = cv2.VideoCapture(0)@app.route('/')
return "Default Message"def gen(video):
success, image = video.read()
ret, jpeg = cv2.imencode('.jpg', image)
frame = jpeg.tobytes()
b'Content-Type: image/jpeg\r\n\r\n' + frame + b'\r\n\r\n')@app.route('/video_feed')
mimetype='multipart/x-mixed-replace; boundary=frame')if __name__ == '__main__':
app.run(host='0.0.0.0', port=2204, threaded=True)
In this tutorial, I will explain how to expose the rest api using python flask in Google Colab.
I have used ngrok for making the public ip from our local. So download the ngrok and extract it.
!wget https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-amd64.zip!unzip -o ngrok-stable-linux-amd64.zip
‘!’ command used for run the linux command in colab jupyter
from IPython import get_ipython
‘get_ipython’ used for run the linux command in background
In the jupyter 6 and 7 cell used for run the flask app.py and ngrok
Cell 8 used for see the public ip. Once you got the ngrok public ip, paste into the browser and see the output.
This is the complete google colab code.
Chat application but it’s a one way messaging system
This is blog explain how to steaming the message using redis. The Redis is a python library to streaming message with publisher and subscriber. This is a one way chat, don’t have the reply option in this application.
Sender only send…
Speed and accuracy are both improved
The Yolov4 released by Alexey Bochkovskiy and there are a huge number of features which are said to improve Convolutional Neural Network (CNN) accuracy. Practical testing of combinations of such features on large datasets, and theoretical justification of the result, is required. …
Before you will check this blog when you are going to read this blog. Because I have explained how to track the object using Euclidean distance by referring to the previous frame.
In this blog explains how to track each object by referring to the ’n’ previous frame. The ’n’…
In my previous blog, I have explained what is object detection and how to detect and track multiple objects.
In this blog, I explain how to track each object from the video. …
This blog explains, how to train and get the named entity from my own training data using spacy and python.
This blog explains, what is spacy and how to get the named entity recognition using spacy. …
spaCy is an open-source software library for advanced Natural Language Processing, written in the programming languages Python and Cython. The library is published under the MIT license and currently offers statistical neural network models for English, German, Spanish, Portuguese, French, Italian, Dutch and multi-language NER, as well as tokenization for…
I have studied the dot product from vector analysis in my school. Now that formula, I will use for finding the angle between three points. We have use multiple dimentional data like 1D, 2D, 3D and higher dimensions not only 2D. But i explained with 2D data points.