BUILD 21.1 KB
Newer Older
1
# Description:
2
#   Contains files for loading, training and evaluating TF-Slim-based models.
3
# load("//devtools/python/blaze:python3.bzl", "py2and3_test")
4

5
6
7
package(
    default_visibility = ["//visibility:public"],
)
8
9
10
11
12
13
14
15

licenses(["notice"])  # Apache 2.0

exports_files(["LICENSE"])

py_library(
    name = "dataset_utils",
    srcs = ["datasets/dataset_utils.py"],
Derek Chow's avatar
Derek Chow committed
16
    deps = [
17
        "//third_party/py/six",
18
        # "//tensorflow",
Derek Chow's avatar
Derek Chow committed
19
    ],
20
21
)

derekjchow's avatar
derekjchow committed
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
sh_binary(
    name = "download_and_convert_imagenet",
    srcs = ["datasets/download_and_convert_imagenet.sh"],
    data = [
        "datasets/download_imagenet.sh",
        "datasets/imagenet_2012_validation_synset_labels.txt",
        "datasets/imagenet_lsvrc_2015_synsets.txt",
        "datasets/imagenet_metadata.txt",
        "datasets/preprocess_imagenet_validation_data.py",
        "datasets/process_bounding_boxes.py",
        ":build_imagenet_data",
    ],
)

py_binary(
    name = "build_imagenet_data",
    srcs = ["datasets/build_imagenet_data.py"],
39
    python_version = "PY2",
derekjchow's avatar
derekjchow committed
40
    deps = [
41
        # "//numpy",
42
        "//third_party/py/six",
43
        # "//tensorflow",
derekjchow's avatar
derekjchow committed
44
45
46
    ],
)

47
py_library(
48
49
    name = "download_and_convert_cifar10",
    srcs = ["datasets/download_and_convert_cifar10.py"],
Derek Chow's avatar
Derek Chow committed
50
51
    deps = [
        ":dataset_utils",
52
        # "//numpy",
53
        "//third_party/py/six",
54
        # "//tensorflow",
Derek Chow's avatar
Derek Chow committed
55
    ],
56
57
)

58
py_library(
59
60
    name = "download_and_convert_flowers",
    srcs = ["datasets/download_and_convert_flowers.py"],
Derek Chow's avatar
Derek Chow committed
61
62
    deps = [
        ":dataset_utils",
63
        # "//tensorflow",
Derek Chow's avatar
Derek Chow committed
64
    ],
65
66
)

67
py_library(
68
69
    name = "download_and_convert_mnist",
    srcs = ["datasets/download_and_convert_mnist.py"],
Derek Chow's avatar
Derek Chow committed
70
71
    deps = [
        ":dataset_utils",
72
        # "//numpy",
73
        "//third_party/py/six",
74
        # "//tensorflow",
Derek Chow's avatar
Derek Chow committed
75
    ],
76
77
)

78
79
80
py_library(
    name = "download_and_convert_visualwakewords_lib",
    srcs = ["datasets/download_and_convert_visualwakewords_lib.py"],
81
    deps = [
82
83
84
        ":dataset_utils",
        "//third_party/py/PIL:pil",
        "//third_party/py/contextlib2",
85
        # "//tensorflow",
86
87
88
    ],
)

89
90
91
py_library(
    name = "download_and_convert_visualwakewords",
    srcs = ["datasets/download_and_convert_visualwakewords.py"],
92
    deps = [
93
        ":download_and_convert_visualwakewords_lib",
94
95
96
97
        # "//tensorflow",
    ],
)

98
99
100
101
py_binary(
    name = "download_and_convert_data",
    srcs = ["download_and_convert_data.py"],
    python_version = "PY2",
102
    deps = [
103
104
105
106
        ":download_and_convert_cifar10",
        ":download_and_convert_flowers",
        ":download_and_convert_mnist",
        ":download_and_convert_visualwakewords",
107
108
109
110
        # "//tensorflow",
    ],
)

111
py_library(
112
113
    name = "cifar10",
    srcs = ["datasets/cifar10.py"],
Derek Chow's avatar
Derek Chow committed
114
115
    deps = [
        ":dataset_utils",
116
        # "//tensorflow",
117
        # "//tensorflow/contrib/slim",
Derek Chow's avatar
Derek Chow committed
118
    ],
119
120
)

