Skip to content

Instantly share code, notes, and snippets.

@jcheong0428
Last active March 7, 2024 15:53
Show Gist options
  • Save jcheong0428/c16146b386ea60fab888b56e8e5ee747 to your computer and use it in GitHub Desktop.
Save jcheong0428/c16146b386ea60fab888b56e8e5ee747 to your computer and use it in GitHub Desktop.
OpenFace_Shared.ipynb
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jcheong0428
Copy link
Author

jcheong0428 commented Mar 8, 2022

Can i run this code on windows instead of linux?

Installing and bash commands won’t work as intended as they are in linux. Nevertheless the openface github repo has window binaries you could download which actually makes installing a breeze. https://github.com/TadasBaltrusaitis/OpenFace/wiki/Windows-Installation Running the code would be similar. They python code would work either way

@jcheong0428
Copy link
Author

jcheong0428 commented Mar 8, 2022

Can OpenFace be used for real-time gaze detection? Eg. using a webcam video stream instead of a YouTube video?

Yes it’s possible. See Command line arguments in the openface wiki and search for webcam. https://github.com/TadasBaltrusaitis/OpenFace/wiki/Command-line-arguments

@AwaisAE7
Copy link

AwaisAE7 commented Mar 9, 2022

is it possible to find confident level of a person in a video using this code?

@jcheong0428
Copy link
Author

is it possible to find confident level of a person in a video using this code?
@AwaisAE7 Nope, but you can train your own model from the extracted data if you have labeled data.

@Ching87
Copy link

Ching87 commented Apr 11, 2022

how did u get the processed/video.csv file?

@weskhoo
Copy link

weskhoo commented May 6, 2022

Hello jcheong0428, thank you so much for this google colab.

The google colab was working fine until yesterday where I started having this error (/bin/bash: ./OpenFace/build/bin/FaceLandmarkVidMulti: No such file or directory). Any ideas what is wrong? Thank you!

@jcheong0428
Copy link
Author

Hello jcheong0428, thank you so much for this google colab.

The google colab was working fine until yesterday where I started having this error (/bin/bash: ./OpenFace/build/bin/FaceLandmarkVidMulti: No such file or directory). Any ideas what is wrong? Thank you!

@weskhoo Can you see a directory named "OpenFace" after running the first few cells for installation? If not, the error could be due to a failed installation. Please try running the first few cells to install OpenFace again and let me know if you still run into issues. Thanks!

@weskhoo
Copy link

weskhoo commented May 9, 2022

@jcheong0428 I do see the "OpenFace" in the directory. Attach is the image of everything is in the directory after running the first cell.
image

I recalled when I ran this weeks ago, it took 30-40 mins for the first cell, and it always ask for an input of 'Y' or 'N'. This time, it takes around 3 mins to finish running the first cell, and it does not ask me for any inputs.

I have attached the last few lines of the output of the first cell when completely run.

Reading package lists... Done
W: GPG error: http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64 InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY A4B469963BF863CC
E: The repository 'http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64 InRelease' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: Target Packages (Packages) is configured multiple times in /etc/apt/sources.list.d/nvidia-machine-learning.list:1 and /etc/apt/sources.list.d/nvidia-ml.list:1
W: Target Packages (Packages) is configured multiple times in /etc/apt/sources.list.d/nvidia-machine-learning.list:1 and /etc/apt/sources.list.d/nvidia-ml.list:1

@weskhoo
Copy link

weskhoo commented May 16, 2022

Hello @jcheong0428,
I think I fixed it for now. Your google colab is working.
I think it's an error with the video drivers. I added these 2 lines in #Get newest GCC.

Get newest GCC

!sudo apt-get update
!sudo apt-get install build-essential
!sudo apt-get install g++-8

#added 5/15/2022
!sudo apt-key del 7fa2af80
!sudo apt-key adv --fetch-keys http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/3bf863cc.pub

install python dependencies

!pip install -q youtube-dl

@jcheong0428
Copy link
Author

@weskhoo Thank you for catching the bug and fixing it! Added to the gist!

@SkyeChanGi
Copy link

Hi, Cheong. I encountered with the same error when I run OpenFace in Google Colab. The feedback said that there is an error "/bin/bash: ./OpenFace/build/bin/FaceLandmarkVidMulti: No such file or directory". I tried the updated "Get newest GCC", but I failed. Could you please kindly help me with it? Many thanks!

@ProgrammerIsMe
Copy link

Hi, Jcheong, thanks a lot for sharing this code on google colab.
This code worked well before, but in late January 2023, the installation parts encountered some problems like "Couldn't find any package by regex 'nvidia-machine-learning-repo-ubuntu1804_1.0.0-1_amd64.deb'", i'm not quite sure if it's because of the google colab service (it works well before), and the code may need a little modification?
thanks!

@SkyeChanGi
Copy link

SkyeChanGi commented Feb 1, 2023

Yes, I agree with you. The code worked smoothly until late January. I am wondering how could we modify the code accordingly.
Many thanks.

@nicolasd2h
Copy link

Hello,

When I try to run the code I have a message : No such file or directory processed/video.avi
The program worked when I tried few months ago

Is there any solution ? I'm using the code for my master thesis but it does not work anymore ...

@SkyeChanGi
Copy link

Hello,

When I try to run the code I have a message : No such file or directory processed/video.avi The program worked when I tried few months ago

Is there any solution ? I'm using the code for my master thesis but it does not work anymore ...

