BUILD 17.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

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
        # "//tensorflow",
derekjchow's avatar
derekjchow committed
43
44
45
    ],
)

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

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

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

75
76
77
py_binary(
    name = "download_and_convert_data",
    srcs = ["download_and_convert_data.py"],
78
    python_version = "PY2",
79
80
81
82
    deps = [
        ":download_and_convert_cifar10",
        ":download_and_convert_flowers",
        ":download_and_convert_mnist",
83
        # "//tensorflow",
84
85
86
    ],
)

87
88
89
90
91
92
93
94
sh_binary(
    name = "download_mscoco",
    srcs = ["datasets/download_mscoco.sh"],
)

py_binary(
    name = "build_visualwakewords_data",
    srcs = ["datasets/build_visualwakewords_data.py"],
95
    python_version = "PY2",
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
    deps = [
        ":build_visualwakewords_data_lib",
        # "//tensorflow",
    ],
)

py_library(
    name = "build_visualwakewords_data_lib",
    srcs = ["datasets/build_visualwakewords_data_lib.py"],
    deps = [
        ":dataset_utils",
        "//third_party/py/PIL:pil",
        "//third_party/py/contextlib2",
        # "//tensorflow",
    ],
)

113
py_library(
114
115
    name = "cifar10",
    srcs = ["datasets/cifar10.py"],
Derek Chow's avatar
Derek Chow committed
116
117
    deps = [
        ":dataset_utils",
118
        # "//tensorflow",
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",
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
        # "//tensorflow",
Derek Chow's avatar
Derek Chow committed
137
    ],
138
139
)

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

149
150
151
152
153
154
155
156
157
py_library(
    name = "visualwakewords",
    srcs = ["datasets/visualwakewords.py"],
    deps = [
        ":dataset_utils",
        # "//tensorflow",
    ],
)

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

py_library(
    name = "model_deploy",
172
    srcs = ["deployment/model_deploy.py"],
Derek Chow's avatar
Derek Chow committed
173
    deps = [
174
        # "//tensorflow",
Derek Chow's avatar
Derek Chow committed
175
    ],
176
177
178
179
)

py_test(
    name = "model_deploy_test",
180
    srcs = ["deployment/model_deploy_test.py"],
181
    python_version = "PY2",
182
    srcs_version = "PY2AND3",
Derek Chow's avatar
Derek Chow committed
183
184
    deps = [
        ":model_deploy",
185
        # "//numpy",
186
        # "//tensorflow",
Derek Chow's avatar
Derek Chow committed
187
    ],
188
189
190
)

py_library(
191
192
    name = "cifarnet_preprocessing",
    srcs = ["preprocessing/cifarnet_preprocessing.py"],
Derek Chow's avatar
Derek Chow committed
193
    deps = [
194
        # "//tensorflow",
Derek Chow's avatar
Derek Chow committed
195
    ],
196
197
198
199
)

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

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

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

py_library(
    name = "preprocessing_factory",
225
    srcs = ["preprocessing/preprocessing_factory.py"],
226
    deps = [
227
        ":cifarnet_preprocessing",
228
229
230
        ":inception_preprocessing",
        ":lenet_preprocessing",
        ":vgg_preprocessing",
231
        # "//tensorflow",
232
233
234
    ],
)

235
236
237
238
239
240
241
# Typical networks definitions.

py_library(
    name = "nets",
    deps = [
        ":alexnet",
        ":cifarnet",
242
        ":cyclegan",
243
        ":i3d",
244
245
        ":inception",
        ":lenet",
246
        ":mobilenet",
247
        ":nasnet",
248
        ":overfeat",
249
        ":pix2pix",
maximneumann's avatar
maximneumann committed
250
        ":pnasnet",
251
252
        ":resnet_v1",
        ":resnet_v2",
253
        ":s3dg",
254
255
256
257
258
259
260
261
        ":vgg",
    ],
)

py_library(
    name = "alexnet",
    srcs = ["nets/alexnet.py"],
    srcs_version = "PY2AND3",
262
    deps = [
pkulzc's avatar
pkulzc committed
263
        # "//tensorflow",
264
    ],
265
266
267
268
269
270
)