121
py_library(
122
123
    name = "flowers",
    srcs = ["datasets/flowers.py"],
Derek Chow's avatar
Derek Chow committed
124
125
    deps = [
        ":dataset_utils",
126
        # "//tensorflow",
127
        # "//tensorflow/contrib/slim",
Derek Chow's avatar
Derek Chow committed
128
    ],
129
130
)

131
py_library(
132
133
    name = "imagenet",
    srcs = ["datasets/imagenet.py"],
Derek Chow's avatar
Derek Chow committed
134
135
    deps = [
        ":dataset_utils",
136
        "//third_party/py/six",
137
        # "//tensorflow",
138
        # "//tensorflow/contrib/slim",
Derek Chow's avatar
Derek Chow committed
139
    ],
140
141
)

142
py_library(
143
144
    name = "mnist",
    srcs = ["datasets/mnist.py"],
Derek Chow's avatar
Derek Chow committed
145
146
    deps = [
        ":dataset_utils",
147
        # "//tensorflow",
148
        # "//tensorflow/contrib/slim",
Derek Chow's avatar
Derek Chow committed
149
    ],
150
151
)

152
153
154
155
156
157
py_library(
    name = "visualwakewords",
    srcs = ["datasets/visualwakewords.py"],
    deps = [
        ":dataset_utils",
        # "//tensorflow",
158
        # "//tensorflow/contrib/slim",
159
160
161
    ],
)

162
163
164
165
166
167
168
169
py_library(
    name = "dataset_factory",
    srcs = ["datasets/dataset_factory.py"],
    deps = [
        ":cifar10",
        ":flowers",
        ":imagenet",
        ":mnist",
170
        ":visualwakewords",
171
172
173
174
175
    ],
)

py_library(
    name = "model_deploy",
176
    srcs = ["deployment/model_deploy.py"],
Derek Chow's avatar
Derek Chow committed
177
    deps = [
178
        # "//tensorflow",
179
        # "//tensorflow/contrib/slim",
Derek Chow's avatar
Derek Chow committed
180
    ],
181
182
183
184
)

py_test(
    name = "model_deploy_test",
185
    srcs = ["deployment/model_deploy_test.py"],
186
    python_version = "PY2",
187
    srcs_version = "PY2AND3",
Derek Chow's avatar
Derek Chow committed
188
189
    deps = [
        ":model_deploy",
190
        # "//numpy",
191
        # "//tensorflow",
192
193
194
        # "//tensorflow/contrib/framework:framework_py",
        # "//tensorflow/contrib/layers:layers_py",
        # "//tensorflow/contrib/slim",
Derek Chow's avatar
Derek Chow committed
195
    ],
196
197
198
)

py_library(
199
200
    name = "cifarnet_preprocessing",
    srcs = ["preprocessing/cifarnet_preprocessing.py"],
Derek Chow's avatar
Derek Chow committed
201
    deps = [
202
        # "//tensorflow",
203
        # "//tensorflow/contrib/slim",
Derek Chow's avatar
Derek Chow committed
204
    ],
205
206
207
208
)

py_library(
    name = "inception_preprocessing",
209
    srcs = ["preprocessing/inception_preprocessing.py"],
Derek Chow's avatar
Derek Chow committed
210
    deps = [
211
212
        # "//tensorflow",
        # "//tensorflow/python:control_flow_ops",
Derek Chow's avatar
Derek Chow committed
213
    ],
214
215
216
217
)

py_library(
    name = "lenet_preprocessing",
218
    srcs = ["preprocessing/lenet_preprocessing.py"],
Derek Chow's avatar
Derek Chow committed
219
    deps = [
220
        # "//tensorflow",
221
        # "//tensorflow/contrib/slim",
Derek Chow's avatar
Derek Chow committed
222
    ],
223
224
225
226
)

py_library(
    name = "vgg_preprocessing",
227
    srcs = ["preprocessing/vgg_preprocessing.py"],
Derek Chow's avatar
Derek Chow committed
228
    deps = [
229
        # "//tensorflow",
230
        # "//tensorflow/contrib/slim",
Derek Chow's avatar
Derek Chow committed
231
    ],
232
233
234
235
)

py_library(
    name = "preprocessing_factory",
236
    srcs = ["preprocessing/preprocessing_factory.py"],
237
    deps = [
238
        ":cifarnet_preprocessing",
239
240
241
        ":inception_preprocessing",
        ":lenet_preprocessing",
        ":vgg_preprocessing",
242
        # "//tensorflow/contrib/slim",
243
244
245
    ],
)