Dear Nicolasd, yes.I've found the solution. I searched for an OpenFace Offline Application, which worked fine in Windows system. Please go to this page for more information. https://sourceforge.net/projects/openface.mirror/
I hope this helps.

Best,
Skye

@nouhan123
Copy link

nouhan123 commented Feb 16, 2023

hello, guys.
I started using this google colab but I have this error: "/bin/bash: ./OpenFace/build/bin/FaceLandmarkVidMulti: No such file or directory" I see all the suggestions here, but I can't fix the problem. do you have any idea? 

thank you in advance 

@itsceallach
Copy link

itsceallach commented Feb 20, 2023

Hello,
When I try to run the code I have a message : No such file or directory processed/video.avi The program worked when I tried few months ago
Is there any solution ? I'm using the code for my master thesis but it does not work anymore ...

Dear Nicolasd, yes.I've found the solution. I searched for an OpenFace Offline Application, which worked fine in Windows system. Please go to this page for more information. https://sourceforge.net/projects/openface.mirror/ I hope this helps.

Best, Skye

Sorry I'm new to this, may I ask how did you make it work? I also have the same problem with the processed directory

@nicolasd2h
Copy link

Hello,
When I try to run the code I have a message : No such file or directory processed/video.avi The program worked when I tried few months ago
Is there any solution ? I'm using the code for my master thesis but it does not work anymore ...

Dear Nicolasd, yes.I've found the solution. I searched for an OpenFace Offline Application, which worked fine in Windows system. Please go to this page for more information. https://sourceforge.net/projects/openface.mirror/ I hope this helps.
Best, Skye

Sorry I'm new to this, may I ask how did you make it work? I also have the same problem with the processed directory

I use the command line directly in Powershell so now it works but no longer with Google Colab

@itsceallach
Copy link

itsceallach commented Feb 23, 2023

Hello,
When I try to run the code I have a message : No such file or directory processed/video.avi The program worked when I tried few months ago
Is there any solution ? I'm using the code for my master thesis but it does not work anymore ...

Dear Nicolasd, yes.I've found the solution. I searched for an OpenFace Offline Application, which worked fine in Windows system. Please go to this page for more information. https://sourceforge.net/projects/openface.mirror/ I hope this helps.
Best, Skye

Sorry I'm new to this, may I ask how did you make it work? I also have the same problem with the processed directory

I use the command line directly in Powershell so now it works but no longer with Google Colab

Thank you! I manage to make it work using Powershell tho I'm quite not satisfied because I still want to use the notebook without having to manually upload the .avi and .csv file on Colab. Is there any way I can use it with Jupyter? Also is there a way to run the .exe file in jupyter?

@archangelmichael110
Copy link

Hello jcheong0428,I was running the code that you provided in your git directory and some error popped up while I was extracting features from a video. I have attached an image for the errors shown. Can you please help me fix this.......
Screenshot (1)

@accj1990
Copy link

accj1990 commented Mar 7, 2023

Hello, good evening.
Any news about the problem reported above ? "/bin/bash: ./OpenFace/build/bin/FaceLandmarkVidMulti: No such file or directory"
No file is being created in \bin and the command is not finding the file for this reason. Could someone please shed some light on this?

@SkyeChanGi
Copy link

Hello, good evening. Any news about the problem reported above ? "/bin/bash: ./OpenFace/build/bin/FaceLandmarkVidMulti: No such file or directory" No file is being created in \bin and the command is not finding the file for this reason. Could someone please shed some light on this?

Yes, I have downloaded OpenFaceOffline on my computer, and it successfully ran. Please go to this page if you want to run OpenFace offline. https://sourceforge.net/projects/openface.mirror/

@accj1990
Copy link

accj1990 commented Mar 8, 2023

Hello, good evening. Any news about the problem reported above ? "/bin/bash: ./OpenFace/build/bin/FaceLandmarkVidMulti: No such file or directory" No file is being created in \bin and the command is not finding the file for this reason. Could someone please shed some light on this?

Yes, I have downloaded OpenFaceOffline on my computer, and it successfully ran. Please go to this page if you want to run OpenFace offline. https://sourceforge.net/projects/openface.mirror/

Hi @SkyeChanGi, I am messing with sensitive data and cannot run the solution offline as I cannot keep the data on my own machine. Is there any possibility of a fix for what is happening?

@SkyeChanGi
Copy link

Hi Accj1990, I am so sorry that I have no idea on fixing the errors of running OpenFace in Google Colab. :( I am also waiting for someone who can solve the problem.

@Saumyadav
Copy link

Getting same error-
"-- Configuring done
CMake Error: install(EXPORT "OpenCVModules" ...) includes target "opencv_core" which requires target "tbb" that is not in the export set.
-- Generating done
-- Build files have been written to: /content/OpenFace/opencv-4.1.0/build"
Can anyone help with this?

@vivkfdr
Copy link

vivkfdr commented Jun 18, 2023

Hello jcheong0428,I was running the code that you provided in your git directory and some error popped up while I was extracting features from a video. I have attached an image for the errors shown. Can you please help me fix this.......
Screenshot (1)

I got the same issue

@G-force78
Copy link

Any fix found?

@paivalucass
Copy link

Getting same error- "-- Configuring done CMake Error: install(EXPORT "OpenCVModules" ...) includes target "opencv_core" which requires target "tbb" that is not in the export set. -- Generating done -- Build files have been written to: /content/OpenFace/opencv-4.1.0/build" Can anyone help with this?

Any fix ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment