-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmakefile
42 lines (34 loc) · 1.17 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
37
38
39
40
41
42
SHELL := zsh
current_todd_version := $$(cat .todd_version)
latest_todd_version := $(shell curl -H "Accept: application/vnd.github.sha" -s https://api.github.com/repos/LutingWang/todd/commits/main)
define install_todd
pipenv run pip uninstall -y todd_ai
GIT_LFS_SKIP_SMUDGE=1 pipenv run pip install \
"todd_ai @ git+https://github.com/LutingWang/todd.git@$(1)"
pipenv run pip uninstall -y opencv-python opencv-python-headless
pipenv run pip install opencv-python-headless
endef
.PHONY: lint commit install_todd todd tb
lint:
pipenv run pre-commit run -a
commit:
pipenv run cz c
install_todd:
$(call install_todd,$(current_todd_version))
todd:
if [[ "$(latest_todd_version)" == "$(current_todd_version)" ]]; then \
echo "No changes since last build."; \
exit 1; \
fi
$(call install_todd,$(latest_todd_version))
echo $(latest_todd_version) > .todd_version
tb:
mkdir -p tensorboards
for work_dir in work_dirs/*; do \
name=$$(basename $${work_dir}); \
tb_dir=$${work_dir}/tensorboard; \
if [[ -d $${tb_dir} ]]; then \
ln -sfT $$(realpath $${tb_dir}) tensorboards/$${name}; \
fi; \
done
tensorboard --logdir tensorboards --bind_all