246
247
248
249
250
251
252
# Typical networks definitions.

py_library(
    name = "nets",
    deps = [
        ":alexnet",
        ":cifarnet",
253
        ":cyclegan",
254
        ":i3d",
255
256
        ":inception",
        ":lenet",
257
        ":mobilenet",
258
        ":nasnet",
259
        ":overfeat",
260
        ":pix2pix",
maximneumann's avatar
maximneumann committed
261
        ":pnasnet",
262
263
        ":resnet_v1",
        ":resnet_v2",
264
        ":s3dg",
265
266
267
268
269
270
271
272
        ":vgg",
    ],
)

py_library(
    name = "alexnet",
    srcs = ["nets/alexnet.py"],
    srcs_version = "PY2AND3",
273
    deps = [
pkulzc's avatar
pkulzc committed
274
        # "//tensorflow",
275
        # "//tensorflow/contrib/slim",
276
    ],
277
278
279
280
281
282
)

py_test(
    name = "alexnet_test",
    size = "medium",
    srcs = ["nets/alexnet_test.py"],
283
    python_version = "PY2",
284
    srcs_version = "PY2AND3",
Derek Chow's avatar
Derek Chow committed
285
286
    deps = [
        ":alexnet",
287
        # "//tensorflow",
288
        # "//tensorflow/contrib/slim",
Derek Chow's avatar
Derek Chow committed
289
    ],
290
291
292
293
294
)

py_library(
    name = "cifarnet",
    srcs = ["nets/cifarnet.py"],
Derek Chow's avatar
Derek Chow committed
295
    deps = [
296
        # "//tensorflow",
297
        # "//tensorflow/contrib/slim",
Derek Chow's avatar
Derek Chow committed
298
    ],
299
300
)

301
302
303
304
305
py_library(
    name = "cyclegan",
    srcs = ["nets/cyclegan.py"],
    deps = [
        # "//numpy",
306
        "//third_party/py/six",
307
        # "//tensorflow",
308
309
310
        # "//tensorflow/contrib/framework:framework_py",
        # "//tensorflow/contrib/layers:layers_py",
        # "//tensorflow/contrib/util:util_py",
311
312
313
314
315
316
    ],
)

py_test(
    name = "cyclegan_test",
    srcs = ["nets/cyclegan_test.py"],
317
    python_version = "PY2",
318
319
320
321
    shard_count = 3,
    srcs_version = "PY2AND3",
    deps = [
        ":cyclegan",
322
        # "//tensorflow",
323
324
325
326
327
328
329
    ],
)

py_library(
    name = "dcgan",
    srcs = ["nets/dcgan.py"],
    deps = [
330
        "//third_party/py/six",
331
        # "//tensorflow",
332
        # "//tensorflow/contrib/slim",
333
334
335
336
337
338
    ],
)

py_test(
    name = "dcgan_test",
    srcs = ["nets/dcgan_test.py"],
339
    python_version = "PY2",
340
341
342
343
    shard_count = 3,
    srcs_version = "PY2AND3",
    deps = [
        ":dcgan",
344
        "//third_party/py/six",
345
        # "//tensorflow",
346
347
348
    ],
)

349
350
351
352
353
354
355
356
py_library(
    name = "i3d",
    srcs = ["nets/i3d.py"],
    srcs_version = "PY2AND3",
    deps = [
        ":i3d_utils",
        ":s3dg",
        # "//tensorflow",
357
        # "//tensorflow/contrib/slim",
358
359
360
361
362
363
364
    ],
)

py_test(
    name = "i3d_test",
    size = "large",
    srcs = ["nets/i3d_test.py"],
365
    python_version = "PY2",
366
367
368
369
370
371
372
373
374
375
376
377
378
    shard_count = 3,
    srcs_version = "PY2AND3",
    deps = [
        ":i3d",
        # "//tensorflow",
    ],
)

py_library(
    name = "i3d_utils",
    srcs = ["nets/i3d_utils.py"],
    srcs_version = "PY2AND3",
    deps = [
379
        # "//numpy",
380
        # "//tensorflow",
381
382
        # "//tensorflow/contrib/framework:framework_py",
        # "//tensorflow/contrib/layers:layers_py",
383
384
385
    ],
)

