BUILD 21.5 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
load("//devtools/python/blaze:pytype.bzl", "pytype_strict_binary")
5

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

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
17
    deps = [
18
        "//third_party/py/six",
19
        # "//tensorflow",
Derek Chow's avatar
Derek Chow committed
20
    ],
21
22
)

derekjchow's avatar
derekjchow committed
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
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"],
40
    python_version = "PY2",
derekjchow's avatar
derekjchow committed
41
    deps = [
42
        # "//numpy",
43
        "//third_party/py/six",
44
        # "//tensorflow",
derekjchow's avatar
derekjchow committed
45
46
47
    ],
)

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

479
py_test(  # py2and3_test
480
481
482
483
484
    name = "inception_v2_test",
    size = "large",
    srcs = ["nets/inception_v2_test.py"],
    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
py_test(  # py2and3_test
594
595
596
597
598
    name = "mobilenet_v2_test",
    srcs = ["nets/mobilenet/mobilenet_v2_test.py"],
    srcs_version = "PY2AND3",
    deps = [
        ":mobilenet",
599
        ":mobilenet_common",
600
        "//third_party/py/six",
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
py_test(  # py2and3_test
759
760
761
762
    name = "overfeat_test",
    size = "medium",
    srcs = ["nets/overfeat_test.py"],
    srcs_version = "PY2AND3",
Derek Chow's avatar
Derek Chow committed
763
764
    deps = [
        ":overfeat",
765
        # "//tensorflow",
766
        # "//tensorflow/contrib/slim",
Derek Chow's avatar
Derek Chow committed
767
    ],
768
769
)

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

781
py_test(  # py2and3_test
782
783
784
785
786
    name = "pix2pix_test",
    srcs = ["nets/pix2pix_test.py"],
    srcs_version = "PY2AND3",
    deps = [
        ":pix2pix",
787
        # "//tensorflow",
788
        # "//tensorflow/contrib/framework:framework_py",
789
790
791
    ],
)

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

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

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

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

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

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

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

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

892
py_test(  # py2and3_test
893
894
895
896
    name = "vgg_test",
    size = "medium",
    srcs = ["nets/vgg_test.py"],
    srcs_version = "PY2AND3",
Derek Chow's avatar
Derek Chow committed
897
898
    deps = [
        ":vgg",
899
        # "//tensorflow",
900
        # "//tensorflow/contrib/slim",
Derek Chow's avatar
Derek Chow committed
901
    ],
902
903
904
905
906
)

py_library(
    name = "nets_factory",
    srcs = ["nets/nets_factory.py"],
Derek Chow's avatar
Derek Chow committed
907
908
    deps = [
        ":nets",
909
        # "//tensorflow/contrib/slim",
Derek Chow's avatar
Derek Chow committed
910
    ],
911
912
)

913
py_test(  # py2and3_test
914
    name = "nets_factory_test",
915
    size = "large",
916
    srcs = ["nets/nets_factory_test.py"],
917
    shard_count = 3,
918
    srcs_version = "PY2AND3",
Derek Chow's avatar
Derek Chow committed
919
920
    deps = [
        ":nets_factory",
921
        # "//tensorflow",
Derek Chow's avatar
Derek Chow committed
922
    ],
923
924
)

925
926
927
928
929
930
931
932
933
934
935
936
937
938
pytype_strict_binary(
    name = "post_training_quantization",
    srcs = ["nets/post_training_quantization.py"],
    python_version = "PY3",
    deps = [
        ":nets_factory",
        ":preprocessing_factory",
        "//third_party/py/absl:app",
        "//third_party/py/absl/flags",
        # "//tensorflow",
        # "//tensorflow_datasets",
    ],
)

939
940
py_library(
    name = "train_image_classifier_lib",
941
    srcs = ["train_image_classifier.py"],
942
    srcs_version = "PY2AND3",
943
944
945
946
947
    deps = [
        ":dataset_factory",
        ":model_deploy",
        ":nets_factory",
        ":preprocessing_factory",
948
        # "//tensorflow",
949
950
        # "//tensorflow/contrib/quantize:quantize_graph",
        # "//tensorflow/contrib/slim",
951
    ],
952
953
)

954
955
956
py_binary(
    name = "train_image_classifier",
    srcs = ["train_image_classifier.py"],
957
958
    # WARNING: not supported in bazel; will be commented out by copybara.
    # paropts = ["--compress"],
959
    python_version = "PY2",
960
961
962
963
964
    deps = [
        ":train_image_classifier_lib",
    ],
)

965
966
py_library(
    name = "eval_image_classifier_lib",
967
    srcs = ["eval_image_classifier.py"],
968
969
    deps = [
        ":dataset_factory",
970
        ":nets_factory",
971
        ":preprocessing_factory",
972
        # "//tensorflow",
973
974
        # "//tensorflow/contrib/quantize:quantize_graph",
        # "//tensorflow/contrib/slim",
975
976
    ],
)
977

978
979
980
py_binary(
    name = "eval_image_classifier",
    srcs = ["eval_image_classifier.py"],
981
    python_version = "PY2",
982
983
984
985
986
    deps = [
        ":eval_image_classifier_lib",
    ],
)

987
988
989
py_binary(
    name = "export_inference_graph",
    srcs = ["export_inference_graph.py"],
990
991
    # WARNING: not supported in bazel; will be commented out by copybara.
    # paropts = ["--compress"],
992
    python_version = "PY2",
993
994
995
996
997
998
    deps = [":export_inference_graph_lib"],
)

py_library(
    name = "export_inference_graph_lib",
    srcs = ["export_inference_graph.py"],
999
1000
1001
    deps = [
        ":dataset_factory",
        ":nets_factory",
1002
        # "//tensorflow",
1003
1004
        # "//tensorflow/contrib/quantize:quantize_graph",
        # "//tensorflow/contrib/slim",
1005
        # "//tensorflow/python:platform",
1006
1007
1008
1009
1010
1011
1012
    ],
)

py_test(
    name = "export_inference_graph_test",
    size = "medium",
    srcs = ["export_inference_graph_test.py"],
1013
    python_version = "PY2",
1014
1015
1016
1017
1018
    srcs_version = "PY2AND3",
    tags = [
        "manual",
    ],
    deps = [
1019
        ":export_inference_graph_lib",
1020
1021
        # "//tensorflow",
        # "//tensorflow/python:platform",
1022
1023
    ],
)