Open pangshengwei opened 3 years ago
how can we change FPS for Model prediction?
Consider setting the save_fps
parameter to a number 2-25. This will only compute on the nth frame.
thanks for answering but after changing save_fps parameter, i have to retrain the model ? and if i give save_fps=3 or 4 then will model get decrease its accuracy?
save_fps
just changes how many frames are skipped when running inference
on the video. It doesn't change the model, only how it is applied to the
video.
On Thu, Jun 17, 2021 at 11:59 AM Neelkanth @.***> wrote:
thanks for answering but after changing save_fps parameter, i have to retrain the model ? and if i give save_fps=3 or 4 then will model get decrease its accuracy?
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/justinshenk/fer/issues/20#issuecomment-863104481, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACOLMZGQ6GMEXWXKLL4Z2BDTTHBONANCNFSM4355BPHQ .
Thank you so much. I just found where to put that and it's working fine. and another doubt in my mind about whether we can have any solution to make this entire process fast? I have a GPU too but still it takes too much time for complete execution for just 1 minute video file.
On Thu, Jun 17, 2021 at 4:29 PM Neelkanth Bhavnagarwala < @.***> wrote:
means if i am using this below code then where do i make changes for save_fps can you tell me please ?
def foremotion():
fn contains the video file name (Ensure that you only upload one file)
videofile = "D://RR/integration/in.mp4"
Face detection
detector = FER(mtcnn=True)
Video predictions
video = Video(videofile)
Output list of dictionaries
raw_data = video.analyze(detector, display=False)
Convert to pandas for analysis
df = video.to_pandas(raw_data) df = video.get_first_face(df) df = video.get_emotions(df)
Plot emotions
fig = df.plot(figsize=(20, 10), fontsize=14).get_figure()
Filename for plot
fig.savefig('static/my_figure.png')
return render_template('try.html',img="static/my_figure.png")
On Thu, Jun 17, 2021 at 3:57 PM Justin Shenk @.***> wrote:
save_fps
just changes how many frames are skipped when running inference on the video. It doesn't change the model, only how it is applied to the video.On Thu, Jun 17, 2021 at 11:59 AM Neelkanth @.***> wrote:
thanks for answering but after changing save_fps parameter, i have to retrain the model ? and if i give save_fps=3 or 4 then will model get decrease its accuracy?
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/justinshenk/fer/issues/20#issuecomment-863104481, or unsubscribe < https://github.com/notifications/unsubscribe-auth/ACOLMZGQ6GMEXWXKLL4Z2BDTTHBONANCNFSM4355BPHQ
.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/justinshenk/fer/issues/20#issuecomment-863123478, or unsubscribe https://github.com/notifications/unsubscribe-auth/APU3EWCJ6K7JBELVNRU4DYDTTHEX5ANCNFSM4355BPHQ .
It could be extended for this, maybe someone else will be kind enough to contribute this feature.
On Thu 17. Jun 2021 at 13:19 Neelkanth @.***> wrote:
Thank you so much. I just found where to put that and it's working fine. and another doubt in my mind about whether we can have any solution to make this entire process fast? I have a GPU too but still it takes too much time for complete execution for just 1 minute video file.
On Thu, Jun 17, 2021 at 4:29 PM Neelkanth Bhavnagarwala < @.***> wrote:
means if i am using this below code then where do i make changes for save_fps can you tell me please ?
def foremotion():
fn contains the video file name (Ensure that you only upload one file)
videofile = "D://RR/integration/in.mp4"
Face detection
detector = FER(mtcnn=True)
Video predictions
video = Video(videofile)
Output list of dictionaries
raw_data = video.analyze(detector, display=False)
Convert to pandas for analysis
df = video.to_pandas(raw_data) df = video.get_first_face(df) df = video.get_emotions(df)
Plot emotions
fig = df.plot(figsize=(20, 10), fontsize=14).get_figure()
Filename for plot
fig.savefig('static/my_figure.png')
return render_template('try.html',img="static/my_figure.png")
On Thu, Jun 17, 2021 at 3:57 PM Justin Shenk @.***> wrote:
save_fps
just changes how many frames are skipped when running inference on the video. It doesn't change the model, only how it is applied to the video.On Thu, Jun 17, 2021 at 11:59 AM Neelkanth @.***> wrote:
thanks for answering but after changing save_fps parameter, i have to retrain the model ? and if i give save_fps=3 or 4 then will model get decrease its accuracy?
— You are receiving this because you commented. Reply to this email directly, view it on GitHub <https://github.com/justinshenk/fer/issues/20#issuecomment-863104481 , or unsubscribe <
https://github.com/notifications/unsubscribe-auth/ACOLMZGQ6GMEXWXKLL4Z2BDTTHBONANCNFSM4355BPHQ
.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/justinshenk/fer/issues/20#issuecomment-863123478, or unsubscribe < https://github.com/notifications/unsubscribe-auth/APU3EWCJ6K7JBELVNRU4DYDTTHEX5ANCNFSM4355BPHQ
.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/justinshenk/fer/issues/20#issuecomment-863154964, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACOLMZDAKOEATIGQSX4RDV3TTHK5DANCNFSM4355BPHQ .
Yes, we could batch images through the model. Are you using cpu only or also GPU acceleration?