Initial commit of person-detection-app

Change-Id: Ic4141fd19d3d8c89929b798191310fa2c49e3070
diff --git a/Makefile b/Makefile
index e057470..e4ca58d 100644
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,67 @@
-all:
+# SPDX-FileCopyrightText: 2020-present Open Networking Foundation <info@opennetworking.org>
+# SPDX-License-Identifier: LicenseRef-ONF-Member-1.01
+#
+define PROJECT_HELP_MSG
+Usage:
+    make help                   show this message
+    make clean                  remove intermediate files
 
-build:
+    make ${VENV}                  make a virtualenv in the base directory
+    make python-reqs            install python packages in requirements.pip
+    make git-config             set local git configuration
+    make setup                  make python-reqs
+
+    make run                    launch network-video-recorder
+    make run-native             run native application (no docker)
+    make run-native-no-show     run native applicaiton (no docker) w/o video output
+endef
+export PROJECT_HELP_MSG
+
+SHELL = /bin/bash
+VENV = .venv
+PYTHON = $(VENV)/bin/python3
+PIP = $(VENV)/bin/pip
+IMAGE = person-detection-app
+
+help:
+	echo "$$PROJECT_HELP_MSG" | less
+
+
+$(VENV): $(VENV)/touchfile
+
+$(VENV)/touchfile: requirements.txt
+	test -d $(VENV) || python3 -m venv $(VENV)
+	. $(VENV)/bin/activate; pip install -Ur requirements.txt
+	touch $(VENV)/touchfile
+
+$(VENV)/bin/activate: requirements.txt
+	python3 -m venv $(VENV)
+	$(PIP) install -r requirements.txt
+
+build: $(VENV)
+	docker build -f docker/Dockerfile -t $(IMAGE) .
+
+run:
+	docker run -itu root:root --privileged --network host --name $(IMAGE) --rm $(IMAGE)
+
+run-native-test:
+	. ./person_detection.sh -i ./resources/run.mp4
+
+run-native:
+	. ./person_detection.sh -i gstreamer
+
+run-native-test-no-show:
+	. ./person_detection.sh -i ./resources/run.mp4 -ns
+
+run-native-no-show:
+	. ./person_detection.sh -i gstreamer -ns
 
 test:
+
+
+CLEANUP = *.pyc $(VENV)
+clean:
+	rm -rf ${CLEANUP}
+
+.PHONY: run clean
+