tf-models-nightly 2.17.0.dev20240617__py2.py3-none-any.whl → 2.20.0.dev20251205__py2.py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1257) hide show
  1. official/__init__.py +1 -1
  2. official/common/__init__.py +1 -1
  3. official/common/dataset_fn.py +1 -1
  4. official/common/distribute_utils.py +27 -3
  5. official/common/distribute_utils_test.py +13 -12
  6. official/common/flags.py +24 -6
  7. official/common/registry_imports.py +1 -1
  8. official/common/streamz_counters.py +1 -1
  9. official/core/__init__.py +1 -1
  10. official/core/actions.py +1 -1
  11. official/core/actions_test.py +1 -1
  12. official/core/base_task.py +1 -1
  13. official/core/base_trainer.py +1 -1
  14. official/core/base_trainer_test.py +1 -1
  15. official/core/config_definitions.py +1 -1
  16. official/core/exp_factory.py +1 -1
  17. official/core/export_base.py +1 -1
  18. official/core/export_base_test.py +1 -1
  19. official/core/file_writers.py +1 -1
  20. official/core/file_writers_test.py +1 -1
  21. official/core/input_reader.py +1 -1
  22. official/core/registry.py +1 -1
  23. official/core/registry_test.py +1 -1
  24. official/core/savedmodel_checkpoint_manager.py +1 -1
  25. official/core/savedmodel_checkpoint_manager_test.py +1 -1
  26. official/core/task_factory.py +1 -1
  27. official/core/test_utils.py +1 -1
  28. official/core/tf_example_builder.py +1 -1
  29. official/core/tf_example_builder_test.py +1 -1
  30. official/core/tf_example_feature_key.py +1 -1
  31. official/core/tf_example_feature_key_test.py +1 -1
  32. official/core/train_lib.py +1 -3
  33. official/core/train_lib_test.py +1 -1
  34. official/core/train_utils.py +1 -1
  35. official/core/train_utils_test.py +1 -1
  36. official/legacy/__init__.py +1 -1
  37. official/legacy/albert/__init__.py +1 -1
  38. official/legacy/albert/configs.py +1 -1
  39. official/legacy/bert/__init__.py +1 -1
  40. official/legacy/bert/bert_models.py +1 -1
  41. official/legacy/bert/bert_models_test.py +1 -1
  42. official/legacy/bert/common_flags.py +1 -1
  43. official/legacy/bert/configs.py +1 -1
  44. official/legacy/bert/export_tfhub.py +1 -2
  45. official/legacy/bert/export_tfhub_test.py +1 -1
  46. official/legacy/bert/input_pipeline.py +1 -1
  47. official/legacy/bert/model_saving_utils.py +1 -1
  48. official/legacy/bert/model_training_utils.py +1 -1
  49. official/legacy/bert/model_training_utils_test.py +1 -1
  50. official/legacy/bert/run_classifier.py +1 -2
  51. official/legacy/bert/run_pretraining.py +1 -2
  52. official/legacy/bert/run_squad.py +1 -2
  53. official/legacy/bert/run_squad_helper.py +1 -1
  54. official/legacy/bert/serving.py +1 -1
  55. official/legacy/detection/__init__.py +1 -1
  56. official/legacy/detection/configs/__init__.py +1 -1
  57. official/legacy/detection/configs/base_config.py +1 -1
  58. official/legacy/detection/configs/factory.py +1 -1
  59. official/legacy/detection/configs/maskrcnn_config.py +1 -1
  60. official/legacy/detection/configs/olnmask_config.py +1 -1
  61. official/legacy/detection/configs/retinanet_config.py +1 -1
  62. official/legacy/detection/configs/shapemask_config.py +1 -1
  63. official/legacy/detection/dataloader/__init__.py +1 -1
  64. official/legacy/detection/dataloader/anchor.py +1 -1
  65. official/legacy/detection/dataloader/factory.py +1 -1
  66. official/legacy/detection/dataloader/input_reader.py +1 -1
  67. official/legacy/detection/dataloader/maskrcnn_parser.py +1 -1
  68. official/legacy/detection/dataloader/mode_keys.py +1 -1
  69. official/legacy/detection/dataloader/olnmask_parser.py +1 -1
  70. official/legacy/detection/dataloader/retinanet_parser.py +1 -1
  71. official/legacy/detection/dataloader/shapemask_parser.py +1 -1
  72. official/legacy/detection/dataloader/tf_example_decoder.py +1 -1
  73. official/legacy/detection/evaluation/__init__.py +1 -1
  74. official/legacy/detection/evaluation/coco_evaluator.py +1 -1
  75. official/legacy/detection/evaluation/coco_utils.py +1 -1
  76. official/legacy/detection/evaluation/factory.py +1 -1
  77. official/legacy/detection/executor/__init__.py +1 -1
  78. official/legacy/detection/executor/detection_executor.py +1 -1
  79. official/legacy/detection/executor/distributed_executor.py +1 -1
  80. official/legacy/detection/main.py +1 -1
  81. official/legacy/detection/modeling/__init__.py +1 -1
  82. official/legacy/detection/modeling/architecture/__init__.py +1 -1
  83. official/legacy/detection/modeling/architecture/factory.py +1 -1
  84. official/legacy/detection/modeling/architecture/fpn.py +1 -1
  85. official/legacy/detection/modeling/architecture/heads.py +1 -1
  86. official/legacy/detection/modeling/architecture/identity.py +1 -1
  87. official/legacy/detection/modeling/architecture/nn_blocks.py +1 -1
  88. official/legacy/detection/modeling/architecture/nn_ops.py +1 -1
  89. official/legacy/detection/modeling/architecture/resnet.py +1 -1
  90. official/legacy/detection/modeling/architecture/spinenet.py +1 -1
  91. official/legacy/detection/modeling/base_model.py +1 -1
  92. official/legacy/detection/modeling/checkpoint_utils.py +1 -1
  93. official/legacy/detection/modeling/factory.py +1 -1
  94. official/legacy/detection/modeling/learning_rates.py +1 -1
  95. official/legacy/detection/modeling/losses.py +1 -1
  96. official/legacy/detection/modeling/maskrcnn_model.py +1 -1
  97. official/legacy/detection/modeling/olnmask_model.py +1 -1
  98. official/legacy/detection/modeling/optimizers.py +1 -1
  99. official/legacy/detection/modeling/retinanet_model.py +1 -1
  100. official/legacy/detection/modeling/shapemask_model.py +1 -1
  101. official/legacy/detection/ops/__init__.py +1 -1
  102. official/legacy/detection/ops/nms.py +1 -1
  103. official/legacy/detection/ops/postprocess_ops.py +1 -1
  104. official/legacy/detection/ops/roi_ops.py +1 -1
  105. official/legacy/detection/ops/spatial_transform_ops.py +1 -1
  106. official/legacy/detection/ops/target_ops.py +1 -1
  107. official/legacy/detection/utils/__init__.py +1 -1
  108. official/legacy/detection/utils/box_utils.py +1 -1
  109. official/legacy/detection/utils/class_utils.py +1 -1
  110. official/legacy/detection/utils/dataloader_utils.py +1 -1
  111. official/legacy/detection/utils/input_utils.py +1 -1
  112. official/legacy/detection/utils/mask_utils.py +1 -1
  113. official/legacy/image_classification/__init__.py +1 -1
  114. official/legacy/image_classification/augment.py +1 -1
  115. official/legacy/image_classification/augment_test.py +1 -1
  116. official/legacy/image_classification/callbacks.py +1 -1
  117. official/legacy/image_classification/classifier_trainer.py +1 -1
  118. official/legacy/image_classification/classifier_trainer_test.py +1 -1
  119. official/legacy/image_classification/classifier_trainer_util_test.py +1 -1
  120. official/legacy/image_classification/configs/__init__.py +1 -1
  121. official/legacy/image_classification/configs/base_configs.py +1 -1
  122. official/legacy/image_classification/configs/configs.py +1 -1
  123. official/legacy/image_classification/dataset_factory.py +1 -1
  124. official/legacy/image_classification/efficientnet/__init__.py +1 -1
  125. official/legacy/image_classification/efficientnet/common_modules.py +1 -1
  126. official/legacy/image_classification/efficientnet/efficientnet_config.py +1 -1
  127. official/legacy/image_classification/efficientnet/efficientnet_model.py +1 -1
  128. official/legacy/image_classification/efficientnet/tfhub_export.py +1 -1
  129. official/legacy/image_classification/learning_rate.py +1 -1
  130. official/legacy/image_classification/learning_rate_test.py +1 -1
  131. official/legacy/image_classification/mnist_main.py +1 -2
  132. official/legacy/image_classification/mnist_test.py +1 -1
  133. official/legacy/image_classification/optimizer_factory.py +1 -1
  134. official/legacy/image_classification/optimizer_factory_test.py +1 -1
  135. official/legacy/image_classification/preprocessing.py +1 -1
  136. official/legacy/image_classification/resnet/__init__.py +1 -1
  137. official/legacy/image_classification/resnet/common.py +1 -1
  138. official/legacy/image_classification/resnet/imagenet_preprocessing.py +1 -1
  139. official/legacy/image_classification/resnet/resnet_config.py +1 -1
  140. official/legacy/image_classification/resnet/resnet_ctl_imagenet_main.py +1 -2
  141. official/legacy/image_classification/resnet/resnet_model.py +1 -1
  142. official/legacy/image_classification/resnet/resnet_runnable.py +1 -1
  143. official/legacy/image_classification/resnet/tfhub_export.py +1 -2
  144. official/legacy/image_classification/test_utils.py +1 -1
  145. official/legacy/image_classification/vgg/__init__.py +1 -1
  146. official/legacy/image_classification/vgg/vgg_config.py +1 -1
  147. official/legacy/image_classification/vgg/vgg_model.py +1 -1
  148. official/legacy/transformer/__init__.py +1 -1
  149. official/legacy/transformer/attention_layer.py +1 -1
  150. official/legacy/transformer/beam_search_v1.py +1 -1
  151. official/legacy/transformer/compute_bleu.py +1 -1
  152. official/legacy/transformer/compute_bleu_test.py +1 -1
  153. official/legacy/transformer/data_download.py +1 -1
  154. official/legacy/transformer/data_pipeline.py +1 -1
  155. official/legacy/transformer/embedding_layer.py +1 -1
  156. official/legacy/transformer/ffn_layer.py +1 -1
  157. official/legacy/transformer/metrics.py +1 -1
  158. official/legacy/transformer/misc.py +1 -1
  159. official/legacy/transformer/model_params.py +1 -1
  160. official/legacy/transformer/model_utils.py +1 -1
  161. official/legacy/transformer/model_utils_test.py +1 -1
  162. official/legacy/transformer/optimizer.py +1 -1
  163. official/legacy/transformer/transformer.py +1 -1
  164. official/legacy/transformer/transformer_forward_test.py +1 -1
  165. official/legacy/transformer/transformer_layers_test.py +1 -1
  166. official/legacy/transformer/transformer_main.py +1 -5
  167. official/legacy/transformer/transformer_main_test.py +1 -1
  168. official/legacy/transformer/transformer_test.py +1 -1
  169. official/legacy/transformer/translate.py +1 -2
  170. official/legacy/transformer/utils/__init__.py +1 -1
  171. official/legacy/transformer/utils/metrics.py +1 -1
  172. official/legacy/transformer/utils/tokenizer.py +1 -1
  173. official/legacy/transformer/utils/tokenizer_test.py +1 -1
  174. official/legacy/xlnet/__init__.py +1 -1
  175. official/legacy/xlnet/classifier_utils.py +1 -1
  176. official/legacy/xlnet/common_flags.py +1 -1
  177. official/legacy/xlnet/data_utils.py +1 -1
  178. official/legacy/xlnet/optimization.py +1 -1
  179. official/legacy/xlnet/preprocess_classification_data.py +1 -2
  180. official/legacy/xlnet/preprocess_pretrain_data.py +1 -2
  181. official/legacy/xlnet/preprocess_squad_data.py +1 -2
  182. official/legacy/xlnet/preprocess_utils.py +1 -1
  183. official/legacy/xlnet/run_classifier.py +1 -2
  184. official/legacy/xlnet/run_pretrain.py +1 -2
  185. official/legacy/xlnet/run_squad.py +1 -2
  186. official/legacy/xlnet/squad_utils.py +1 -1
  187. official/legacy/xlnet/training_utils.py +1 -1
  188. official/legacy/xlnet/xlnet_config.py +1 -1
  189. official/legacy/xlnet/xlnet_modeling.py +1 -1
  190. official/modeling/__init__.py +1 -1
  191. official/modeling/activations/__init__.py +1 -1
  192. official/modeling/activations/gelu.py +1 -1
  193. official/modeling/activations/gelu_test.py +1 -1
  194. official/modeling/activations/mish.py +1 -1
  195. official/modeling/activations/mish_test.py +1 -1
  196. official/modeling/activations/relu.py +1 -1
  197. official/modeling/activations/relu_test.py +1 -1
  198. official/modeling/activations/sigmoid.py +1 -1
  199. official/modeling/activations/sigmoid_test.py +1 -1
  200. official/modeling/activations/swish.py +1 -1
  201. official/modeling/activations/swish_test.py +1 -1
  202. official/modeling/grad_utils.py +1 -1
  203. official/modeling/grad_utils_test.py +1 -1
  204. official/modeling/hyperparams/__init__.py +1 -1
  205. official/modeling/hyperparams/base_config.py +27 -19
  206. official/modeling/hyperparams/base_config_test.py +32 -1
  207. official/modeling/hyperparams/oneof.py +1 -1
  208. official/modeling/hyperparams/oneof_test.py +1 -1
  209. official/modeling/hyperparams/params_dict.py +1 -1
  210. official/modeling/hyperparams/params_dict_test.py +1 -1
  211. official/modeling/multitask/__init__.py +1 -1
  212. official/modeling/multitask/base_model.py +1 -1
  213. official/modeling/multitask/base_trainer.py +1 -1
  214. official/modeling/multitask/base_trainer_test.py +1 -1
  215. official/modeling/multitask/configs.py +3 -3
  216. official/modeling/multitask/evaluator.py +1 -1
  217. official/modeling/multitask/evaluator_test.py +1 -1
  218. official/modeling/multitask/interleaving_trainer.py +1 -1
  219. official/modeling/multitask/interleaving_trainer_test.py +1 -1
  220. official/modeling/multitask/multitask.py +1 -1
  221. official/modeling/multitask/task_sampler.py +1 -1
  222. official/modeling/multitask/task_sampler_test.py +1 -1
  223. official/modeling/multitask/test_utils.py +1 -1
  224. official/modeling/multitask/train_lib.py +81 -14
  225. official/modeling/multitask/train_lib_test.py +1 -1
  226. official/modeling/optimization/__init__.py +1 -1
  227. official/modeling/optimization/adafactor_optimizer.py +1 -1
  228. official/modeling/optimization/configs/__init__.py +1 -1
  229. official/modeling/optimization/configs/learning_rate_config.py +1 -1
  230. official/modeling/optimization/configs/optimization_config.py +1 -1
  231. official/modeling/optimization/configs/optimization_config_test.py +1 -1
  232. official/modeling/optimization/configs/optimizer_config.py +1 -1
  233. official/modeling/optimization/ema_optimizer.py +1 -1
  234. official/modeling/optimization/lamb.py +1 -1
  235. official/modeling/optimization/lamb_test.py +1 -1
  236. official/modeling/optimization/lars.py +1 -1
  237. official/modeling/optimization/legacy_adamw.py +1 -1
  238. official/modeling/optimization/lr_schedule.py +1 -1
  239. official/modeling/optimization/lr_schedule_test.py +1 -1
  240. official/modeling/optimization/optimizer_factory.py +1 -1
  241. official/modeling/optimization/optimizer_factory_test.py +1 -1
  242. official/modeling/optimization/slide_optimizer.py +1 -1
  243. official/modeling/performance.py +1 -1
  244. official/modeling/privacy/__init__.py +1 -1
  245. official/modeling/privacy/configs.py +1 -1
  246. official/modeling/privacy/configs_test.py +1 -1
  247. official/modeling/privacy/ops.py +1 -1
  248. official/modeling/privacy/ops_test.py +1 -1
  249. official/modeling/tf_utils.py +1 -1
  250. official/modeling/tf_utils_test.py +1 -1
  251. official/nlp/__init__.py +1 -1
  252. official/nlp/configs/__init__.py +1 -1
  253. official/nlp/configs/bert.py +1 -1
  254. official/nlp/configs/electra.py +1 -1
  255. official/nlp/configs/encoders.py +1 -1
  256. official/nlp/configs/encoders_test.py +1 -1
  257. official/nlp/configs/experiment_configs.py +1 -1
  258. official/nlp/configs/finetuning_experiments.py +1 -1
  259. official/nlp/configs/pretraining_experiments.py +1 -1
  260. official/nlp/configs/wmt_transformer_experiments.py +1 -1
  261. official/nlp/continuous_finetune_lib.py +1 -1
  262. official/nlp/continuous_finetune_lib_test.py +1 -1
  263. official/nlp/data/__init__.py +1 -1
  264. official/nlp/data/classifier_data_lib.py +1 -1
  265. official/nlp/data/classifier_data_lib_test.py +1 -1
  266. official/nlp/data/create_finetuning_data.py +1 -2
  267. official/nlp/data/create_pretraining_data.py +1 -3
  268. official/nlp/data/create_pretraining_data_test.py +1 -1
  269. official/nlp/data/create_xlnet_pretraining_data.py +1 -3
  270. official/nlp/data/create_xlnet_pretraining_data_test.py +1 -1
  271. official/nlp/data/data_loader.py +1 -1
  272. official/nlp/data/data_loader_factory.py +1 -1
  273. official/nlp/data/data_loader_factory_test.py +1 -1
  274. official/nlp/data/dual_encoder_dataloader.py +1 -1
  275. official/nlp/data/dual_encoder_dataloader_test.py +1 -1
  276. official/nlp/data/pretrain_dataloader.py +1 -1
  277. official/nlp/data/pretrain_dataloader_test.py +1 -1
  278. official/nlp/data/pretrain_dynamic_dataloader.py +1 -1
  279. official/nlp/data/pretrain_dynamic_dataloader_test.py +1 -1
  280. official/nlp/data/pretrain_text_dataloader.py +1 -1
  281. official/nlp/data/question_answering_dataloader.py +1 -1
  282. official/nlp/data/question_answering_dataloader_test.py +1 -1
  283. official/nlp/data/sentence_prediction_dataloader.py +1 -1
  284. official/nlp/data/sentence_prediction_dataloader_test.py +1 -1
  285. official/nlp/data/sentence_retrieval_lib.py +1 -1
  286. official/nlp/data/squad_lib.py +1 -1
  287. official/nlp/data/squad_lib_sp.py +1 -1
  288. official/nlp/data/tagging_data_lib.py +1 -1
  289. official/nlp/data/tagging_data_lib_test.py +1 -1
  290. official/nlp/data/tagging_dataloader.py +1 -1
  291. official/nlp/data/tagging_dataloader_test.py +1 -1
  292. official/nlp/data/train_sentencepiece.py +1 -1
  293. official/nlp/data/wmt_dataloader.py +1 -1
  294. official/nlp/data/wmt_dataloader_test.py +1 -1
  295. official/nlp/metrics/__init__.py +1 -1
  296. official/nlp/metrics/bleu.py +1 -1
  297. official/nlp/metrics/bleu_test.py +1 -1
  298. official/nlp/modeling/__init__.py +1 -1
  299. official/nlp/modeling/layers/__init__.py +1 -1
  300. official/nlp/modeling/layers/attention.py +1 -1
  301. official/nlp/modeling/layers/attention_test.py +1 -1
  302. official/nlp/modeling/layers/bigbird_attention.py +1 -1
  303. official/nlp/modeling/layers/bigbird_attention_test.py +1 -1
  304. official/nlp/modeling/layers/block_diag_feedforward.py +1 -1
  305. official/nlp/modeling/layers/block_diag_feedforward_test.py +1 -1
  306. official/nlp/modeling/layers/block_sparse_attention.py +187 -44
  307. official/nlp/modeling/layers/block_sparse_attention_test.py +137 -7
  308. official/nlp/modeling/layers/cls_head.py +1 -1
  309. official/nlp/modeling/layers/cls_head_test.py +1 -1
  310. official/nlp/modeling/layers/factorized_embedding.py +1 -1
  311. official/nlp/modeling/layers/factorized_embedding_test.py +1 -1
  312. official/nlp/modeling/layers/gated_feedforward.py +2 -2
  313. official/nlp/modeling/layers/gated_feedforward_test.py +1 -1
  314. official/nlp/modeling/layers/gaussian_process.py +1 -1
  315. official/nlp/modeling/layers/gaussian_process_test.py +1 -1
  316. official/nlp/modeling/layers/kernel_attention.py +1 -1
  317. official/nlp/modeling/layers/kernel_attention_test.py +1 -1
  318. official/nlp/modeling/layers/masked_lm.py +1 -1
  319. official/nlp/modeling/layers/masked_lm_test.py +1 -1
  320. official/nlp/modeling/layers/masked_softmax.py +1 -1
  321. official/nlp/modeling/layers/masked_softmax_test.py +1 -1
  322. official/nlp/modeling/layers/mat_mul_with_margin.py +1 -2
  323. official/nlp/modeling/layers/mat_mul_with_margin_test.py +1 -1
  324. official/nlp/modeling/layers/mixing.py +1 -1
  325. official/nlp/modeling/layers/mixing_test.py +1 -1
  326. official/nlp/modeling/layers/mobile_bert_layers.py +1 -1
  327. official/nlp/modeling/layers/mobile_bert_layers_test.py +1 -1
  328. official/nlp/modeling/layers/moe.py +1 -1
  329. official/nlp/modeling/layers/moe_test.py +1 -1
  330. official/nlp/modeling/layers/multi_channel_attention.py +1 -1
  331. official/nlp/modeling/layers/multi_channel_attention_test.py +1 -1
  332. official/nlp/modeling/layers/multi_query_attention.py +222 -4
  333. official/nlp/modeling/layers/multi_query_attention_test.py +201 -1
  334. official/nlp/modeling/layers/on_device_embedding.py +1 -1
  335. official/nlp/modeling/layers/on_device_embedding_test.py +1 -1
  336. official/nlp/modeling/layers/pack_optimization.py +1 -1
  337. official/nlp/modeling/layers/pack_optimization_test.py +1 -1
  338. official/nlp/modeling/layers/per_dim_scale_attention.py +1 -1
  339. official/nlp/modeling/layers/per_dim_scale_attention_test.py +1 -1
  340. official/nlp/modeling/layers/position_embedding.py +1 -1
  341. official/nlp/modeling/layers/position_embedding_test.py +1 -1
  342. official/nlp/modeling/layers/relative_attention.py +1 -1
  343. official/nlp/modeling/layers/relative_attention_test.py +1 -1
  344. official/nlp/modeling/layers/reuse_attention.py +1 -1
  345. official/nlp/modeling/layers/reuse_attention_test.py +1 -1
  346. official/nlp/modeling/layers/reuse_transformer.py +1 -1
  347. official/nlp/modeling/layers/reuse_transformer_test.py +1 -1
  348. official/nlp/modeling/layers/rezero_transformer.py +20 -1
  349. official/nlp/modeling/layers/rezero_transformer_test.py +1 -1
  350. official/nlp/modeling/layers/routing.py +1 -1
  351. official/nlp/modeling/layers/routing_test.py +1 -1
  352. official/nlp/modeling/layers/self_attention_mask.py +1 -1
  353. official/nlp/modeling/layers/spectral_normalization.py +1 -1
  354. official/nlp/modeling/layers/spectral_normalization_test.py +1 -1
  355. official/nlp/modeling/layers/talking_heads_attention.py +1 -1
  356. official/nlp/modeling/layers/talking_heads_attention_test.py +1 -1
  357. official/nlp/modeling/layers/text_layers.py +1 -1
  358. official/nlp/modeling/layers/text_layers_test.py +1 -1
  359. official/nlp/modeling/layers/tn_expand_condense.py +1 -1
  360. official/nlp/modeling/layers/tn_expand_condense_test.py +1 -1
  361. official/nlp/modeling/layers/tn_transformer_expand_condense.py +1 -3
  362. official/nlp/modeling/layers/tn_transformer_test.py +1 -1
  363. official/nlp/modeling/layers/transformer.py +1 -1
  364. official/nlp/modeling/layers/transformer_encoder_block.py +273 -52
  365. official/nlp/modeling/layers/transformer_encoder_block_test.py +215 -11
  366. official/nlp/modeling/layers/transformer_scaffold.py +1 -1
  367. official/nlp/modeling/layers/transformer_scaffold_test.py +1 -1
  368. official/nlp/modeling/layers/transformer_test.py +1 -1
  369. official/nlp/modeling/layers/transformer_xl.py +1 -1
  370. official/nlp/modeling/layers/transformer_xl_test.py +1 -1
  371. official/nlp/modeling/layers/util.py +1 -1
  372. official/nlp/modeling/losses/__init__.py +1 -1
  373. official/nlp/modeling/losses/weighted_sparse_categorical_crossentropy.py +1 -1
  374. official/nlp/modeling/losses/weighted_sparse_categorical_crossentropy_test.py +1 -1
  375. official/nlp/modeling/models/__init__.py +1 -1
  376. official/nlp/modeling/models/bert_classifier.py +1 -1
  377. official/nlp/modeling/models/bert_classifier_test.py +1 -1
  378. official/nlp/modeling/models/bert_pretrainer.py +1 -1
  379. official/nlp/modeling/models/bert_pretrainer_test.py +1 -1
  380. official/nlp/modeling/models/bert_span_labeler.py +1 -1
  381. official/nlp/modeling/models/bert_span_labeler_test.py +1 -1
  382. official/nlp/modeling/models/bert_token_classifier.py +1 -1
  383. official/nlp/modeling/models/bert_token_classifier_test.py +1 -1
  384. official/nlp/modeling/models/dual_encoder.py +1 -1
  385. official/nlp/modeling/models/dual_encoder_test.py +1 -1
  386. official/nlp/modeling/models/electra_pretrainer.py +1 -1
  387. official/nlp/modeling/models/electra_pretrainer_test.py +1 -1
  388. official/nlp/modeling/models/seq2seq_transformer.py +1 -1
  389. official/nlp/modeling/models/seq2seq_transformer_test.py +1 -1
  390. official/nlp/modeling/models/t5.py +1 -1
  391. official/nlp/modeling/models/t5_test.py +1 -1
  392. official/nlp/modeling/models/xlnet.py +1 -1
  393. official/nlp/modeling/models/xlnet_test.py +1 -1
  394. official/nlp/modeling/networks/__init__.py +1 -1
  395. official/nlp/modeling/networks/albert_encoder.py +1 -1
  396. official/nlp/modeling/networks/albert_encoder_test.py +1 -1
  397. official/nlp/modeling/networks/bert_dense_encoder_test.py +1 -2
  398. official/nlp/modeling/networks/bert_encoder.py +1 -1
  399. official/nlp/modeling/networks/bert_encoder_test.py +1 -2
  400. official/nlp/modeling/networks/classification.py +1 -1
  401. official/nlp/modeling/networks/classification_test.py +1 -1
  402. official/nlp/modeling/networks/encoder_scaffold.py +1 -1
  403. official/nlp/modeling/networks/encoder_scaffold_test.py +1 -1
  404. official/nlp/modeling/networks/fnet.py +1 -1
  405. official/nlp/modeling/networks/fnet_test.py +1 -1
  406. official/nlp/modeling/networks/funnel_transformer.py +1 -1
  407. official/nlp/modeling/networks/funnel_transformer_test.py +1 -1
  408. official/nlp/modeling/networks/mobile_bert_encoder.py +6 -4
  409. official/nlp/modeling/networks/mobile_bert_encoder_test.py +1 -1
  410. official/nlp/modeling/networks/packed_sequence_embedding.py +1 -1
  411. official/nlp/modeling/networks/packed_sequence_embedding_test.py +1 -3
  412. official/nlp/modeling/networks/span_labeling.py +1 -1
  413. official/nlp/modeling/networks/span_labeling_test.py +1 -1
  414. official/nlp/modeling/networks/sparse_mixer.py +1 -1
  415. official/nlp/modeling/networks/sparse_mixer_test.py +1 -1
  416. official/nlp/modeling/networks/xlnet_base.py +1 -1
  417. official/nlp/modeling/networks/xlnet_base_test.py +1 -1
  418. official/nlp/modeling/ops/__init__.py +1 -1
  419. official/nlp/modeling/ops/beam_search.py +1 -1
  420. official/nlp/modeling/ops/beam_search_test.py +1 -1
  421. official/nlp/modeling/ops/decoding_module.py +1 -1
  422. official/nlp/modeling/ops/decoding_module_test.py +1 -1
  423. official/nlp/modeling/ops/sampling_module.py +3 -3
  424. official/nlp/modeling/ops/segment_extractor.py +1 -1
  425. official/nlp/modeling/ops/segment_extractor_test.py +1 -1
  426. official/nlp/optimization.py +1 -1
  427. official/nlp/serving/__init__.py +1 -1
  428. official/nlp/serving/export_savedmodel.py +1 -1
  429. official/nlp/serving/export_savedmodel_test.py +1 -1
  430. official/nlp/serving/export_savedmodel_util.py +1 -1
  431. official/nlp/serving/serving_modules.py +1 -1
  432. official/nlp/serving/serving_modules_test.py +1 -1
  433. official/nlp/tasks/__init__.py +1 -1
  434. official/nlp/tasks/dual_encoder.py +1 -2
  435. official/nlp/tasks/dual_encoder_test.py +1 -1
  436. official/nlp/tasks/electra_task.py +1 -1
  437. official/nlp/tasks/electra_task_test.py +1 -1
  438. official/nlp/tasks/masked_lm.py +1 -1
  439. official/nlp/tasks/masked_lm_determinism_test.py +1 -1
  440. official/nlp/tasks/masked_lm_test.py +1 -1
  441. official/nlp/tasks/question_answering.py +1 -1
  442. official/nlp/tasks/question_answering_test.py +1 -1
  443. official/nlp/tasks/sentence_prediction.py +1 -1
  444. official/nlp/tasks/sentence_prediction_test.py +1 -1
  445. official/nlp/tasks/tagging.py +1 -1
  446. official/nlp/tasks/tagging_test.py +1 -1
  447. official/nlp/tasks/translation.py +1 -1
  448. official/nlp/tasks/translation_test.py +1 -1
  449. official/nlp/tasks/utils.py +1 -1
  450. official/nlp/tools/__init__.py +1 -1
  451. official/nlp/tools/export_tfhub.py +1 -1
  452. official/nlp/tools/export_tfhub_lib.py +1 -2
  453. official/nlp/tools/export_tfhub_lib_test.py +1 -1
  454. official/nlp/tools/squad_evaluate_v1_1.py +1 -1
  455. official/nlp/tools/squad_evaluate_v2_0.py +1 -1
  456. official/nlp/tools/tf1_bert_checkpoint_converter_lib.py +1 -1
  457. official/nlp/tools/tf2_albert_encoder_checkpoint_converter.py +1 -1
  458. official/nlp/tools/tf2_bert_encoder_checkpoint_converter.py +1 -1
  459. official/nlp/tools/tokenization.py +1 -1
  460. official/nlp/tools/tokenization_test.py +1 -1
  461. official/nlp/train.py +1 -1
  462. official/projects/__init__.py +1 -1
  463. official/projects/bigbird/__init__.py +1 -1
  464. official/projects/bigbird/encoder.py +1 -1
  465. official/projects/bigbird/encoder_test.py +1 -1
  466. official/projects/bigbird/experiment_configs.py +1 -1
  467. official/projects/bigbird/recompute_grad.py +1 -1
  468. official/projects/bigbird/recomputing_dropout.py +1 -1
  469. official/projects/bigbird/stateless_dropout.py +1 -1
  470. official/projects/centernet/__init__.py +1 -1
  471. official/projects/centernet/common/__init__.py +1 -1
  472. official/projects/centernet/common/registry_imports.py +1 -1
  473. official/projects/centernet/configs/__init__.py +1 -1
  474. official/projects/centernet/configs/backbones.py +1 -1
  475. official/projects/centernet/configs/centernet.py +1 -1
  476. official/projects/centernet/configs/centernet_test.py +1 -1
  477. official/projects/centernet/dataloaders/__init__.py +1 -1
  478. official/projects/centernet/dataloaders/centernet_input.py +1 -1
  479. official/projects/centernet/losses/__init__.py +1 -1
  480. official/projects/centernet/losses/centernet_losses.py +1 -1
  481. official/projects/centernet/losses/centernet_losses_test.py +1 -1
  482. official/projects/centernet/modeling/__init__.py +1 -1
  483. official/projects/centernet/modeling/backbones/__init__.py +1 -1
  484. official/projects/centernet/modeling/backbones/hourglass.py +1 -1
  485. official/projects/centernet/modeling/backbones/hourglass_test.py +1 -1
  486. official/projects/centernet/modeling/centernet_model.py +2 -2
  487. official/projects/centernet/modeling/centernet_model_test.py +1 -1
  488. official/projects/centernet/modeling/heads/__init__.py +1 -1
  489. official/projects/centernet/modeling/heads/centernet_head.py +2 -2
  490. official/projects/centernet/modeling/heads/centernet_head_test.py +1 -1
  491. official/projects/centernet/modeling/layers/__init__.py +1 -1
  492. official/projects/centernet/modeling/layers/cn_nn_blocks.py +1 -1
  493. official/projects/centernet/modeling/layers/cn_nn_blocks_test.py +1 -1
  494. official/projects/centernet/modeling/layers/detection_generator.py +1 -1
  495. official/projects/centernet/modeling/layers/detection_generator_test.py +1 -1
  496. official/projects/centernet/ops/__init__.py +1 -1
  497. official/projects/centernet/ops/box_list.py +1 -1
  498. official/projects/centernet/ops/box_list_ops.py +1 -1
  499. official/projects/centernet/ops/loss_ops.py +1 -1
  500. official/projects/centernet/ops/nms_ops.py +1 -1
  501. official/projects/centernet/ops/preprocess_ops.py +1 -1
  502. official/projects/centernet/ops/target_assigner.py +1 -1
  503. official/projects/centernet/ops/target_assigner_test.py +1 -1
  504. official/projects/centernet/tasks/__init__.py +1 -1
  505. official/projects/centernet/tasks/centernet.py +1 -1
  506. official/projects/centernet/train.py +1 -1
  507. official/projects/centernet/utils/__init__.py +1 -1
  508. official/projects/centernet/utils/checkpoints/__init__.py +1 -1
  509. official/projects/centernet/utils/checkpoints/config_classes.py +1 -1
  510. official/projects/centernet/utils/checkpoints/config_data.py +1 -1
  511. official/projects/centernet/utils/checkpoints/load_weights.py +1 -1
  512. official/projects/centernet/utils/checkpoints/read_checkpoints.py +1 -1
  513. official/projects/centernet/utils/tf2_centernet_checkpoint_converter.py +1 -1
  514. official/projects/deepmac_maskrcnn/__init__.py +1 -1
  515. official/projects/deepmac_maskrcnn/common/__init__.py +1 -1
  516. official/projects/deepmac_maskrcnn/common/registry_imports.py +1 -1
  517. official/projects/deepmac_maskrcnn/configs/__init__.py +1 -1
  518. official/projects/deepmac_maskrcnn/configs/deep_mask_head_rcnn.py +1 -1
  519. official/projects/deepmac_maskrcnn/configs/deep_mask_head_rcnn_config_test.py +1 -1
  520. official/projects/deepmac_maskrcnn/modeling/__init__.py +1 -1
  521. official/projects/deepmac_maskrcnn/modeling/heads/__init__.py +1 -1
  522. official/projects/deepmac_maskrcnn/modeling/heads/hourglass_network.py +1 -1
  523. official/projects/deepmac_maskrcnn/modeling/heads/instance_heads.py +1 -3
  524. official/projects/deepmac_maskrcnn/modeling/heads/instance_heads_test.py +1 -2
  525. official/projects/deepmac_maskrcnn/modeling/maskrcnn_model.py +1 -3
  526. official/projects/deepmac_maskrcnn/modeling/maskrcnn_model_test.py +1 -3
  527. official/projects/deepmac_maskrcnn/serving/__init__.py +1 -1
  528. official/projects/deepmac_maskrcnn/serving/detection.py +1 -1
  529. official/projects/deepmac_maskrcnn/serving/detection_test.py +1 -1
  530. official/projects/deepmac_maskrcnn/serving/export_saved_model.py +1 -1
  531. official/projects/deepmac_maskrcnn/tasks/__init__.py +1 -1
  532. official/projects/deepmac_maskrcnn/tasks/deep_mask_head_rcnn.py +1 -1
  533. official/projects/deepmac_maskrcnn/train.py +1 -1
  534. official/projects/detr/__init__.py +14 -0
  535. official/projects/detr/configs/__init__.py +14 -0
  536. official/projects/detr/configs/detr.py +277 -0
  537. official/projects/detr/configs/detr_test.py +51 -0
  538. official/projects/detr/dataloaders/__init__.py +14 -0
  539. official/projects/detr/dataloaders/coco.py +157 -0
  540. official/projects/detr/dataloaders/coco_test.py +111 -0
  541. official/projects/detr/dataloaders/detr_input.py +175 -0
  542. official/projects/detr/experiments/__init__.py +14 -0
  543. official/projects/detr/modeling/__init__.py +14 -0
  544. official/projects/detr/modeling/detr.py +345 -0
  545. official/projects/detr/modeling/detr_test.py +70 -0
  546. official/projects/detr/modeling/transformer.py +849 -0
  547. official/projects/detr/modeling/transformer_test.py +263 -0
  548. official/projects/detr/ops/__init__.py +14 -0
  549. official/projects/detr/ops/matchers.py +489 -0
  550. official/projects/detr/ops/matchers_test.py +95 -0
  551. official/projects/detr/optimization.py +151 -0
  552. official/projects/detr/serving/__init__.py +14 -0
  553. official/projects/detr/serving/export_module.py +103 -0
  554. official/projects/detr/serving/export_module_test.py +98 -0
  555. official/projects/detr/serving/export_saved_model.py +109 -0
  556. official/projects/detr/tasks/__init__.py +14 -0
  557. official/projects/detr/tasks/detection.py +433 -0
  558. official/projects/detr/tasks/detection_test.py +203 -0
  559. official/projects/detr/train.py +70 -0
  560. official/projects/maskconver/__init__.py +14 -0
  561. official/projects/maskconver/configs/__init__.py +14 -0
  562. official/projects/maskconver/configs/backbones.py +43 -0
  563. official/projects/maskconver/configs/decoders.py +36 -0
  564. official/projects/maskconver/configs/maskconver.py +523 -0
  565. official/projects/maskconver/configs/multiscale_maskconver.py +215 -0
  566. official/projects/maskconver/tasks/__init__.py +14 -0
  567. official/projects/maskconver/tasks/maskconver.py +641 -0
  568. official/projects/maskconver/tasks/multiscale_maskconver.py +278 -0
  569. official/projects/maskconver/train.py +30 -0
  570. official/projects/maxvit/__init__.py +1 -1
  571. official/projects/maxvit/configs/__init__.py +1 -1
  572. official/projects/maxvit/configs/backbones.py +1 -1
  573. official/projects/maxvit/configs/image_classification.py +1 -1
  574. official/projects/maxvit/configs/image_classification_test.py +1 -1
  575. official/projects/maxvit/configs/rcnn.py +1 -1
  576. official/projects/maxvit/configs/rcnn_test.py +1 -1
  577. official/projects/maxvit/configs/retinanet.py +1 -1
  578. official/projects/maxvit/configs/retinanet_test.py +1 -1
  579. official/projects/maxvit/configs/semantic_segmentation.py +1 -1
  580. official/projects/maxvit/configs/semantic_segmentation_test.py +1 -1
  581. official/projects/maxvit/modeling/__init__.py +1 -1
  582. official/projects/maxvit/modeling/common_ops.py +14 -1
  583. official/projects/maxvit/modeling/layers.py +1 -1
  584. official/projects/maxvit/modeling/maxvit.py +2 -2
  585. official/projects/maxvit/modeling/maxvit_test.py +1 -1
  586. official/projects/maxvit/registry_imports.py +1 -1
  587. official/projects/maxvit/train.py +1 -1
  588. official/projects/maxvit/train_test.py +1 -1
  589. official/projects/mobilebert/__init__.py +1 -1
  590. official/projects/mobilebert/distillation.py +1 -1
  591. official/projects/mobilebert/distillation_test.py +1 -1
  592. official/projects/mobilebert/export_tfhub.py +1 -1
  593. official/projects/mobilebert/model_utils.py +1 -1
  594. official/projects/mobilebert/run_distillation.py +1 -1
  595. official/projects/mobilebert/tf2_model_checkpoint_converter.py +1 -1
  596. official/projects/mobilebert/utils.py +1 -1
  597. official/projects/movinet/__init__.py +1 -1
  598. official/projects/movinet/configs/__init__.py +1 -1
  599. official/projects/movinet/configs/movinet.py +1 -1
  600. official/projects/movinet/configs/movinet_test.py +1 -1
  601. official/projects/movinet/modeling/__init__.py +1 -1
  602. official/projects/movinet/modeling/movinet.py +1 -1
  603. official/projects/movinet/modeling/movinet_layers.py +1 -1
  604. official/projects/movinet/modeling/movinet_layers_test.py +1 -1
  605. official/projects/movinet/modeling/movinet_model.py +1 -1
  606. official/projects/movinet/modeling/movinet_model_test.py +1 -1
  607. official/projects/movinet/modeling/movinet_test.py +1 -1
  608. official/projects/movinet/tools/__init__.py +1 -1
  609. official/projects/movinet/tools/convert_3d_2plus1d.py +1 -1
  610. official/projects/movinet/tools/convert_3d_2plus1d_test.py +1 -1
  611. official/projects/movinet/tools/export_saved_model.py +1 -1
  612. official/projects/movinet/tools/export_saved_model_test.py +6 -3
  613. official/projects/movinet/tools/quantize_movinet.py +1 -1
  614. official/projects/movinet/train.py +1 -1
  615. official/projects/movinet/train_test.py +1 -1
  616. official/projects/nhnet/__init__.py +1 -1
  617. official/projects/nhnet/configs.py +1 -1
  618. official/projects/nhnet/configs_test.py +1 -1
  619. official/projects/nhnet/decoder.py +1 -1
  620. official/projects/nhnet/decoder_test.py +1 -1
  621. official/projects/nhnet/evaluation.py +1 -3
  622. official/projects/nhnet/input_pipeline.py +1 -1
  623. official/projects/nhnet/models.py +1 -1
  624. official/projects/nhnet/models_test.py +1 -1
  625. official/projects/nhnet/optimizer.py +1 -1
  626. official/projects/nhnet/raw_data_process.py +1 -1
  627. official/projects/nhnet/raw_data_processor.py +1 -1
  628. official/projects/nhnet/trainer.py +1 -6
  629. official/projects/nhnet/trainer_test.py +1 -1
  630. official/projects/nhnet/utils.py +1 -1
  631. official/projects/panoptic/__init__.py +1 -1
  632. official/projects/panoptic/configs/__init__.py +1 -1
  633. official/projects/panoptic/configs/panoptic_deeplab.py +5 -6
  634. official/projects/panoptic/configs/panoptic_maskrcnn.py +1 -1
  635. official/projects/panoptic/tasks/__init__.py +1 -1
  636. official/projects/panoptic/tasks/panoptic_deeplab.py +1 -1
  637. official/projects/panoptic/tasks/panoptic_maskrcnn.py +3 -1
  638. official/projects/panoptic/train.py +1 -1
  639. official/projects/qat/__init__.py +1 -1
  640. official/projects/qat/nlp/__init__.py +1 -1
  641. official/projects/qat/nlp/configs/__init__.py +1 -1
  642. official/projects/qat/nlp/configs/finetuning_experiments.py +1 -1
  643. official/projects/qat/nlp/modeling/__init__.py +1 -1
  644. official/projects/qat/nlp/modeling/layers/__init__.py +1 -1
  645. official/projects/qat/nlp/modeling/layers/mobile_bert_layers.py +1 -1
  646. official/projects/qat/nlp/modeling/layers/multi_head_attention.py +1 -1
  647. official/projects/qat/nlp/modeling/layers/transformer_encoder_block.py +1 -1
  648. official/projects/qat/nlp/modeling/layers/transformer_encoder_block_test.py +1 -1
  649. official/projects/qat/nlp/modeling/models/__init__.py +1 -1
  650. official/projects/qat/nlp/modeling/models/bert_span_labeler.py +1 -1
  651. official/projects/qat/nlp/modeling/networks/__init__.py +1 -1
  652. official/projects/qat/nlp/modeling/networks/span_labeling.py +1 -1
  653. official/projects/qat/nlp/pretrained_checkpoint_converter.py +1 -3
  654. official/projects/qat/nlp/quantization/__init__.py +1 -1
  655. official/projects/qat/nlp/quantization/configs.py +1 -1
  656. official/projects/qat/nlp/quantization/configs_test.py +1 -2
  657. official/projects/qat/nlp/quantization/helper.py +1 -1
  658. official/projects/qat/nlp/quantization/schemes.py +1 -3
  659. official/projects/qat/nlp/quantization/wrappers.py +1 -1
  660. official/projects/qat/nlp/registry_imports.py +1 -1
  661. official/projects/qat/nlp/tasks/__init__.py +1 -1
  662. official/projects/qat/nlp/tasks/question_answering.py +1 -1
  663. official/projects/qat/nlp/tasks/question_answering_test.py +1 -1
  664. official/projects/qat/nlp/train.py +1 -1
  665. official/projects/qat/vision/__init__.py +1 -1
  666. official/projects/qat/vision/configs/__init__.py +1 -1
  667. official/projects/qat/vision/configs/common.py +1 -1
  668. official/projects/qat/vision/configs/image_classification.py +1 -1
  669. official/projects/qat/vision/configs/image_classification_test.py +1 -1
  670. official/projects/qat/vision/configs/retinanet.py +1 -1
  671. official/projects/qat/vision/configs/retinanet_test.py +1 -1
  672. official/projects/qat/vision/configs/semantic_segmentation.py +1 -1
  673. official/projects/qat/vision/configs/semantic_segmentation_test.py +1 -1
  674. official/projects/qat/vision/modeling/__init__.py +1 -1
  675. official/projects/qat/vision/modeling/factory.py +1 -3
  676. official/projects/qat/vision/modeling/factory_test.py +1 -3
  677. official/projects/qat/vision/modeling/heads/__init__.py +1 -1
  678. official/projects/qat/vision/modeling/heads/dense_prediction_heads.py +1 -3
  679. official/projects/qat/vision/modeling/heads/dense_prediction_heads_test.py +1 -2
  680. official/projects/qat/vision/modeling/layers/__init__.py +1 -1
  681. official/projects/qat/vision/modeling/layers/nn_blocks.py +1 -3
  682. official/projects/qat/vision/modeling/layers/nn_blocks_test.py +1 -2
  683. official/projects/qat/vision/modeling/layers/nn_layers.py +2 -2
  684. official/projects/qat/vision/modeling/layers/nn_layers_test.py +1 -2
  685. official/projects/qat/vision/modeling/segmentation_model.py +1 -2
  686. official/projects/qat/vision/n_bit/__init__.py +1 -1
  687. official/projects/qat/vision/n_bit/configs.py +1 -1
  688. official/projects/qat/vision/n_bit/configs_test.py +1 -3
  689. official/projects/qat/vision/n_bit/nn_blocks.py +1 -3
  690. official/projects/qat/vision/n_bit/nn_blocks_test.py +1 -2
  691. official/projects/qat/vision/n_bit/nn_layers.py +1 -1
  692. official/projects/qat/vision/n_bit/schemes.py +1 -3
  693. official/projects/qat/vision/quantization/__init__.py +1 -1
  694. official/projects/qat/vision/quantization/configs.py +1 -1
  695. official/projects/qat/vision/quantization/configs_test.py +1 -3
  696. official/projects/qat/vision/quantization/helper.py +1 -1
  697. official/projects/qat/vision/quantization/helper_test.py +1 -1
  698. official/projects/qat/vision/quantization/layer_transforms.py +1 -1
  699. official/projects/qat/vision/quantization/schemes.py +1 -3
  700. official/projects/qat/vision/registry_imports.py +1 -1
  701. official/projects/qat/vision/serving/__init__.py +1 -1
  702. official/projects/qat/vision/serving/export_module.py +1 -1
  703. official/projects/qat/vision/serving/export_saved_model.py +1 -1
  704. official/projects/qat/vision/serving/export_tflite.py +1 -1
  705. official/projects/qat/vision/tasks/__init__.py +1 -1
  706. official/projects/qat/vision/tasks/image_classification.py +1 -1
  707. official/projects/qat/vision/tasks/image_classification_test.py +1 -1
  708. official/projects/qat/vision/tasks/retinanet.py +1 -1
  709. official/projects/qat/vision/tasks/retinanet_test.py +1 -1
  710. official/projects/qat/vision/tasks/semantic_segmentation.py +1 -1
  711. official/projects/qat/vision/train.py +1 -1
  712. official/projects/roformer/__init__.py +1 -1
  713. official/projects/roformer/roformer.py +1 -1
  714. official/projects/roformer/roformer_attention.py +1 -1
  715. official/projects/roformer/roformer_attention_test.py +1 -1
  716. official/projects/roformer/roformer_encoder.py +1 -1
  717. official/projects/roformer/roformer_encoder_block.py +1 -1
  718. official/projects/roformer/roformer_encoder_block_test.py +1 -1
  719. official/projects/roformer/roformer_encoder_test.py +1 -1
  720. official/projects/roformer/roformer_experiments.py +1 -1
  721. official/projects/roformer/train.py +1 -1
  722. official/projects/teams/__init__.py +1 -1
  723. official/projects/teams/teams.py +1 -1
  724. official/projects/teams/teams_experiments.py +1 -1
  725. official/projects/teams/teams_pretrainer.py +1 -1
  726. official/projects/teams/teams_pretrainer_test.py +1 -1
  727. official/projects/teams/teams_task.py +1 -1
  728. official/projects/teams/teams_task_test.py +1 -1
  729. official/projects/teams/train.py +1 -1
  730. official/projects/triviaqa/__init__.py +1 -1
  731. official/projects/triviaqa/dataset.py +1 -1
  732. official/projects/triviaqa/download_and_prepare.py +1 -1
  733. official/projects/triviaqa/evaluate.py +1 -1
  734. official/projects/triviaqa/evaluation.py +1 -1
  735. official/projects/triviaqa/inputs.py +1 -1
  736. official/projects/triviaqa/modeling.py +1 -1
  737. official/projects/triviaqa/predict.py +1 -1
  738. official/projects/triviaqa/prediction.py +1 -1
  739. official/projects/triviaqa/preprocess.py +1 -1
  740. official/projects/triviaqa/sentencepiece_pb2.py +1 -1
  741. official/projects/triviaqa/train.py +1 -1
  742. official/projects/video_ssl/__init__.py +1 -1
  743. official/projects/video_ssl/configs/__init__.py +1 -1
  744. official/projects/video_ssl/configs/video_ssl.py +1 -1
  745. official/projects/video_ssl/configs/video_ssl_test.py +1 -1
  746. official/projects/video_ssl/dataloaders/__init__.py +1 -1
  747. official/projects/video_ssl/dataloaders/video_ssl_input.py +1 -1
  748. official/projects/video_ssl/dataloaders/video_ssl_input_test.py +1 -2
  749. official/projects/video_ssl/losses/__init__.py +1 -1
  750. official/projects/video_ssl/losses/losses.py +1 -2
  751. official/projects/video_ssl/modeling/__init__.py +1 -1
  752. official/projects/video_ssl/modeling/video_ssl_model.py +1 -3
  753. official/projects/video_ssl/ops/__init__.py +1 -1
  754. official/projects/video_ssl/ops/video_ssl_preprocess_ops.py +1 -1
  755. official/projects/video_ssl/ops/video_ssl_preprocess_ops_test.py +1 -1
  756. official/projects/video_ssl/tasks/__init__.py +1 -1
  757. official/projects/video_ssl/tasks/linear_eval.py +1 -1
  758. official/projects/video_ssl/tasks/pretrain.py +1 -1
  759. official/projects/video_ssl/tasks/pretrain_test.py +1 -1
  760. official/projects/video_ssl/train.py +1 -1
  761. official/projects/volumetric_models/__init__.py +1 -1
  762. official/projects/volumetric_models/configs/__init__.py +1 -1
  763. official/projects/volumetric_models/configs/backbones.py +1 -1
  764. official/projects/volumetric_models/configs/decoders.py +1 -1
  765. official/projects/volumetric_models/configs/semantic_segmentation_3d.py +1 -1
  766. official/projects/volumetric_models/configs/semantic_segmentation_3d_test.py +1 -1
  767. official/projects/volumetric_models/dataloaders/__init__.py +1 -1
  768. official/projects/volumetric_models/dataloaders/segmentation_input_3d.py +1 -1
  769. official/projects/volumetric_models/dataloaders/segmentation_input_3d_test.py +1 -1
  770. official/projects/volumetric_models/evaluation/__init__.py +1 -1
  771. official/projects/volumetric_models/evaluation/segmentation_metrics.py +1 -1
  772. official/projects/volumetric_models/evaluation/segmentation_metrics_test.py +1 -1
  773. official/projects/volumetric_models/losses/__init__.py +1 -1
  774. official/projects/volumetric_models/losses/segmentation_losses.py +1 -1
  775. official/projects/volumetric_models/losses/segmentation_losses_test.py +1 -1
  776. official/projects/volumetric_models/modeling/__init__.py +1 -1
  777. official/projects/volumetric_models/modeling/backbones/__init__.py +1 -1
  778. official/projects/volumetric_models/modeling/backbones/unet_3d.py +1 -2
  779. official/projects/volumetric_models/modeling/backbones/unet_3d_test.py +1 -2
  780. official/projects/volumetric_models/modeling/decoders/__init__.py +1 -1
  781. official/projects/volumetric_models/modeling/decoders/factory.py +1 -3
  782. official/projects/volumetric_models/modeling/decoders/factory_test.py +1 -1
  783. official/projects/volumetric_models/modeling/decoders/unet_3d_decoder.py +1 -1
  784. official/projects/volumetric_models/modeling/decoders/unet_3d_decoder_test.py +1 -2
  785. official/projects/volumetric_models/modeling/factory.py +1 -3
  786. official/projects/volumetric_models/modeling/factory_test.py +1 -1
  787. official/projects/volumetric_models/modeling/heads/__init__.py +1 -1
  788. official/projects/volumetric_models/modeling/heads/segmentation_heads_3d.py +1 -1
  789. official/projects/volumetric_models/modeling/heads/segmentation_heads_3d_test.py +1 -1
  790. official/projects/volumetric_models/modeling/nn_blocks_3d.py +2 -3
  791. official/projects/volumetric_models/modeling/nn_blocks_3d_test.py +1 -2
  792. official/projects/volumetric_models/modeling/segmentation_model_test.py +1 -1
  793. official/projects/volumetric_models/registry_imports.py +1 -1
  794. official/projects/volumetric_models/serving/__init__.py +1 -1
  795. official/projects/volumetric_models/serving/export_saved_model.py +1 -1
  796. official/projects/volumetric_models/serving/semantic_segmentation_3d.py +1 -1
  797. official/projects/volumetric_models/serving/semantic_segmentation_3d_test.py +3 -3
  798. official/projects/volumetric_models/tasks/__init__.py +1 -1
  799. official/projects/volumetric_models/tasks/semantic_segmentation_3d.py +1 -1
  800. official/projects/volumetric_models/tasks/semantic_segmentation_3d_test.py +1 -1
  801. official/projects/volumetric_models/train.py +1 -1
  802. official/projects/volumetric_models/train_test.py +1 -1
  803. official/projects/waste_identification_ml/__init__.py +1 -1
  804. official/projects/waste_identification_ml/data_generation/__init__.py +1 -1
  805. official/projects/waste_identification_ml/data_generation/utils.py +1 -1
  806. official/projects/waste_identification_ml/data_generation/utils_test.py +1 -1
  807. official/projects/yolo/__init__.py +1 -1
  808. official/projects/yolo/common/__init__.py +1 -1
  809. official/projects/yolo/common/registry_imports.py +1 -1
  810. official/projects/yolo/configs/__init__.py +1 -1
  811. official/projects/yolo/configs/backbones.py +1 -1
  812. official/projects/yolo/configs/darknet_classification.py +1 -1
  813. official/projects/yolo/configs/decoders.py +1 -1
  814. official/projects/yolo/configs/yolo.py +1 -1
  815. official/projects/yolo/configs/yolov7.py +17 -1
  816. official/projects/yolo/dataloaders/__init__.py +1 -1
  817. official/projects/yolo/dataloaders/classification_input.py +1 -1
  818. official/projects/yolo/dataloaders/tf_example_decoder.py +1 -1
  819. official/projects/yolo/dataloaders/yolo_input.py +1 -1
  820. official/projects/yolo/losses/__init__.py +1 -1
  821. official/projects/yolo/losses/yolo_loss.py +1 -1
  822. official/projects/yolo/losses/yolo_loss_test.py +1 -1
  823. official/projects/yolo/losses/yolov7_loss.py +1 -1
  824. official/projects/yolo/losses/yolov7_loss_test.py +1 -1
  825. official/projects/yolo/modeling/__init__.py +1 -1
  826. official/projects/yolo/modeling/backbones/__init__.py +1 -1
  827. official/projects/yolo/modeling/backbones/darknet.py +1 -1
  828. official/projects/yolo/modeling/backbones/darknet_test.py +1 -1
  829. official/projects/yolo/modeling/backbones/yolov7.py +69 -1
  830. official/projects/yolo/modeling/backbones/yolov7_test.py +1 -1
  831. official/projects/yolo/modeling/decoders/__init__.py +1 -1
  832. official/projects/yolo/modeling/decoders/yolo_decoder.py +1 -1
  833. official/projects/yolo/modeling/decoders/yolo_decoder_test.py +1 -2
  834. official/projects/yolo/modeling/decoders/yolov7.py +90 -1
  835. official/projects/yolo/modeling/decoders/yolov7_test.py +1 -1
  836. official/projects/yolo/modeling/factory.py +1 -1
  837. official/projects/yolo/modeling/factory_test.py +1 -1
  838. official/projects/yolo/modeling/heads/__init__.py +1 -1
  839. official/projects/yolo/modeling/heads/yolo_head.py +1 -1
  840. official/projects/yolo/modeling/heads/yolo_head_test.py +1 -2
  841. official/projects/yolo/modeling/heads/yolov7_head.py +1 -1
  842. official/projects/yolo/modeling/heads/yolov7_head_test.py +1 -1
  843. official/projects/yolo/modeling/layers/__init__.py +1 -1
  844. official/projects/yolo/modeling/layers/detection_generator.py +1 -1
  845. official/projects/yolo/modeling/layers/detection_generator_test.py +1 -1
  846. official/projects/yolo/modeling/layers/nn_blocks.py +1 -1
  847. official/projects/yolo/modeling/layers/nn_blocks_test.py +1 -1
  848. official/projects/yolo/modeling/yolo_model.py +2 -2
  849. official/projects/yolo/modeling/yolov7_model.py +2 -2
  850. official/projects/yolo/ops/__init__.py +1 -1
  851. official/projects/yolo/ops/anchor.py +1 -1
  852. official/projects/yolo/ops/box_ops.py +1 -1
  853. official/projects/yolo/ops/box_ops_test.py +1 -1
  854. official/projects/yolo/ops/initializer_ops.py +1 -1
  855. official/projects/yolo/ops/kmeans_anchors.py +1 -1
  856. official/projects/yolo/ops/kmeans_anchors_test.py +1 -1
  857. official/projects/yolo/ops/loss_utils.py +1 -1
  858. official/projects/yolo/ops/math_ops.py +1 -1
  859. official/projects/yolo/ops/mosaic.py +1 -1
  860. official/projects/yolo/ops/preprocessing_ops.py +1 -1
  861. official/projects/yolo/ops/preprocessing_ops_test.py +1 -1
  862. official/projects/yolo/optimization/__init__.py +1 -1
  863. official/projects/yolo/optimization/configs/__init__.py +1 -1
  864. official/projects/yolo/optimization/configs/optimization_config.py +1 -1
  865. official/projects/yolo/optimization/configs/optimizer_config.py +1 -1
  866. official/projects/yolo/optimization/optimizer_factory.py +1 -1
  867. official/projects/yolo/optimization/sgd_torch.py +1 -1
  868. official/projects/yolo/serving/__init__.py +1 -1
  869. official/projects/yolo/serving/export_module_factory.py +1 -1
  870. official/projects/yolo/serving/export_saved_model.py +1 -1
  871. official/projects/yolo/serving/export_tflite.py +1 -1
  872. official/projects/yolo/serving/model_fn.py +1 -1
  873. official/projects/yolo/tasks/__init__.py +1 -1
  874. official/projects/yolo/tasks/image_classification.py +1 -1
  875. official/projects/yolo/tasks/task_utils.py +1 -1
  876. official/projects/yolo/tasks/yolo.py +1 -1
  877. official/projects/yolo/tasks/yolov7.py +1 -1
  878. official/projects/yolo/train.py +1 -1
  879. official/projects/yt8m/__init__.py +1 -1
  880. official/projects/yt8m/configs/__init__.py +1 -1
  881. official/projects/yt8m/configs/yt8m.py +1 -1
  882. official/projects/yt8m/configs/yt8m_test.py +1 -1
  883. official/projects/yt8m/modeling/__init__.py +1 -1
  884. official/projects/yt8m/modeling/backbones/__init__.py +1 -1
  885. official/projects/yt8m/modeling/backbones/dbof.py +1 -1
  886. official/projects/yt8m/modeling/backbones/dbof_test.py +1 -1
  887. official/projects/yt8m/modeling/heads/__init__.py +1 -1
  888. official/projects/yt8m/modeling/heads/logistic.py +1 -1
  889. official/projects/yt8m/modeling/heads/moe.py +1 -1
  890. official/projects/yt8m/modeling/nn_layers.py +1 -1
  891. official/projects/yt8m/modeling/nn_layers_test.py +1 -1
  892. official/projects/yt8m/modeling/yt8m_model.py +1 -1
  893. official/projects/yt8m/modeling/yt8m_model_test.py +1 -1
  894. official/projects/yt8m/modeling/yt8m_model_utils.py +1 -1
  895. official/projects/yt8m/modeling/yt8m_model_utils_test.py +1 -1
  896. official/projects/yt8m/tasks/__init__.py +1 -1
  897. official/projects/yt8m/tasks/yt8m_task.py +1 -1
  898. official/projects/yt8m/train.py +1 -1
  899. official/projects/yt8m/train_test.py +1 -1
  900. official/recommendation/__init__.py +1 -1
  901. official/recommendation/constants.py +1 -1
  902. official/recommendation/create_ncf_data.py +1 -2
  903. official/recommendation/data_pipeline.py +1 -1
  904. official/recommendation/data_preprocessing.py +1 -1
  905. official/recommendation/data_test.py +4 -4
  906. official/recommendation/movielens.py +1 -2
  907. official/recommendation/ncf_common.py +1 -1
  908. official/recommendation/ncf_input_pipeline.py +1 -1
  909. official/recommendation/ncf_keras_main.py +1 -1
  910. official/recommendation/ncf_test.py +1 -1
  911. official/recommendation/neumf_model.py +1 -1
  912. official/recommendation/popen_helper.py +1 -1
  913. official/recommendation/ranking/__init__.py +1 -1
  914. official/recommendation/ranking/common.py +1 -1
  915. official/recommendation/ranking/configs/__init__.py +1 -1
  916. official/recommendation/ranking/configs/config.py +14 -1
  917. official/recommendation/ranking/configs/config_test.py +1 -1
  918. official/recommendation/ranking/data/__init__.py +1 -1
  919. official/recommendation/ranking/data/data_pipeline.py +9 -2
  920. official/recommendation/ranking/data/data_pipeline_multi_hot.py +8 -2
  921. official/recommendation/ranking/data/data_pipeline_multi_hot_test.py +12 -6
  922. official/recommendation/ranking/data/data_pipeline_test.py +18 -8
  923. official/recommendation/ranking/task.py +102 -19
  924. official/recommendation/ranking/task_test.py +1 -1
  925. official/recommendation/ranking/train.py +1 -1
  926. official/recommendation/ranking/train_test.py +76 -31
  927. official/recommendation/stat_utils.py +1 -1
  928. official/recommendation/uplift/__init__.py +1 -1
  929. official/recommendation/uplift/keras_test_case.py +1 -1
  930. official/recommendation/uplift/keys.py +1 -1
  931. official/recommendation/uplift/layers/__init__.py +1 -1
  932. official/recommendation/uplift/layers/encoders/__init__.py +1 -1
  933. official/recommendation/uplift/layers/encoders/concat_features.py +1 -1
  934. official/recommendation/uplift/layers/encoders/concat_features_test.py +1 -1
  935. official/recommendation/uplift/layers/heads/__init__.py +1 -1
  936. official/recommendation/uplift/layers/heads/two_tower_logits_head.py +1 -1
  937. official/recommendation/uplift/layers/heads/two_tower_logits_head_test.py +1 -1
  938. official/recommendation/uplift/layers/uplift_networks/__init__.py +1 -1
  939. official/recommendation/uplift/layers/uplift_networks/base_uplift_networks.py +1 -1
  940. official/recommendation/uplift/layers/uplift_networks/two_tower_output_head.py +1 -1
  941. official/recommendation/uplift/layers/uplift_networks/two_tower_output_head_test.py +1 -1
  942. official/recommendation/uplift/layers/uplift_networks/two_tower_uplift_network.py +1 -1
  943. official/recommendation/uplift/layers/uplift_networks/two_tower_uplift_network_test.py +1 -1
  944. official/recommendation/uplift/losses/__init__.py +1 -1
  945. official/recommendation/uplift/losses/true_logits_loss.py +1 -1
  946. official/recommendation/uplift/losses/true_logits_loss_test.py +1 -1
  947. official/recommendation/uplift/metrics/__init__.py +1 -1
  948. official/recommendation/uplift/metrics/label_mean.py +1 -1
  949. official/recommendation/uplift/metrics/label_mean_test.py +1 -1
  950. official/recommendation/uplift/metrics/label_variance.py +1 -1
  951. official/recommendation/uplift/metrics/label_variance_test.py +1 -1
  952. official/recommendation/uplift/metrics/loss_metric.py +1 -1
  953. official/recommendation/uplift/metrics/loss_metric_test.py +1 -1
  954. official/recommendation/uplift/metrics/metric_configs.py +1 -1
  955. official/recommendation/uplift/metrics/poisson_metrics.py +1 -1
  956. official/recommendation/uplift/metrics/poisson_metrics_test.py +1 -1
  957. official/recommendation/uplift/metrics/sliced_metric.py +1 -1
  958. official/recommendation/uplift/metrics/sliced_metric_test.py +1 -1
  959. official/recommendation/uplift/metrics/treatment_fraction.py +1 -1
  960. official/recommendation/uplift/metrics/treatment_fraction_test.py +1 -1
  961. official/recommendation/uplift/metrics/treatment_sliced_metric.py +1 -1
  962. official/recommendation/uplift/metrics/treatment_sliced_metric_test.py +1 -1
  963. official/recommendation/uplift/metrics/uplift_mean.py +1 -1
  964. official/recommendation/uplift/metrics/uplift_mean_test.py +1 -1
  965. official/recommendation/uplift/metrics/variance.py +1 -1
  966. official/recommendation/uplift/metrics/variance_test.py +12 -10
  967. official/recommendation/uplift/models/__init__.py +1 -1
  968. official/recommendation/uplift/models/two_tower_uplift_model.py +1 -1
  969. official/recommendation/uplift/models/two_tower_uplift_model_test.py +1 -1
  970. official/recommendation/uplift/types.py +1 -1
  971. official/recommendation/uplift/utils.py +3 -3
  972. official/recommendation/uplift/utils_test.py +1 -1
  973. official/utils/__init__.py +1 -1
  974. official/utils/docs/__init__.py +1 -1
  975. official/utils/docs/build_orbit_api_docs.py +1 -1
  976. official/utils/docs/build_tfm_api_docs.py +1 -1
  977. official/utils/flags/__init__.py +1 -1
  978. official/utils/flags/_base.py +1 -1
  979. official/utils/flags/_benchmark.py +1 -1
  980. official/utils/flags/_conventions.py +1 -1
  981. official/utils/flags/_device.py +1 -1
  982. official/utils/flags/_distribution.py +1 -1
  983. official/utils/flags/_misc.py +1 -1
  984. official/utils/flags/_performance.py +1 -1
  985. official/utils/flags/core.py +1 -1
  986. official/utils/flags/flags_test.py +1 -1
  987. official/utils/hyperparams_flags.py +1 -1
  988. official/utils/misc/__init__.py +1 -1
  989. official/utils/misc/keras_utils.py +1 -1
  990. official/utils/misc/model_helpers.py +1 -1
  991. official/utils/misc/model_helpers_test.py +3 -3
  992. official/utils/testing/__init__.py +1 -1
  993. official/utils/testing/integration.py +1 -1
  994. official/utils/testing/mock_task.py +1 -1
  995. official/vision/__init__.py +1 -1
  996. official/vision/configs/__init__.py +1 -1
  997. official/vision/configs/backbones.py +3 -1
  998. official/vision/configs/backbones_3d.py +1 -2
  999. official/vision/configs/common.py +1 -3
  1000. official/vision/configs/decoders.py +1 -3
  1001. official/vision/configs/image_classification.py +1 -1
  1002. official/vision/configs/image_classification_test.py +1 -1
  1003. official/vision/configs/maskrcnn.py +1 -1
  1004. official/vision/configs/maskrcnn_test.py +1 -1
  1005. official/vision/configs/retinanet.py +2 -1
  1006. official/vision/configs/retinanet_test.py +1 -1
  1007. official/vision/configs/semantic_segmentation.py +7 -8
  1008. official/vision/configs/semantic_segmentation_test.py +1 -1
  1009. official/vision/configs/video_classification.py +1 -1
  1010. official/vision/configs/video_classification_test.py +1 -1
  1011. official/vision/data/__init__.py +1 -1
  1012. official/vision/data/create_coco_tf_record.py +1 -1
  1013. official/vision/data/fake_feature_generator.py +5 -2
  1014. official/vision/data/image_utils.py +1 -1
  1015. official/vision/data/image_utils_test.py +1 -1
  1016. official/vision/data/process_coco_few_shot_json_files.py +1 -1
  1017. official/vision/data/tf_example_builder.py +1 -1
  1018. official/vision/data/tf_example_builder_test.py +1 -1
  1019. official/vision/data/tf_example_feature_key.py +1 -1
  1020. official/vision/data/tfrecord_lib.py +1 -1
  1021. official/vision/data/tfrecord_lib_test.py +1 -1
  1022. official/vision/dataloaders/__init__.py +1 -1
  1023. official/vision/dataloaders/classification_input.py +1 -2
  1024. official/vision/dataloaders/decoder.py +1 -1
  1025. official/vision/dataloaders/input_reader.py +1 -1
  1026. official/vision/dataloaders/input_reader_factory.py +1 -1
  1027. official/vision/dataloaders/maskrcnn_input.py +1 -2
  1028. official/vision/dataloaders/parser.py +1 -1
  1029. official/vision/dataloaders/retinanet_input.py +1 -3
  1030. official/vision/dataloaders/segmentation_input.py +9 -4
  1031. official/vision/dataloaders/tf_example_decoder.py +1 -1
  1032. official/vision/dataloaders/tf_example_decoder_test.py +1 -2
  1033. official/vision/dataloaders/tf_example_label_map_decoder.py +1 -2
  1034. official/vision/dataloaders/tf_example_label_map_decoder_test.py +1 -2
  1035. official/vision/dataloaders/tfds_classification_decoders.py +1 -1
  1036. official/vision/dataloaders/tfds_detection_decoders.py +1 -1
  1037. official/vision/dataloaders/tfds_factory.py +1 -1
  1038. official/vision/dataloaders/tfds_factory_test.py +1 -1
  1039. official/vision/dataloaders/tfds_segmentation_decoders.py +1 -1
  1040. official/vision/dataloaders/tfexample_utils.py +1 -1
  1041. official/vision/dataloaders/utils.py +1 -2
  1042. official/vision/dataloaders/utils_test.py +1 -3
  1043. official/vision/dataloaders/video_input.py +1 -1
  1044. official/vision/dataloaders/video_input_test.py +1 -2
  1045. official/vision/evaluation/__init__.py +1 -1
  1046. official/vision/evaluation/coco_evaluator.py +1 -2
  1047. official/vision/evaluation/coco_utils.py +1 -3
  1048. official/vision/evaluation/coco_utils_test.py +1 -1
  1049. official/vision/evaluation/instance_metrics.py +1 -1
  1050. official/vision/evaluation/instance_metrics_test.py +1 -1
  1051. official/vision/evaluation/iou.py +1 -1
  1052. official/vision/evaluation/iou_test.py +1 -1
  1053. official/vision/evaluation/panoptic_quality.py +1 -1
  1054. official/vision/evaluation/panoptic_quality_evaluator.py +1 -1
  1055. official/vision/evaluation/panoptic_quality_evaluator_test.py +1 -1
  1056. official/vision/evaluation/panoptic_quality_test.py +1 -1
  1057. official/vision/evaluation/segmentation_metrics.py +1 -1
  1058. official/vision/evaluation/segmentation_metrics_test.py +1 -1
  1059. official/vision/evaluation/wod_detection_evaluator.py +1 -1
  1060. official/vision/losses/__init__.py +1 -1
  1061. official/vision/losses/focal_loss.py +1 -1
  1062. official/vision/losses/loss_utils.py +1 -1
  1063. official/vision/losses/maskrcnn_losses.py +1 -2
  1064. official/vision/losses/maskrcnn_losses_test.py +1 -1
  1065. official/vision/losses/retinanet_losses.py +1 -2
  1066. official/vision/losses/segmentation_losses.py +1 -1
  1067. official/vision/losses/segmentation_losses_test.py +1 -1
  1068. official/vision/modeling/__init__.py +1 -1
  1069. official/vision/modeling/backbones/__init__.py +1 -1
  1070. official/vision/modeling/backbones/efficientnet.py +1 -3
  1071. official/vision/modeling/backbones/efficientnet_test.py +1 -2
  1072. official/vision/modeling/backbones/factory.py +1 -3
  1073. official/vision/modeling/backbones/factory_test.py +1 -2
  1074. official/vision/modeling/backbones/mobiledet.py +1 -1
  1075. official/vision/modeling/backbones/mobiledet_test.py +1 -1
  1076. official/vision/modeling/backbones/mobilenet.py +73 -3
  1077. official/vision/modeling/backbones/mobilenet_test.py +12 -3
  1078. official/vision/modeling/backbones/resnet.py +1 -2
  1079. official/vision/modeling/backbones/resnet_3d.py +1 -2
  1080. official/vision/modeling/backbones/resnet_3d_test.py +1 -2
  1081. official/vision/modeling/backbones/resnet_deeplab.py +5 -4
  1082. official/vision/modeling/backbones/resnet_deeplab_test.py +21 -10
  1083. official/vision/modeling/backbones/resnet_test.py +1 -2
  1084. official/vision/modeling/backbones/resnet_unet.py +1 -2
  1085. official/vision/modeling/backbones/resnet_unet_test.py +1 -3
  1086. official/vision/modeling/backbones/revnet.py +1 -2
  1087. official/vision/modeling/backbones/revnet_test.py +1 -2
  1088. official/vision/modeling/backbones/spinenet.py +1 -3
  1089. official/vision/modeling/backbones/spinenet_mobile.py +1 -3
  1090. official/vision/modeling/backbones/spinenet_mobile_test.py +1 -2
  1091. official/vision/modeling/backbones/spinenet_test.py +1 -2
  1092. official/vision/modeling/backbones/vit.py +53 -27
  1093. official/vision/modeling/backbones/vit_specs.py +1 -1
  1094. official/vision/modeling/backbones/vit_test.py +12 -1
  1095. official/vision/modeling/classification_model.py +1 -2
  1096. official/vision/modeling/classification_model_test.py +1 -2
  1097. official/vision/modeling/decoders/__init__.py +1 -1
  1098. official/vision/modeling/decoders/aspp.py +1 -3
  1099. official/vision/modeling/decoders/aspp_test.py +1 -2
  1100. official/vision/modeling/decoders/factory.py +1 -3
  1101. official/vision/modeling/decoders/factory_test.py +1 -1
  1102. official/vision/modeling/decoders/fpn.py +1 -2
  1103. official/vision/modeling/decoders/fpn_test.py +1 -2
  1104. official/vision/modeling/decoders/nasfpn.py +1 -3
  1105. official/vision/modeling/decoders/nasfpn_test.py +1 -2
  1106. official/vision/modeling/factory.py +1 -1
  1107. official/vision/modeling/factory_3d.py +1 -2
  1108. official/vision/modeling/factory_test.py +1 -2
  1109. official/vision/modeling/heads/__init__.py +1 -1
  1110. official/vision/modeling/heads/dense_prediction_heads.py +1 -3
  1111. official/vision/modeling/heads/dense_prediction_heads_test.py +1 -3
  1112. official/vision/modeling/heads/instance_heads.py +3 -4
  1113. official/vision/modeling/heads/instance_heads_test.py +1 -2
  1114. official/vision/modeling/heads/segmentation_heads.py +2 -2
  1115. official/vision/modeling/heads/segmentation_heads_test.py +1 -2
  1116. official/vision/modeling/layers/__init__.py +1 -1
  1117. official/vision/modeling/layers/box_sampler.py +1 -2
  1118. official/vision/modeling/layers/deeplab.py +1 -1
  1119. official/vision/modeling/layers/deeplab_test.py +1 -1
  1120. official/vision/modeling/layers/detection_generator.py +1 -3
  1121. official/vision/modeling/layers/detection_generator_test.py +1 -3
  1122. official/vision/modeling/layers/edgetpu.py +1 -1
  1123. official/vision/modeling/layers/edgetpu_test.py +1 -1
  1124. official/vision/modeling/layers/mask_sampler.py +1 -2
  1125. official/vision/modeling/layers/nn_blocks.py +1 -2
  1126. official/vision/modeling/layers/nn_blocks_3d.py +1 -2
  1127. official/vision/modeling/layers/nn_blocks_3d_test.py +1 -2
  1128. official/vision/modeling/layers/nn_blocks_test.py +1 -3
  1129. official/vision/modeling/layers/nn_layers.py +1 -1
  1130. official/vision/modeling/layers/nn_layers_test.py +1 -2
  1131. official/vision/modeling/layers/roi_aligner.py +7 -5
  1132. official/vision/modeling/layers/roi_aligner_test.py +1 -2
  1133. official/vision/modeling/layers/roi_generator.py +1 -2
  1134. official/vision/modeling/layers/roi_sampler.py +1 -2
  1135. official/vision/modeling/maskrcnn_model.py +1 -1
  1136. official/vision/modeling/maskrcnn_model_test.py +1 -2
  1137. official/vision/modeling/models/__init__.py +1 -1
  1138. official/vision/modeling/retinanet_model.py +9 -8
  1139. official/vision/modeling/retinanet_model_test.py +1 -2
  1140. official/vision/modeling/segmentation_model.py +4 -4
  1141. official/vision/modeling/segmentation_model_test.py +1 -1
  1142. official/vision/modeling/video_classification_model.py +1 -1
  1143. official/vision/modeling/video_classification_model_test.py +1 -2
  1144. official/vision/ops/__init__.py +1 -1
  1145. official/vision/ops/anchor.py +1 -3
  1146. official/vision/ops/anchor_generator.py +1 -1
  1147. official/vision/ops/anchor_generator_test.py +1 -1
  1148. official/vision/ops/anchor_test.py +1 -2
  1149. official/vision/ops/augment.py +4 -16
  1150. official/vision/ops/augment_test.py +1 -1
  1151. official/vision/ops/box_matcher.py +1 -1
  1152. official/vision/ops/box_matcher_test.py +1 -1
  1153. official/vision/ops/box_ops.py +1 -2
  1154. official/vision/ops/iou_similarity.py +1 -1
  1155. official/vision/ops/iou_similarity_test.py +1 -1
  1156. official/vision/ops/mask_ops.py +1 -3
  1157. official/vision/ops/mask_ops_test.py +1 -2
  1158. official/vision/ops/nms.py +1 -2
  1159. official/vision/ops/preprocess_ops.py +40 -11
  1160. official/vision/ops/preprocess_ops_3d.py +6 -3
  1161. official/vision/ops/preprocess_ops_3d_test.py +1 -1
  1162. official/vision/ops/preprocess_ops_test.py +13 -7
  1163. official/vision/ops/sampling_ops.py +1 -2
  1164. official/vision/ops/spatial_transform_ops.py +1 -1
  1165. official/vision/ops/target_gather.py +1 -1
  1166. official/vision/ops/target_gather_test.py +1 -1
  1167. official/vision/registry_imports.py +1 -1
  1168. official/vision/serving/__init__.py +1 -1
  1169. official/vision/serving/detection.py +21 -1
  1170. official/vision/serving/detection_test.py +39 -1
  1171. official/vision/serving/export_base.py +1 -1
  1172. official/vision/serving/export_base_v2.py +1 -1
  1173. official/vision/serving/export_base_v2_test.py +1 -1
  1174. official/vision/serving/export_module_factory.py +1 -1
  1175. official/vision/serving/export_module_factory_test.py +1 -1
  1176. official/vision/serving/export_saved_model.py +1 -1
  1177. official/vision/serving/export_saved_model_lib.py +1 -1
  1178. official/vision/serving/export_saved_model_lib_test.py +1 -1
  1179. official/vision/serving/export_saved_model_lib_v2.py +1 -1
  1180. official/vision/serving/export_tfhub.py +1 -2
  1181. official/vision/serving/export_tfhub_lib.py +1 -3
  1182. official/vision/serving/export_tflite.py +1 -1
  1183. official/vision/serving/export_tflite_lib.py +1 -1
  1184. official/vision/serving/export_utils.py +1 -1
  1185. official/vision/serving/image_classification.py +1 -1
  1186. official/vision/serving/image_classification_test.py +1 -1
  1187. official/vision/serving/semantic_segmentation.py +6 -3
  1188. official/vision/serving/semantic_segmentation_test.py +71 -7
  1189. official/vision/serving/video_classification.py +1 -1
  1190. official/vision/serving/video_classification_test.py +1 -1
  1191. official/vision/tasks/__init__.py +1 -1
  1192. official/vision/tasks/image_classification.py +1 -1
  1193. official/vision/tasks/maskrcnn.py +1 -1
  1194. official/vision/tasks/retinanet.py +1 -1
  1195. official/vision/tasks/semantic_segmentation.py +1 -1
  1196. official/vision/tasks/video_classification.py +1 -1
  1197. official/vision/train.py +1 -1
  1198. official/vision/train_spatial_partitioning.py +1 -1
  1199. official/vision/utils/__init__.py +1 -1
  1200. official/vision/utils/object_detection/__init__.py +1 -1
  1201. official/vision/utils/object_detection/argmax_matcher.py +1 -1
  1202. official/vision/utils/object_detection/balanced_positive_negative_sampler.py +1 -1
  1203. official/vision/utils/object_detection/box_coder.py +1 -1
  1204. official/vision/utils/object_detection/box_list.py +1 -1
  1205. official/vision/utils/object_detection/box_list_ops.py +1 -1
  1206. official/vision/utils/object_detection/faster_rcnn_box_coder.py +1 -1
  1207. official/vision/utils/object_detection/matcher.py +1 -1
  1208. official/vision/utils/object_detection/minibatch_sampler.py +1 -1
  1209. official/vision/utils/object_detection/ops.py +1 -1
  1210. official/vision/utils/object_detection/preprocessor.py +1 -1
  1211. official/vision/utils/object_detection/region_similarity_calculator.py +1 -1
  1212. official/vision/utils/object_detection/shape_utils.py +1 -1
  1213. official/vision/utils/object_detection/target_assigner.py +1 -1
  1214. official/vision/utils/object_detection/visualization_utils.py +6 -1
  1215. official/vision/utils/ops_test.py +1 -1
  1216. official/vision/utils/summary_manager.py +1 -1
  1217. orbit/__init__.py +1 -1
  1218. orbit/actions/__init__.py +1 -1
  1219. orbit/actions/conditional_action.py +3 -2
  1220. orbit/actions/conditional_action_test.py +1 -1
  1221. orbit/actions/export_saved_model.py +1 -1
  1222. orbit/actions/export_saved_model_test.py +1 -1
  1223. orbit/actions/new_best_metric.py +2 -2
  1224. orbit/actions/new_best_metric_test.py +2 -2
  1225. orbit/actions/save_checkpoint_if_preempted.py +1 -1
  1226. orbit/controller.py +1 -1
  1227. orbit/controller_test.py +1 -1
  1228. orbit/examples/__init__.py +1 -1
  1229. orbit/examples/single_task/__init__.py +1 -1
  1230. orbit/examples/single_task/single_task_evaluator.py +1 -1
  1231. orbit/examples/single_task/single_task_evaluator_test.py +1 -1
  1232. orbit/examples/single_task/single_task_trainer.py +1 -1
  1233. orbit/examples/single_task/single_task_trainer_test.py +1 -1
  1234. orbit/runner.py +1 -1
  1235. orbit/standard_runner.py +1 -1
  1236. orbit/standard_runner_test.py +1 -1
  1237. orbit/utils/__init__.py +1 -1
  1238. orbit/utils/common.py +1 -1
  1239. orbit/utils/common_test.py +1 -1
  1240. orbit/utils/epoch_helper.py +1 -1
  1241. orbit/utils/loop_fns.py +7 -2
  1242. orbit/utils/summary_manager.py +1 -1
  1243. orbit/utils/summary_manager_interface.py +1 -1
  1244. orbit/utils/tpu_summaries.py +1 -1
  1245. orbit/utils/tpu_summaries_test.py +1 -1
  1246. tensorflow_models/__init__.py +1 -1
  1247. tensorflow_models/nlp/__init__.py +1 -1
  1248. tensorflow_models/tensorflow_models_test.py +1 -1
  1249. tensorflow_models/uplift/__init__.py +1 -1
  1250. tensorflow_models/vision/__init__.py +1 -1
  1251. {tf_models_nightly-2.17.0.dev20240617.dist-info → tf_models_nightly-2.20.0.dev20251205.dist-info}/METADATA +1 -1
  1252. tf_models_nightly-2.20.0.dev20251205.dist-info/RECORD +1256 -0
  1253. tf_models_nightly-2.17.0.dev20240617.dist-info/RECORD +0 -1220
  1254. {tf_models_nightly-2.17.0.dev20240617.dist-info → tf_models_nightly-2.20.0.dev20251205.dist-info}/AUTHORS +0 -0
  1255. {tf_models_nightly-2.17.0.dev20240617.dist-info → tf_models_nightly-2.20.0.dev20251205.dist-info}/LICENSE +0 -0
  1256. {tf_models_nightly-2.17.0.dev20240617.dist-info → tf_models_nightly-2.20.0.dev20251205.dist-info}/WHEEL +0 -0
  1257. {tf_models_nightly-2.17.0.dev20240617.dist-info → tf_models_nightly-2.20.0.dev20251205.dist-info}/top_level.txt +0 -0