386
387
388
389
390
391
392
393
394
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
395
        ":inception_v4",
396
397
398
    ],
)

Alex Kurakin's avatar
Alex Kurakin committed
399
400
401
402
py_library(
    name = "inception_utils",
    srcs = ["nets/inception_utils.py"],
    srcs_version = "PY2AND3",
403
    deps = [
pkulzc's avatar
pkulzc committed
404
        # "//tensorflow",
405
        # "//tensorflow/contrib/slim",
406
    ],
Alex Kurakin's avatar
Alex Kurakin committed
407
408
)

409
410
411
412
py_library(
    name = "inception_v1",
    srcs = ["nets/inception_v1.py"],
    srcs_version = "PY2AND3",
Alex Kurakin's avatar
Alex Kurakin committed
413
414
    deps = [
        ":inception_utils",
415
        # "//tensorflow",
416
        # "//tensorflow/contrib/slim",
Alex Kurakin's avatar
Alex Kurakin committed
417
    ],
418
419
420
421
422
423
)

py_library(
    name = "inception_v2",
    srcs = ["nets/inception_v2.py"],
    srcs_version = "PY2AND3",
Alex Kurakin's avatar
Alex Kurakin committed
424
425
    deps = [
        ":inception_utils",
426
        # "//tensorflow",
427
        # "//tensorflow/contrib/slim",
Alex Kurakin's avatar
Alex Kurakin committed
428
    ],
429
430
431
432
433
434
)

py_library(
    name = "inception_v3",
    srcs = ["nets/inception_v3.py"],
    srcs_version = "PY2AND3",
Alex Kurakin's avatar
Alex Kurakin committed
435
436
    deps = [
        ":inception_utils",
437
        # "//tensorflow",
438
        # "//tensorflow/contrib/slim",
Alex Kurakin's avatar
Alex Kurakin committed
439
440
441
442
443
444
445
446
447
    ],
)

py_library(
    name = "inception_v4",
    srcs = ["nets/inception_v4.py"],
    srcs_version = "PY2AND3",
    deps = [
        ":inception_utils",
448
        # "//tensorflow",
449
        # "//tensorflow/contrib/slim",
Alex Kurakin's avatar
Alex Kurakin committed
450
    ],
451
452
453
454
455
456
)

py_library(
    name = "inception_resnet_v2",
    srcs = ["nets/inception_resnet_v2.py"],
    srcs_version = "PY2AND3",
457
    deps = [
pkulzc's avatar
pkulzc committed
458
        # "//tensorflow",
459
        # "//tensorflow/contrib/slim",
460
    ],
461
462
463
464
465
466
)

py_test(
    name = "inception_v1_test",
    size = "large",
    srcs = ["nets/inception_v1_test.py"],
467
    python_version = "PY2",
468
469
    shard_count = 3,
    srcs_version = "PY2AND3",
Derek Chow's avatar
Derek Chow committed
470
471
    deps = [
        ":inception",
472
        # "//numpy",
473
        # "//tensorflow",
474
        # "//tensorflow/contrib/slim",
Derek Chow's avatar
Derek Chow committed
475
    ],
476
477
478
479
480
481
)

py_test(
    name = "inception_v2_test",
    size = "large",
    srcs = ["nets/inception_v2_test.py"],
482
    python_version = "PY2",
483
484
    shard_count = 3,
    srcs_version = "PY2AND3",
Derek Chow's avatar
Derek Chow committed
485
486
    deps = [
        ":inception",
487
        # "//numpy",
488
        # "//tensorflow",
489
        # "//tensorflow/contrib/slim",
Derek Chow's avatar
Derek Chow committed
490
    ],
491
492
493
494
495
496
)

py_test(
    name = "inception_v3_test",
    size = "large",
    srcs = ["nets/inception_v3_test.py"],
497
    python_version = "PY2",
498
499
    shard_count = 3,
    srcs_version = "PY2AND3",
Derek Chow's avatar
Derek Chow committed
500
501
    deps = [
        ":inception",
502
        # "//numpy",
503
        # "//tensorflow",
504
        # "//tensorflow/contrib/slim",
Derek Chow's avatar
Derek Chow committed
505
    ],
506
507
)

