-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
36 lines (28 loc) · 1.25 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
UNAME := $(shell uname)
ILLUSTRATOR_TENSORFLOW_MODEL_DIR ?= $(CURDIR)/deps/tensorflow_models
ILLUSTRATOR_PYTHONPATH ?= $(PYTHONPATH):$(CURDIR):$(ILLUSTRATOR_TENSORFLOW_MODEL_DIR):$(ILLUSTRATOR_TENSORFLOW_MODEL_DIR)/research:$(ILLUSTRATOR_TENSORFLOW_MODEL_DIR)/research/im2txt:$(ILLUSTRATOR_TENSORFLOW_MODEL_DIR)/research/slim
ILLUSTRATOR_MAIN ?= illustrator/illustrate.py
ifeq ($(UNAME), Linux)
install_cmd = sudo apt install protobuf-compiler
endif
ifeq ($(UNAME), Darwin)
install_cmd = brew install protobuf
endif
all: protobuf python cocoapi
update:
git submodule update --merge
git lfs pull
protobuf: update
$(install_cmd)
cd ./deps/tensorflow_models/research/ && \
protoc ./object_detection/protos/*.proto --python_out=.
python:
pip3 install numpy Cython wheel
pip3 install -r requirements.txt
test -d $(shell python3 -c 'import site; print(list(filter(lambda x: "site-packages" in x, site.getsitepackages()))[0])')/en_core_web_lg || python3 -m spacy download en_core_web_lg
cocoapi: update
$(MAKE) -C ./deps/cocoapi/PythonAPI
cp -r deps/cocoapi/PythonAPI/pycocotools $(ILLUSTRATOR_TENSORFLOW_MODEL_DIR)/research
run:
@PYTHONPATH=$(ILLUSTRATOR_PYTHONPATH) python3 $(ILLUSTRATOR_MAIN) $(ILLUSTRATOR_INPUT)
.PHONY: cocoapi update protobuf python run all