Giter Club home page Giter Club logo

aicure / open_dbm Goto Github PK

View Code? Open in Web Editor NEW
60.0 9.0 25.0 828.94 MB

Tool for measurement of digital biomarkers from video or audio of an individual’s behavior.

Home Page: https://aicure.github.io/open_dbm

License: GNU Affero General Public License v3.0

Dockerfile 0.42% Python 73.87% Shell 0.63% JavaScript 22.28% CSS 2.22% HTML 0.43% Makefile 0.13%
hacktoberfest open-science-project global open-source-community open-source-project digital-biomarker digital-biomarker-discovery opencv openface parselmouth

open_dbm's Introduction

OpenDBM

GitHub Actions for deploying to GitHub Pages with Static Site Generators

PyPI Latest Release Anaconda Latest Release Python Version PyPI - License Test Coverage Code style: black Imports: isort

Supported OS Platforms

OS Build Status
Linux Build
Windows Build
macOS-Intel Build

What is it

OpenDBM is a software package that allows for calculation of digital biomarkers of health and functioning from video or audio of an individual’s behavior. It integrates existing tools for behavioral measurements such as facial activity, voice, speech, and movement into a single package for measurement of overall behavior. Checkout the OpenDBM digital biomarker variables and list of scientific publications

More About OpenDBM

At a modular level, OpenDBM is a library that consists of the following components:

Component Description
Facial An OpenDBM module to get facial attributes
Movement An OpenDBM module to get movement attributes
Verbal Acoustic An OpenDBM module to get verbal acoustic attributes
Speech & Language An OpenDBM module to get speech & language attributes

Usually, OpenDBM is used for:

  • A digital biomaker extraction app
  • A helper tools to give insight of patient condition

Table of Contents

⭐️ Installation

Prerequisites (Install Dependencies)

With Conda Environment (recommended)

Make sure to install conda first at anaconda

On Linux/macOS

conda install -c conda-forge cmake ffmpeg sox

On Windows

#Make sure to run in Anaconda Prompt, or add conda to the path.
conda install -c conda-forge ffmpeg sox dlib

Without Conda Environment

Installation instructions

OpenDBM Installation

pip install opendbm 

Model Download ( Facial and Movement Components)

Make sure you have installed docker and already login to Docker Hub.

If you haven't, Find the tutorial here

docker pull opendbmteam/dbm-openface

⭐️ Usage

Basic Usage

Try your first OpenDBM program

from opendbm import FacialActivity

#make sure Docker is active to access the model
model = FacialActivity()
path = "sample.mp4"
model.fit(path)
landmark = model.get_landmark()

To get the attribute like mean and std is as straighforward as .mean():

landmark.mean()
landmark.std()
landmark.to_dataframe() # convert results as pandas dataframe

For more in-depth tutorials about OpenDBM, you can check out:

⭐️ More resources

⭐️ License

OpenDBM is published under the GNU AGPL 3.0 license.

⭐️ People

OpenDBM is maintained by the Clinical Data Science Team (including Andre Paredes, Director of OpenDBM) at AiCure. Current development and maintenance build on the efforts of Anzar Abbas and Vijay Yadav, alongside Vidya Koesmahargyo and Isaac Galatzer-Levy. OpenDBM was made open source in October 2020. Email the community at [email protected].

open_dbm's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

open_dbm's Issues

Video's over a certain length causes the code to end without completion.

We've been running into issues when attempting to process longer videos (30 minutes - 2 hours), in which the process will kill itself before completion. This leaves us with incomplete data in comparison to what we get from 12 minutes and under where we get the derived variables etc. We are unsure if this is an issue with windows, the processing power of the computer we're using, or if certain video lengths are not meant to be used on this software. I'll attach an image below showing the command prompt, and where the process gets killed. In the picture below, we attempted to run a 38-minute video with just the acoustic dbm_group.

For extra information, the analysis is being run on a computer running an Intel(R) Core(TM) i5-6500T CPU @ 2.50GHz with 8 GB of ram.
opendbm

Adding unit test to verbal acoustics and speech API

💡 The feature, motivation and pitch

Currently, users are not seeing predictable results if API is exposed. Therefore, unit tests are needed for the API to behave correctly.