Alex Kurakin's avatar
Alex Kurakin committed
508
509
510
511
py_test(
    name = "inception_v4_test",
    size = "large",
    srcs = ["nets/inception_v4_test.py"],
512
    python_version = "PY2",
Alex Kurakin's avatar
Alex Kurakin committed
513
514
    shard_count = 3,
    srcs_version = "PY2AND3",
Derek Chow's avatar
Derek Chow committed
515
516
    deps = [
        ":inception",
517
        # "//tensorflow",
518
        # "//tensorflow/contrib/slim",
Derek Chow's avatar
Derek Chow committed
519
    ],
Alex Kurakin's avatar
Alex Kurakin committed
520
521
)

522
523
524
525
py_test(
    name = "inception_resnet_v2_test",
    size = "large",
    srcs = ["nets/inception_resnet_v2_test.py"],
526
    python_version = "PY2",
527
528
    shard_count = 3,
    srcs_version = "PY2AND3",
Derek Chow's avatar
Derek Chow committed
529
530
    deps = [
        ":inception",
531
        # "//tensorflow",
532
        # "//tensorflow/contrib/slim",
Derek Chow's avatar
Derek Chow committed
533
    ],
534
535
)

536
537
538
py_library(
    name = "lenet",
    srcs = ["nets/lenet.py"],
Derek Chow's avatar
Derek Chow committed
539
    deps = [
540
        # "//tensorflow",
541
        # "//tensorflow/contrib/slim",
Derek Chow's avatar
Derek Chow committed
542
    ],
543
544
)

andrewghoward's avatar
andrewghoward committed
545
546
547
548
py_library(
    name = "mobilenet_v1",
    srcs = ["nets/mobilenet_v1.py"],
    srcs_version = "PY2AND3",
549
    deps = [
pkulzc's avatar
pkulzc committed
550
        # "//tensorflow",
551
552
        # "//tensorflow/contrib/layers:layers_py",
        # "//tensorflow/contrib/slim",
553
    ],
andrewghoward's avatar
andrewghoward committed
554
555
)

556
557
558
559
560
561
562
563
564
py_library(
    name = "mobilenet_common",
    srcs = [
        "nets/mobilenet/conv_blocks.py",
        "nets/mobilenet/mobilenet.py",
    ],
    srcs_version = "PY2AND3",
    deps = [
        # "//tensorflow",
565
        # "//tensorflow/contrib/slim",
566
567
568
    ],
)

569
570
py_library(
    name = "mobilenet_v2",
571
    srcs = ["nets/mobilenet/mobilenet_v2.py"],
572
    srcs_version = "PY2AND3",
573
    deps = [
574
575
        ":mobilenet_common",
        # "//tensorflow",
576
577
        # "//tensorflow/contrib/layers:layers_py",
        # "//tensorflow/contrib/slim",
578
579
580
581
582
583
584
585
586
    ],
)

py_library(
    name = "mobilenet_v3",
    srcs = ["nets/mobilenet/mobilenet_v3.py"],
    srcs_version = "PY2AND3",
    deps = [
        ":mobilenet_common",
587
        # "//numpy",
588
        # "//tensorflow",
589
        # "//tensorflow/contrib/slim",
590
591
592
    ],
)

593
594
595
py_test(
    name = "mobilenet_v2_test",
    srcs = ["nets/mobilenet/mobilenet_v2_test.py"],
596
    python_version = "PY2",
597
598
599
    srcs_version = "PY2AND3",
    deps = [
        ":mobilenet",
600
        ":mobilenet_common",
601
        # "//tensorflow",
602
        # "//tensorflow/contrib/slim",
603
604
605
    ],
)

606
607
608
609
610
611
py_test(  # py2and3_test
    name = "mobilenet_v3_test",
    srcs = ["nets/mobilenet/mobilenet_v3_test.py"],
    srcs_version = "PY2AND3",
    deps = [
        ":mobilenet",
612
        "//third_party/py/absl/testing:absltest",
613
614
615
616
        # "//tensorflow",
    ],
)

617
618
py_library(
    name = "mobilenet",
619
620
    deps = [
        ":mobilenet_v1",
621
        ":mobilenet_v2",
622
        ":mobilenet_v3",
623
624
625
    ],
)