py_test(
    name = "alexnet_test",
    size = "medium",
    srcs = ["nets/alexnet_test.py"],
271
    python_version = "PY2",
272
    srcs_version = "PY2AND3",
Derek Chow's avatar
Derek Chow committed
273
274
    deps = [
        ":alexnet",
275
        # "//tensorflow",
Derek Chow's avatar
Derek Chow committed
276
    ],
277
278
279
280
281
)

py_library(
    name = "cifarnet",
    srcs = ["nets/cifarnet.py"],
Derek Chow's avatar
Derek Chow committed
282
    deps = [
283
        # "//tensorflow",
Derek Chow's avatar
Derek Chow committed
284
    ],
285
286
)

287
288
289
290
291
py_library(
    name = "cyclegan",
    srcs = ["nets/cyclegan.py"],
    deps = [
        # "//numpy",
292
        # "//tensorflow",
293
294
295
296
297
298
    ],
)

py_test(
    name = "cyclegan_test",
    srcs = ["nets/cyclegan_test.py"],
299
    python_version = "PY2",
300
301
302
303
    shard_count = 3,
    srcs_version = "PY2AND3",
    deps = [
        ":cyclegan",
304
        # "//tensorflow",
305
306
307
308
309
310
311
    ],
)

py_library(
    name = "dcgan",
    srcs = ["nets/dcgan.py"],
    deps = [
312
        # "//tensorflow",
313
314
315
316
317
318
    ],
)

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

328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
py_library(
    name = "i3d",
    srcs = ["nets/i3d.py"],
    srcs_version = "PY2AND3",
    deps = [
        ":i3d_utils",
        ":s3dg",
        # "//tensorflow",
    ],
)

py_test(
    name = "i3d_test",
    size = "large",
    srcs = ["nets/i3d_test.py"],
343
    python_version = "PY2",
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
    shard_count = 3,
    srcs_version = "PY2AND3",
    deps = [
        ":i3d",
        # "//tensorflow",
    ],
)

py_library(
    name = "i3d_utils",
    srcs = ["nets/i3d_utils.py"],
    srcs_version = "PY2AND3",
    deps = [
        # "//tensorflow",
    ],
)

361
362
363
364
365
366
367
368
369
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
370
        ":inception_v4",
371
372
373
    ],
)

Alex Kurakin's avatar
Alex Kurakin committed
374
375
376
377
py_library(
    name = "inception_utils",
    srcs = ["nets/inception_utils.py"],
    srcs_version = "PY2AND3",
378
    deps = [
pkulzc's avatar
pkulzc committed
379
        # "//tensorflow",
380
    ],
Alex Kurakin's avatar
Alex Kurakin committed
381
382
)

383
384
385
386
py_library(
    name = "inception_v1",
    srcs = ["nets/inception_v1.py"],
    srcs_version = "PY2AND3",
Alex Kurakin's avatar
Alex Kurakin committed
387
388
    deps = [
        ":inception_utils",
389
        # "//tensorflow",
Alex Kurakin's avatar
Alex Kurakin committed
390
    ],
391
392
393
394
395
396
)

py_library(
    name = "inception_v2",
    srcs = ["nets/inception_v2.py"],
    srcs_version = "PY2AND3",
Alex Kurakin's avatar
Alex Kurakin committed
397
398
    deps = [
        ":inception_utils",
399
        # "//tensorflow",
Alex Kurakin's avatar
Alex Kurakin committed
400
    ],
401
402
403
404
405
406
)

py_library(
    name = "inception_v3",
    srcs = ["nets/inception_v3.py"],
    srcs_version = "PY2AND3",
Alex Kurakin's avatar
Alex Kurakin committed
407
408
    deps = [
        ":inception_utils",
409
        # "//tensorflow",
Alex Kurakin's avatar
Alex Kurakin committed
410
411
412
413
414
415
416
417
418
    ],
)

py_library(
    name = "inception_v4",
    srcs = ["nets/inception_v4.py"],
    srcs_version = "PY2AND3",
    deps = [
        ":inception_utils",
419
        # "//tensorflow",
Alex Kurakin's avatar
Alex Kurakin committed
420
    ],
421
422
423
424
425
426
)

