BUILD 7 KB
Newer Older
1
# Description:
2
#   Contains files for loading, training and evaluating TF-Slim-based models.
3

4
5
6
7
package(default_visibility = [
    ":internal",
    "//domain_adaptation:__subpackages__",
])
8
9
10
11
12

licenses(["notice"])  # Apache 2.0

exports_files(["LICENSE"])

13
package_group(name = "internal")
14
15
16
17
18
19

py_library(
    name = "dataset_utils",
    srcs = ["datasets/dataset_utils.py"],
)

20
py_library(
21
22
23
24
25
    name = "download_and_convert_cifar10",
    srcs = ["datasets/download_and_convert_cifar10.py"],
    deps = [":dataset_utils"],
)

26
py_library(
27
28
29
30
31
    name = "download_and_convert_flowers",
    srcs = ["datasets/download_and_convert_flowers.py"],
    deps = [":dataset_utils"],
)

32
py_library(
33
34
35
36
37
    name = "download_and_convert_mnist",
    srcs = ["datasets/download_and_convert_mnist.py"],
    deps = [":dataset_utils"],
)

38
39
40
41
42
43
44
45
46
47
py_binary(
    name = "download_and_convert_data",
    srcs = ["download_and_convert_data.py"],
    deps = [
        ":download_and_convert_cifar10",
        ":download_and_convert_flowers",
        ":download_and_convert_mnist",
    ],
)

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
py_binary(
    name = "cifar10",
    srcs = ["datasets/cifar10.py"],
    deps = [":dataset_utils"],
)

py_binary(
    name = "flowers",
    srcs = ["datasets/flowers.py"],
    deps = [":dataset_utils"],
)

py_binary(
    name = "imagenet",
    srcs = ["datasets/imagenet.py"],
    deps = [":dataset_utils"],
)

py_binary(
    name = "mnist",
    srcs = ["datasets/mnist.py"],
    deps = [":dataset_utils"],
)

py_library(
    name = "dataset_factory",
    srcs = ["datasets/dataset_factory.py"],
    deps = [
        ":cifar10",
        ":flowers",
        ":imagenet",
        ":mnist",
    ],
)

py_library(
    name = "model_deploy",
85
    srcs = ["deployment/model_deploy.py"],
86
87
88
89
)

py_test(
    name = "model_deploy_test",
90
    srcs = ["deployment/model_deploy_test.py"],
91
92
93
94
95
    srcs_version = "PY2AND3",
    deps = [":model_deploy"],
)

py_library(
96
97
    name = "cifarnet_preprocessing",
    srcs = ["preprocessing/cifarnet_preprocessing.py"],
98
99
100
101
)

py_library(
    name = "inception_preprocessing",
102
    srcs = ["preprocessing/inception_preprocessing.py"],
103
104
105
106
)

py_library(
    name = "lenet_preprocessing",
107
    srcs = ["preprocessing/lenet_preprocessing.py"],
108
109
110
111
)

py_library(
    name = "vgg_preprocessing",
112
    srcs = ["preprocessing/vgg_preprocessing.py"],
113
114
115
116
)

py_library(
    name = "preprocessing_factory",
117
    srcs = ["preprocessing/preprocessing_factory.py"],
118
    deps = [
119
        ":cifarnet_preprocessing",
120
121
122
123
124
125
        ":inception_preprocessing",
        ":lenet_preprocessing",
        ":vgg_preprocessing",
    ],
)

126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
# Typical networks definitions.

py_library(
    name = "nets",
    deps = [
        ":alexnet",
        ":cifarnet",
        ":inception",
        ":lenet",
        ":overfeat",
        ":resnet_v1",
        ":resnet_v2",
        ":vgg",
    ],
)

py_library(
    name = "alexnet",
    srcs = ["nets/alexnet.py"],
    srcs_version = "PY2AND3",
)

py_test(
    name = "alexnet_test",
    size = "medium",
    srcs = ["nets/alexnet_test.py"],
    srcs_version = "PY2AND3",
    deps = [":alexnet"],
)

py_library(
    name = "cifarnet",
    srcs = ["nets/cifarnet.py"],
)

py_library(
    name = "inception",
    srcs = ["nets/inception.py"],
    srcs_version = "PY2AND3",
    deps = [
        ":inception_resnet_v2",
        ":inception_v1",
        ":inception_v2",
        ":inception_v3",
Alex Kurakin's avatar
Alex Kurakin committed
170
        ":inception_v4",
171
172
173
    ],
)

Alex Kurakin's avatar
Alex Kurakin committed
174
175
176
177
178
179
py_library(
    name = "inception_utils",
    srcs = ["nets/inception_utils.py"],
    srcs_version = "PY2AND3",
)

180
181
182
183
py_library(
    name = "inception_v1",
    srcs = ["nets/inception_v1.py"],
    srcs_version = "PY2AND3",
Alex Kurakin's avatar
Alex Kurakin committed
184
185
186
    deps = [
        ":inception_utils",
    ],
187
188
189
190
191
192
)