andrewghoward's avatar
andrewghoward committed
626
627
628
629
py_test(
    name = "mobilenet_v1_test",
    size = "large",
    srcs = ["nets/mobilenet_v1_test.py"],
630
    python_version = "PY2",
andrewghoward's avatar
andrewghoward committed
631
632
633
634
    shard_count = 3,
    srcs_version = "PY2AND3",
    deps = [
        ":mobilenet_v1",
635
        # "//numpy",
636
        # "//tensorflow",
637
        # "//tensorflow/contrib/slim",
638
639
640
    ],
)

641
642
643
py_binary(
    name = "mobilenet_v1_train",
    srcs = ["nets/mobilenet_v1_train.py"],
644
    python_version = "PY2",
645
646
647
648
649
    deps = [
        ":dataset_factory",
        ":mobilenet_v1",
        ":preprocessing_factory",
        # "//tensorflow",
650
651
        # "//tensorflow/contrib/quantize:quantize_graph",
        # "//tensorflow/contrib/slim",
652
653
654
655
656
657
    ],
)

py_binary(
    name = "mobilenet_v1_eval",
    srcs = ["nets/mobilenet_v1_eval.py"],
658
    python_version = "PY2",
659
660
661
662
663
    deps = [
        ":dataset_factory",
        ":mobilenet_v1",
        ":preprocessing_factory",
        # "//tensorflow",
664
665
        # "//tensorflow/contrib/quantize:quantize_graph",
        # "//tensorflow/contrib/slim",
666
667
668
    ],
)

669
670
671
672
673
py_library(
    name = "nasnet_utils",
    srcs = ["nets/nasnet/nasnet_utils.py"],
    srcs_version = "PY2AND3",
    deps = [
674
        # "//tensorflow",
675
676
        # "//tensorflow/contrib/framework:framework_py",
        # "//tensorflow/contrib/slim",
677
678
679
680
681
682
683
684
685
    ],
)

py_library(
    name = "nasnet",
    srcs = ["nets/nasnet/nasnet.py"],
    srcs_version = "PY2AND3",
    deps = [
        ":nasnet_utils",
686
        # "//tensorflow",
687
688
689
690
        # "//tensorflow/contrib/framework:framework_py",
        # "//tensorflow/contrib/layers:layers_py",
        # "//tensorflow/contrib/slim",
        # "//tensorflow/contrib/training:training_py",
691
692
693
694
695
696
697
    ],
)

py_test(
    name = "nasnet_utils_test",
    size = "medium",
    srcs = ["nets/nasnet/nasnet_utils_test.py"],
698
    python_version = "PY2",
699
700
701
    srcs_version = "PY2AND3",
    deps = [
        ":nasnet_utils",
702
        # "//tensorflow",
703
704
705
706
707
708
709
    ],
)

py_test(
    name = "nasnet_test",
    size = "large",
    srcs = ["nets/nasnet/nasnet_test.py"],
710
    python_version = "PY2",
711
712
713
714
    shard_count = 10,
    srcs_version = "PY2AND3",
    deps = [
        ":nasnet",
715
        # "//tensorflow",
716
        # "//tensorflow/contrib/slim",
andrewghoward's avatar
andrewghoward committed
717
718
719
    ],
)

maximneumann's avatar
maximneumann committed
720
721
722
723
724
725
726
727
py_library(
    name = "pnasnet",
    srcs = ["nets/nasnet/pnasnet.py"],
    srcs_version = "PY2AND3",
    deps = [
        ":nasnet",
        ":nasnet_utils",
        # "//tensorflow",
728
729
730
        # "//tensorflow/contrib/framework:framework_py",
        # "//tensorflow/contrib/slim",
        # "//tensorflow/contrib/training:training_py",
maximneumann's avatar
maximneumann committed
731
732
733
734
735
736
737
    ],
)

py_test(
    name = "pnasnet_test",
    size = "large",
    srcs = ["nets/nasnet/pnasnet_test.py"],
738
    python_version = "PY2",
maximneumann's avatar
maximneumann committed
739
740
741
742
743
    shard_count = 4,
    srcs_version = "PY2AND3",
    deps = [
        ":pnasnet",
        # "//tensorflow",
744
        # "//tensorflow/contrib/slim",
maximneumann's avatar
maximneumann committed
745
746
747
    ],
)

748
py_library(
749
750
751
    name = "overfeat",
    srcs = ["nets/overfeat.py"],
    srcs_version = "PY2AND3",
752
    deps = [
pkulzc's avatar
pkulzc committed
753
        # "//tensorflow",
754
        # "//tensorflow/contrib/slim",
755
    ],
756
757
758
759
760
761
)

