Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extend data recording #5

Open
stephenparvaresh opened this issue Apr 7, 2020 · 12 comments
Open

Extend data recording #5

stephenparvaresh opened this issue Apr 7, 2020 · 12 comments

Comments

@stephenparvaresh
Copy link

Currently, only records 300 frames. How to extend to an infinite number of frames?

@connormeaton
Copy link

@stephenparvaresh Have you figured this out? If so, can you share?

@stephenparvaresh
Copy link
Author

@cmeaton it was a few changes, in process_mask.py, I increased the threshold for self.hrs pop from 300 to 3000, and in the run.py file, I increased the default '-b' parser option from 30 to 100. This allowed me to save 1000 frames instead of the 270 as it is.
I also added options to save timestamps, and various other data. My rppg repo is up to date with all changes I've made, and notebooks of data output examples.

@stephenparvaresh
Copy link
Author

@cmeaton these changes to change the way the fourier transform performs, extending the data initialization, delaying when the graphical window pops up. I was unable to tweak the fourier to prevent this delay. But, as it is, you lose the first x data points.

@connormeaton
Copy link

@stephenparvaresh Thanks for your quick response and sharing your repo. I'm running your code as instructed in your readme. Its showing the cropped video and printing the FPS in the terminal, but thats all. I know you said the first x data points will be lost, but the webcam version has been running for 3 minutes and the terminal hasn't printed anything except FPS and then the float value changes. Any ideas?

@stephenparvaresh
Copy link
Author

@cmeaton a separate window should open once the fourier has been established that shows the graphical results.
However, I also check the pulse.npy or hrs.npy files to see if those change. Perhaps the data is saving, but for some reason that graphical interface isn't loading.
I haven't had that happen to me or any of my coworkers, so I'm not sure what the issue could be.

@connormeaton
Copy link

@stephenparvaresh Sorry to bug you again. Its still not acting as expected. I pulled your repo and ran exactly as is and it just lagged for up to 5 minutes, showing the face-cropped video but thats all, printing only 'FPS: (some float)'.

I was hacking at things and got it to print more stuff to try and see what's going on.

  • In process_mask.py on line 66 I added a line to print the heart rate (hr) to see whats going on.
  • The above print statement didn't do anything until in pulse.py, I manually entered the framerate as 30 instead of using self.framerate.

Now it printed out the heart rate, but it stopped after 4 cycles. This was my terminal printout:

init
FPS: 3.218209397047897heartrate 61.01694915254237
FPS: 3.2452454809518128heartrate 61.01694915254237
FPS: 3.2622304878532202heartrate 61.01694915254237
FPS: 3.2711506206546725heartrate 61.01694915254237
FPS: 2.4685947449188883

It lagged here and I killed it after ~9 minutes of processing a 10 second video.

If you have recommendations on any of this, let me know. Thanks for your work!
FPS: 2.8052436552738752

@connormeaton
Copy link

The above print out was from running a pre recorded video, in case that is important. Here is a print out from webcam (confirming with wearable that my pulse is 55, so not sure whats going on with the 122)

init
FPS: 2.527609043901841heartrate 54.91525423728813
FPS: 2.4762952553355158heartrate 54.91525423728813
FPS: 2.3317201736844404heartrate 122.03389830508473
FPS: 2.51296759663095heartrate 122.03389830508473
FPS: 2.6365503999106883

Thanks again for your work here, this is a super cool process.

@stephenparvaresh
Copy link
Author

@cmeaton I pushed my repo again (I realized I hadn't done that in a while). If you would like to pull it and see if it works, hopefully it does.
I just tested it and it runs at ~12 fps, and takes ~1 minute to open the graph window.
In the meantime, what kind of system are you running on? What OS?

@connormeaton
Copy link

@stephenparvaresh Cool, I just pulled and tried again. It performs the same. I'm running on Mac OS. What do you mean by ~12 fps? My video is 30 fps, maybe this is the problem?

@stephenparvaresh
Copy link
Author

You set your framerate at 30, but the program is only running at ~2.5 based on your print-outs. While your video may be 30fps, the program sets a processing framerate, which effects the fourier transform (frequency is based on the framerate that it sets). I'm not sure why your processing fps would be so much lower.

@connormeaton
Copy link

Thanks for all your advice. I still can't get it to work. It still only computes 4 hr values, then lags for 20+ minutes and the graph interface never loads. I tried viewing the hrs.npy file; hrs.hrs is 0 for the first 169 seconds (hrs.seconds), then hrs.hrs is 55.93 for the next 2800 columns while the hrs.seconds column changes to nan for the rest of the values.

I'm really not sure how to proceed. I think I'll go back to the original code and try to continue messing with things until it works. Thanks again for your code and responses!

@seymatakir28
Copy link

@stephenparvaresh If it doesn't get any rppg data in the video, does it add something average to that value in the graphs shown, or does it not care at all?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants