BUILD 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372
  1. # Description:
  2. # Contains files for loading, training and evaluating TF-Slim-based models.
  3. package(default_visibility = [":internal"])
  4. licenses(["notice"]) # Apache 2.0
  5. exports_files(["LICENSE"])
  6. package_group(name = "internal")
  7. py_library(
  8. name = "dataset_utils",
  9. srcs = ["datasets/dataset_utils.py"],
  10. )
  11. py_library(
  12. name = "download_and_convert_cifar10",
  13. srcs = ["datasets/download_and_convert_cifar10.py"],
  14. deps = [":dataset_utils"],
  15. )
  16. py_library(
  17. name = "download_and_convert_flowers",
  18. srcs = ["datasets/download_and_convert_flowers.py"],
  19. deps = [":dataset_utils"],
  20. )
  21. py_library(
  22. name = "download_and_convert_mnist",
  23. srcs = ["datasets/download_and_convert_mnist.py"],
  24. deps = [":dataset_utils"],
  25. )
  26. py_binary(
  27. name = "download_and_convert_data",
  28. srcs = ["download_and_convert_data.py"],
  29. deps = [
  30. ":download_and_convert_cifar10",
  31. ":download_and_convert_flowers",
  32. ":download_and_convert_mnist",
  33. ],
  34. )
  35. py_binary(
  36. name = "cifar10",
  37. srcs = ["datasets/cifar10.py"],
  38. deps = [":dataset_utils"],
  39. )
  40. py_binary(
  41. name = "flowers",
  42. srcs = ["datasets/flowers.py"],
  43. deps = [":dataset_utils"],
  44. )
  45. py_binary(
  46. name = "imagenet",
  47. srcs = ["datasets/imagenet.py"],
  48. deps = [":dataset_utils"],
  49. )
  50. py_binary(
  51. name = "mnist",
  52. srcs = ["datasets/mnist.py"],
  53. deps = [":dataset_utils"],
  54. )
  55. py_library(
  56. name = "dataset_factory",
  57. srcs = ["datasets/dataset_factory.py"],
  58. deps = [
  59. ":cifar10",
  60. ":flowers",
  61. ":imagenet",
  62. ":mnist",
  63. ],
  64. )
  65. py_library(
  66. name = "model_deploy",
  67. srcs = ["deployment/model_deploy.py"],
  68. )
  69. py_test(
  70. name = "model_deploy_test",
  71. srcs = ["deployment/model_deploy_test.py"],
  72. srcs_version = "PY2AND3",
  73. deps = [":model_deploy"],
  74. )
  75. py_library(
  76. name = "cifarnet_preprocessing",
  77. srcs = ["preprocessing/cifarnet_preprocessing.py"],
  78. )
  79. py_library(
  80. name = "inception_preprocessing",
  81. srcs = ["preprocessing/inception_preprocessing.py"],
  82. )
  83. py_library(
  84. name = "lenet_preprocessing",
  85. srcs = ["preprocessing/lenet_preprocessing.py"],
  86. )
  87. py_library(
  88. name = "vgg_preprocessing",
  89. srcs = ["preprocessing/vgg_preprocessing.py"],
  90. )
  91. py_library(
  92. name = "preprocessing_factory",
  93. srcs = ["preprocessing/preprocessing_factory.py"],
  94. deps = [
  95. ":cifarnet_preprocessing",
  96. ":inception_preprocessing",
  97. ":lenet_preprocessing",
  98. ":vgg_preprocessing",
  99. ],
  100. )
  101. # Typical networks definitions.
  102. py_library(
  103. name = "nets",
  104. deps = [
  105. ":alexnet",
  106. ":cifarnet",
  107. ":inception",
  108. ":lenet",
  109. ":overfeat",
  110. ":resnet_v1",
  111. ":resnet_v2",
  112. ":vgg",
  113. ],
  114. )
  115. py_library(
  116. name = "alexnet",
  117. srcs = ["nets/alexnet.py"],
  118. srcs_version = "PY2AND3",
  119. )
  120. py_test(
  121. name = "alexnet_test",
  122. size = "medium",
  123. srcs = ["nets/alexnet_test.py"],
  124. srcs_version = "PY2AND3",
  125. deps = [":alexnet"],
  126. )
  127. py_library(
  128. name = "cifarnet",
  129. srcs = ["nets/cifarnet.py"],
  130. )
  131. py_library(
  132. name = "inception",
  133. srcs = ["nets/inception.py"],
  134. srcs_version = "PY2AND3",
  135. deps = [
  136. ":inception_resnet_v2",
  137. ":inception_v1",
  138. ":inception_v2",
  139. ":inception_v3",
  140. ":inception_v4",
  141. ],
  142. )
  143. py_library(
  144. name = "inception_utils",
  145. srcs = ["nets/inception_utils.py"],
  146. srcs_version = "PY2AND3",
  147. )
  148. py_library(
  149. name = "inception_v1",
  150. srcs = ["nets/inception_v1.py"],
  151. srcs_version = "PY2AND3",
  152. deps = [
  153. ":inception_utils",
  154. ],
  155. )
  156. py_library(
  157. name = "inception_v2",
  158. srcs = ["nets/inception_v2.py"],
  159. srcs_version = "PY2AND3",
  160. deps = [
  161. ":inception_utils",
  162. ],
  163. )
  164. py_library(
  165. name = "inception_v3",
  166. srcs = ["nets/inception_v3.py"],
  167. srcs_version = "PY2AND3",
  168. deps = [
  169. ":inception_utils",
  170. ],
  171. )
  172. py_library(
  173. name = "inception_v4",
  174. srcs = ["nets/inception_v4.py"],
  175. srcs_version = "PY2AND3",
  176. deps = [
  177. ":inception_utils",
  178. ],
  179. )
  180. py_library(
  181. name = "inception_resnet_v2",
  182. srcs = ["nets/inception_resnet_v2.py"],
  183. srcs_version = "PY2AND3",
  184. )
  185. py_test(
  186. name = "inception_v1_test",
  187. size = "large",
  188. srcs = ["nets/inception_v1_test.py"],
  189. shard_count = 3,
  190. srcs_version = "PY2AND3",
  191. deps = [":inception"],
  192. )
  193. py_test(
  194. name = "inception_v2_test",
  195. size = "large",
  196. srcs = ["nets/inception_v2_test.py"],
  197. shard_count = 3,
  198. srcs_version = "PY2AND3",
  199. deps = [":inception"],
  200. )
  201. py_test(
  202. name = "inception_v3_test",
  203. size = "large",
  204. srcs = ["nets/inception_v3_test.py"],
  205. shard_count = 3,
  206. srcs_version = "PY2AND3",
  207. deps = [":inception"],
  208. )
  209. py_test(
  210. name = "inception_v4_test",
  211. size = "large",
  212. srcs = ["nets/inception_v4_test.py"],
  213. shard_count = 3,
  214. srcs_version = "PY2AND3",
  215. deps = [":inception"],
  216. )
  217. py_test(
  218. name = "inception_resnet_v2_test",
  219. size = "large",
  220. srcs = ["nets/inception_resnet_v2_test.py"],
  221. shard_count = 3,
  222. srcs_version = "PY2AND3",
  223. deps = [":inception"],
  224. )
  225. py_library(
  226. name = "lenet",
  227. srcs = ["nets/lenet.py"],
  228. )
  229. py_library(
  230. name = "overfeat",
  231. srcs = ["nets/overfeat.py"],
  232. srcs_version = "PY2AND3",
  233. )
  234. py_test(
  235. name = "overfeat_test",
  236. size = "medium",
  237. srcs = ["nets/overfeat_test.py"],
  238. srcs_version = "PY2AND3",
  239. deps = [":overfeat"],
  240. )
  241. py_library(
  242. name = "resnet_utils",
  243. srcs = ["nets/resnet_utils.py"],
  244. srcs_version = "PY2AND3",
  245. )
  246. py_library(
  247. name = "resnet_v1",
  248. srcs = ["nets/resnet_v1.py"],
  249. srcs_version = "PY2AND3",
  250. deps = [
  251. ":resnet_utils",
  252. ],
  253. )
  254. py_test(
  255. name = "resnet_v1_test",
  256. size = "medium",
  257. srcs = ["nets/resnet_v1_test.py"],
  258. srcs_version = "PY2AND3",
  259. deps = [":resnet_v1"],
  260. )
  261. py_library(
  262. name = "resnet_v2",
  263. srcs = ["nets/resnet_v2.py"],
  264. srcs_version = "PY2AND3",
  265. deps = [
  266. ":resnet_utils",
  267. ],
  268. )
  269. py_test(
  270. name = "resnet_v2_test",
  271. size = "medium",
  272. srcs = ["nets/resnet_v2_test.py"],
  273. srcs_version = "PY2AND3",
  274. deps = [":resnet_v2"],
  275. )
  276. py_library(
  277. name = "vgg",
  278. srcs = ["nets/vgg.py"],
  279. srcs_version = "PY2AND3",
  280. )
  281. py_test(
  282. name = "vgg_test",
  283. size = "medium",
  284. srcs = ["nets/vgg_test.py"],
  285. srcs_version = "PY2AND3",
  286. deps = [":vgg"],
  287. )
  288. py_library(
  289. name = "nets_factory",
  290. srcs = ["nets/nets_factory.py"],
  291. deps = [":nets"],
  292. )
  293. py_test(
  294. name = "nets_factory_test",
  295. size = "medium",
  296. srcs = ["nets/nets_factory_test.py"],
  297. srcs_version = "PY2AND3",
  298. deps = [":nets_factory"],
  299. )
  300. py_binary(
  301. name = "train_image_classifier",
  302. srcs = ["train_image_classifier.py"],
  303. deps = [
  304. ":dataset_factory",
  305. ":model_deploy",
  306. ":nets_factory",
  307. ":preprocessing_factory",
  308. ],
  309. )
  310. py_binary(
  311. name = "eval_image_classifier",
  312. srcs = ["eval_image_classifier.py"],
  313. deps = [
  314. ":dataset_factory",
  315. ":model_deploy",
  316. ":nets_factory",
  317. ":preprocessing_factory",
  318. ],
  319. )