@@ -1,4 +1,4 @@
1
- # Copyright 2024 The TensorFlow Authors. All Rights Reserved.
1
+ # Copyright 2025 The TensorFlow Authors. All Rights Reserved.
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
@@ -14,7 +14,6 @@
14
14
 
15
15
  """Tests for video classification network."""
16
16
 
17
- # Import libraries
18
17
  from absl.testing import parameterized
19
18
  import numpy as np
20
19
  import tensorflow as tf, tf_keras
@@ -1,4 +1,4 @@
1
- # Copyright 2024 The TensorFlow Authors. All Rights Reserved.
1
+ # Copyright 2025 The TensorFlow Authors. All Rights Reserved.
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
@@ -1,4 +1,4 @@
1
- # Copyright 2024 The TensorFlow Authors. All Rights Reserved.
1
+ # Copyright 2025 The TensorFlow Authors. All Rights Reserved.
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
@@ -18,8 +18,6 @@ import collections
18
18
  import math
19
19
  from typing import Dict, Optional, Tuple
20
20
 
21
- # Import libraries
22
-
23
21
  import tensorflow as tf, tf_keras
24
22
 
25
23
  from official.vision.ops import box_matcher
@@ -1,4 +1,4 @@
1
- # Copyright 2024 The TensorFlow Authors. All Rights Reserved.
1
+ # Copyright 2025 The TensorFlow Authors. All Rights Reserved.
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
@@ -1,4 +1,4 @@
1
- # Copyright 2024 The TensorFlow Authors. All Rights Reserved.
1
+ # Copyright 2025 The TensorFlow Authors. All Rights Reserved.
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
@@ -1,4 +1,4 @@
1
- # Copyright 2024 The TensorFlow Authors. All Rights Reserved.
1
+ # Copyright 2025 The TensorFlow Authors. All Rights Reserved.
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
@@ -14,7 +14,6 @@
14
14
 