py_test(
    name = "overfeat_test",
    size = "medium",
    srcs = ["nets/overfeat_test.py"],
762
    python_version = "PY2",
763
    srcs_version = "PY2AND3",
Derek Chow's avatar
Derek Chow committed
764
765
    deps = [
        ":overfeat",
766
        # "//tensorflow",
767
        # "//tensorflow/contrib/slim",
Derek Chow's avatar
Derek Chow committed
768
    ],
769
770
)

771
772
773
774
py_library(
    name = "pix2pix",
    srcs = ["nets/pix2pix.py"],
    srcs_version = "PY2AND3",
775
    deps = [
pkulzc's avatar
pkulzc committed
776
        # "//tensorflow",
777
778
        # "//tensorflow/contrib/framework:framework_py",
        # "//tensorflow/contrib/layers:layers_py",
779
    ],
780
781
782
783
784
)

py_test(
    name = "pix2pix_test",
    srcs = ["nets/pix2pix_test.py"],
785
    python_version = "PY2",
786
787
788
    srcs_version = "PY2AND3",
    deps = [
        ":pix2pix",
789
        # "//tensorflow",
790
        # "//tensorflow/contrib/framework:framework_py",
791
792
793
    ],
)

794
795
796
797
py_library(
    name = "resnet_utils",
    srcs = ["nets/resnet_utils.py"],
    srcs_version = "PY2AND3",
798
    deps = [
pkulzc's avatar
pkulzc committed
799
        # "//tensorflow",
800
        # "//tensorflow/contrib/slim",
801
    ],
802
803
804
805
806
807
808
809
)

py_library(
    name = "resnet_v1",
    srcs = ["nets/resnet_v1.py"],
    srcs_version = "PY2AND3",
    deps = [
        ":resnet_utils",
810
        # "//tensorflow",
811
        # "//tensorflow/contrib/slim",
812
813
814
815
816
817
    ],
)

py_test(
    name = "resnet_v1_test",
    size = "medium",
818
    timeout = "long",
819
    srcs = ["nets/resnet_v1_test.py"],
820
    python_version = "PY2",
Derek Chow's avatar
Derek Chow committed
821
    shard_count = 2,
822
    srcs_version = "PY2AND3",
Derek Chow's avatar
Derek Chow committed
823
    deps = [
824
        ":resnet_utils",
Derek Chow's avatar
Derek Chow committed
825
        ":resnet_v1",
826
        # "//numpy",
827
        # "//tensorflow",
828
        # "//tensorflow/contrib/slim",
Derek Chow's avatar
Derek Chow committed
829
    ],
830
831
832
833
834
835
836
837
)

py_library(
    name = "resnet_v2",
    srcs = ["nets/resnet_v2.py"],
    srcs_version = "PY2AND3",
    deps = [
        ":resnet_utils",
838
        # "//tensorflow",
839
        # "//tensorflow/contrib/slim",
840
841
842
843
844
845
846
    ],
)

py_test(
    name = "resnet_v2_test",
    size = "medium",
    srcs = ["nets/resnet_v2_test.py"],
847
    python_version = "PY2",
Derek Chow's avatar
Derek Chow committed
848
    shard_count = 2,
849
    srcs_version = "PY2AND3",
Derek Chow's avatar
Derek Chow committed
850
    deps = [
851
        ":resnet_utils",
Derek Chow's avatar
Derek Chow committed
852
        ":resnet_v2",
853
        # "//numpy",
854
        # "//tensorflow",
855
        # "//tensorflow/contrib/slim",
Derek Chow's avatar
Derek Chow committed
856
    ],
857
858
)

859
860
861
862
863
864
865
py_library(
    name = "s3dg",
    srcs = ["nets/s3dg.py"],
    srcs_version = "PY2AND3",
    deps = [
        ":i3d_utils",
        # "//tensorflow",
866
867
        # "//tensorflow/contrib/framework:framework_py",
        # "//tensorflow/contrib/layers:layers_py",
868
869
870
871
872
873
874
    ],
)

py_test(
    name = "s3dg_test",
    size = "large",
    srcs = ["nets/s3dg_test.py"],
875
    python_version = "PY2",
876
877
878
879
880
881
882
883
    shard_count = 3,
    srcs_version = "PY2AND3",
    deps = [
        ":s3dg",
        # "//tensorflow",
    ],
)

