Skip to content

w-i-l/dexter-laboratory-face-detection

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation



How to use it

NOTE: For this you will need to have conda installed. If you do not have it, you can install it by following the instructions from the official documentation.

For using the provided application you will need to install the dependecies by running the following code:

conda create -n dexter python=3.10
conda activate dexter
conda install matplotlib numpy opencv scipy tqdm -y
pip install tf_keras

For creating a Python virtual environment you can use the following guide. Then install the dependencies using pip.

This will create a new environment called dexter and install the required packages, using the Python3.

After that we will want to install the Tensorflow package with the MPS capabilities for the MacOS. This will ensure a faster processing time. For this we will use the following code:

conda install -c apple tensorflow-deps
pip install tensorflow-macos==2.15.0
pip install tensorflow-metal==1.1.0

For Windows you can use the following code:

pip install tensorflow

For other platforms or distribution, please refer to offical documentation.

After the instalation is complete, you will need to create a folder in the data directory called test. Here you can put all of the images.

So the folder structure should look like this:

data
│
└───test
│   │
│   └───001.jpg
│   │   002.jpg
│   │   ...

After that you can run the following code:

python main.py

Note: If you encounter the following error: ImportError: attempted relative import with no known parent package or ModuleNotFoundError: No module named make sure to run the script from the src folder and if that does not work, try to run the script with the following code:

export PYTHONPATH=$PYTHONPATH:$(pwd)

This will generate the predictions for each task in the data/output directory.

On my machine the processing time for 200 images with the MPS capabilities enabled was around 13 minutes. Also keep in mind the data loaders for the CNN models are using a small batches to ensure a lower use of hardware resources.

About

Face detection on the Dexter cartoon

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages