|
| 1 | +.ONESHELL: |
| 2 | + |
| 3 | +SHELL := /bin/bash |
| 4 | +DATE_ID := $(shell date +"%y.%m.%d") |
| 5 | + |
| 6 | +# Get package name from pwd |
| 7 | +SOURCE_DIR = source /opt/intel/openvino/bin/setupvars.sh |
| 8 | + |
| 9 | +.DEFAULT_GOAL := help |
| 10 | + |
| 11 | +define PRINT_HELP_PYSCRIPT |
| 12 | +import re, sys |
| 13 | + |
| 14 | +for line in sys.stdin: |
| 15 | + match = re.match(r'^([a-zA-Z_-]+):.*?## (.*)$$', line) |
| 16 | + if match: |
| 17 | + target, help = match.groups() |
| 18 | + print("%-20s %s" % (target, help)) |
| 19 | +endef |
| 20 | +export PRINT_HELP_PYSCRIPT |
| 21 | + |
| 22 | + |
| 23 | +.PHONY: clean clean-test clean-pyc clean-build help changelog run |
| 24 | + |
| 25 | +help: |
| 26 | + @python3 -c "$$PRINT_HELP_PYSCRIPT" < $(MAKEFILE_LIST) |
| 27 | + |
| 28 | +clean: clean-build clean-pyc clean-test ## remove all build, test, coverage and Python artifacts |
| 29 | + |
| 30 | +clean-build: ## remove build artifacts |
| 31 | + rm -fr build/ |
| 32 | + rm -fr dist/ |
| 33 | + rm -fr .eggs/ |
| 34 | + find . -name '*.egg-info' -exec rm -fr {} + |
| 35 | + find . -name '*.egg' -exec rm -f {} + |
| 36 | + |
| 37 | +clean-pyc: ## remove Python file artifacts |
| 38 | + find . -name '*.pyc' -exec rm -f {} + |
| 39 | + find . -name '*.pyo' -exec rm -f {} + |
| 40 | + find . -name '__pycache__' -exec rm -fr {} + |
| 41 | + |
| 42 | +clean-test: ## remove test and coverage artifacts |
| 43 | + rm -f .coverage |
| 44 | + rm -fr htmlcov/ |
| 45 | + rm -fr .pytest_cache |
| 46 | + |
| 47 | +changelog: ## Generate changelog for current repo |
| 48 | + docker run -it --rm -v "$(pwd)":/usr/local/src/your-app \ |
| 49 | + ferrarimarco/github-changelog-generator -u "$(USER)" -p face_mask_detection_openvino |
| 50 | + |
| 51 | +formatter: ## Format style with black |
| 52 | + isort -rc . |
| 53 | + black -l 90 . |
| 54 | + |
| 55 | +lint: ## check style with flake8 |
| 56 | + flake8 --max-line-length 90 . |
| 57 | + |
| 58 | +example: ## Run main.py with example |
| 59 | + xhost +; |
| 60 | + docker run --rm -ti --volume "$(CURDIR)":/app --env DISPLAY=$(DISPLAY) \ |
| 61 | + --volume="/tmp/.X11-unix:/tmp/.X11-unix:rw" --device /dev/snd \ |
| 62 | + --device /dev/video0 mmphego/intel-openvino \ |
| 63 | + bash -c "source /opt/intel/openvino/bin/setupvars.sh && \ |
| 64 | + python main.py --face-model models/face-detection-adas-0001 \ |
| 65 | + --mask-model models/face_mask \ |
| 66 | + -i resources/mask.mp4 \ |
| 67 | + --debug \ |
| 68 | + --show-bbox \ |
| 69 | + --enable-speech" |
| 70 | + |
0 commit comments