Comments (8)
Hi Tiago,
finally find the solution on stackoverflow, it seems (randomly) put localhost instread 127.0.0.1, it takes 2s every call... Now it works very smooth, I will let you know when I finish this project.
Many thanks
Frenz
from fastapi-frame-stream.
Hi @TiagoPrata , please see my new shared project, finally I solve the problem with Socket
https://github.com/Frenz86/FastSocketAPI
B.R.
Frenz
from fastapi-frame-stream.
Hi @Frenz86,
Thanks for your comment.
I've just tested the code you post and it worked pretty normal (see the attached video).
Media1.mp4
Do you need something faster than that or it is slower in your environment?
from fastapi-frame-stream.
Hi Tiago,
that's make me crazy!!! I tryed on new virtualenv, on linux WSL2, but still got 3-4 FPS.
Please have a look into my repo. Something wrong?
https://github.com/Frenz86/FastAPI_StreamWeb
These's a possibility you got the NASA's hardware?
I have also a quite powerfull laptop, what can cause the problem?
Many thanks
Frenz
from fastapi-frame-stream.
Hi @Frenz86,
Right now I'm testing it directly on Windows (instead of WSL2), inside a virtual environment. I don't know it the performance inside WSL2 can be affected.
Apart from that, my laptop is a very common one (i7-7850H, 16Gb RAM, Win10) so I don't think I'm taking any advantage of it.
The video I posted above was testing the same code you shared (which is in the file streamer_openc.py
of your repository), but I also noted that you have another file where you're trying to use streamlit. Actually I've created this library exactly for this purpose. I was trying to send some frames to streamlit and I found no alternative.
I didn't test your streamlit file so far, but the OpenCV one looks fine here.
Later I'll try to have a better look on it, but unfortunately I have no other clue of what is happening for you :(
If you figure something out, please let me know.
from fastapi-frame-stream.
Hi Tiago,
so weird, I also tested on a second laptop (W11 -i7 16GB also the second one), but nothign chnage.
Maybe could be the version of python (I'm using python 3.8). My idea is to use streamlit inside pyodide (stlite) and load the html thanks to jinja template, in order to have the streamer web all in one, with the API server, and make it runner inside a container on google Cloudrun, but latency is killing me :/
Many thanks
Let me know if you find the possible issue.
Frenz
from fastapi-frame-stream.
Hi @Frenz86,
Fantastic finding. I also didn't know that!
And, yes, please let me know when your project finishes.
BR,
Tiago
from fastapi-frame-stream.
Hi @TiagoPrata , I came across in a couple of good esample. It seems for realtime application, websocket would be easier, and memory optimize for the streaming video. I made some example in this repo, example1 and example2
https://github.com/Frenz86/FastAPI_StreamWebSocket
mi idea is to use fastapi as a machine learning websocket server, and with html, send the camera streaming and receive the object detection etc, for a simple cloud implementation. I am zero to html, do you know how to transform example2 with fastapi ed camera HTML on frontend?
Many thanks
Frenz
from fastapi-frame-stream.
Related Issues (2)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fastapi-frame-stream.