-
Notifications
You must be signed in to change notification settings - Fork 56
/
Copy pathMakefile
118 lines (97 loc) · 2.67 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
DEBUG=0
VPATH=./src/:./src/layer:./
CONVERT=darknet2ncnn
VERIFY=convert_verify
EXT_LIB=libdarknet2ncnn.a
OBJDIR=./obj/
CC=gcc
CPP=g++
AR=ar
ARFLAGS=rcs
OPTS=-Ofast
LDFLAGS= -L ncnn/build/install/lib/ -L . -L darknet -ldarknet -lncnn -ldarknet2ncnn -lm -pthread -fopenmp
COMMON= -I include -I ncnn/build/install/include/ncnn/ -I darknet/include/ -I src -I ncnn/src/
CFLAGS= -Wno-unused-result -Wfatal-errors -fPIC
ifeq ($(DEBUG), 1)
OPTS=-O0 -g
endif
CFLAGS+=$(OPTS)
LDFLAGS+= `pkg-config --libs opencv` -lstdc++
COMMON+= `pkg-config --cflags opencv`
CONVERT_OBJA=darknet2ncnn.o
VERIFY_OBJA=convert_verify.o
EXT_LIB_OBJA= darknet_activation.o \
darknet_shortcut.o \
yolov1_detection.o \
yolov3_detection.o \
object_detection.o \
register_darknet.o
CONVERT_OBJ = $(addprefix $(OBJDIR), $(CONVERT_OBJA))
VERIFY_OBJ = $(addprefix $(OBJDIR), $(VERIFY_OBJA))
EXT_LIB_OBJ = $(addprefix $(OBJDIR), $(EXT_LIB_OBJA))
DEPS = $(wildcard *.h) Makefile
all: obj $(CONVERT) $(VERIFY) $(EXT_LIB)
$(VERIFY): $(VERIFY_OBJ) $(EXT_LIB)
$(CC) $^ -o $@ $(LDFLAGS) $(COMMON) $(CFLAGS)
$(CONVERT): $(CONVERT_OBJ) $(EXT_LIB)
$(CC) $^ -o $@ $(LDFLAGS) $(COMMON) $(CFLAGS)
$(EXT_LIB): $(EXT_LIB_OBJ)
$(AR) $(ARFLAGS) $@ $^
$(OBJDIR)%.o: %.cpp $(DEPS)
$(CPP) $(COMMON) $(CFLAGS) -c $< -o $@
$(OBJDIR)%.o: %.c $(DEPS)
$(CC) $(COMMON) $(CFLAGS) -c $< -o $@
%.net: $(VERIFY) $(CONVERT)
./darknet2ncnn data/$(basename $@).cfg data/$(basename $@).weights example/zoo/$(basename $@).param example/zoo/$(basename $@).bin
./convert_verify data/$(basename $@).cfg data/$(basename $@).weights example/zoo/$(basename $@).param example/zoo/$(basename $@).bin example/data/dog.jpg
obj:
mkdir -p obj
cifar: $(VERIFY) $(CONVERT)
./darknet2ncnn data/[email protected] data/[email protected] example/zoo/[email protected] example/zoo/[email protected]
./convert_verify data/[email protected] data/[email protected] example/zoo/[email protected] example/zoo/[email protected] example/data/21263_ship.png
alexnet.net:
darknet.net:
darknet19.net:
darknet53.net:
densenet201.net:
extraction.net:
resnet18.net:
resnet34.net:
resnet50.net:
resnet101.net:
resnet152.net:
resnext50.net:
resnext101-32x4d.net:
resnext152-32x4d.net:
vgg-16.net:
yolov1-tiny.net:
yolov2-tiny.net:
yolov2.net:
yolov3-tiny.net:
yolov3.net:
yolov3-spp.net:
all-net:cifar\
alexnet.net\
darknet.net\
darknet19.net\
darknet53.net\
densenet201.net\
extraction.net\
resnet18.net\
resnet34.net\
resnet50.net\
resnet101.net\
resnet152.net\
resnext50.net\
resnext101-32x4d.net\
resnext152-32x4d.net\
vgg-16.net\
yolov1-tiny.net\
yolov2-tiny.net\
yolov2.net\
yolov3-tiny.net\
yolov3.net\
yolov3-spp.net\
.PHONY: clean
clean:
rm -rf $(OBJS) $(CONVERT) $(CONVERT_OBJ) $(EXT_LIB_OBJ) $(EXT_LIB) $(VERIFY) $(VERIFY_OBJ) $(OBJDIR)/*