Unstructured set of the helper functions.
Project description
Facemask detection
Detection masks on faces.
Train set
No mask:
Mask:
- https://www.kaggle.com/andrewmvd/face-mask-detection
- https://www.kaggle.com/alexandralorenzo/maskdetection
- https://github.com/X-zhangyang/Real-World-Masked-Face-Dataset
- https://humansintheloop.org/medical-mask-dataset
Trainining
Define config, similar to facemask_detection_configs/2020-07-29.yaml.
Run
python facemask_detection/train.py -c <config>
Inference
python -m torch.distributed.launch --nproc_per_node=1 facemask_detection/inference.py -h
usage: inference.py [-h] -i INPUT_PATH -c CONFIG_PATH -o OUTPUT_PATH
[-b BATCH_SIZE] [-j NUM_WORKERS] -w WEIGHT_PATH
[--world_size WORLD_SIZE] [--local_rank LOCAL_RANK]
[--fp16]
optional arguments:
-h, --help show this help message and exit
-i INPUT_PATH, --input_path INPUT_PATH
Path with images.
-c CONFIG_PATH, --config_path CONFIG_PATH
Path to config.
-o OUTPUT_PATH, --output_path OUTPUT_PATH
Path to save jsons.
-b BATCH_SIZE, --batch_size BATCH_SIZE
batch_size
-j NUM_WORKERS, --num_workers NUM_WORKERS
num_workers
-w WEIGHT_PATH, --weight_path WEIGHT_PATH
Path to weights.
--world_size WORLD_SIZE
number of nodes for distributed training
--local_rank LOCAL_RANK
node rank for distributed training
--fp16 Use fp6
Example:
python -m torch.distributed.launch --nproc_per_node=<num_gpu> facemask_detection/inference.py \
-i <input_path> \
-w <path to weights> \
-o <path to the output_csv> \
-c <path to config>
-b <batch size>
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file facemask_detection-0.0.1.tar.gz
.
File metadata
- Download URL: facemask_detection-0.0.1.tar.gz
- Upload date:
- Size: 7.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/47.3.1 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.7.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8698880f5af44456143ccb6f276a0bcb96caf8809f0d9d26ebe9d188187e2389 |
|
MD5 | 745484c8ebf83d021929997050bb4497 |
|
BLAKE2b-256 | 917367fe7fa69693bd7e3b7ec39a1c083b66999d5ccbc8107f0e15f62bbc8633 |
File details
Details for the file facemask_detection-0.0.1-py2.py3-none-any.whl
.
File metadata
- Download URL: facemask_detection-0.0.1-py2.py3-none-any.whl
- Upload date:
- Size: 8.5 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/47.3.1 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.7.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a5be48eaa003ee4c23489604e02e7689d7b3e1581986f82a4d1a0715b8f0e3f3 |
|
MD5 | 9722d172a0a94b6738b194cb0932b9e0 |
|
BLAKE2b-256 | 97ca729b076786fc51b4731408afbfa6a6ccda4186fe34ba8c47ab29802a3528 |