BUILD 8.59 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
# Tensorflow Object Detection API: Utility functions.

package(
    default_visibility = ["//visibility:public"],
)

licenses(["notice"])

# Apache 2.0

11
12
13
14
15
16
py_library(
    name = "test_case",
    srcs = ["test_case.py"],
    deps = ["//tensorflow"],
)

17
18
19
20
21
22
py_library(
    name = "category_util",
    srcs = ["category_util.py"],
    deps = ["//tensorflow"],
)

23
24
25
26
py_library(
    name = "config_util",
    srcs = ["config_util.py"],
    deps = [
27
        "//pyglib/logging",
28
        "//tensorflow",
29
        "//tensorflow/models/research/object_detection/protos:eval_py_pb2",
30
        "//tensorflow/models/research/object_detection/protos:image_resizer_py_pb2",
31
32
33
34
        "//tensorflow/models/research/object_detection/protos:input_reader_py_pb2",
        "//tensorflow/models/research/object_detection/protos:model_py_pb2",
        "//tensorflow/models/research/object_detection/protos:pipeline_py_pb2",
        "//tensorflow/models/research/object_detection/protos:train_py_pb2",
35
36
37
    ],
)

38
39
40
41
42
43
44
45
py_library(
    name = "dataset_util",
    srcs = ["dataset_util.py"],
    deps = [
        "//tensorflow",
    ],
)

46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
py_library(
    name = "json_utils",
    srcs = ["json_utils.py"],
    deps = [],
)

py_test(
    name = "json_utils_test",
    srcs = ["json_utils_test.py"],
    deps = [
        ":json_utils",
        "//tensorflow",
    ],
)

61
62
63
64
py_library(
    name = "label_map_util",
    srcs = ["label_map_util.py"],
    deps = [
65
        "//google/protobuf",
66
        "//tensorflow",
67
        "//tensorflow/models/research/object_detection/protos:string_int_label_map_py_pb2",
68
69
70
71
72
73
    ],
)

py_library(
    name = "learning_schedules",
    srcs = ["learning_schedules.py"],
74
75
76
    deps = [
        "//tensorflow",
    ],
77
78
79
80
81
)

py_library(
    name = "metrics",
    srcs = ["metrics.py"],
82
    deps = ["//numpy"],
83
84
85
86
87
)

py_library(
    name = "np_box_list",
    srcs = ["np_box_list.py"],
88
89
90
91
92
93
94
95
96
97
    deps = ["//numpy"],
)

py_library(
    name = "np_box_mask_list",
    srcs = ["np_box_mask_list.py"],
    deps = [
        ":np_box_list",
        "//numpy",
    ],
98
99
100
101
102
103
104
105
)

py_library(
    name = "np_box_list_ops",
    srcs = ["np_box_list_ops.py"],
    deps = [
        ":np_box_list",
        ":np_box_ops",
106
107
108
109
110
111
112
113
114
115
116
117
        "//numpy",
    ],
)

py_library(
    name = "np_box_mask_list_ops",
    srcs = ["np_box_mask_list_ops.py"],
    deps = [
        ":np_box_list_ops",
        ":np_box_mask_list",
        ":np_mask_ops",
        "//numpy",
118
119
120
121
122
123
124
125
126
    ],
)

py_library(
    name = "np_box_ops",
    srcs = ["np_box_ops.py"],
    deps = ["//tensorflow"],
)

127
128
129
130
131
132
py_library(
    name = "np_mask_ops",
    srcs = ["np_mask_ops.py"],
    deps = ["//numpy"],
)

133
134
135
136
py_library(
    name = "object_detection_evaluation",
    srcs = ["object_detection_evaluation.py"],
    deps = [
137
        ":label_map_util",
138
139
140
        ":metrics",
        ":per_image_evaluation",
        "//tensorflow",
141
        "//tensorflow/models/research/object_detection/core:standard_fields",
142
143
144
145
146
147
148
    ],
)

py_library(
    name = "ops",
    srcs = ["ops.py"],
    deps = [
149
        ":shape_utils",
150
151
        ":static_shape",
        "//tensorflow",
152
153
154
        "//tensorflow/models/research/object_detection/core:box_list",
        "//tensorflow/models/research/object_detection/core:box_list_ops",
        "//tensorflow/models/research/object_detection/core:standard_fields",
155
156
157
158
159
160
161
162
163
    ],
)

py_library(
    name = "per_image_evaluation",
    srcs = ["per_image_evaluation.py"],
    deps = [
        ":np_box_list",
        ":np_box_list_ops",
164
165
        ":np_box_mask_list",
        ":np_box_mask_list_ops",
166
167
168
169
170
171
172
        "//tensorflow",
    ],
)

py_library(
    name = "shape_utils",
    srcs = ["shape_utils.py"],
173
174
175
176
    deps = [
        ":static_shape",
        "//tensorflow",
    ],
177
178
179
180
181
182
183
184
185
186
187
188
189
)

py_library(
    name = "static_shape",
    srcs = ["static_shape.py"],
    deps = [],
)

py_library(
    name = "test_utils",
    srcs = ["test_utils.py"],
    deps = [
        "//tensorflow",
190
191
192
193
194
195
        "//tensorflow/models/research/object_detection/core:anchor_generator",
        "//tensorflow/models/research/object_detection/core:box_coder",
        "//tensorflow/models/research/object_detection/core:box_list",
        "//tensorflow/models/research/object_detection/core:box_predictor",
        "//tensorflow/models/research/object_detection/core:matcher",
        "//tensorflow/models/research/object_detection/utils:shape_utils",
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
    ],
)