py_library(
    name = "inception_resnet_v2",
    srcs = ["nets/inception_resnet_v2.py"],
    srcs_version = "PY2AND3",
427
    deps = [
pkulzc's avatar
pkulzc committed
428
        # "//tensorflow",
429
    ],
430
431
432
433
434
435
)

py_test(
    name = "inception_v1_test",
    size = "large",
    srcs = ["nets/inception_v1_test.py"],
436
    python_version = "PY2",
437
438
    shard_count = 3,
    srcs_version = "PY2AND3",
Derek Chow's avatar
Derek Chow committed
439
440
    deps = [
        ":inception",
441
        # "//numpy",
442
        # "//tensorflow",
Derek Chow's avatar
Derek Chow committed
443
    ],
444
445
446
447
448
449
)

py_test(
    name = "inception_v2_test",
    size = "large",
    srcs = ["nets/inception_v2_test.py"],
450
    python_version = "PY2",
451
452
    shard_count = 3,
    srcs_version = "PY2AND3",
Derek Chow's avatar
Derek Chow committed
453
454
    deps = [
        ":inception",
455
        # "//numpy",
456
        # "//tensorflow",
Derek Chow's avatar
Derek Chow committed
457
    ],
458
459
460
461
462
463
)

py_test(
    name = "inception_v3_test",
    size = "large",
    srcs = ["nets/inception_v3_test.py"],
464
    python_version = "PY2",
465
466
    shard_count = 3,
    srcs_version = "PY2AND3",
Derek Chow's avatar
Derek Chow committed
467
468
    deps = [
        ":inception",
469
        # "//numpy",
470
        # "//tensorflow",
Derek Chow's avatar
Derek Chow committed
471
    ],
472
473
)

Alex Kurakin's avatar
Alex Kurakin committed
474
475
476
477
py_test(
    name = "inception_v4_test",
    size = "large",
    srcs = ["nets/inception_v4_test.py"],
478
    python_version = "PY2",
Alex Kurakin's avatar
Alex Kurakin committed
479
480
    shard_count = 3,
    srcs_version = "PY2AND3",
Derek Chow's avatar
Derek Chow committed
481
482
    deps = [
        ":inception",
483
        # "//tensorflow",
Derek Chow's avatar
Derek Chow committed
484
    ],
Alex Kurakin's avatar
Alex Kurakin committed
485
486
)

487
488
489
490
py_test(
    name = "inception_resnet_v2_test",
    size = "large",
    srcs = ["nets/inception_resnet_v2_test.py"],
491
    python_version = "PY2",
492
493
    shard_count = 3,
    srcs_version = "PY2AND3",
Derek Chow's avatar
Derek Chow committed
494
495
    deps = [
        ":inception",
496
        # "//tensorflow",
Derek Chow's avatar
Derek Chow committed
497
    ],
498
499
)

500
501
502
py_library(
    name = "lenet",
    srcs = ["nets/lenet.py"],
Derek Chow's avatar
Derek Chow committed
503
    deps = [
504
        # "//tensorflow",
Derek Chow's avatar
Derek Chow committed
505
    ],
506
507
)

andrewghoward's avatar
andrewghoward committed
508
509
510
511
py_library(
    name = "mobilenet_v1",
    srcs = ["nets/mobilenet_v1.py"],
    srcs_version = "PY2AND3",
512
    deps = [
pkulzc's avatar
pkulzc committed
513
        # "//tensorflow",
514
    ],
andrewghoward's avatar
andrewghoward committed
515
516
)

517
518
519
520
521
522
523
524
525
526
527
528
py_library(
    name = "mobilenet_common",
    srcs = [
        "nets/mobilenet/conv_blocks.py",
        "nets/mobilenet/mobilenet.py",
    ],
    srcs_version = "PY2AND3",
    deps = [
        # "//tensorflow",
    ],
)

