BUILD 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. package(default_visibility = [":internal"])
  2. licenses(["notice"]) # Apache 2.0
  3. exports_files(["LICENSE"])
  4. package_group(
  5. name = "internal",
  6. packages = [
  7. "//im2txt/...",
  8. ],
  9. )
  10. py_binary(
  11. name = "build_mscoco_data",
  12. srcs = [
  13. "data/build_mscoco_data.py",
  14. ],
  15. )
  16. sh_binary(
  17. name = "download_and_preprocess_mscoco",
  18. srcs = ["data/download_and_preprocess_mscoco.sh"],
  19. data = [
  20. ":build_mscoco_data",
  21. ],
  22. )
  23. py_library(
  24. name = "configuration",
  25. srcs = ["configuration.py"],
  26. srcs_version = "PY2AND3",
  27. )
  28. py_library(
  29. name = "show_and_tell_model",
  30. srcs = ["show_and_tell_model.py"],
  31. srcs_version = "PY2AND3",
  32. deps = [
  33. "//im2txt/ops:image_embedding",
  34. "//im2txt/ops:image_processing",
  35. "//im2txt/ops:inputs",
  36. ],
  37. )
  38. py_test(
  39. name = "show_and_tell_model_test",
  40. size = "large",
  41. srcs = ["show_and_tell_model_test.py"],
  42. deps = [
  43. ":configuration",
  44. ":show_and_tell_model",
  45. ],
  46. )
  47. py_library(
  48. name = "inference_wrapper",
  49. srcs = ["inference_wrapper.py"],
  50. srcs_version = "PY2AND3",
  51. deps = [
  52. ":show_and_tell_model",
  53. "//im2txt/inference_utils:inference_wrapper_base",
  54. ],
  55. )
  56. py_binary(
  57. name = "train",
  58. srcs = ["train.py"],
  59. srcs_version = "PY2AND3",
  60. deps = [
  61. ":configuration",
  62. ":show_and_tell_model",
  63. ],
  64. )
  65. py_binary(
  66. name = "evaluate",
  67. srcs = ["evaluate.py"],
  68. srcs_version = "PY2AND3",
  69. deps = [
  70. ":configuration",
  71. ":show_and_tell_model",
  72. ],
  73. )
  74. py_binary(
  75. name = "run_inference",
  76. srcs = ["run_inference.py"],
  77. srcs_version = "PY2AND3",
  78. deps = [
  79. ":configuration",
  80. ":inference_wrapper",
  81. "//im2txt/inference_utils:caption_generator",
  82. "//im2txt/inference_utils:vocabulary",
  83. ],
  84. )