py_library(
    name = "inception_v2",
    srcs = ["nets/inception_v2.py"],
    srcs_version = "PY2AND3",
Alex Kurakin's avatar
Alex Kurakin committed
193
194
195
    deps = [
        ":inception_utils",
    ],
196
197
198
199
200
201
)

py_library(
    name = "inception_v3",
    srcs = ["nets/inception_v3.py"],
    srcs_version = "PY2AND3",
Alex Kurakin's avatar
Alex Kurakin committed
202
203
204
205
206
207
208
209
210
211
212
213
    deps = [
        ":inception_utils",
    ],
)

py_library(
    name = "inception_v4",
    srcs = ["nets/inception_v4.py"],
    srcs_version = "PY2AND3",
    deps = [
        ":inception_utils",
    ],
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
)

py_library(
    name = "inception_resnet_v2",
    srcs = ["nets/inception_resnet_v2.py"],
    srcs_version = "PY2AND3",
)

py_test(
    name = "inception_v1_test",
    size = "large",
    srcs = ["nets/inception_v1_test.py"],
    shard_count = 3,
    srcs_version = "PY2AND3",
    deps = [":inception"],
)

py_test(
    name = "inception_v2_test",
    size = "large",
    srcs = ["nets/inception_v2_test.py"],
    shard_count = 3,
    srcs_version = "PY2AND3",
    deps = [":inception"],
)

py_test(
    name = "inception_v3_test",
    size = "large",
    srcs = ["nets/inception_v3_test.py"],
    shard_count = 3,
    srcs_version = "PY2AND3",
    deps = [":inception"],
)

Alex Kurakin's avatar
Alex Kurakin committed
249
250
251
252
253
254
255
256
257
py_test(
    name = "inception_v4_test",
    size = "large",
    srcs = ["nets/inception_v4_test.py"],
    shard_count = 3,
    srcs_version = "PY2AND3",
    deps = [":inception"],
)

258
259
260
261
262
263
264
265
266
py_test(
    name = "inception_resnet_v2_test",
    size = "large",
    srcs = ["nets/inception_resnet_v2_test.py"],
    shard_count = 3,
    srcs_version = "PY2AND3",
    deps = [":inception"],
)

267
268
269
270
271
272
py_library(
    name = "lenet",
    srcs = ["nets/lenet.py"],
)

py_library(
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
    name = "overfeat",
    srcs = ["nets/overfeat.py"],
    srcs_version = "PY2AND3",
)

py_test(
    name = "overfeat_test",
    size = "medium",
    srcs = ["nets/overfeat_test.py"],
    srcs_version = "PY2AND3",
    deps = [":overfeat"],
)

py_library(
    name = "resnet_utils",
    srcs = ["nets/resnet_utils.py"],
    srcs_version = "PY2AND3",
)

py_library(
    name = "resnet_v1",
    srcs = ["nets/resnet_v1.py"],
    srcs_version = "PY2AND3",
    deps = [
        ":resnet_utils",
    ],
)

py_test(
    name = "resnet_v1_test",
    size = "medium",
    srcs = ["nets/resnet_v1_test.py"],
    srcs_version = "PY2AND3",
    deps = [":resnet_v1"],
)

py_library(
    name = "resnet_v2",
    srcs = ["nets/resnet_v2.py"],
    srcs_version = "PY2AND3",
    deps = [
        ":resnet_utils",
    ],
)

py_test(
    name = "resnet_v2_test",
    size = "medium",
    srcs = ["nets/resnet_v2_test.py"],
    srcs_version = "PY2AND3",
    deps = [":resnet_v2"],
)

py_library(
    name = "vgg",
    srcs = ["nets/vgg.py"],
    srcs_version = "PY2AND3",
)

py_test(
    name = "vgg_test",
    size = "medium",
    srcs = ["nets/vgg_test.py"],
    srcs_version = "PY2AND3",
    deps = [":vgg"],
)

py_library(
    name = "nets_factory",
    srcs = ["nets/nets_factory.py"],
    deps = [":nets"],
)

py_test(
    name = "nets_factory_test",
    size = "medium",
    srcs = ["nets/nets_factory_test.py"],
    srcs_version = "PY2AND3",
    deps = [":nets_factory"],
)

py_binary(
    name = "train_image_classifier",
    srcs = ["train_image_classifier.py"],
    deps = [
        ":dataset_factory",
        ":model_deploy",
        ":nets_factory",
        ":preprocessing_factory",
    ],
363
364
365
)

py_binary(
366
367
    name = "eval_image_classifier",
    srcs = ["eval_image_classifier.py"],
368
369
370
    deps = [
        ":dataset_factory",
        ":model_deploy",
371
        ":nets_factory",
372
373
374
        ":preprocessing_factory",
    ],
)