529
530
py_library(
    name = "mobilenet_v2",
531
    srcs = ["nets/mobilenet/mobilenet_v2.py"],
532
    srcs_version = "PY2AND3",
533
    deps = [
534
535
536
537
538
539
540
541
542
543
544
        ":mobilenet_common",
        # "//tensorflow",
    ],
)

py_library(
    name = "mobilenet_v3",
    srcs = ["nets/mobilenet/mobilenet_v3.py"],
    srcs_version = "PY2AND3",
    deps = [
        ":mobilenet_common",
545
        # "//tensorflow",
546
547
548
    ],
)

549
550
551
py_test(
    name = "mobilenet_v2_test",
    srcs = ["nets/mobilenet/mobilenet_v2_test.py"],
552
    python_version = "PY2",
553
554
555
556
557
558
559
    srcs_version = "PY2AND3",
    deps = [
        ":mobilenet",
        # "//tensorflow",
    ],
)

560
561
562
563
564
565
566
567
568
569
py_test(  # py2and3_test
    name = "mobilenet_v3_test",
    srcs = ["nets/mobilenet/mobilenet_v3_test.py"],
    srcs_version = "PY2AND3",
    deps = [
        ":mobilenet",
        # "//tensorflow",
    ],
)

570
571
py_library(
    name = "mobilenet",
572
573
    deps = [
        ":mobilenet_v1",
574
        ":mobilenet_v2",
575
        ":mobilenet_v3",
576
577
578
    ],
)

andrewghoward's avatar
andrewghoward committed
579
580
581
582
py_test(
    name = "mobilenet_v1_test",
    size = "large",
    srcs = ["nets/mobilenet_v1_test.py"],
583
    python_version = "PY2",
andrewghoward's avatar
andrewghoward committed
584
585
586
587
    shard_count = 3,
    srcs_version = "PY2AND3",
    deps = [
        ":mobilenet_v1",
588
        # "//numpy",
589
        # "//tensorflow",
590
591
592
    ],
)

593
594
595
py_binary(
    name = "mobilenet_v1_train",
    srcs = ["nets/mobilenet_v1_train.py"],
596
    python_version = "PY2",
597
598
599
600
601
602
603
604
605
606
607
    deps = [
        ":dataset_factory",
        ":mobilenet_v1",
        ":preprocessing_factory",
        # "//tensorflow",
    ],
)

py_binary(
    name = "mobilenet_v1_eval",
    srcs = ["nets/mobilenet_v1_eval.py"],
608
    python_version = "PY2",
609
610
611
612
613
614
615
616
    deps = [
        ":dataset_factory",
        ":mobilenet_v1",
        ":preprocessing_factory",
        # "//tensorflow",
    ],
)

617
618
619
620
621
py_library(
    name = "nasnet_utils",
    srcs = ["nets/nasnet/nasnet_utils.py"],
    srcs_version = "PY2AND3",
    deps = [
622
        # "//tensorflow",
623
624
625
626
627
628
629
630
631
    ],
)

py_library(
    name = "nasnet",
    srcs = ["nets/nasnet/nasnet.py"],
    srcs_version = "PY2AND3",
    deps = [
        ":nasnet_utils",
632
        # "//tensorflow",
633
634
635
636
637
638
639
    ],
)

py_test(
    name = "nasnet_utils_test",
    size = "medium",
    srcs = ["nets/nasnet/nasnet_utils_test.py"],
640
    python_version = "PY2",
641
642
643
    srcs_version = "PY2AND3",
    deps = [
        ":nasnet_utils",
644
        # "//tensorflow",
645
646
647
648
649
650
651
    ],
)

py_test(
    name = "nasnet_test",
    size = "large",
    srcs = ["nets/nasnet/nasnet_test.py"],
652
    python_version = "PY2",
653
654
655
656
    shard_count = 10,
    srcs_version = "PY2AND3",
    deps = [
        ":nasnet",
657
        # "//tensorflow",
andrewghoward's avatar
andrewghoward committed
658
659
660
    ],
)

maximneumann's avatar
maximneumann committed
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
py_library(
    name = "pnasnet",
    srcs = ["nets/nasnet/pnasnet.py"],
    srcs_version = "PY2AND3",
    deps = [
        ":nasnet",
        ":nasnet_utils",
        # "//tensorflow",
    ],
)