15
15
  """Tests for anchor.py."""
16
16
 
17
- # Import libraries
18
17
  from absl.testing import parameterized
19
18
  import numpy as np
20
19
  import tensorflow as tf, tf_keras
@@ -1,4 +1,4 @@
1
- # Copyright 2024 The TensorFlow Authors. All Rights Reserved.
1
+ # Copyright 2025 The TensorFlow Authors. All Rights Reserved.
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
@@ -844,19 +844,7 @@ def color(image: tf.Tensor, factor: float) -> tf.Tensor:
844
844
 
845
845
  def contrast(image: tf.Tensor, factor: float) -> tf.Tensor:
846
846
  """Equivalent of PIL Contrast."""
847
- degenerate = tf.image.rgb_to_grayscale(image)
848
- # Cast before calling tf.histogram.
849
- degenerate = tf.cast(degenerate, tf.int32)
850
-
851
- # Compute the grayscale histogram, then compute the mean pixel value,
852
- # and create a constant image size of that value. Use that as the
853
- # blending degenerate target of the original image.
854
- hist = tf.histogram_fixed_width(degenerate, [0, 255], nbins=256)
855
- mean = tf.reduce_sum(tf.cast(hist, tf.float32)) / 256.0
856
- degenerate = tf.ones_like(degenerate, dtype=tf.float32) * mean
857
- degenerate = tf.clip_by_value(degenerate, 0.0, 255.0)
858
- degenerate = tf.image.grayscale_to_rgb(tf.cast(degenerate, tf.uint8))
859
- return blend(degenerate, image, factor)
847
+ return tf.image.adjust_contrast(image, factor)
860
848
 