py_library(
    name = "variables_helper",
    srcs = ["variables_helper.py"],
    deps = [
        "//tensorflow",
    ],
)

py_library(
    name = "visualization_utils",
    srcs = ["visualization_utils.py"],
    deps = [
211
212
213
214
        "//PIL:pil",
        "//Tkinter",  # buildcleaner: keep
        "//matplotlib",
        "//six",
215
        "//tensorflow",
216
        "//tensorflow/models/research/object_detection/core:standard_fields",
217
218
219
220
221
222
223
224
225
226
227
228
    ],
)

py_test(
    name = "category_util_test",
    srcs = ["category_util_test.py"],
    deps = [
        ":category_util",
        "//tensorflow",
    ],
)

229
230
231
232
233
py_test(
    name = "config_util_test",
    srcs = ["config_util_test.py"],
    deps = [
        ":config_util",
234
        "//tensorflow",
235
        "//tensorflow/models/research/object_detection/protos:image_resizer_py_pb2",
236
237
238
239
        "//tensorflow/models/research/object_detection/protos:input_reader_py_pb2",
        "//tensorflow/models/research/object_detection/protos:model_py_pb2",
        "//tensorflow/models/research/object_detection/protos:pipeline_py_pb2",
        "//tensorflow/models/research/object_detection/protos:train_py_pb2",
240
241
242
    ],
)

243
244
245
246
247
248
py_test(
    name = "dataset_util_test",
    srcs = ["dataset_util_test.py"],
    deps = [
        ":dataset_util",
        "//tensorflow",
249
        "//tensorflow/models/research/object_detection/protos:input_reader_py_pb2",
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
    ],
)

py_test(
    name = "label_map_util_test",
    srcs = ["label_map_util_test.py"],
    deps = [
        ":label_map_util",
        "//tensorflow",
    ],
)

py_test(
    name = "learning_schedules_test",
    srcs = ["learning_schedules_test.py"],
    deps = [
        ":learning_schedules",
        "//tensorflow",
    ],
)

py_test(
    name = "metrics_test",
    srcs = ["metrics_test.py"],
    deps = [
        ":metrics",
        "//tensorflow",
    ],
)

py_test(
    name = "np_box_list_test",
    srcs = ["np_box_list_test.py"],
    deps = [
        ":np_box_list",
285
286
287
288
289
290
291
292
293
294
295
        "//numpy",
        "//tensorflow",
    ],
)

py_test(
    name = "np_box_mask_list_test",
    srcs = ["np_box_mask_list_test.py"],
    deps = [
        ":np_box_mask_list",
        "//numpy",
296
297
298
299
300
301
302
303
304
305
        "//tensorflow",
    ],
)

py_test(
    name = "np_box_list_ops_test",
    srcs = ["np_box_list_ops_test.py"],
    deps = [
        ":np_box_list",
        ":np_box_list_ops",
306
307
308
309
310
311
312
313
314
315
316
317
        "//numpy",
        "//tensorflow",
    ],
)

py_test(
    name = "np_box_mask_list_ops_test",
    srcs = ["np_box_mask_list_ops_test.py"],
    deps = [
        ":np_box_mask_list",
        ":np_box_mask_list_ops",
        "//numpy",
318
319
320
321
322
323
324
325
326
327
328
329
330
        "//tensorflow",
    ],
)

py_test(
    name = "np_box_ops_test",
    srcs = ["np_box_ops_test.py"],
    deps = [
        ":np_box_ops",
        "//tensorflow",
    ],
)

331
332
333
334
335
336
337
338
339
py_test(
    name = "np_mask_ops_test",
    srcs = ["np_mask_ops_test.py"],
    deps = [
        ":np_mask_ops",
        "//tensorflow",
    ],
)

340
341
342
343
344
345
py_test(
    name = "object_detection_evaluation_test",
    srcs = ["object_detection_evaluation_test.py"],
    deps = [
        ":object_detection_evaluation",
        "//tensorflow",
346
        "//tensorflow/models/research/object_detection/core:standard_fields",
347
348
349
350
351
352
353
354
    ],
)

py_test(
    name = "ops_test",
    srcs = ["ops_test.py"],
    deps = [
        ":ops",
355
        ":test_case",
356
        "//tensorflow",
357
        "//tensorflow/models/research/object_detection/core:standard_fields",
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
    ],
)

py_test(
    name = "per_image_evaluation_test",
    srcs = ["per_image_evaluation_test.py"],
    deps = [
        ":per_image_evaluation",
        "//tensorflow",
    ],
)

py_test(
    name = "shape_utils_test",
    srcs = ["shape_utils_test.py"],
    deps = [
        ":shape_utils",
375
        "//numpy",
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
        "//tensorflow",
    ],
)

py_test(
    name = "static_shape_test",
    srcs = ["static_shape_test.py"],
    deps = [
        ":static_shape",
        "//tensorflow",
    ],
)

py_test(
    name = "test_utils_test",
    srcs = ["test_utils_test.py"],
    deps = [
        ":test_utils",
        "//tensorflow",
    ],
)

py_test(
    name = "variables_helper_test",
    srcs = ["variables_helper_test.py"],
    deps = [
        ":variables_helper",
        "//tensorflow",
    ],
)

py_test(
    name = "visualization_utils_test",
    srcs = ["visualization_utils_test.py"],
410
    data = [
411
        "//tensorflow/models/research/object_detection/test_images:image1.jpg",
412
    ],
413
414
    deps = [
        ":visualization_utils",
415
416
        "//pyglib/flags",
        "//PIL:pil",
417
418
    ],
)