884
885
886
887
py_library(
    name = "vgg",
    srcs = ["nets/vgg.py"],
    srcs_version = "PY2AND3",
888
    deps = [
pkulzc's avatar
pkulzc committed
889
        # "//tensorflow",
890
        # "//tensorflow/contrib/slim",
891
    ],
892
893
894
895
896
897
)

py_test(
    name = "vgg_test",
    size = "medium",
    srcs = ["nets/vgg_test.py"],
898
    python_version = "PY2",
899
    srcs_version = "PY2AND3",
Derek Chow's avatar
Derek Chow committed
900
901
    deps = [
        ":vgg",
902
        # "//tensorflow",
903
        # "//tensorflow/contrib/slim",
Derek Chow's avatar
Derek Chow committed
904
    ],
905
906
907
908
909
)

py_library(
    name = "nets_factory",
    srcs = ["nets/nets_factory.py"],
Derek Chow's avatar
Derek Chow committed
910
911
    deps = [
        ":nets",
912
        # "//tensorflow/contrib/slim",
Derek Chow's avatar
Derek Chow committed
913
    ],
914
915
916
917
)

py_test(
    name = "nets_factory_test",
918
    size = "large",
919
    srcs = ["nets/nets_factory_test.py"],
920
    python_version = "PY2",
921
    shard_count = 3,
922
    srcs_version = "PY2AND3",
Derek Chow's avatar
Derek Chow committed
923
924
    deps = [
        ":nets_factory",
925
        # "//tensorflow",
Derek Chow's avatar
Derek Chow committed
926
    ],
927
928
)

929
930
py_library(
    name = "train_image_classifier_lib",
931
932
933
934
935
936
    srcs = ["train_image_classifier.py"],
    deps = [
        ":dataset_factory",
        ":model_deploy",
        ":nets_factory",
        ":preprocessing_factory",
937
        # "//tensorflow",
938
939
        # "//tensorflow/contrib/quantize:quantize_graph",
        # "//tensorflow/contrib/slim",
940
    ],
941
942
)

943
944
945
py_binary(
    name = "train_image_classifier",
    srcs = ["train_image_classifier.py"],
946
947
    # WARNING: not supported in bazel; will be commented out by copybara.
    # paropts = ["--compress"],
948
    python_version = "PY2",
949
950
951
952
953
    deps = [
        ":train_image_classifier_lib",
    ],
)

954
955
py_library(
    name = "eval_image_classifier_lib",
956
    srcs = ["eval_image_classifier.py"],
957
958
    deps = [
        ":dataset_factory",
959
        ":nets_factory",
960
        ":preprocessing_factory",
961
        # "//tensorflow",
962
963
        # "//tensorflow/contrib/quantize:quantize_graph",
        # "//tensorflow/contrib/slim",
964
965
    ],
)
966

967
968
969
py_binary(
    name = "eval_image_classifier",
    srcs = ["eval_image_classifier.py"],
970
    python_version = "PY2",
971
972
973
974
975
    deps = [
        ":eval_image_classifier_lib",
    ],
)

976
977
978
py_binary(
    name = "export_inference_graph",
    srcs = ["export_inference_graph.py"],
979
980
    # WARNING: not supported in bazel; will be commented out by copybara.
    # paropts = ["--compress"],
981
    python_version = "PY2",
982
983
984
985
986
987
    deps = [":export_inference_graph_lib"],
)

py_library(
    name = "export_inference_graph_lib",
    srcs = ["export_inference_graph.py"],
988
989
990
    deps = [
        ":dataset_factory",
        ":nets_factory",
991
        # "//tensorflow",
992
993
        # "//tensorflow/contrib/quantize:quantize_graph",
        # "//tensorflow/contrib/slim",
994
        # "//tensorflow/python:platform",
995
996
997
998
999
1000
1001
    ],
)

py_test(
    name = "export_inference_graph_test",
    size = "medium",
    srcs = ["export_inference_graph_test.py"],
1002
    python_version = "PY2",
1003
1004
1005
1006
1007
    srcs_version = "PY2AND3",
    tags = [
        "manual",
    ],
    deps = [
1008
        ":export_inference_graph_lib",
1009
1010
        # "//tensorflow",
        # "//tensorflow/python:platform",
1011
1012
    ],
)