861
849
 
862
850
  def brightness(image: tf.Tensor, factor: float) -> tf.Tensor:
@@ -2709,8 +2697,8 @@ class MixupAndCutmix:
2709
2697
 
2710
2698
  @staticmethod
2711
2699
  def _sample_from_beta(alpha, beta, shape):
2712
- sample_alpha = tf.random.gamma(shape, 1., beta=alpha)
2713
- sample_beta = tf.random.gamma(shape, 1., beta=beta)
2700
+ sample_alpha = tf.random.gamma(shape, alpha, beta=1.0)
2701
+ sample_beta = tf.random.gamma(shape, beta, beta=1.0)
2714
2702
  return sample_alpha / (sample_alpha + sample_beta)
2715
2703
 
2716
2704
  def _cutmix(self, images: tf.Tensor,
@@ -1,4 +1,4 @@
1
- # Copyright 2024 The TensorFlow Authors. All Rights Reserved.
1
+ # Copyright 2025 The TensorFlow Authors. All Rights Reserved.
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
@@ -1,4 +1,4 @@
1
- # Copyright 2024 The TensorFlow Authors. All Rights Reserved.
1
+ # Copyright 2025 The TensorFlow Authors. All Rights Reserved.
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
@@ -1,4 +1,4 @@
1
- # Copyright 2024 The TensorFlow Authors. All Rights Reserved.
1
+ # Copyright 2025 The TensorFlow Authors. All Rights Reserved.
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
@@ -1,4 +1,4 @@
1
- # Copyright 2024 The TensorFlow Authors. All Rights Reserved.
1
+ # Copyright 2025 The TensorFlow Authors. All Rights Reserved.
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
@@ -14,7 +14,6 @@
14
14
 
15
15
  """Box related ops."""
16
16
 
17
- # Import libraries
18
17
  import numpy as np
19
18
  import tensorflow as tf, tf_keras
20
19
 
@@ -1,4 +1,4 @@
1
- # Copyright 2024 The TensorFlow Authors. All Rights Reserved.
1
+ # Copyright 2025 The TensorFlow Authors. All Rights Reserved.
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
@@ -1,4 +1,4 @@
1
- # Copyright 2024 The TensorFlow Authors. All Rights Reserved.
1
+ # Copyright 2025 The TensorFlow Authors. All Rights Reserved.
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
@@ -1,4 +1,4 @@
1
- # Copyright 2024 The TensorFlow Authors. All Rights Reserved.
1
+ # Copyright 2025 The TensorFlow Authors. All Rights Reserved.
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
@@ -17,8 +17,6 @@
17
17
  import math
18
18
  from typing import List, Tuple
19
19
 
20
- # Import libraries
21
-
22
20
  import cv2
23
21
  import numpy as np
24
22
  import tensorflow as tf, tf_keras
@@ -1,4 +1,4 @@
1
- # Copyright 2024 The TensorFlow Authors. All Rights Reserved.
1
+ # Copyright 2025 The TensorFlow Authors. All Rights Reserved.
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
@@ -14,7 +14,6 @@
14
14
 
15
15
  """Tests for mask_ops.py."""
16
16
 
17
- # Import libraries
18
17
  import numpy as np
19
18
  import tensorflow as tf, tf_keras
20
19
  from official.vision.ops import mask_ops
@@ -1,4 +1,4 @@
1
- # Copyright 2024 The TensorFlow Authors. All Rights Reserved.
1
+ # Copyright 2025 The TensorFlow Authors. All Rights Reserved.
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
@@ -14,7 +14,6 @@
14
14
 
15
15
  """Tensorflow implementation of non max suppression."""
16
16
 
17
- # Import libraries
18
17
  import tensorflow as tf, tf_keras
19
18
 
20
19
  from official.vision.ops import box_ops
@@ -1,4 +1,4 @@
1
- # Copyright 2024 The TensorFlow Authors. All Rights Reserved.
1
+ # Copyright 2025 The TensorFlow Authors. All Rights Reserved.
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
@@ -82,13 +82,28 @@ def normalize_image(
82
82
  ) -> tf.Tensor:
83
83
  """Normalizes the image to zero mean and unit variance.
84
84
 
85
- If the input image dtype is float, it is expected to either have values in
86
- [0, 1) and offset is MEAN_NORM, or have values in [0, 255] and offset is
87
- MEAN_RGB.
85
+ This function normalizes the input image by subtracting the `offset`
86
+ and dividing by the `scale`.
87
+
88
+ **Important Note about Input Types and Normalization:**
89
+
90
+ * **Integer Images:** If the input `image` is an integer type (e.g., `uint8`),
91
+ the provided `offset` and `scale` values should be already **normalized**
92
+ to the range [0, 1]. This is because the function converts integer images to
93
+ float32 with values in the range [0, 1] before the normalization happens.
94
+
95
+ * **Float Images:** If the input `image` is a float type (e.g., `float32`),
96
+ the `offset` and `scale` values should be in the **same range** as the
97
+ image data.
98
+ - If the image has values in [0, 1], the `offset` and `scale` should
99
+ also be in [0, 1].
100
+ - If the image has values in [0, 255], the `offset` and `scale` should
101
+ also be in [0, 255].
88
102
 
89
103
  Args:
90
- image: A tf.Tensor in either (1) float dtype with values in range [0, 1) or
91
- [0, 255], or (2) int type with values in range [0, 255].
104
+ image: A `tf.Tensor` in either:
105
+ (1) float dtype with values in range [0, 1) or [0, 255], or
106
+ (2) int type with values in range [0, 255].
92
107
  offset: A tuple of mean values to be subtracted from the image.
93
108
  scale: A tuple of normalization factors.
94
109
 
@@ -182,7 +197,7 @@ def resize_and_crop_image(
182
197
  2. Pad the rescaled image to the padded_size.
183
198
 
184
199
  Args:
185
- image: a `Tensor` of shape [height, width, 3] representing an image.
200
+ image: a `Tensor` of shape [height, width, c] representing an image.
186
201
  desired_size: a `Tensor` or `int` list/tuple of two elements representing
187
202
  [height, width] of the desired actual output image size.
188
203
  padded_size: a `Tensor` or `int` list/tuple of two elements representing
@@ -201,7 +216,7 @@ def resize_and_crop_image(
201
216
  behaviour is to place it at left top corner.
202
217
 
203
218
  Returns:
204
- output_image: `Tensor` of shape [height, width, 3] where [height, width]
219
+ output_image: `Tensor` of shape [height, width, c] where [height, width]
205
220
  equals to `output_size`.
206
221
  image_info: a 2D `Tensor` that encodes the information of the image and the
207
222
  applied preprocessing. It is in the format of
@@ -780,13 +795,27 @@ def horizontal_flip_masks(masks):
780
795
  return masks[:, :, ::-1]
781
796
 
782
797
 
798
+ def vertical_flip_image(image):
799
+ """Flips image vertically."""
800
+ return tf.image.flip_up_down(image)
801
+
802
+
803
+ def vertical_flip_masks(masks):
804
+ """Flips masks vertically. Expects rank-3 input dimensions."""
805
+ # For masks shape of [h, w, 1].
806
+ if masks.shape[-1] == 1:
807
+ return masks[::-1, :, :]
808
+ else:
809
+ return masks[:, ::-1, :]
810
+
811
+
783
812
  def random_horizontal_flip(
784
813
  image, normalized_boxes=None, masks=None, seed=1, prob=0.5
785
814
  ):
786
815
  """Randomly flips input image and bounding boxes and/or masks horizontally.
787
816
 
788
817
  Expects input tensors without the batch dimension; i.e. for RGB image assume
789
- rank-3 input like [h, w, 3], for masks assume either [h, w, 1] or [1, h, w].
818
+ rank-3 input like [h, w, c], for masks assume either [h, w, 1] or [1, h, w].
790
819
 
791
820
  Args:
792
821
  image: `tf.Tensor`, the image to apply the random flip, [h, w, channels].
@@ -885,7 +914,7 @@ def random_vertical_flip(
885
914
  do_flip = tf.less(tf.random.uniform([], seed=seed), prob)
886
915
 
887
916
  image = tf.cond(
888
- do_flip, lambda: tf.image.flip_up_down(image), lambda: image
917
+ do_flip, lambda: vertical_flip_image(image), lambda: image
889
918
  )
890
919
 
891
920
  if normalized_boxes is not None:
@@ -898,7 +927,7 @@ def random_vertical_flip(
898
927
  if masks is not None:
899
928
  masks = tf.cond(
900
929
  do_flip,
901
- lambda: tf.image.flip_up_down(masks[..., None])[..., 0],
930
+ lambda: vertical_flip_masks(masks),
902
931
  lambda: masks,
903
932
  )
904
933
 
@@ -1,4 +1,4 @@
1
- # Copyright 2024 The TensorFlow Authors. All Rights Reserved.
1
+ # Copyright 2025 The TensorFlow Authors. All Rights Reserved.
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
@@ -339,7 +339,8 @@ def resize_smallest(frames: tf.Tensor, min_resize: int) -> tf.Tensor:
339
339
  def random_crop_resize(frames: tf.Tensor, output_h: int, output_w: int,
340
340
  num_frames: int, num_channels: int,
341
341
  aspect_ratio: Tuple[float, float],
342
- area_range: Tuple[float, float]) -> tf.Tensor:
342
+ area_range: Tuple[float, float],
343
+ seed: int = 0) -> tf.Tensor:
343
344
  """First crops clip with jittering and then resizes to (output_h, output_w).
344
345
 
345
346
  Args:
@@ -350,6 +351,7 @@ def random_crop_resize(frames: tf.Tensor, output_h: int, output_w: int,
350
351
  num_channels: Number of channels of the clip.
351
352
  aspect_ratio: Float tuple with the aspect range for cropping.
352
353
  area_range: Float tuple with the area range for cropping.
354
+ seed: A seed to use for the random sampling.
353
355
 
354
356
  Returns:
355
357
  A Tensor of shape [timesteps, output_h, output_w, channels] of type
@@ -367,7 +369,8 @@ def random_crop_resize(frames: tf.Tensor, output_h: int, output_w: int,
367
369
  aspect_ratio_range=aspect_ratio,
368
370
  area_range=area_range,
369
371
  max_attempts=100,
370
- use_image_if_no_bounding_boxes=True)
372
+ use_image_if_no_bounding_boxes=True,
373
+ seed=seed)
371
374
  bbox_begin, bbox_size, _ = sample_distorted_bbox
372
375
  offset_y, offset_x, _ = tf.unstack(bbox_begin)
373
376
  target_height, target_width, _ = tf.unstack(bbox_size)
@@ -1,4 +1,4 @@
1
- # Copyright 2024 The TensorFlow Authors. All Rights Reserved.
1
+ # Copyright 2025 The TensorFlow Authors. All Rights Reserved.
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
@@ -1,4 +1,4 @@
1
- # Copyright 2024 The TensorFlow Authors. All Rights Reserved.
1
+ # Copyright 2025 The TensorFlow Authors. All Rights Reserved.
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
@@ -16,8 +16,6 @@
16
16
 
17
17
  import io
18
18
 
19
- # Import libraries
20
-
21
19
  from absl.testing import parameterized
22
20
  import numpy as np
23
21
  from PIL import Image
@@ -80,11 +78,19 @@ class InputUtilsTest(parameterized.TestCase, tf.test.TestCase):
80
78
  aug_scale_max=2.0,
81
79
  output_scales=(20 / 100, 10 / 200),
82
80
  ),
81
+ dict(
82
+ testcase_name='no_jittering_with_4_channels',
83
+ input_size=(100, 200),
84
+ desired_size=(20, 10),
85
+ aug_scale_max=1.0,
86
+ output_scales=(20 / 100, 10 / 200),
87
+ channels=4,
88
+ ),
83
89
  )
84
90
  def test_resize_and_crop_image_not_keep_aspect_ratio(
85
- self, input_size, desired_size, aug_scale_max, output_scales
91
+ self, input_size, desired_size, aug_scale_max, output_scales, channels=3
86
92
  ):
87
- image = tf.convert_to_tensor(np.random.rand(*input_size, 3))
93
+ image = tf.convert_to_tensor(np.random.rand(*input_size, channels))
88
94
 
89
95
  resized_image, image_info = preprocess_ops.resize_and_crop_image(
90
96
  image,
@@ -95,7 +101,7 @@ class InputUtilsTest(parameterized.TestCase, tf.test.TestCase):
95
101
  )
96
102
  resized_image_shape = tf.shape(resized_image)
97
103
 
98
- self.assertAllEqual([*desired_size, 3], resized_image_shape.numpy())
104
+ self.assertAllEqual([*desired_size, channels], resized_image_shape.numpy())
99
105
  if aug_scale_max == 1:
100
106
  self.assertNDArrayNear(
101
107
  [input_size, desired_size, output_scales, [0.0, 0.0]],
@@ -108,7 +114,7 @@ class InputUtilsTest(parameterized.TestCase, tf.test.TestCase):
108
114
  (100, 256, 128, 256, 32, 1.0, 1.0, 128, 256),
109
115
  (200, 512, 200, 128, 32, 0.25, 0.25, 224, 128),
110
116
  )
111
- def test_resize_and_crop_image_rectangluar_case(
117
+ def test_resize_and_crop_image_rectangular_case(
112
118
  self,
113
119
  input_height,
114
120
  input_width,
@@ -1,4 +1,4 @@
1
- # Copyright 2024 The TensorFlow Authors. All Rights Reserved.
1
+ # Copyright 2025 The TensorFlow Authors. All Rights Reserved.
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
@@ -31,7 +31,6 @@ when number of examples set to True in indicator is less than batch_size.
31
31
  This is originally implemented in TensorFlow Object Detection API.
32
32
  """
33
33
 
34
- # Import libraries
35
34
  import tensorflow as tf, tf_keras
36
35
 
37
36
 
@@ -1,4 +1,4 @@
1
- # Copyright 2024 The TensorFlow Authors. All Rights Reserved.
1
+ # Copyright 2025 The TensorFlow Authors. All Rights Reserved.
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
@@ -1,4 +1,4 @@
1
- # Copyright 2024 The TensorFlow Authors. All Rights Reserved.
1
+ # Copyright 2025 The TensorFlow Authors. All Rights Reserved.
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
@@ -1,4 +1,4 @@
1
- # Copyright 2024 The TensorFlow Authors. All Rights Reserved.
1
+ # Copyright 2025 The TensorFlow Authors. All Rights Reserved.
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
@@ -1,4 +1,4 @@
1
- # Copyright 2024 The TensorFlow Authors. All Rights Reserved.
1
+ # Copyright 2025 The TensorFlow Authors. All Rights Reserved.
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
@@ -1,4 +1,4 @@
1
- # Copyright 2024 The TensorFlow Authors. All Rights Reserved.
1
+ # Copyright 2025 The TensorFlow Authors. All Rights Reserved.
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
@@ -1,4 +1,4 @@
1
- # Copyright 2024 The TensorFlow Authors. All Rights Reserved.
1
+ # Copyright 2025 The TensorFlow Authors. All Rights Reserved.
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
@@ -136,6 +136,14 @@ class DetectionModule(export_base.ExportModule):
136
136
 
137
137
  return detections_dict
138
138
 
139
+ def _flatten_output(self, feature_map, feature_size=4):
140
+ flatten_outputs = []
141
+ for level_output in feature_map.values():
142
+ flatten_outputs.append(
143
+ tf.reshape(level_output, (self._batch_size, -1, feature_size))
144
+ )
145
+ return tf.concat(flatten_outputs, axis=1)
146
+
139
147
  def preprocess(
140
148
  self, images: tf.Tensor
141
149
  ) -> Tuple[tf.Tensor, Mapping[str, tf.Tensor], tf.Tensor]:
@@ -271,6 +279,18 @@ class DetectionModule(export_base.ExportModule):
271
279
  final_outputs['detection_outer_boxes'] = detections[
272
280
  'detection_outer_boxes'
273
281
  ]
282
+ elif (
283
+ isinstance(self.params.task.model, configs.retinanet.RetinaNet)
284
+ and not self.params.task.model.detection_generator.decode_boxes
285
+ ):
286
+ final_outputs = {
287
+ 'raw_boxes': self._flatten_output(detections['box_outputs'], 4),
288
+ 'raw_scores': tf.sigmoid(
289
+ self._flatten_output(
290
+ detections['cls_outputs'], self.params.task.model.num_classes
291
+ )
292
+ ),
293
+ }
274
294
  else:
275
295
  # For RetinaNet model, apply export_config.
276
296
  if isinstance(self.params.task.model, configs.retinanet.RetinaNet):
@@ -1,4 +1,4 @@
1
- # Copyright 2024 The TensorFlow Authors. All Rights Reserved.
1
+ # Copyright 2025 The TensorFlow Authors. All Rights Reserved.
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
@@ -38,6 +38,7 @@ class DetectionExportTest(tf.test.TestCase, parameterized.TestCase):
38
38
  normalized_coordinates=False,
39
39
  nms_version='batched',
40
40
  output_intermediate_features=False,
41
+ decode_boxes=True,
41
42
  ):
42
43
  params = exp_factory.get_exp_config(experiment_name)
43
44
  params.task.model.outer_boxes_scale = outer_boxes_scale
@@ -48,6 +49,8 @@ class DetectionExportTest(tf.test.TestCase, parameterized.TestCase):
48
49
  params.task.model.detection_generator.nms_version = nms_version
49
50
  if output_intermediate_features:
50
51
  params.task.export_config.output_intermediate_features = True
52
+ if not decode_boxes:
53
+ params.task.model.detection_generator.decode_boxes = False
51
54
  detection_module = detection.DetectionModule(
52
55
  params,
53
56
  batch_size=1,
@@ -232,6 +235,41 @@ class DetectionExportTest(tf.test.TestCase, parameterized.TestCase):
232
235
  max_values.numpy(), tf.ones_like(max_values).numpy()
233
236
  )
234
237
 
238
+ @parameterized.parameters(
239
+ 'retinanet_mobile_coco',
240
+ 'retinanet_spinenet_coco',
241
+ )
242
+ def test_export_without_decoding_boxes(
243
+ self,
244
+ experiment_name,
245
+ ):
246
+ input_type = 'tflite'
247
+ tmp_dir = self.get_temp_dir()
248
+ module = self._get_detection_module(
249
+ experiment_name,
250
+ input_type=input_type,
251
+ apply_nms=False,
252
+ decode_boxes=False,
253
+ )
254
+
255
+ self._export_from_module(module, input_type, tmp_dir)
256
+
257
+ imported = tf.saved_model.load(tmp_dir)
258
+ detection_fn = imported.signatures['serving_default']
259
+
260
+ images = self._get_dummy_input(
261
+ input_type, batch_size=1, image_size=(640, 640)
262
+ )
263
+ outputs = detection_fn(tf.constant(images))
264
+
265
+ self.assertContainsSubset(
266
+ {
267
+ 'raw_boxes',
268
+ 'raw_scores',
269
+ },
270
+ outputs.keys(),
271
+ )
272
+
235
273
 
236
274
  if __name__ == '__main__':
237
275
  tf.test.main()
@@ -1,4 +1,4 @@
1
- # Copyright 2024 The TensorFlow Authors. All Rights Reserved.
1
+ # Copyright 2025 The TensorFlow Authors. All Rights Reserved.
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
@@ -1,4 +1,4 @@
1
- # Copyright 2024 The TensorFlow Authors. All Rights Reserved.
1
+ # Copyright 2025 The TensorFlow Authors. All Rights Reserved.
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
@@ -1,4 +1,4 @@
1
- # Copyright 2024 The TensorFlow Authors. All Rights Reserved.
1
+ # Copyright 2025 The TensorFlow Authors. All Rights Reserved.
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
@@ -1,4 +1,4 @@
1
- # Copyright 2024 The TensorFlow Authors. All Rights Reserved.
1
+ # Copyright 2025 The TensorFlow Authors. All Rights Reserved.
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
@@ -1,4 +1,4 @@
1
- # Copyright 2024 The TensorFlow Authors. All Rights Reserved.
1
+ # Copyright 2025 The TensorFlow Authors. All Rights Reserved.
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
@@ -1,4 +1,4 @@
1
- # Copyright 2024 The TensorFlow Authors. All Rights Reserved.
1
+ # Copyright 2025 The TensorFlow Authors. All Rights Reserved.
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
@@ -1,4 +1,4 @@
1
- # Copyright 2024 The TensorFlow Authors. All Rights Reserved.
1
+ # Copyright 2025 The TensorFlow Authors. All Rights Reserved.
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
@@ -1,4 +1,4 @@
1
- # Copyright 2024 The TensorFlow Authors. All Rights Reserved.
1
+ # Copyright 2025 The TensorFlow Authors. All Rights Reserved.
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
@@ -1,4 +1,4 @@
1
- # Copyright 2024 The TensorFlow Authors. All Rights Reserved.
1
+ # Copyright 2025 The TensorFlow Authors. All Rights Reserved.
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
@@ -1,4 +1,4 @@
1
- # Copyright 2024 The TensorFlow Authors. All Rights Reserved.
1
+ # Copyright 2025 The TensorFlow Authors. All Rights Reserved.
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
@@ -14,7 +14,6 @@
14
14
 
15
15
  """A script to export the image classification as a TF-Hub SavedModel."""
16
16
 
17
- # Import libraries
18
17
  from absl import app
19
18
  from absl import flags
20
19
 
@@ -1,4 +1,4 @@
1
- # Copyright 2024 The TensorFlow Authors. All Rights Reserved.
1
+ # Copyright 2025 The TensorFlow Authors. All Rights Reserved.
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
@@ -15,8 +15,6 @@
15
15
  """A script to export a TF-Hub SavedModel."""
16
16
  from typing import List, Optional
17
17
 
18
- # Import libraries
19
-
20
18
  import tensorflow as tf, tf_keras
21
19
 
22
20
  from official.core import config_definitions as cfg