forked from wimspaargaren/yolov3
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
63 lines (48 loc) · 1.51 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
.PHONY: all test lint bird-example street-example cuda-example ci-init ci-lint ci-test
data/yolov3:
@$(shell ./getModels.sh)
# Retrieves yolov3 models
models: | data/yolov3
@
# Runs lint
lint:
@echo Linting...
@golangci-lint -v --concurrency=3 --config=.golangci.yml --issues-exit-code=1 run \
--out-format=colored-line-number
# Run tests
test:
@echo Running tests...
@mkdir -p reports
LOGFORMAT=ASCII gotest -covermode=count -p=4 -v -coverprofile reports/codecoverage_all.cov `go list ./...`
@echo "Done running tests"
@go tool cover -func=reports/codecoverage_all.cov > reports/functioncoverage.out
@go tool cover -html=reports/codecoverage_all.cov -o reports/coverage.html
@echo "View report at $(PWD)/reports/coverage.html"
@tail -n 1 reports/functioncoverage.out
# Opens created coverage report in default browser
coverage-report:
@open reports/coverage.html
# Runs the examples
bird-example:
@cd cmd/image && go run .
street-example:
@cd cmd/image && go run . -i ../../data/example_images/street.jpg
webcam-example:
@cd cmd/webcam && go run .
cuda-example:
@cd cmd/cuda && go run .
# CI commands
ci-init:
@docker build -t yolov3-ci .
ci-lint:
@docker run yolov3-ci make lint
ci-test:
@docker run yolov3-ci make test
$(GOBIN)/gofumpt:
@GO111MODULE=on go get mvdan.cc/gofumpt
@go mod tidy
gofumpt: | $(GOBIN)/gofumpt
@gofumpt -w
gci:
@gci -local="github.com/wimspaargaren/yolov3" -w $(shell ls -d $(PWD)/* | grep -v mocks)
@gci -local="github.com/wimspaargaren/yolov3" -w $(shell ls -d $(PWD)/cmd/*)