blob: 709f89f5096069f460c2758ee57f0ee33a8ed9f4 [file] [log] [blame]
Shad Ansari47432b62021-09-27 22:46:25 +00001# SPDX-FileCopyrightText: 2020-present Open Networking Foundation <info@opennetworking.org>
2# SPDX-License-Identifier: LicenseRef-ONF-Member-1.01
3#
4define PROJECT_HELP_MSG
5Usage:
6 make help show this message
7 make clean remove intermediate files
Shad Ansari55ff1852021-09-27 20:05:54 +00008
Shad Ansari47432b62021-09-27 22:46:25 +00009 make ${VENV} make a virtualenv in the base directory
10 make python-reqs install python packages in requirements.pip
11 make git-config set local git configuration
12 make setup make python-reqs
13
14 make run launch network-video-recorder
15 make run-native run native application (no docker)
16 make run-native-no-show run native applicaiton (no docker) w/o video output
17endef
18export PROJECT_HELP_MSG
19
20SHELL = /bin/bash
21VENV = .venv
22PYTHON = $(VENV)/bin/python3
23PIP = $(VENV)/bin/pip
24IMAGE = person-detection-app
25
26help:
27 echo "$$PROJECT_HELP_MSG" | less
28
29
30$(VENV): $(VENV)/touchfile
31
32$(VENV)/touchfile: requirements.txt
33 test -d $(VENV) || python3 -m venv $(VENV)
34 . $(VENV)/bin/activate; pip install -Ur requirements.txt
35 touch $(VENV)/touchfile
36
37$(VENV)/bin/activate: requirements.txt
38 python3 -m venv $(VENV)
39 $(PIP) install -r requirements.txt
40
41build: $(VENV)
42 docker build -f docker/Dockerfile -t $(IMAGE) .
43
44run:
45 docker run -itu root:root --privileged --network host --name $(IMAGE) --rm $(IMAGE)
46
47run-native-test:
Shad Ansarid80531f2021-09-27 23:15:03 +000048 . ./bin/person_detection.sh -i ./resources/run.mp4
Shad Ansari47432b62021-09-27 22:46:25 +000049
50run-native:
Shad Ansarid80531f2021-09-27 23:15:03 +000051 . ./bin/person_detection.sh -i gstreamer
Shad Ansari47432b62021-09-27 22:46:25 +000052
Shad Ansari0119b422021-09-27 23:51:49 +000053run-native-cam:
54 . ./bin/person_detection.sh -i cam
55
Shad Ansari47432b62021-09-27 22:46:25 +000056run-native-test-no-show:
Shad Ansarid80531f2021-09-27 23:15:03 +000057 . ./bin/person_detection.sh -i ./resources/run.mp4 -ns
Shad Ansari47432b62021-09-27 22:46:25 +000058
59run-native-no-show:
Shad Ansarid80531f2021-09-27 23:15:03 +000060 . ./bin/person_detection.sh -i gstreamer -ns
Shad Ansari55ff1852021-09-27 20:05:54 +000061
62test:
Shad Ansari47432b62021-09-27 22:46:25 +000063
64
65CLEANUP = *.pyc $(VENV)
66clean:
67 rm -rf ${CLEANUP}
68
69.PHONY: run clean
70