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

Is there an OpenSense/Libreface Command Line Tool? #21

Open
nelsonalbertohj opened this issue Oct 30, 2023 · 6 comments
Open

Is there an OpenSense/Libreface Command Line Tool? #21

nelsonalbertohj opened this issue Oct 30, 2023 · 6 comments

Comments

@nelsonalbertohj
Copy link

I'm trying to process many video files through libreface, but it does not seem like the wpf application allows to input a list of video files.
Is there a command line interface for OpenSense/Libreface? I have found that with tools like OpenFace 2.0 and Affdex 2.0, the command line interface saved me a lot of work and processed videos significantly faster than any python implementation.
If not, what is the best way that you recommend going about this? I'm not familiar with .NET or C++ , so it would be very time-consuming to go modify the OpenSense source code for me.

@KanaHayama
Copy link
Member

We only have a prototype of a command line tool which is currently in the dev-libreface-app branch. And you can get it by compiling from source.
That command line tool uses the native MPEG reader and JSON writer from Microsoft \psi.
We found that MPEG reader is too picky about the video format, and the JSON store writer is too slow in terms of serialization performance.
So, we are writing dedicated components to replace these two components from Microsoft \psi. It will take a while. I will release binaries of it after we complete these two new components.

@KanaHayama
Copy link
Member

By the way, have you tried our OpenSense WPF application (other than the one I mentioned above)?
It comes with a graphical user interface. With it, you even do not need to code. Just follow the steps at here,

@nelsonalbertohj
Copy link
Author

nelsonalbertohj commented Oct 30, 2023

Thank you for the quick response! I have tried the OpenSense WPF application, and it's awesome!
However, is there any way to automatically load more than one video at the same time? Basically, as it is implemented right now, I'm only able to process one video at a time, so I would have to manually load each individual video from a pretty large dataset to get the LibreFace outputs. Please, let me know if there any workarounds to have something like a queue of videos to load, process, and output CSV files for.

@KanaHayama
Copy link
Member

As you discovered, we do not have a way to load multiple video files. I am planning to add command line options to OpenSense WPF application, so that you can load configurations programmatically (and video filenames can be substituted programmatically). However, this feature is not there now. One possible workaround is concatenating videos into one.

About exporting as CSV files, there is a CSV exporter that I implemented years ago. I would say its performance is poor and might crash and if I do it again it definitely will be better than the current one. You can give it a try. If it does not work, you can use the Python 3 component to write customized python code to write your files. Though, setting up its accepted input type might be a little bit hard if you do not know about .NET programming.

As you can see, we have plans to develop features you mentioned, but since there are too many of them and we do not have a dedicated budget for developing this tool, we are not able to release them timely. However, I do plan to finish these before the WACV 2024 conference personally.

@KanaHayama
Copy link
Member

And I forgot to mention that, if you want to record outputs of LibreFace in OpenSense, please use releases higher than 3.2.0 (I uploaded a new binary release to our google drive folder a couple days ago but I did not setup a github release because someone asked us about a GPU accelerated version and I compiled it again with the latest commits).
We added a configuration to make it possible to change the Microsoft \psi Delivery Policy inside the LibreFace component. You want to use Unlimited policy to ensure not frame is dropped. The LibreFace command line application I mentioned uses that Unlimited policy by default.

@KanaHayama
Copy link
Member

I have completed and uploaded a command line tool at here. This tool is Windows only.

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

2 participants