This is also useful for future developers to improve the codebase.

Alternatives

No response

Additional context

No response

Trouble starting container (Windows)

I'm having trouble starting the container in Windows using the command listed in the wiki.
The command reads: > docker start

But, I get a "syntax of the command is incorrect" message - any suggestions?

Thank you for your help

Failed to run the first OpenDBM program

Hi!I'm a beginner.I am learning this project through GitHub.I want to ask if I can use the code without installing openface.
I just successfully installed open_ dbm on my Windows. But I haven't finished installing openface. Then I ran the code and an error occurred.Here is the error message.
subprocess.CalledProcessError: Command '['wsl', 'docker', 'image', 'ls']' returned non-zero exit status 1.
During handling of the above exception, another exception occurred:
OSError: Make sure to set the Docker to be active

Finally, can I run this project locally without using Docker?
Thanks!

Unable to Build OpenDBM Docker Images

Bug Type

Build/Install

Source

source (default)

OpenDBM Version

2.0

Custom Code

Yes

OS Platform and Distribution

macOS Monterey v 12.4

Mobile device / Browser (for Doc bugs)

No response

Python version

3.9.13

GCC/Compiler version

No response

Docker version

20.10.22

GPU model and memory

No response

🐞 Describe the bug. Steps/Code to Reproduce

This is from the Dockerfile when attempting to run "docker build --tag dbm ."

RUN ln -sfn /usr/bin/pip3 /usr/bin/pip

COPY . /app

#cloning openface
WORKDIR /app/opendbm/pkg
RUN git clone https://github.com/AiCure/open_dbm.git -b openface

RUN echo "Installing OpenFace..."
WORKDIR /app/opendbm/pkg/open_dbm/OpenFace
RUN bash ./download_models.sh
RUN dpkg --configure -a
RUN su -c ./install.sh
RUN echo "Done OpenFace!"

Expected Results

It would successfully build "dbm" image in the docker.

Actual Results and relevant log outputs

=> [internal] load build definition from Dockerfile 0.0s
=> => transferring dockerfile: 1.67kB 0.0s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 2B 0.0s
=> [internal] load metadata for docker.io/library/ubuntu:18.04 0.7s
=> [auth] library/ubuntu:pull token for registry-1.docker.io 0.0s
=> [stage-1 1/22] FROM docker.io/library/ubuntu:18.04@sha256:c1d0baf242 0.0s
=> [internal] load build context 20.3s
=> => transferring context: 1.96GB 20.3s
=> CACHED [stage-1 2/22] RUN apt-get update && apt-get install -y pytho 0.0s
=> CACHED [stage-1 3/22] RUN ln -sfn /usr/bin/pip3 /usr/bin/pip 0.0s
=> [stage-1 4/22] COPY . /app 4.5s
=> [stage-1 5/22] WORKDIR /app/opendbm/pkg 0.0s
=> ERROR [stage-1 6/22] RUN git clone https://github.com/AiCure/open_db 0.4s


[stage-1 6/22] RUN git clone https://github.com/AiCure/open_dbm.git -b openface:
#11 0.200 Cloning into 'open_dbm'...
#11 0.430 fatal: Remote branch openface not found in upstream origin


