I'm not sure this is what you want... but found one problem:
You initialize the MediaPipe model (with mp_holistic.Holistic) and load the TF model (model = load_model()) in recv(), but this is not a good design,
because recv() is called on every frames so model loadings happen everytime a new frame arrives. It is not efficient.
You should do such computationally expensive but cachable processing only once, practically at __init__() method.
For example, this object detection demo does so as this
This app can be another example which uses MediaPipe for pose estimation.
It also initializes the model at __init__() like this.
Note that this version is using multiprocessing because MediaPipe running in a single process had a problem with Streamlit in a multi-user situation. If your case is not so, you can refer to this previous version.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Hello! First, thanks for you incredible work!
I am trying to run a Machine Learning classification model, to classify Sign Language words. This is how it should look:
But when I deploy it in local using Streamlit, these anotations don't show up:
Im not getting major errors on the logs, just a TensorFlow warning because im not using GPU:
This is part of my ML model detection and cv2.puttext function to show the test:
Could you please tell me if you have any hint about why is this happening?
Thanks again!
Okey, I have tried to hardcode a string into the putText function and it works:
So I am thinking that there might be some problem with the Machine Learning part...
This is the code for my app, could you please look at it and reply if there is something wrong?
About the utils module, just some functions and the model definition, but they seem to work as it shows in the result that my face is landmarked.
I'm not sure this is what you want... but found one problem:
You initialize the MediaPipe model (
with mp_holistic.Holistic
) and load the TF model (model = load_model()
) inrecv()
, but this is not a good design,because
recv()
is called on every frames so model loadings happen everytime a new frame arrives. It is not efficient.You should do such computationally expensive but cachable processing only once, practically at
__init__()
method.For example, this object detection demo does so as this
This app can be another example which uses MediaPipe for pose estimation.
It also initializes the model at
__init__()
like this.Note that this version is using
multiprocessing
because MediaPipe running in a single process had a problem with Streamlit in a multi-user situation. If your case is not so, you can refer to this previous version.