py_test(
    name = "pnasnet_test",
    size = "large",
    srcs = ["nets/nasnet/pnasnet_test.py"],
676
    python_version = "PY2",
maximneumann's avatar
maximneumann committed
677
678
679
680
681
682
683
684
    shard_count = 4,
    srcs_version = "PY2AND3",
    deps = [
        ":pnasnet",
        # "//tensorflow",
    ],
)

685
py_library(
686
687
688
    name = "overfeat",
    srcs = ["nets/overfeat.py"],
    srcs_version = "PY2AND3",
689
    deps = [
pkulzc's avatar
pkulzc committed
690
        # "//tensorflow",
691
    ],
692
693
694
695
696
697
)

py_test(
    name = "overfeat_test",
    size = "medium",
    srcs = ["nets/overfeat_test.py"],
698
    python_version = "PY2",
699
    srcs_version = "PY2AND3",
Derek Chow's avatar
Derek Chow committed
700
701
    deps = [
        ":overfeat",
702
        # "//tensorflow",
Derek Chow's avatar
Derek Chow committed
703
    ],
704
705
)

706
707
708
709
py_library(
    name = "pix2pix",
    srcs = ["nets/pix2pix.py"],
    srcs_version = "PY2AND3",
710
    deps = [
pkulzc's avatar
pkulzc committed
711
        # "//tensorflow",
712
    ],
713
714
715
716
717
)

py_test(
    name = "pix2pix_test",
    srcs = ["nets/pix2pix_test.py"],
718
    python_version = "PY2",
719
720
721
    srcs_version = "PY2AND3",
    deps = [
        ":pix2pix",
722
        # "//tensorflow",
723
724
725
    ],
)

726
727
728
729
py_library(
    name = "resnet_utils",
    srcs = ["nets/resnet_utils.py"],
    srcs_version = "PY2AND3",
730
    deps = [
pkulzc's avatar
pkulzc committed
731
        # "//tensorflow",
732
    ],
733
734
735
736
737
738
739
740
)

py_library(
    name = "resnet_v1",
    srcs = ["nets/resnet_v1.py"],
    srcs_version = "PY2AND3",
    deps = [
        ":resnet_utils",
741
        # "//tensorflow",
742
743
744
745
746
747
    ],
)

py_test(
    name = "resnet_v1_test",
    size = "medium",
748
    timeout = "long",
749
    srcs = ["nets/resnet_v1_test.py"],
750
    python_version = "PY2",
Derek Chow's avatar
Derek Chow committed
751
    shard_count = 2,
752
    srcs_version = "PY2AND3",
Derek Chow's avatar
Derek Chow committed
753
    deps = [
754
        ":resnet_utils",
Derek Chow's avatar
Derek Chow committed
755
        ":resnet_v1",
756
        # "//numpy",
757
        # "//tensorflow",
Derek Chow's avatar
Derek Chow committed
758
    ],
759
760
761
762
763
764
765
766
)

py_library(
    name = "resnet_v2",
    srcs = ["nets/resnet_v2.py"],
    srcs_version = "PY2AND3",
    deps = [
        ":resnet_utils",
767
        # "//tensorflow",
768
769
770
771
772
773
774
    ],
)

py_test(
    name = "resnet_v2_test",
    size = "medium",
    srcs = ["nets/resnet_v2_test.py"],
775
    python_version = "PY2",
Derek Chow's avatar
Derek Chow committed
776
    shard_count = 2,
777
    srcs_version = "PY2AND3",
Derek Chow's avatar
Derek Chow committed
778
    deps = [
779
        ":resnet_utils",
Derek Chow's avatar
Derek Chow committed
780
        ":resnet_v2",
781
        # "//numpy",
782
        # "//tensorflow",
Derek Chow's avatar
Derek Chow committed
783
    ],
784
785
)

786
787
788
789
790
791
792
793
794
795
796
797
798
799
py_library(
    name = "s3dg",
    srcs = ["nets/s3dg.py"],
    srcs_version = "PY2AND3",
    deps = [
        ":i3d_utils",
        # "//tensorflow",
    ],
)