executor failed running [/bin/sh -c git clone https://github.com/AiCure/open_dbm.git -b openface]: exit code: 128

openDBM

Hello,

I just installed openDBM and run the sample_data to look at the variables and understand the results, when I realised that the values for the raw variables fac_AUXXpres and facAUXXint do not make sense.

In the presentation it stated, that the fac_AUXXpres variable should be binary and show if the specific AU is present or not. Interestingly the value I get is either 10 or 0 which is odd. But the real problem is, that the intensity values which should be 0-5 according to the documentation do show any kind of value even up to 233. And also how is it possible, that there is an intensity value when the fac_AUXXpres variable is 0 meaning that the specific AU ist noch present.

Thanks for the help,
Nschotschi

Openface failing with sample data

I successfully installed open_dbm on my mac (OSX 10.15.7), entered the open_dbm directory, and ran:

bash process_dbm.sh --input_path=sample_data --output_path=sample_data_output

The program appeared to fail when running openface. Here is the error message at the terminal:

Computing OpenFace features /app/raw_data/subj02_timepoint01.mp4 from video file
ERROR:root:Failed to run OpenFace on /app/raw_data/subj02_timepoint01.mp4
Command '['pkg/open_dbm/OpenFace/build/bin/FeatureExtraction', '-q', '-2Dfp', '-3Dfp', '-pdmparams', '-pose', '-aus', '-gaze', '-f', '/app/raw_data/subj02_timepoint01.mp4', '-out_dir', '/app/output/raw_variables/subj02_timepoint01/subj02_timepoint01_openface']' returned non-zero exit status 1.
I'm attaching text files with the docker installation output, as well as the full output of the process_dbm.sh command.

Thanks - John

open_dbm_docker_process_dbm__output.txt

open_dbm_docker_install_output.txt

sample data run issue

Hello, I think I have docker properly installed and build complete, but I get the following message when I try to analyze the sample data. Any suggestions on how to proceed?

Joels-MacBook:open_dbm-master joelthomas$ bash process_dbm.sh --input_path=/Users/joelthomas/Documents_Backup/Documents/Emory/Research Activities/Digital Biomarkers/open_dbm-master/sample_data --output_path=/Users/joelthomas/Desktop

Usage: process_dbm.sh --input_path parameterA --output_path parameterB --dbm_group parameterC
--input_path Description of what is parameterA
--output_path Description of what is parameterB
-dbm_group Description of what is parameterC
Joels-MacBook:open_dbm-master joelthomas$ bash process_dbm.sh --input_path=/Users/joelthomas/Documents_Backup/Documents/Emory/Research Activities/Digital Biomarkers/open_dbm-master/sample_data --output_path=/Users/joelthomas/Desktop --dbm_group=acoustic

Usage: process_dbm.sh --input_path parameterA --output_path parameterB --dbm_group parameterC
--input_path Description of what is parameterA
--output_path Description of what is parameterB
-dbm_group Description of what is parameterC

'\r': command not found when running process_dbm.sh

Bug Type

Performance

Source

source (default)

OpenDBM Version

1

Custom Code

No

OS Platform and Distribution

Windows only

🐞 Describe the bug. Steps/Code to Reproduce

bash process_dbm.sh --input_path=sample_data --output_path=abcd

Bash script produces the error where it saw unexpected token "\r" . I think this is because the script is using CRLF line separator. When I tried using LF, it works. Will make the PR soon.

Expected Results

It should be run as expected.

Actual Results and relevant log outputs

`D:\workspace\test_docker_1\open_dbm_core_refactor>bash process_dbm.sh --input_path=sample_data --output_path=abcd
process_dbm.sh: line 2: $'\r': command not found
process_dbm.sh: line 3: syntax error near unexpected token `$'\r''
'rocess_dbm.sh: line 3: `helpFunction()`

error in log despite working fine

Bug Type

Performance

Source

source (default)

OpenDBM Version

2.0

Custom Code

No

OS Platform and Distribution

any

Mobile device / Browser (for Doc bugs)

No response

Python version

3.6

GCC/Compiler version

No response

Docker version

No response

GPU model and memory

No response

🐞 Describe the bug. Steps/Code to Reproduce

Terminal output:

ERROR:root:Failed to process video file
  • Appears in terminal, but function works just fine or not.

  • The error message appears every time the function is called.

affected file: /dbm_lib/dbm_features//raw_features/movement/facial_tremor.py Line 164

#     except Exception as e:
        logger.error('Failed to process video file')

The message confused me when I tried to build a singularity container and shouldn't be there.

Expected Results

  • error if exception is thrown
  • no error if function was successful

Actual Results and relevant log outputs

INFO:root:Concluded computing tremor features
ERROR:root:Failed to process video file(facial_tremor)
INFO:root:Calculating derived variables...

error appears every time

Adding unit test to facial activity and movement API

💡 The feature, motivation and pitch

Currently, users are not seeing predictable results if API is exposed. Therefore, unit tests are needed for the API to behave correctly.

This is also useful for future developers to improve the codebase.

Alternatives

No response

Additional context

No response

OpenDBM web documentation

💡 The feature, motivation and pitch

It would be great if we can access web documentation for detail information about installation, usage, api and so on. It will gives community about the API details such as arguments, type of args, expected output and so on.

Alternatives

Separate documentation site other than github readme.md which also have a structured informations for easier navigation

Additional context

No response

Add setup.py to create pip installation

💡 The feature, motivation and pitch

The first step for OpenDBM installation as a python package, along with other steps to install for non-python dependencies.

Alternatives

No response

Additional context

No response

OpenDBM REST API

💡 The feature, motivation and pitch

It will be great to have REST API which expose OpenDBM functionalities for some purposes

Alternatives

We can use FastAPI python framework to boot up the service. Combine with Uvicorn which is an ASGI web server implementation to support async operation

Additional context

No response

TypeError: load() missing 1 required positional argument: 'Loader'

Hi,

I just installed the docker and built a container on Windows following the instruction in the Wiki documents. When I run the process_data.py, I got this:

root@4f8a1641c0a3:/app# python3 process_data.py --input_path sample_data --output_path sample_output --dbm_group facial --tr on

Traceback (most recent call last):
File "process_data.py", line 210, in
s_config = config_reader.ConfigReader()
File "/app/dbm_lib/config/config_reader.py", line 26, in init
config = yaml.load(ymlfile)
TypeError: load() missing 1 required positional argument: 'Loader'

Could you help me with this?
Thanks

Debugging Final Step of OpenDBM v2.0, 2.1.2.2

Describe the bug
Encountered the following errors while running the script to build the docker image:
#5 154.4 dpkg: unrecoverable fatal error, aborting:
#5 154.4 unable to fsync updated status of 'mailutils': Input/output error
#5 154.4 E: Sub-process /usr/bin/dpkg returned an error code (2)

executor failed running [/bin/sh -c apt-get update && apt-get install -y python3-pip && apt-get install -y wget && apt-get install -y automake --upgrade && apt-get install -y libtool --upgrade && apt-get -y install ffmpeg && apt-get install -y lsb-core && apt-get install -y libavcodec-dev && apt-get install -y libavformat-dev && apt-get install -y libavdevice-dev && apt-get install -y libboost-all-dev && apt-get install -y git && apt-get install -y sox]: exit code: 100

To Reproduce
Steps to reproduce the behavior:

  1. Paste 'docker build --tag dbm .' in Terminal
  2. Have my Macbook Pro Computer

Expected behavior
No error

Screenshots
n/a

Desktop (please complete the following information):
n/a still at installation phase

Smartphone (please complete the following information):
n/a still at installation phase

Additional context
Let me know if other details would help.

Confidence <.8

📕 The doc issue

I refer to this part of the documentation:
"Along with everything else, OpenFace outputs ‘confidence scores’ that delineate how confident it is that it is indeed seeing a face in an image from a video. If the confidence score for an image frame is below 80%, we do not process any facial activity variables for those frames and the framewise raw variable output does not contain values. All derived facial variables that are then calculated from the raw variables only reflect image frames where the confidence was >80%. " on page 23.

In the raw output variable output I can see some confidences <.8 and the AU-data does contain values. I guess these frames are not included into the calculation of the derived variables but is there a possibility to see which frames were dismissed or can I be sure that all the frames with a confidence <.8 were dismissed?

Suggest a potential alternative/fix

No response

Refactoring OpenDBM Core Module

💡 The feature, motivation and pitch

Me, @napjon, @haposan06 and friends want to restructure the OpenDBM design. Currently, OpenDBM only can be accessed by docker, so we want to propose additional features that consist of:

  1. Merge all core packages into a single directory. We see that folder dbm_lib, resources, and pkg are the ones that OpenDBM uses to process data. This approach can be good if later we develop OpenDBM to be pip installable(ex: pip install OpenDBM ).
  2. Make OpenDBM accessible with Python API (ex: import OpenDBM ). As of now, we see that OpenDBM core modules have the capabilities to be embedded with Python API.
  3. Refactor OpenDBM codes. We want to do code refactoring with the help of other open-source libraries, such as flake8, black, and isort.

We will try to achieve this while ensuring the docker command is still successfully run after we implement our approach. In order to do that, Dockerfile will also be updated to adjust the new structure of OpenDBM.

Alternatives

No response

Additional context

No response

OpenDBM pipeline

💡 The feature, motivation and pitch

It would be awesome if this library which produce critical informations has automation pipeline to manage the changes. It also useful to make sure the library keep supporting all platform with each new commit.

Alternatives

No response

Additional context

No response

openface failing with sample data

I successfully installed open_dbm on my mac (OSX 10.15.7), entered the open_dbm directory, and ran:

bash process_dbm.sh --input_path=sample_data --output_path=~

The program appeared to provide output for everything except openface-related variables. The terminal output showed the following error:

Computing OpenFace features /app/raw_data/subj02_timepoint01.mp4 from video file
ERROR:root:Failed to run OpenFace on /app/raw_data/subj02_timepoint01.mp4
Command '['pkg/OpenFace/build/bin/FeatureExtraction', '-q', '-2Dfp', '-3Dfp', '-pdmparams', '-pose', '-aus', '-gaze', '-f', '/app/raw_data/subj02_timepoint01.mp4', '-out_dir', '/app/output/raw_variables/subj02_timepoint01/subj02_timepoint01_openface']' returned non-zero exit status 1.

I reviewed the output of the docker installation and saw no errors related to the compilation of openface programs or their dependencies (opencv, dlib).

Thanks very much - John

Expose Verbal Acoustics and Speech

💡 The feature, motivation and pitch

Need to open these modules so users can use it either by processing programmatically or through Jupyter

Alternatives

No response

Additional context

No response

[New Feature] Visualization Analysis Tool

💡 The feature, motivation and pitch

First version of a visualization analysis tool that will visualize OpenDBM output data and runs on localhost (not an API).
The tool will run via react app and will provide insight into both cohort (multiple) and individual videos using derived and raw biomarker variables.

This will include

  1. Front end
  2. Back end
  3. Documents to iterate on with community

Alternatives

No response

Additional context

No response

Expose Facial Activity and Movement

💡 The feature, motivation and pitch

Need to open these modules so users can use it either by processing programmatically or through Jupyter

Alternatives

No response

Additional context

No response

Open DBM not producing Derived Variable Output for Multiple Videos in One Folder

Describe the bug
I am trying to get derived variable outputs in Excel from a folder of 10, 1-minute long videos, but when I try to run open_dbm through terminal on the whole folder, the output I get only gives me raw variables for the 4th, 7th and the 9th image. I can get a derived variable output when I only leave 1 video in the folder, but when I have all 10 videos in the folder it doesn't work. I ran the same script with the four, 5-second sample videos provided with open_dbm, and I was able to get a derived variable output that had seperate lines in excel for the four seperate videos. This is what I am hoping to get for my 10 videos, as I am currently having to analyse each video one by one and it is very time consuming. I will provide a copy of the script I am running in Terminal in the 'To Reproduce' Section.

To Reproduce
Steps to reproduce the behavior:

  1. Go to 'Terminal'
  2. Run script "cd ~/open_dbm-master"
  3. Run pwd command to show that I am in "Users/user/open_dbm-master"
  4. Run script "bash process_dbm.sh --input_path=/USers/user/Documents/1Video_Recordings/009 --output_oath=/Users/user/Docuemtns/2Extracted_Data/009
  5. Outcome: no derived variables folder with excel file inside, just a raw variables folder with raw variable outputs for Image 4 (7T), Image 7 (1T) and Image 9 (2W)
    Screen Shot 2021-08-03 at 2 00 14 pm.

Expected behavior
A derived variable folder in the output folder that has an excel file with 10 lines for each of the 10 videos in the folder.

Screenshots
image
image
image
image
image
image
image

Desktop (please complete the following information):

  • OS: macOS Big Sur, version 11.2.2
  • Browser: Chrome
  • Version: 11.2.2

Not running all videos in folder

I'm having an issue with the software, where when I try to run the program on 10 videos in a folder, I only only get data for one video in the folder (and it's not even the first video in the folder). I have followed the instructions as given in the wiki/doc as well as the ones shown in the tutorial videos, and have run the program multiple times, but keep only getting data for one video in the folder. I'm not sure what is wrong here. I'd appreciate any help!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.