py_test(
    name = "s3dg_test",
    size = "large",
    srcs = ["nets/s3dg_test.py"],
800
    python_version = "PY2",
801
802
803
804
805
806
807
808
    shard_count = 3,
    srcs_version = "PY2AND3",
    deps = [
        ":s3dg",
        # "//tensorflow",
    ],
)

809
810
811
812
py_library(
    name = "vgg",
    srcs = ["nets/vgg.py"],
    srcs_version = "PY2AND3",
813
    deps = [
pkulzc's avatar
pkulzc committed
814
        # "//tensorflow",
815
    ],
816
817
818
819
820
821
)

py_test(
    name = "vgg_test",
    size = "medium",
    srcs = ["nets/vgg_test.py"],
822
    python_version = "PY2",
823
    srcs_version = "PY2AND3",
Derek Chow's avatar
Derek Chow committed
824
825
    deps = [
        ":vgg",
826
        # "//tensorflow",
Derek Chow's avatar
Derek Chow committed
827
    ],
828
829
830
831
832
)

py_library(
    name = "nets_factory",
    srcs = ["nets/nets_factory.py"],
Derek Chow's avatar
Derek Chow committed
833
834
    deps = [
        ":nets",
835
        # "//tensorflow",
Derek Chow's avatar
Derek Chow committed
836
    ],
837
838
839
840
)

py_test(
    name = "nets_factory_test",
841
    size = "large",
842
    srcs = ["nets/nets_factory_test.py"],
843
    python_version = "PY2",
844
    shard_count = 3,
845
    srcs_version = "PY2AND3",
Derek Chow's avatar
Derek Chow committed
846
847
    deps = [
        ":nets_factory",
848
        # "//tensorflow",
Derek Chow's avatar
Derek Chow committed
849
    ],
850
851
)

852
853
py_library(
    name = "train_image_classifier_lib",
854
855
856
857
858
859
    srcs = ["train_image_classifier.py"],
    deps = [
        ":dataset_factory",
        ":model_deploy",
        ":nets_factory",
        ":preprocessing_factory",
860
        # "//tensorflow",
861
    ],
862
863
)

864
865
866
py_binary(
    name = "train_image_classifier",
    srcs = ["train_image_classifier.py"],
867
868
    # WARNING: not supported in bazel; will be commented out by copybara.
    # paropts = ["--compress"],
869
    python_version = "PY2",
870
871
872
873
874
    deps = [
        ":train_image_classifier_lib",
    ],
)

875
876
py_library(
    name = "eval_image_classifier_lib",
877
    srcs = ["eval_image_classifier.py"],
878
879
    deps = [
        ":dataset_factory",
880
        ":nets_factory",
881
        ":preprocessing_factory",
882
        # "//tensorflow",
883
884
    ],
)
885

886
887
888
py_binary(
    name = "eval_image_classifier",
    srcs = ["eval_image_classifier.py"],
889
    python_version = "PY2",
890
891
892
893
894
    deps = [
        ":eval_image_classifier_lib",
    ],
)

895
896
897
py_binary(
    name = "export_inference_graph",
    srcs = ["export_inference_graph.py"],
898
899
    # WARNING: not supported in bazel; will be commented out by copybara.
    # paropts = ["--compress"],
900
    python_version = "PY2",
901
902
903
904
905
906
    deps = [":export_inference_graph_lib"],
)

py_library(
    name = "export_inference_graph_lib",
    srcs = ["export_inference_graph.py"],
907
908
909
    deps = [
        ":dataset_factory",
        ":nets_factory",
910
911
        # "//tensorflow",
        # "//tensorflow/python:platform",
912
913
914
915
916
917
918
    ],
)

py_test(
    name = "export_inference_graph_test",
    size = "medium",
    srcs = ["export_inference_graph_test.py"],
919
    python_version = "PY2",
920
921
922
923
924
    srcs_version = "PY2AND3",
    tags = [
        "manual",
    ],
    deps = [
925
        ":export_inference_graph_lib",
926
927
        # "//tensorflow",
        # "//tensorflow/python:platform",
928
929
    ],
)