roboflow-workflows 0.1.0__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 (834) hide show
  1. roboflow_workflows/__init__.py +0 -0
  2. roboflow_workflows/_compat_names.py +52 -0
  3. roboflow_workflows/configuration.py +342 -0
  4. roboflow_workflows/core_steps/__init__.py +0 -0
  5. roboflow_workflows/core_steps/analytics/__init__.py +0 -0
  6. roboflow_workflows/core_steps/analytics/_zone_geometry.py +234 -0
  7. roboflow_workflows/core_steps/analytics/data_aggregator/__init__.py +0 -0
  8. roboflow_workflows/core_steps/analytics/data_aggregator/v1.py +493 -0
  9. roboflow_workflows/core_steps/analytics/detection_event_log/__init__.py +0 -0
  10. roboflow_workflows/core_steps/analytics/detection_event_log/v1.py +478 -0
  11. roboflow_workflows/core_steps/analytics/detection_event_log/v1_tensor.py +482 -0
  12. roboflow_workflows/core_steps/analytics/line_counter/__init__.py +0 -0
  13. roboflow_workflows/core_steps/analytics/line_counter/v1.py +203 -0
  14. roboflow_workflows/core_steps/analytics/line_counter/v1_tensor.py +221 -0
  15. roboflow_workflows/core_steps/analytics/line_counter/v2.py +250 -0
  16. roboflow_workflows/core_steps/analytics/line_counter/v2_tensor.py +280 -0
  17. roboflow_workflows/core_steps/analytics/overlap/__init__.py +0 -0
  18. roboflow_workflows/core_steps/analytics/overlap/v1.py +178 -0
  19. roboflow_workflows/core_steps/analytics/overlap/v1_tensor.py +191 -0
  20. roboflow_workflows/core_steps/analytics/path_deviation/__init__.py +0 -0
  21. roboflow_workflows/core_steps/analytics/path_deviation/v1.py +252 -0
  22. roboflow_workflows/core_steps/analytics/path_deviation/v1_tensor.py +271 -0
  23. roboflow_workflows/core_steps/analytics/path_deviation/v2.py +264 -0
  24. roboflow_workflows/core_steps/analytics/path_deviation/v2_tensor.py +284 -0
  25. roboflow_workflows/core_steps/analytics/time_in_zone/__init__.py +0 -0
  26. roboflow_workflows/core_steps/analytics/time_in_zone/v1.py +272 -0
  27. roboflow_workflows/core_steps/analytics/time_in_zone/v1_tensor.py +300 -0
  28. roboflow_workflows/core_steps/analytics/time_in_zone/v2.py +279 -0
  29. roboflow_workflows/core_steps/analytics/time_in_zone/v2_tensor.py +307 -0
  30. roboflow_workflows/core_steps/analytics/time_in_zone/v3.py +384 -0
  31. roboflow_workflows/core_steps/analytics/time_in_zone/v3_tensor.py +410 -0
  32. roboflow_workflows/core_steps/analytics/velocity/__init__.py +0 -0
  33. roboflow_workflows/core_steps/analytics/velocity/v1.py +289 -0
  34. roboflow_workflows/core_steps/analytics/velocity/v1_tensor.py +392 -0
  35. roboflow_workflows/core_steps/cache/__init__.py +0 -0
  36. roboflow_workflows/core_steps/cache/cache_get/__init__.py +0 -0
  37. roboflow_workflows/core_steps/cache/cache_get/v1.py +169 -0
  38. roboflow_workflows/core_steps/cache/cache_set/__init__.py +0 -0
  39. roboflow_workflows/core_steps/cache/cache_set/v1.py +180 -0
  40. roboflow_workflows/core_steps/cache/common.py +24 -0
  41. roboflow_workflows/core_steps/cache/memory_cache.py +43 -0
  42. roboflow_workflows/core_steps/classical_cv/__init__.py +0 -0
  43. roboflow_workflows/core_steps/classical_cv/auto_rotate_on_edges/__init__.py +0 -0
  44. roboflow_workflows/core_steps/classical_cv/auto_rotate_on_edges/v1.py +421 -0
  45. roboflow_workflows/core_steps/classical_cv/background_subtraction/__init__.py +0 -0
  46. roboflow_workflows/core_steps/classical_cv/background_subtraction/v1.py +159 -0
  47. roboflow_workflows/core_steps/classical_cv/camera_focus/__init__.py +0 -0
  48. roboflow_workflows/core_steps/classical_cv/camera_focus/v1.py +243 -0
  49. roboflow_workflows/core_steps/classical_cv/camera_focus/v2.py +1048 -0
  50. roboflow_workflows/core_steps/classical_cv/contours/__init__.py +0 -0
  51. roboflow_workflows/core_steps/classical_cv/contours/v1.py +195 -0
  52. roboflow_workflows/core_steps/classical_cv/contrast_enhancement/__init__.py +1 -0
  53. roboflow_workflows/core_steps/classical_cv/contrast_enhancement/v1.py +292 -0
  54. roboflow_workflows/core_steps/classical_cv/contrast_enhancement/v1_tensor.py +115 -0
  55. roboflow_workflows/core_steps/classical_cv/contrast_equalization/__init__.py +0 -0
  56. roboflow_workflows/core_steps/classical_cv/contrast_equalization/v1.py +177 -0
  57. roboflow_workflows/core_steps/classical_cv/contrast_equalization/v1_tensor.py +124 -0
  58. roboflow_workflows/core_steps/classical_cv/convert_grayscale/__init__.py +0 -0
  59. roboflow_workflows/core_steps/classical_cv/convert_grayscale/v1.py +129 -0
  60. roboflow_workflows/core_steps/classical_cv/convert_grayscale/v1_tensor.py +70 -0
  61. roboflow_workflows/core_steps/classical_cv/detections_nearest_neighbor/__init__.py +0 -0
  62. roboflow_workflows/core_steps/classical_cv/detections_nearest_neighbor/v1.py +440 -0
  63. roboflow_workflows/core_steps/classical_cv/detections_nearest_neighbor/v1_tensor.py +373 -0
  64. roboflow_workflows/core_steps/classical_cv/distance_measurement/__init__.py +0 -0
  65. roboflow_workflows/core_steps/classical_cv/distance_measurement/v1.py +468 -0
  66. roboflow_workflows/core_steps/classical_cv/distance_measurement/v1_tensor.py +516 -0
  67. roboflow_workflows/core_steps/classical_cv/dominant_color/__init__.py +0 -0
  68. roboflow_workflows/core_steps/classical_cv/dominant_color/v1.py +206 -0
  69. roboflow_workflows/core_steps/classical_cv/dominant_color/v1_tensor.py +70 -0
  70. roboflow_workflows/core_steps/classical_cv/image_blur/__init__.py +0 -0
  71. roboflow_workflows/core_steps/classical_cv/image_blur/v1.py +206 -0
  72. roboflow_workflows/core_steps/classical_cv/image_blur/v1_tensor.py +180 -0
  73. roboflow_workflows/core_steps/classical_cv/image_preprocessing/__init__.py +0 -0
  74. roboflow_workflows/core_steps/classical_cv/image_preprocessing/v1.py +286 -0
  75. roboflow_workflows/core_steps/classical_cv/image_preprocessing/v1_tensor.py +217 -0
  76. roboflow_workflows/core_steps/classical_cv/mask_area_measurement/__init__.py +0 -0
  77. roboflow_workflows/core_steps/classical_cv/mask_area_measurement/v1.py +181 -0
  78. roboflow_workflows/core_steps/classical_cv/mask_area_measurement/v1_tensor.py +201 -0
  79. roboflow_workflows/core_steps/classical_cv/mask_edge_snap/__init__.py +0 -0
  80. roboflow_workflows/core_steps/classical_cv/mask_edge_snap/v1.py +578 -0
  81. roboflow_workflows/core_steps/classical_cv/mask_edge_snap/v1_tensor.py +625 -0
  82. roboflow_workflows/core_steps/classical_cv/morphological_transformation/__init__.py +0 -0
  83. roboflow_workflows/core_steps/classical_cv/morphological_transformation/v1.py +230 -0
  84. roboflow_workflows/core_steps/classical_cv/morphological_transformation/v2.py +202 -0
  85. roboflow_workflows/core_steps/classical_cv/motion_detection/__init__.py +0 -0
  86. roboflow_workflows/core_steps/classical_cv/motion_detection/v1.py +379 -0
  87. roboflow_workflows/core_steps/classical_cv/motion_detection/v1_tensor.py +422 -0
  88. roboflow_workflows/core_steps/classical_cv/pixel_color_count/__init__.py +0 -0
  89. roboflow_workflows/core_steps/classical_cv/pixel_color_count/v1.py +206 -0
  90. roboflow_workflows/core_steps/classical_cv/pixel_color_count/v1_tensor.py +96 -0
  91. roboflow_workflows/core_steps/classical_cv/sift/__init__.py +0 -0
  92. roboflow_workflows/core_steps/classical_cv/sift/v1.py +170 -0
  93. roboflow_workflows/core_steps/classical_cv/sift_comparison/__init__.py +0 -0
  94. roboflow_workflows/core_steps/classical_cv/sift_comparison/v1.py +157 -0
  95. roboflow_workflows/core_steps/classical_cv/sift_comparison/v2.py +346 -0
  96. roboflow_workflows/core_steps/classical_cv/size_measurement/__init__.py +0 -0
  97. roboflow_workflows/core_steps/classical_cv/size_measurement/v1.py +307 -0
  98. roboflow_workflows/core_steps/classical_cv/size_measurement/v1_tensor.py +314 -0
  99. roboflow_workflows/core_steps/classical_cv/template_matching/__init__.py +0 -0
  100. roboflow_workflows/core_steps/classical_cv/template_matching/v1.py +236 -0
  101. roboflow_workflows/core_steps/classical_cv/template_matching/v1_tensor.py +269 -0
  102. roboflow_workflows/core_steps/classical_cv/threshold/__init__.py +0 -0
  103. roboflow_workflows/core_steps/classical_cv/threshold/v1.py +271 -0
  104. roboflow_workflows/core_steps/classical_cv/threshold/v1_tensor.py +261 -0
  105. roboflow_workflows/core_steps/common/__init__.py +0 -0
  106. roboflow_workflows/core_steps/common/deserializers.py +705 -0
  107. roboflow_workflows/core_steps/common/deserializers_tensor.py +689 -0
  108. roboflow_workflows/core_steps/common/entities.py +14 -0
  109. roboflow_workflows/core_steps/common/inference_response_entities.py +105 -0
  110. roboflow_workflows/core_steps/common/keypoints.py +60 -0
  111. roboflow_workflows/core_steps/common/openrouter.py +1083 -0
  112. roboflow_workflows/core_steps/common/operators.py +39 -0
  113. roboflow_workflows/core_steps/common/query_language/__init__.py +0 -0
  114. roboflow_workflows/core_steps/common/query_language/entities/__init__.py +0 -0
  115. roboflow_workflows/core_steps/common/query_language/entities/enums.py +122 -0
  116. roboflow_workflows/core_steps/common/query_language/entities/introspection.py +33 -0
  117. roboflow_workflows/core_steps/common/query_language/entities/operations.py +1063 -0
  118. roboflow_workflows/core_steps/common/query_language/entities/types.py +4 -0
  119. roboflow_workflows/core_steps/common/query_language/errors.py +25 -0
  120. roboflow_workflows/core_steps/common/query_language/evaluation_engine/__init__.py +0 -0
  121. roboflow_workflows/core_steps/common/query_language/evaluation_engine/core.py +310 -0
  122. roboflow_workflows/core_steps/common/query_language/evaluation_engine/detection/__init__.py +0 -0
  123. roboflow_workflows/core_steps/common/query_language/evaluation_engine/detection/geometry.py +14 -0
  124. roboflow_workflows/core_steps/common/query_language/introspection/__init__.py +0 -0
  125. roboflow_workflows/core_steps/common/query_language/introspection/core.py +130 -0
  126. roboflow_workflows/core_steps/common/query_language/operations/__init__.py +0 -0
  127. roboflow_workflows/core_steps/common/query_language/operations/booleans/__init__.py +0 -0
  128. roboflow_workflows/core_steps/common/query_language/operations/booleans/base.py +17 -0
  129. roboflow_workflows/core_steps/common/query_language/operations/classification_results/__init__.py +0 -0
  130. roboflow_workflows/core_steps/common/query_language/operations/classification_results/base.py +382 -0
  131. roboflow_workflows/core_steps/common/query_language/operations/core.py +219 -0
  132. roboflow_workflows/core_steps/common/query_language/operations/detection/__init__.py +0 -0
  133. roboflow_workflows/core_steps/common/query_language/operations/detection/base.py +253 -0
  134. roboflow_workflows/core_steps/common/query_language/operations/detections/__init__.py +0 -0
  135. roboflow_workflows/core_steps/common/query_language/operations/detections/base.py +1644 -0
  136. roboflow_workflows/core_steps/common/query_language/operations/dictionaries/__init__.py +0 -0
  137. roboflow_workflows/core_steps/common/query_language/operations/dictionaries/base.py +29 -0
  138. roboflow_workflows/core_steps/common/query_language/operations/frame_metadata/__init__.py +0 -0
  139. roboflow_workflows/core_steps/common/query_language/operations/frame_metadata/base.py +43 -0
  140. roboflow_workflows/core_steps/common/query_language/operations/generic/__init__.py +0 -0
  141. roboflow_workflows/core_steps/common/query_language/operations/generic/base.py +42 -0
  142. roboflow_workflows/core_steps/common/query_language/operations/images/__init__.py +0 -0
  143. roboflow_workflows/core_steps/common/query_language/operations/images/base.py +101 -0
  144. roboflow_workflows/core_steps/common/query_language/operations/numbers/__init__.py +0 -0
  145. roboflow_workflows/core_steps/common/query_language/operations/numbers/base.py +74 -0
  146. roboflow_workflows/core_steps/common/query_language/operations/sequences/__init__.py +0 -0
  147. roboflow_workflows/core_steps/common/query_language/operations/sequences/base.py +165 -0
  148. roboflow_workflows/core_steps/common/query_language/operations/strings/__init__.py +0 -0
  149. roboflow_workflows/core_steps/common/query_language/operations/strings/base.py +65 -0
  150. roboflow_workflows/core_steps/common/query_language/operations/timestamps/__init__.py +0 -0
  151. roboflow_workflows/core_steps/common/query_language/operations/timestamps/base.py +16 -0
  152. roboflow_workflows/core_steps/common/query_language/operations/utils.py +11 -0
  153. roboflow_workflows/core_steps/common/reasoning.py +138 -0
  154. roboflow_workflows/core_steps/common/rle_compact.py +236 -0
  155. roboflow_workflows/core_steps/common/segmentation_entities.py +98 -0
  156. roboflow_workflows/core_steps/common/serializers.py +464 -0
  157. roboflow_workflows/core_steps/common/serializers_tensor.py +829 -0
  158. roboflow_workflows/core_steps/common/tensor_native.py +1060 -0
  159. roboflow_workflows/core_steps/common/token_usage.py +80 -0
  160. roboflow_workflows/core_steps/common/utils.py +768 -0
  161. roboflow_workflows/core_steps/common/utils_tensor.py +69 -0
  162. roboflow_workflows/core_steps/common/vlm_decoding/__init__.py +90 -0
  163. roboflow_workflows/core_steps/common/vlm_decoding/classification.py +199 -0
  164. roboflow_workflows/core_steps/common/vlm_decoding/detection_formats.py +545 -0
  165. roboflow_workflows/core_steps/common/vlm_decoding/detections.py +195 -0
  166. roboflow_workflows/core_steps/common/vlm_decoding/json_extraction.py +106 -0
  167. roboflow_workflows/core_steps/common/vlm_decoding/outputs.py +164 -0
  168. roboflow_workflows/core_steps/common/vlm_decoding/tensor_native.py +387 -0
  169. roboflow_workflows/core_steps/common/vlm_decoding/utils.py +35 -0
  170. roboflow_workflows/core_steps/common/vlm_json.py +135 -0
  171. roboflow_workflows/core_steps/common/vlms.py +82 -0
  172. roboflow_workflows/core_steps/flow_control/__init__.py +0 -0
  173. roboflow_workflows/core_steps/flow_control/continue_if/__init__.py +0 -0
  174. roboflow_workflows/core_steps/flow_control/continue_if/v1.py +165 -0
  175. roboflow_workflows/core_steps/flow_control/delta_filter/__init__.py +0 -0
  176. roboflow_workflows/core_steps/flow_control/delta_filter/v1.py +132 -0
  177. roboflow_workflows/core_steps/flow_control/inner_workflow/__init__.py +0 -0
  178. roboflow_workflows/core_steps/flow_control/inner_workflow/v1.py +377 -0
  179. roboflow_workflows/core_steps/flow_control/rate_limiter/__init__.py +0 -0
  180. roboflow_workflows/core_steps/flow_control/rate_limiter/v1.py +160 -0
  181. roboflow_workflows/core_steps/flow_control/switch_case/__init__.py +0 -0
  182. roboflow_workflows/core_steps/flow_control/switch_case/v1.py +181 -0
  183. roboflow_workflows/core_steps/formatters/__init__.py +0 -0
  184. roboflow_workflows/core_steps/formatters/csv/__init__.py +0 -0
  185. roboflow_workflows/core_steps/formatters/csv/v1.py +215 -0
  186. roboflow_workflows/core_steps/formatters/current_time/__init__.py +0 -0
  187. roboflow_workflows/core_steps/formatters/current_time/v1.py +158 -0
  188. roboflow_workflows/core_steps/formatters/expression/__init__.py +0 -0
  189. roboflow_workflows/core_steps/formatters/expression/v1.py +240 -0
  190. roboflow_workflows/core_steps/formatters/first_non_empty_or_default/__init__.py +0 -0
  191. roboflow_workflows/core_steps/formatters/first_non_empty_or_default/v1.py +143 -0
  192. roboflow_workflows/core_steps/formatters/json_parser/__init__.py +0 -0
  193. roboflow_workflows/core_steps/formatters/json_parser/v1.py +203 -0
  194. roboflow_workflows/core_steps/formatters/property_definition/__init__.py +0 -0
  195. roboflow_workflows/core_steps/formatters/property_definition/v1.py +158 -0
  196. roboflow_workflows/core_steps/formatters/string_template/__init__.py +0 -0
  197. roboflow_workflows/core_steps/formatters/string_template/v1.py +270 -0
  198. roboflow_workflows/core_steps/formatters/vlm_as_classifier/__init__.py +0 -0
  199. roboflow_workflows/core_steps/formatters/vlm_as_classifier/v1.py +330 -0
  200. roboflow_workflows/core_steps/formatters/vlm_as_classifier/v1_tensor.py +390 -0
  201. roboflow_workflows/core_steps/formatters/vlm_as_classifier/v2.py +338 -0
  202. roboflow_workflows/core_steps/formatters/vlm_as_classifier/v2_tensor.py +396 -0
  203. roboflow_workflows/core_steps/formatters/vlm_as_detector/__init__.py +0 -0
  204. roboflow_workflows/core_steps/formatters/vlm_as_detector/anthropic_detection_parsing.py +136 -0
  205. roboflow_workflows/core_steps/formatters/vlm_as_detector/gemini_detection_parsing.py +122 -0
  206. roboflow_workflows/core_steps/formatters/vlm_as_detector/muse_detection_parsing.py +191 -0
  207. roboflow_workflows/core_steps/formatters/vlm_as_detector/openai_detection_parsing.py +137 -0
  208. roboflow_workflows/core_steps/formatters/vlm_as_detector/qwen_detection_parsing.py +221 -0
  209. roboflow_workflows/core_steps/formatters/vlm_as_detector/spacexai_detection_parsing.py +147 -0
  210. roboflow_workflows/core_steps/formatters/vlm_as_detector/v1.py +382 -0
  211. roboflow_workflows/core_steps/formatters/vlm_as_detector/v1_tensor.py +570 -0
  212. roboflow_workflows/core_steps/formatters/vlm_as_detector/v2.py +622 -0
  213. roboflow_workflows/core_steps/formatters/vlm_as_detector/v2_tensor.py +985 -0
  214. roboflow_workflows/core_steps/fusion/__init__.py +0 -0
  215. roboflow_workflows/core_steps/fusion/buffer/__init__.py +0 -0
  216. roboflow_workflows/core_steps/fusion/buffer/v1.py +154 -0
  217. roboflow_workflows/core_steps/fusion/detections_classes_replacement/__init__.py +0 -0
  218. roboflow_workflows/core_steps/fusion/detections_classes_replacement/v1.py +441 -0
  219. roboflow_workflows/core_steps/fusion/detections_classes_replacement/v1_tensor.py +592 -0
  220. roboflow_workflows/core_steps/fusion/detections_consensus/__init__.py +0 -0
  221. roboflow_workflows/core_steps/fusion/detections_consensus/v1.py +735 -0
  222. roboflow_workflows/core_steps/fusion/detections_consensus/v1_tensor.py +1178 -0
  223. roboflow_workflows/core_steps/fusion/detections_difference/__init__.py +0 -0
  224. roboflow_workflows/core_steps/fusion/detections_difference/v1.py +335 -0
  225. roboflow_workflows/core_steps/fusion/detections_difference/v1_tensor.py +396 -0
  226. roboflow_workflows/core_steps/fusion/detections_list_rollup/__init__.py +0 -0
  227. roboflow_workflows/core_steps/fusion/detections_list_rollup/v1.py +1042 -0
  228. roboflow_workflows/core_steps/fusion/detections_list_rollup/v1_tensor.py +1305 -0
  229. roboflow_workflows/core_steps/fusion/detections_stitch/__init__.py +0 -0
  230. roboflow_workflows/core_steps/fusion/detections_stitch/v1.py +305 -0
  231. roboflow_workflows/core_steps/fusion/detections_stitch/v1_tensor.py +1168 -0
  232. roboflow_workflows/core_steps/fusion/dimension_collapse/__init__.py +0 -0
  233. roboflow_workflows/core_steps/fusion/dimension_collapse/v1.py +126 -0
  234. roboflow_workflows/core_steps/fusion/frame_delay/__init__.py +0 -0
  235. roboflow_workflows/core_steps/fusion/frame_delay/v1.py +268 -0
  236. roboflow_workflows/core_steps/fusion/frame_delay/v1_tensor.py +141 -0
  237. roboflow_workflows/core_steps/fusion/image_stack/__init__.py +0 -0
  238. roboflow_workflows/core_steps/fusion/image_stack/v1.py +248 -0
  239. roboflow_workflows/core_steps/fusion/overlap_analysis/__init__.py +0 -0
  240. roboflow_workflows/core_steps/fusion/overlap_analysis/v1.py +212 -0
  241. roboflow_workflows/core_steps/fusion/overlap_analysis/v1_tensor.py +397 -0
  242. roboflow_workflows/core_steps/loader.py +2009 -0
  243. roboflow_workflows/core_steps/math/__init__.py +0 -0
  244. roboflow_workflows/core_steps/math/cosine_similarity/__init__.py +0 -0
  245. roboflow_workflows/core_steps/math/cosine_similarity/v1.py +124 -0
  246. roboflow_workflows/core_steps/math/cosine_similarity/v1_tensor.py +131 -0
  247. roboflow_workflows/core_steps/models/__init__.py +0 -0
  248. roboflow_workflows/core_steps/models/foundation/__init__.py +0 -0
  249. roboflow_workflows/core_steps/models/foundation/anthropic_claude/__init__.py +0 -0
  250. roboflow_workflows/core_steps/models/foundation/anthropic_claude/model_capabilities.py +165 -0
  251. roboflow_workflows/core_steps/models/foundation/anthropic_claude/v1.py +723 -0
  252. roboflow_workflows/core_steps/models/foundation/anthropic_claude/v2.py +852 -0
  253. roboflow_workflows/core_steps/models/foundation/anthropic_claude/v3.py +1014 -0
  254. roboflow_workflows/core_steps/models/foundation/anthropic_claude/v4.py +1195 -0
  255. roboflow_workflows/core_steps/models/foundation/anthropic_claude/v5.py +1272 -0
  256. roboflow_workflows/core_steps/models/foundation/clip/__init__.py +0 -0
  257. roboflow_workflows/core_steps/models/foundation/clip/v1.py +250 -0
  258. roboflow_workflows/core_steps/models/foundation/clip/v1_tensor.py +257 -0
  259. roboflow_workflows/core_steps/models/foundation/clip_comparison/__init__.py +0 -0
  260. roboflow_workflows/core_steps/models/foundation/clip_comparison/v1.py +233 -0
  261. roboflow_workflows/core_steps/models/foundation/clip_comparison/v1_tensor.py +255 -0
  262. roboflow_workflows/core_steps/models/foundation/clip_comparison/v2.py +302 -0
  263. roboflow_workflows/core_steps/models/foundation/clip_comparison/v2_tensor.py +335 -0
  264. roboflow_workflows/core_steps/models/foundation/cog_vlm/__init__.py +0 -0
  265. roboflow_workflows/core_steps/models/foundation/cog_vlm/v1.py +190 -0
  266. roboflow_workflows/core_steps/models/foundation/cosmos3/__init__.py +0 -0
  267. roboflow_workflows/core_steps/models/foundation/cosmos3/v1.py +263 -0
  268. roboflow_workflows/core_steps/models/foundation/depth_estimation/__init__.py +0 -0
  269. roboflow_workflows/core_steps/models/foundation/depth_estimation/v1.py +290 -0
  270. roboflow_workflows/core_steps/models/foundation/depth_estimation/v1_tensor.py +325 -0
  271. roboflow_workflows/core_steps/models/foundation/easy_ocr/__init__.py +0 -0
  272. roboflow_workflows/core_steps/models/foundation/easy_ocr/v1.py +300 -0
  273. roboflow_workflows/core_steps/models/foundation/easy_ocr/v1_tensor.py +363 -0
  274. roboflow_workflows/core_steps/models/foundation/flex/__init__.py +0 -0
  275. roboflow_workflows/core_steps/models/foundation/flex/inpainting/__init__.py +0 -0
  276. roboflow_workflows/core_steps/models/foundation/florence2/__init__.py +0 -0
  277. roboflow_workflows/core_steps/models/foundation/florence2/v1.py +695 -0
  278. roboflow_workflows/core_steps/models/foundation/florence2/v1_tensor.py +376 -0
  279. roboflow_workflows/core_steps/models/foundation/florence2/v2.py +92 -0
  280. roboflow_workflows/core_steps/models/foundation/florence2/v2_tensor.py +43 -0
  281. roboflow_workflows/core_steps/models/foundation/gaze/__init__.py +0 -0
  282. roboflow_workflows/core_steps/models/foundation/gaze/v1.py +147 -0
  283. roboflow_workflows/core_steps/models/foundation/glm_ocr/__init__.py +0 -0
  284. roboflow_workflows/core_steps/models/foundation/glm_ocr/v1.py +407 -0
  285. roboflow_workflows/core_steps/models/foundation/google_gemini/__init__.py +0 -0
  286. roboflow_workflows/core_steps/models/foundation/google_gemini/v1.py +759 -0
  287. roboflow_workflows/core_steps/models/foundation/google_gemini/v2.py +903 -0
  288. roboflow_workflows/core_steps/models/foundation/google_gemini/v3.py +1054 -0
  289. roboflow_workflows/core_steps/models/foundation/google_gemini/v4.py +1089 -0
  290. roboflow_workflows/core_steps/models/foundation/google_gemini/v5.py +1149 -0
  291. roboflow_workflows/core_steps/models/foundation/google_gemini/v6.py +1209 -0
  292. roboflow_workflows/core_steps/models/foundation/google_gemma/__init__.py +0 -0
  293. roboflow_workflows/core_steps/models/foundation/google_gemma/v1.py +667 -0
  294. roboflow_workflows/core_steps/models/foundation/google_gemma/v2.py +262 -0
  295. roboflow_workflows/core_steps/models/foundation/google_gemma/v3.py +309 -0
  296. roboflow_workflows/core_steps/models/foundation/google_gemma/v4.py +357 -0
  297. roboflow_workflows/core_steps/models/foundation/google_vision_ocr/__init__.py +0 -0
  298. roboflow_workflows/core_steps/models/foundation/google_vision_ocr/v1.py +307 -0
  299. roboflow_workflows/core_steps/models/foundation/google_vision_ocr/v1_tensor.py +342 -0
  300. roboflow_workflows/core_steps/models/foundation/kimi_openrouter/__init__.py +0 -0
  301. roboflow_workflows/core_steps/models/foundation/kimi_openrouter/v1.py +667 -0
  302. roboflow_workflows/core_steps/models/foundation/kimi_openrouter/v2.py +264 -0
  303. roboflow_workflows/core_steps/models/foundation/kimi_openrouter/v3.py +316 -0
  304. roboflow_workflows/core_steps/models/foundation/llama_vision/__init__.py +0 -0
  305. roboflow_workflows/core_steps/models/foundation/llama_vision/v1.py +664 -0
  306. roboflow_workflows/core_steps/models/foundation/llama_vision/v2.py +265 -0
  307. roboflow_workflows/core_steps/models/foundation/lmm/__init__.py +0 -0
  308. roboflow_workflows/core_steps/models/foundation/lmm/v1.py +454 -0
  309. roboflow_workflows/core_steps/models/foundation/lmm_classifier/__init__.py +0 -0
  310. roboflow_workflows/core_steps/models/foundation/lmm_classifier/v1.py +294 -0
  311. roboflow_workflows/core_steps/models/foundation/meta_vlm/__init__.py +0 -0
  312. roboflow_workflows/core_steps/models/foundation/meta_vlm/v1.py +630 -0
  313. roboflow_workflows/core_steps/models/foundation/meta_vlm/v2.py +699 -0
  314. roboflow_workflows/core_steps/models/foundation/meta_vlm/v3.py +755 -0
  315. roboflow_workflows/core_steps/models/foundation/moondream2/__init__.py +0 -0
  316. roboflow_workflows/core_steps/models/foundation/moondream2/v1.py +272 -0
  317. roboflow_workflows/core_steps/models/foundation/moondream2/v1_tensor.py +264 -0
  318. roboflow_workflows/core_steps/models/foundation/ocr/__init__.py +0 -0
  319. roboflow_workflows/core_steps/models/foundation/ocr/v1.py +226 -0
  320. roboflow_workflows/core_steps/models/foundation/ocr/v1_tensor.py +249 -0
  321. roboflow_workflows/core_steps/models/foundation/openai/__init__.py +0 -0
  322. roboflow_workflows/core_steps/models/foundation/openai/v1.py +350 -0
  323. roboflow_workflows/core_steps/models/foundation/openai/v2.py +602 -0
  324. roboflow_workflows/core_steps/models/foundation/openai/v3.py +716 -0
  325. roboflow_workflows/core_steps/models/foundation/openai/v4.py +996 -0
  326. roboflow_workflows/core_steps/models/foundation/openai/v5.py +1403 -0
  327. roboflow_workflows/core_steps/models/foundation/openai/v6.py +1448 -0
  328. roboflow_workflows/core_steps/models/foundation/openai/v7.py +1559 -0
  329. roboflow_workflows/core_steps/models/foundation/openai_compatible/__init__.py +0 -0
  330. roboflow_workflows/core_steps/models/foundation/openai_compatible/v1.py +483 -0
  331. roboflow_workflows/core_steps/models/foundation/openrouter/__init__.py +0 -0
  332. roboflow_workflows/core_steps/models/foundation/openrouter/v1.py +282 -0
  333. roboflow_workflows/core_steps/models/foundation/openrouter/v2.py +339 -0
  334. roboflow_workflows/core_steps/models/foundation/openrouter/v3.py +455 -0
  335. roboflow_workflows/core_steps/models/foundation/perception_encoder/__init__.py +0 -0
  336. roboflow_workflows/core_steps/models/foundation/perception_encoder/v1.py +253 -0
  337. roboflow_workflows/core_steps/models/foundation/perception_encoder/v1_tensor.py +267 -0
  338. roboflow_workflows/core_steps/models/foundation/pp_ocr/__init__.py +0 -0
  339. roboflow_workflows/core_steps/models/foundation/pp_ocr/v1.py +255 -0
  340. roboflow_workflows/core_steps/models/foundation/pp_ocr/v1_tensor.py +333 -0
  341. roboflow_workflows/core_steps/models/foundation/qwen/__init__.py +0 -0
  342. roboflow_workflows/core_steps/models/foundation/qwen/v1.py +278 -0
  343. roboflow_workflows/core_steps/models/foundation/qwen3_5_openrouter/__init__.py +0 -0
  344. roboflow_workflows/core_steps/models/foundation/qwen3_5_openrouter/v1.py +679 -0
  345. roboflow_workflows/core_steps/models/foundation/qwen3_5vl/__init__.py +0 -0
  346. roboflow_workflows/core_steps/models/foundation/qwen3_5vl/v1.py +327 -0
  347. roboflow_workflows/core_steps/models/foundation/qwen3_5vl/v1_tensor.py +174 -0
  348. roboflow_workflows/core_steps/models/foundation/qwen3_5vl/v2.py +274 -0
  349. roboflow_workflows/core_steps/models/foundation/qwen3_5vl/v2_tensor.py +151 -0
  350. roboflow_workflows/core_steps/models/foundation/qwen3_6_openrouter/__init__.py +0 -0
  351. roboflow_workflows/core_steps/models/foundation/qwen3_6_openrouter/v1.py +676 -0
  352. roboflow_workflows/core_steps/models/foundation/qwen3vl/__init__.py +0 -0
  353. roboflow_workflows/core_steps/models/foundation/qwen3vl/v1.py +275 -0
  354. roboflow_workflows/core_steps/models/foundation/qwen3vl/v1_tensor.py +168 -0
  355. roboflow_workflows/core_steps/models/foundation/qwen_vlm/__init__.py +0 -0
  356. roboflow_workflows/core_steps/models/foundation/qwen_vlm/v1.py +995 -0
  357. roboflow_workflows/core_steps/models/foundation/qwen_vlm/v2.py +1389 -0
  358. roboflow_workflows/core_steps/models/foundation/qwen_vlm/v3.py +1443 -0
  359. roboflow_workflows/core_steps/models/foundation/qwen_vlm/v4.py +1509 -0
  360. roboflow_workflows/core_steps/models/foundation/seg_preview/__init__.py +0 -0
  361. roboflow_workflows/core_steps/models/foundation/seg_preview/v1.py +357 -0
  362. roboflow_workflows/core_steps/models/foundation/seg_preview/v1_tensor.py +366 -0
  363. roboflow_workflows/core_steps/models/foundation/segment_anything2/__init__.py +0 -0
  364. roboflow_workflows/core_steps/models/foundation/segment_anything2/v1.py +561 -0
  365. roboflow_workflows/core_steps/models/foundation/segment_anything2/v1_tensor.py +652 -0
  366. roboflow_workflows/core_steps/models/foundation/segment_anything2_video/__init__.py +0 -0
  367. roboflow_workflows/core_steps/models/foundation/segment_anything2_video/v1.py +414 -0
  368. roboflow_workflows/core_steps/models/foundation/segment_anything2_video/v1_tensor.py +383 -0
  369. roboflow_workflows/core_steps/models/foundation/segment_anything3/__init__.py +0 -0
  370. roboflow_workflows/core_steps/models/foundation/segment_anything3/v1.py +591 -0
  371. roboflow_workflows/core_steps/models/foundation/segment_anything3/v1_tensor.py +658 -0
  372. roboflow_workflows/core_steps/models/foundation/segment_anything3/v2.py +680 -0
  373. roboflow_workflows/core_steps/models/foundation/segment_anything3/v2_tensor.py +797 -0
  374. roboflow_workflows/core_steps/models/foundation/segment_anything3/v3.py +938 -0
  375. roboflow_workflows/core_steps/models/foundation/segment_anything3/v3_tensor.py +587 -0
  376. roboflow_workflows/core_steps/models/foundation/segment_anything3_3d/__init__.py +0 -0
  377. roboflow_workflows/core_steps/models/foundation/segment_anything3_3d/v1.py +306 -0
  378. roboflow_workflows/core_steps/models/foundation/segment_anything3_3d/v1_tensor.py +310 -0
  379. roboflow_workflows/core_steps/models/foundation/segment_anything3_interactive/__init__.py +0 -0
  380. roboflow_workflows/core_steps/models/foundation/segment_anything3_interactive/v1.py +622 -0
  381. roboflow_workflows/core_steps/models/foundation/segment_anything3_interactive/v1_tensor.py +888 -0
  382. roboflow_workflows/core_steps/models/foundation/segment_anything3_video/__init__.py +0 -0
  383. roboflow_workflows/core_steps/models/foundation/segment_anything3_video/v1.py +648 -0
  384. roboflow_workflows/core_steps/models/foundation/segment_anything3_video/v1_tensor.py +727 -0
  385. roboflow_workflows/core_steps/models/foundation/segment_anything_common/__init__.py +1 -0
  386. roboflow_workflows/core_steps/models/foundation/segment_anything_common/prompts.py +161 -0
  387. roboflow_workflows/core_steps/models/foundation/segment_anything_common/streaming_video.py +340 -0
  388. roboflow_workflows/core_steps/models/foundation/segment_anything_common/streaming_video_tensor.py +169 -0
  389. roboflow_workflows/core_steps/models/foundation/segment_anything_common/visual_prompt.py +38 -0
  390. roboflow_workflows/core_steps/models/foundation/smolvlm/__init__.py +0 -0
  391. roboflow_workflows/core_steps/models/foundation/smolvlm/v1.py +245 -0
  392. roboflow_workflows/core_steps/models/foundation/smolvlm/v1_tensor.py +148 -0
  393. roboflow_workflows/core_steps/models/foundation/spacexai/__init__.py +0 -0
  394. roboflow_workflows/core_steps/models/foundation/spacexai/v1.py +996 -0
  395. roboflow_workflows/core_steps/models/foundation/spacexai/v2.py +1048 -0
  396. roboflow_workflows/core_steps/models/foundation/spacexai/v3.py +1096 -0
  397. roboflow_workflows/core_steps/models/foundation/stability_ai/__init__.py +0 -0
  398. roboflow_workflows/core_steps/models/foundation/stability_ai/image_gen/__init__.py +0 -0
  399. roboflow_workflows/core_steps/models/foundation/stability_ai/image_gen/v1.py +205 -0
  400. roboflow_workflows/core_steps/models/foundation/stability_ai/inpainting/__init__.py +0 -0
  401. roboflow_workflows/core_steps/models/foundation/stability_ai/inpainting/v1.py +238 -0
  402. roboflow_workflows/core_steps/models/foundation/stability_ai/inpainting/v1_tensor.py +245 -0
  403. roboflow_workflows/core_steps/models/foundation/stability_ai/outpainting/__init__.py +0 -0
  404. roboflow_workflows/core_steps/models/foundation/stability_ai/outpainting/v1.py +288 -0
  405. roboflow_workflows/core_steps/models/foundation/yolo_world/__init__.py +0 -0
  406. roboflow_workflows/core_steps/models/foundation/yolo_world/v1.py +297 -0
  407. roboflow_workflows/core_steps/models/foundation/yolo_world/v1_tensor.py +167 -0
  408. roboflow_workflows/core_steps/models/foundation/zai_vlm/__init__.py +0 -0
  409. roboflow_workflows/core_steps/models/foundation/zai_vlm/v1.py +742 -0
  410. roboflow_workflows/core_steps/models/foundation/zai_vlm/v2.py +804 -0
  411. roboflow_workflows/core_steps/models/roboflow/__init__.py +0 -0
  412. roboflow_workflows/core_steps/models/roboflow/action_recognition/__init__.py +0 -0
  413. roboflow_workflows/core_steps/models/roboflow/action_recognition/entities.py +29 -0
  414. roboflow_workflows/core_steps/models/roboflow/action_recognition/v1.py +617 -0
  415. roboflow_workflows/core_steps/models/roboflow/action_recognition/v1_tensor.py +58 -0
  416. roboflow_workflows/core_steps/models/roboflow/instance_segmentation/__init__.py +0 -0
  417. roboflow_workflows/core_steps/models/roboflow/instance_segmentation/v1.py +398 -0
  418. roboflow_workflows/core_steps/models/roboflow/instance_segmentation/v1_tensor.py +701 -0
  419. roboflow_workflows/core_steps/models/roboflow/instance_segmentation/v2.py +403 -0
  420. roboflow_workflows/core_steps/models/roboflow/instance_segmentation/v2_tensor.py +701 -0
  421. roboflow_workflows/core_steps/models/roboflow/instance_segmentation/v3.py +801 -0
  422. roboflow_workflows/core_steps/models/roboflow/instance_segmentation/v3_tensor.py +742 -0
  423. roboflow_workflows/core_steps/models/roboflow/instance_segmentation/v4.py +441 -0
  424. roboflow_workflows/core_steps/models/roboflow/instance_segmentation/v4_tensor.py +729 -0
  425. roboflow_workflows/core_steps/models/roboflow/keypoint_detection/__init__.py +0 -0
  426. roboflow_workflows/core_steps/models/roboflow/keypoint_detection/v1.py +374 -0
  427. roboflow_workflows/core_steps/models/roboflow/keypoint_detection/v1_tensor.py +639 -0
  428. roboflow_workflows/core_steps/models/roboflow/keypoint_detection/v2.py +378 -0
  429. roboflow_workflows/core_steps/models/roboflow/keypoint_detection/v2_tensor.py +641 -0
  430. roboflow_workflows/core_steps/models/roboflow/keypoint_detection/v3.py +417 -0
  431. roboflow_workflows/core_steps/models/roboflow/keypoint_detection/v3_tensor.py +674 -0
  432. roboflow_workflows/core_steps/models/roboflow/multi_class_classification/__init__.py +0 -0
  433. roboflow_workflows/core_steps/models/roboflow/multi_class_classification/v1.py +271 -0
  434. roboflow_workflows/core_steps/models/roboflow/multi_class_classification/v1_tensor.py +471 -0
  435. roboflow_workflows/core_steps/models/roboflow/multi_class_classification/v2.py +279 -0
  436. roboflow_workflows/core_steps/models/roboflow/multi_class_classification/v2_tensor.py +477 -0
  437. roboflow_workflows/core_steps/models/roboflow/multi_class_classification/v3.py +323 -0
  438. roboflow_workflows/core_steps/models/roboflow/multi_class_classification/v3_tensor.py +520 -0
  439. roboflow_workflows/core_steps/models/roboflow/multi_label_classification/__init__.py +0 -0
  440. roboflow_workflows/core_steps/models/roboflow/multi_label_classification/v1.py +274 -0
  441. roboflow_workflows/core_steps/models/roboflow/multi_label_classification/v1_tensor.py +453 -0
  442. roboflow_workflows/core_steps/models/roboflow/multi_label_classification/v2.py +277 -0
  443. roboflow_workflows/core_steps/models/roboflow/multi_label_classification/v2_tensor.py +454 -0
  444. roboflow_workflows/core_steps/models/roboflow/multi_label_classification/v3.py +322 -0
  445. roboflow_workflows/core_steps/models/roboflow/multi_label_classification/v3_tensor.py +493 -0
  446. roboflow_workflows/core_steps/models/roboflow/object_detection/__init__.py +0 -0
  447. roboflow_workflows/core_steps/models/roboflow/object_detection/v1.py +354 -0
  448. roboflow_workflows/core_steps/models/roboflow/object_detection/v1_tensor.py +440 -0
  449. roboflow_workflows/core_steps/models/roboflow/object_detection/v2.py +358 -0
  450. roboflow_workflows/core_steps/models/roboflow/object_detection/v2_tensor.py +440 -0
  451. roboflow_workflows/core_steps/models/roboflow/object_detection/v3.py +400 -0
  452. roboflow_workflows/core_steps/models/roboflow/object_detection/v3_tensor.py +479 -0
  453. roboflow_workflows/core_steps/models/roboflow/semantic_segmentation/__init__.py +0 -0
  454. roboflow_workflows/core_steps/models/roboflow/semantic_segmentation/v1.py +321 -0
  455. roboflow_workflows/core_steps/models/roboflow/semantic_segmentation/v1_tensor.py +643 -0
  456. roboflow_workflows/core_steps/models/roboflow/semantic_segmentation/v2.py +382 -0
  457. roboflow_workflows/core_steps/models/roboflow/semantic_segmentation/v2_tensor.py +702 -0
  458. roboflow_workflows/core_steps/models/third_party/__init__.py +0 -0
  459. roboflow_workflows/core_steps/models/third_party/barcode_detection/__init__.py +0 -0
  460. roboflow_workflows/core_steps/models/third_party/barcode_detection/v1.py +132 -0
  461. roboflow_workflows/core_steps/models/third_party/barcode_detection/v1_tensor.py +158 -0
  462. roboflow_workflows/core_steps/models/third_party/qr_code_detection/__init__.py +0 -0
  463. roboflow_workflows/core_steps/models/third_party/qr_code_detection/v1.py +140 -0
  464. roboflow_workflows/core_steps/models/third_party/qr_code_detection/v1_tensor.py +160 -0
  465. roboflow_workflows/core_steps/sampling/__init__.py +0 -0
  466. roboflow_workflows/core_steps/sampling/identify_changes/__init__.py +0 -0
  467. roboflow_workflows/core_steps/sampling/identify_changes/v1.py +388 -0
  468. roboflow_workflows/core_steps/sampling/identify_changes/v1_tensor.py +405 -0
  469. roboflow_workflows/core_steps/sampling/identify_outliers/__init__.py +0 -0
  470. roboflow_workflows/core_steps/sampling/identify_outliers/v1.py +263 -0
  471. roboflow_workflows/core_steps/sampling/identify_outliers/v1_tensor.py +265 -0
  472. roboflow_workflows/core_steps/secrets_providers/__init__.py +0 -0
  473. roboflow_workflows/core_steps/secrets_providers/environment_secrets_store/__init__.py +0 -0
  474. roboflow_workflows/core_steps/secrets_providers/environment_secrets_store/v1.py +145 -0
  475. roboflow_workflows/core_steps/sinks/__init__.py +0 -0
  476. roboflow_workflows/core_steps/sinks/email_notification/__init__.py +0 -0
  477. roboflow_workflows/core_steps/sinks/email_notification/v1.py +507 -0
  478. roboflow_workflows/core_steps/sinks/email_notification/v2.py +1089 -0
  479. roboflow_workflows/core_steps/sinks/local_file/__init__.py +0 -0
  480. roboflow_workflows/core_steps/sinks/local_file/v1.py +432 -0
  481. roboflow_workflows/core_steps/sinks/noop.py +14 -0
  482. roboflow_workflows/core_steps/sinks/onvif_movement/__init__.py +0 -0
  483. roboflow_workflows/core_steps/sinks/onvif_movement/v1.py +990 -0
  484. roboflow_workflows/core_steps/sinks/onvif_movement/v1_tensor.py +1028 -0
  485. roboflow_workflows/core_steps/sinks/s3/__init__.py +0 -0
  486. roboflow_workflows/core_steps/sinks/s3/v1.py +464 -0
  487. roboflow_workflows/core_steps/sinks/slack/__init__.py +0 -0
  488. roboflow_workflows/core_steps/sinks/slack/notification/__init__.py +0 -0
  489. roboflow_workflows/core_steps/sinks/slack/notification/v1.py +418 -0
  490. roboflow_workflows/core_steps/sinks/twilio/__init__.py +0 -0
  491. roboflow_workflows/core_steps/sinks/twilio/sms/__init__.py +0 -0
  492. roboflow_workflows/core_steps/sinks/twilio/sms/v1.py +437 -0
  493. roboflow_workflows/core_steps/sinks/twilio/sms/v2.py +799 -0
  494. roboflow_workflows/core_steps/sinks/webhook/__init__.py +0 -0
  495. roboflow_workflows/core_steps/sinks/webhook/v1.py +586 -0
  496. roboflow_workflows/core_steps/trackers/__init__.py +0 -0
  497. roboflow_workflows/core_steps/trackers/_base.py +181 -0
  498. roboflow_workflows/core_steps/trackers/_base_tensor.py +318 -0
  499. roboflow_workflows/core_steps/trackers/botsort/__init__.py +0 -0
  500. roboflow_workflows/core_steps/trackers/botsort/v1.py +326 -0
  501. roboflow_workflows/core_steps/trackers/botsort/v1_tensor.py +327 -0
  502. roboflow_workflows/core_steps/trackers/bytetrack/__init__.py +0 -0
  503. roboflow_workflows/core_steps/trackers/bytetrack/v1.py +208 -0
  504. roboflow_workflows/core_steps/trackers/bytetrack/v1_tensor.py +215 -0
  505. roboflow_workflows/core_steps/trackers/ocsort/__init__.py +0 -0
  506. roboflow_workflows/core_steps/trackers/ocsort/v1.py +224 -0
  507. roboflow_workflows/core_steps/trackers/ocsort/v1_tensor.py +224 -0
  508. roboflow_workflows/core_steps/trackers/sort/__init__.py +0 -0
  509. roboflow_workflows/core_steps/trackers/sort/v1.py +195 -0
  510. roboflow_workflows/core_steps/trackers/sort/v1_tensor.py +202 -0
  511. roboflow_workflows/core_steps/transformations/__init__.py +0 -0
  512. roboflow_workflows/core_steps/transformations/absolute_static_crop/__init__.py +0 -0
  513. roboflow_workflows/core_steps/transformations/absolute_static_crop/v1.py +170 -0
  514. roboflow_workflows/core_steps/transformations/absolute_static_crop/v1_tensor.py +186 -0
  515. roboflow_workflows/core_steps/transformations/bounding_rect/__init__.py +0 -0
  516. roboflow_workflows/core_steps/transformations/bounding_rect/v1.py +176 -0
  517. roboflow_workflows/core_steps/transformations/bounding_rect/v1_tensor.py +249 -0
  518. roboflow_workflows/core_steps/transformations/byte_tracker/__init__.py +0 -0
  519. roboflow_workflows/core_steps/transformations/byte_tracker/v1.py +199 -0
  520. roboflow_workflows/core_steps/transformations/byte_tracker/v1_tensor.py +282 -0
  521. roboflow_workflows/core_steps/transformations/byte_tracker/v2.py +219 -0
  522. roboflow_workflows/core_steps/transformations/byte_tracker/v2_tensor.py +302 -0
  523. roboflow_workflows/core_steps/transformations/byte_tracker/v3.py +284 -0
  524. roboflow_workflows/core_steps/transformations/byte_tracker/v3_tensor.py +380 -0
  525. roboflow_workflows/core_steps/transformations/camera_calibration/__init__.py +0 -0
  526. roboflow_workflows/core_steps/transformations/camera_calibration/v1.py +285 -0
  527. roboflow_workflows/core_steps/transformations/detection_offset/__init__.py +0 -0
  528. roboflow_workflows/core_steps/transformations/detection_offset/v1.py +213 -0
  529. roboflow_workflows/core_steps/transformations/detection_offset/v1_tensor.py +317 -0
  530. roboflow_workflows/core_steps/transformations/detections_combine/__init__.py +0 -0
  531. roboflow_workflows/core_steps/transformations/detections_combine/v1.py +123 -0
  532. roboflow_workflows/core_steps/transformations/detections_combine/v1_tensor.py +341 -0
  533. roboflow_workflows/core_steps/transformations/detections_filter/__init__.py +0 -0
  534. roboflow_workflows/core_steps/transformations/detections_filter/v1.py +179 -0
  535. roboflow_workflows/core_steps/transformations/detections_merge/__init__.py +0 -0
  536. roboflow_workflows/core_steps/transformations/detections_merge/v1.py +180 -0
  537. roboflow_workflows/core_steps/transformations/detections_merge/v1_tensor.py +265 -0
  538. roboflow_workflows/core_steps/transformations/detections_transformation/__init__.py +0 -0
  539. roboflow_workflows/core_steps/transformations/detections_transformation/v1.py +265 -0
  540. roboflow_workflows/core_steps/transformations/dynamic_crop/__init__.py +0 -0
  541. roboflow_workflows/core_steps/transformations/dynamic_crop/v1.py +316 -0
  542. roboflow_workflows/core_steps/transformations/dynamic_crop/v1_tensor.py +603 -0
  543. roboflow_workflows/core_steps/transformations/dynamic_zones/__init__.py +0 -0
  544. roboflow_workflows/core_steps/transformations/dynamic_zones/v1.py +387 -0
  545. roboflow_workflows/core_steps/transformations/dynamic_zones/v1_tensor.py +463 -0
  546. roboflow_workflows/core_steps/transformations/geotag_detection/__init__.py +0 -0
  547. roboflow_workflows/core_steps/transformations/geotag_detection/v1.py +294 -0
  548. roboflow_workflows/core_steps/transformations/geotag_detection/v1_tensor.py +327 -0
  549. roboflow_workflows/core_steps/transformations/image_slicer/__init__.py +0 -0
  550. roboflow_workflows/core_steps/transformations/image_slicer/v1.py +236 -0
  551. roboflow_workflows/core_steps/transformations/image_slicer/v2.py +288 -0
  552. roboflow_workflows/core_steps/transformations/per_class_confidence_filter/__init__.py +0 -0
  553. roboflow_workflows/core_steps/transformations/per_class_confidence_filter/v1.py +164 -0
  554. roboflow_workflows/core_steps/transformations/per_class_confidence_filter/v1_tensor.py +209 -0
  555. roboflow_workflows/core_steps/transformations/perspective_correction/__init__.py +0 -0
  556. roboflow_workflows/core_steps/transformations/perspective_correction/v1.py +881 -0
  557. roboflow_workflows/core_steps/transformations/perspective_correction/v1_tensor.py +1368 -0
  558. roboflow_workflows/core_steps/transformations/qr_code_generator/__init__.py +0 -0
  559. roboflow_workflows/core_steps/transformations/qr_code_generator/v1.py +405 -0
  560. roboflow_workflows/core_steps/transformations/relative_static_crop/__init__.py +0 -0
  561. roboflow_workflows/core_steps/transformations/relative_static_crop/v1.py +173 -0
  562. roboflow_workflows/core_steps/transformations/stabilize_detections/__init__.py +0 -0
  563. roboflow_workflows/core_steps/transformations/stabilize_detections/v1.py +337 -0
  564. roboflow_workflows/core_steps/transformations/stabilize_detections/v1_tensor.py +524 -0
  565. roboflow_workflows/core_steps/transformations/stitch_images/__init__.py +0 -0
  566. roboflow_workflows/core_steps/transformations/stitch_images/v1.py +269 -0
  567. roboflow_workflows/core_steps/transformations/stitch_ocr_detections/__init__.py +0 -0
  568. roboflow_workflows/core_steps/transformations/stitch_ocr_detections/v1.py +339 -0
  569. roboflow_workflows/core_steps/transformations/stitch_ocr_detections/v1_tensor.py +403 -0
  570. roboflow_workflows/core_steps/transformations/stitch_ocr_detections/v2.py +881 -0
  571. roboflow_workflows/core_steps/transformations/stitch_ocr_detections/v2_tensor.py +955 -0
  572. roboflow_workflows/core_steps/transformations/track_class_lock/__init__.py +0 -0
  573. roboflow_workflows/core_steps/transformations/track_class_lock/v1.py +460 -0
  574. roboflow_workflows/core_steps/transformations/track_class_lock/v1_tensor.py +413 -0
  575. roboflow_workflows/core_steps/visualizations/__init__.py +0 -0
  576. roboflow_workflows/core_steps/visualizations/background_color/__init__.py +0 -0
  577. roboflow_workflows/core_steps/visualizations/background_color/v1.py +163 -0
  578. roboflow_workflows/core_steps/visualizations/background_color/v1_tensor.py +169 -0
  579. roboflow_workflows/core_steps/visualizations/blur/__init__.py +0 -0
  580. roboflow_workflows/core_steps/visualizations/blur/v1.py +130 -0
  581. roboflow_workflows/core_steps/visualizations/blur/v1_tensor.py +140 -0
  582. roboflow_workflows/core_steps/visualizations/bounding_box/__init__.py +0 -0
  583. roboflow_workflows/core_steps/visualizations/bounding_box/v1.py +175 -0
  584. roboflow_workflows/core_steps/visualizations/bounding_box/v1_tensor.py +525 -0
  585. roboflow_workflows/core_steps/visualizations/circle/__init__.py +0 -0
  586. roboflow_workflows/core_steps/visualizations/circle/v1.py +162 -0
  587. roboflow_workflows/core_steps/visualizations/circle/v1_tensor.py +174 -0
  588. roboflow_workflows/core_steps/visualizations/classification_label/__init__.py +0 -0
  589. roboflow_workflows/core_steps/visualizations/classification_label/v1.py +564 -0
  590. roboflow_workflows/core_steps/visualizations/classification_label/v1_tensor.py +661 -0
  591. roboflow_workflows/core_steps/visualizations/color/__init__.py +0 -0
  592. roboflow_workflows/core_steps/visualizations/color/v1.py +166 -0
  593. roboflow_workflows/core_steps/visualizations/color/v1_tensor.py +178 -0
  594. roboflow_workflows/core_steps/visualizations/common/__init__.py +0 -0
  595. roboflow_workflows/core_steps/visualizations/common/annotators/__init__.py +0 -0
  596. roboflow_workflows/core_steps/visualizations/common/annotators/background_color.py +69 -0
  597. roboflow_workflows/core_steps/visualizations/common/annotators/halo.py +125 -0
  598. roboflow_workflows/core_steps/visualizations/common/annotators/model_comparison.py +140 -0
  599. roboflow_workflows/core_steps/visualizations/common/annotators/polygon.py +137 -0
  600. roboflow_workflows/core_steps/visualizations/common/base.py +115 -0
  601. roboflow_workflows/core_steps/visualizations/common/base_colorable.py +165 -0
  602. roboflow_workflows/core_steps/visualizations/common/base_colorable_tensor.py +165 -0
  603. roboflow_workflows/core_steps/visualizations/common/base_tensor.py +437 -0
  604. roboflow_workflows/core_steps/visualizations/common/fonts/README.md +109 -0
  605. roboflow_workflows/core_steps/visualizations/common/fonts/__init__.py +178 -0
  606. roboflow_workflows/core_steps/visualizations/common/fonts/assets/anonymous_pro/AnonymousPro-Regular.ttf +0 -0
  607. roboflow_workflows/core_steps/visualizations/common/fonts/assets/anonymous_pro/OFL.txt +94 -0
  608. roboflow_workflows/core_steps/visualizations/common/fonts/assets/courier_prime/CourierPrime-Regular.ttf +0 -0
  609. roboflow_workflows/core_steps/visualizations/common/fonts/assets/courier_prime/OFL.txt +93 -0
  610. roboflow_workflows/core_steps/visualizations/common/fonts/assets/fira_code/FiraCode[wght].ttf +0 -0
  611. roboflow_workflows/core_steps/visualizations/common/fonts/assets/fira_code/OFL.txt +93 -0
  612. roboflow_workflows/core_steps/visualizations/common/fonts/assets/geist/Geist-Regular.ttf +0 -0
  613. roboflow_workflows/core_steps/visualizations/common/fonts/assets/geist/OFL.txt +93 -0
  614. roboflow_workflows/core_steps/visualizations/common/fonts/assets/geist_mono/GeistMono-Regular.ttf +0 -0
  615. roboflow_workflows/core_steps/visualizations/common/fonts/assets/geist_mono/OFL.txt +93 -0
  616. roboflow_workflows/core_steps/visualizations/common/fonts/assets/ibm_plex_mono/IBMPlexMono-Regular.ttf +0 -0
  617. roboflow_workflows/core_steps/visualizations/common/fonts/assets/ibm_plex_mono/OFL.txt +93 -0
  618. roboflow_workflows/core_steps/visualizations/common/fonts/assets/inconsolata/Inconsolata[wdth,wght].ttf +0 -0
  619. roboflow_workflows/core_steps/visualizations/common/fonts/assets/inconsolata/OFL.txt +93 -0
  620. roboflow_workflows/core_steps/visualizations/common/fonts/assets/inter/Inter[opsz,wght].ttf +0 -0
  621. roboflow_workflows/core_steps/visualizations/common/fonts/assets/inter/OFL.txt +93 -0
  622. roboflow_workflows/core_steps/visualizations/common/fonts/assets/jetbrains_mono/JetBrainsMono[wght].ttf +0 -0
  623. roboflow_workflows/core_steps/visualizations/common/fonts/assets/jetbrains_mono/OFL.txt +93 -0
  624. roboflow_workflows/core_steps/visualizations/common/fonts/assets/lato/Lato-Regular.ttf +0 -0
  625. roboflow_workflows/core_steps/visualizations/common/fonts/assets/lato/OFL.txt +93 -0
  626. roboflow_workflows/core_steps/visualizations/common/fonts/assets/montserrat/Montserrat[wght].ttf +0 -0
  627. roboflow_workflows/core_steps/visualizations/common/fonts/assets/montserrat/OFL.txt +93 -0
  628. roboflow_workflows/core_steps/visualizations/common/fonts/assets/noto_sans/NotoSans-Regular.ttf +0 -0
  629. roboflow_workflows/core_steps/visualizations/common/fonts/assets/noto_sans/OFL.txt +94 -0
  630. roboflow_workflows/core_steps/visualizations/common/fonts/assets/nunito_sans/NunitoSans[YTLC,opsz,wdth,wght].ttf +0 -0
  631. roboflow_workflows/core_steps/visualizations/common/fonts/assets/nunito_sans/OFL.txt +93 -0
  632. roboflow_workflows/core_steps/visualizations/common/fonts/assets/open_sans/OFL.txt +92 -0
  633. roboflow_workflows/core_steps/visualizations/common/fonts/assets/open_sans/OpenSans[wdth,wght].ttf +0 -0
  634. roboflow_workflows/core_steps/visualizations/common/fonts/assets/pt_mono/OFL.txt +93 -0
  635. roboflow_workflows/core_steps/visualizations/common/fonts/assets/pt_mono/PTM55FT.ttf +0 -0
  636. roboflow_workflows/core_steps/visualizations/common/fonts/assets/roboto/OFL.txt +93 -0
  637. roboflow_workflows/core_steps/visualizations/common/fonts/assets/roboto/Roboto[wdth,wght].ttf +0 -0
  638. roboflow_workflows/core_steps/visualizations/common/fonts/assets/roboto_mono/OFL.txt +93 -0
  639. roboflow_workflows/core_steps/visualizations/common/fonts/assets/roboto_mono/RobotoMono[wght].ttf +0 -0
  640. roboflow_workflows/core_steps/visualizations/common/fonts/assets/source_code_pro/OFL.txt +93 -0
  641. roboflow_workflows/core_steps/visualizations/common/fonts/assets/source_code_pro/SourceCodePro[wght].ttf +0 -0
  642. roboflow_workflows/core_steps/visualizations/common/fonts/assets/space_mono/OFL.txt +93 -0
  643. roboflow_workflows/core_steps/visualizations/common/fonts/assets/space_mono/SpaceMono-Regular.ttf +0 -0
  644. roboflow_workflows/core_steps/visualizations/common/fonts/assets/work_sans/OFL.txt +93 -0
  645. roboflow_workflows/core_steps/visualizations/common/fonts/assets/work_sans/WorkSans[wght].ttf +0 -0
  646. roboflow_workflows/core_steps/visualizations/common/fonts/downloader.py +162 -0
  647. roboflow_workflows/core_steps/visualizations/common/fonts/registry.py +298 -0
  648. roboflow_workflows/core_steps/visualizations/common/fonts/schema.py +60 -0
  649. roboflow_workflows/core_steps/visualizations/common/label_text.py +117 -0
  650. roboflow_workflows/core_steps/visualizations/common/utils.py +69 -0
  651. roboflow_workflows/core_steps/visualizations/corner/__init__.py +0 -0
  652. roboflow_workflows/core_steps/visualizations/corner/v1.py +174 -0
  653. roboflow_workflows/core_steps/visualizations/corner/v1_tensor.py +186 -0
  654. roboflow_workflows/core_steps/visualizations/crop/__init__.py +0 -0
  655. roboflow_workflows/core_steps/visualizations/crop/v1.py +205 -0
  656. roboflow_workflows/core_steps/visualizations/crop/v1_tensor.py +213 -0
  657. roboflow_workflows/core_steps/visualizations/dot/__init__.py +0 -0
  658. roboflow_workflows/core_steps/visualizations/dot/v1.py +196 -0
  659. roboflow_workflows/core_steps/visualizations/dot/v1_tensor.py +204 -0
  660. roboflow_workflows/core_steps/visualizations/ellipse/__init__.py +0 -0
  661. roboflow_workflows/core_steps/visualizations/ellipse/v1.py +186 -0
  662. roboflow_workflows/core_steps/visualizations/ellipse/v1_tensor.py +198 -0
  663. roboflow_workflows/core_steps/visualizations/grid/__init__.py +0 -0
  664. roboflow_workflows/core_steps/visualizations/grid/v1.py +276 -0
  665. roboflow_workflows/core_steps/visualizations/halo/__init__.py +0 -0
  666. roboflow_workflows/core_steps/visualizations/halo/v1.py +193 -0
  667. roboflow_workflows/core_steps/visualizations/halo/v1_tensor.py +203 -0
  668. roboflow_workflows/core_steps/visualizations/halo/v2.py +193 -0
  669. roboflow_workflows/core_steps/visualizations/halo/v2_tensor.py +203 -0
  670. roboflow_workflows/core_steps/visualizations/heatmap/__init__.py +0 -0
  671. roboflow_workflows/core_steps/visualizations/heatmap/v1.py +339 -0
  672. roboflow_workflows/core_steps/visualizations/heatmap/v1_tensor.py +351 -0
  673. roboflow_workflows/core_steps/visualizations/icon/__init__.py +0 -0
  674. roboflow_workflows/core_steps/visualizations/icon/v1.py +393 -0
  675. roboflow_workflows/core_steps/visualizations/icon/v1_tensor.py +402 -0
  676. roboflow_workflows/core_steps/visualizations/keypoint/__init__.py +0 -0
  677. roboflow_workflows/core_steps/visualizations/keypoint/v1.py +327 -0
  678. roboflow_workflows/core_steps/visualizations/keypoint/v1_tensor.py +304 -0
  679. roboflow_workflows/core_steps/visualizations/label/__init__.py +0 -0
  680. roboflow_workflows/core_steps/visualizations/label/v1.py +280 -0
  681. roboflow_workflows/core_steps/visualizations/label/v1_tensor.py +1188 -0
  682. roboflow_workflows/core_steps/visualizations/label/v2.py +268 -0
  683. roboflow_workflows/core_steps/visualizations/label/v2_tensor.py +147 -0
  684. roboflow_workflows/core_steps/visualizations/line_zone/__init__.py +0 -0
  685. roboflow_workflows/core_steps/visualizations/line_zone/v1.py +210 -0
  686. roboflow_workflows/core_steps/visualizations/mask/__init__.py +0 -0
  687. roboflow_workflows/core_steps/visualizations/mask/v1.py +197 -0
  688. roboflow_workflows/core_steps/visualizations/mask/v1_tensor.py +631 -0
  689. roboflow_workflows/core_steps/visualizations/model_comparison/__init__.py +0 -0
  690. roboflow_workflows/core_steps/visualizations/model_comparison/v1.py +224 -0
  691. roboflow_workflows/core_steps/visualizations/model_comparison/v1_tensor.py +233 -0
  692. roboflow_workflows/core_steps/visualizations/pixelate/__init__.py +0 -0
  693. roboflow_workflows/core_steps/visualizations/pixelate/v1.py +134 -0
  694. roboflow_workflows/core_steps/visualizations/pixelate/v1_tensor.py +144 -0
  695. roboflow_workflows/core_steps/visualizations/polygon/__init__.py +0 -0
  696. roboflow_workflows/core_steps/visualizations/polygon/v1.py +181 -0
  697. roboflow_workflows/core_steps/visualizations/polygon/v1_tensor.py +188 -0
  698. roboflow_workflows/core_steps/visualizations/polygon/v2.py +180 -0
  699. roboflow_workflows/core_steps/visualizations/polygon/v2_tensor.py +187 -0
  700. roboflow_workflows/core_steps/visualizations/polygon_zone/__init__.py +0 -0
  701. roboflow_workflows/core_steps/visualizations/polygon_zone/v1.py +178 -0
  702. roboflow_workflows/core_steps/visualizations/reference_path/__init__.py +0 -0
  703. roboflow_workflows/core_steps/visualizations/reference_path/v1.py +156 -0
  704. roboflow_workflows/core_steps/visualizations/rich_label/__init__.py +0 -0
  705. roboflow_workflows/core_steps/visualizations/rich_label/v1.py +365 -0
  706. roboflow_workflows/core_steps/visualizations/rich_label/v1_tensor.py +151 -0
  707. roboflow_workflows/core_steps/visualizations/text_display/__init__.py +0 -0
  708. roboflow_workflows/core_steps/visualizations/text_display/utils.py +350 -0
  709. roboflow_workflows/core_steps/visualizations/text_display/v1.py +483 -0
  710. roboflow_workflows/core_steps/visualizations/trace/__init__.py +0 -0
  711. roboflow_workflows/core_steps/visualizations/trace/v1.py +240 -0
  712. roboflow_workflows/core_steps/visualizations/trace/v1_tensor.py +248 -0
  713. roboflow_workflows/core_steps/visualizations/triangle/__init__.py +0 -0
  714. roboflow_workflows/core_steps/visualizations/triangle/v1.py +212 -0
  715. roboflow_workflows/core_steps/visualizations/triangle/v1_tensor.py +220 -0
  716. roboflow_workflows/enterprise_blocks/__init__.py +0 -0
  717. roboflow_workflows/enterprise_blocks/loader.py +47 -0
  718. roboflow_workflows/enterprise_blocks/sinks/PLC_modbus/__init__.py +0 -0
  719. roboflow_workflows/enterprise_blocks/sinks/PLC_modbus/v1.py +200 -0
  720. roboflow_workflows/enterprise_blocks/sinks/PLCethernetIP/__init__.py +0 -0
  721. roboflow_workflows/enterprise_blocks/sinks/PLCethernetIP/v1.py +226 -0
  722. roboflow_workflows/enterprise_blocks/sinks/__init__.py +0 -0
  723. roboflow_workflows/enterprise_blocks/sinks/event_writer/__init__.py +0 -0
  724. roboflow_workflows/enterprise_blocks/sinks/event_writer/v1.py +725 -0
  725. roboflow_workflows/enterprise_blocks/sinks/microsoft_sql_server/__init__.py +0 -0
  726. roboflow_workflows/enterprise_blocks/sinks/microsoft_sql_server/v1.py +428 -0
  727. roboflow_workflows/enterprise_blocks/sinks/mqtt_writer/__init__.py +0 -0
  728. roboflow_workflows/enterprise_blocks/sinks/mqtt_writer/v1.py +412 -0
  729. roboflow_workflows/enterprise_blocks/sinks/opc_writer/__init__.py +0 -0
  730. roboflow_workflows/enterprise_blocks/sinks/opc_writer/v1.py +1558 -0
  731. roboflow_workflows/enterprise_blocks/sinks/plc/__init__.py +0 -0
  732. roboflow_workflows/enterprise_blocks/sinks/plc/client.py +232 -0
  733. roboflow_workflows/enterprise_blocks/sinks/plc/direct.py +286 -0
  734. roboflow_workflows/enterprise_blocks/sinks/plc/v1.py +572 -0
  735. roboflow_workflows/enterprise_blocks/sinks/postgresql/__init__.py +0 -0
  736. roboflow_workflows/enterprise_blocks/sinks/postgresql/v1.py +630 -0
  737. roboflow_workflows/environment.py +159 -0
  738. roboflow_workflows/errors.py +298 -0
  739. roboflow_workflows/execution_engine/__init__.py +0 -0
  740. roboflow_workflows/execution_engine/constants.py +87 -0
  741. roboflow_workflows/execution_engine/core.py +155 -0
  742. roboflow_workflows/execution_engine/entities/__init__.py +0 -0
  743. roboflow_workflows/execution_engine/entities/base.py +750 -0
  744. roboflow_workflows/execution_engine/entities/engine.py +38 -0
  745. roboflow_workflows/execution_engine/entities/tensor_native_types.py +742 -0
  746. roboflow_workflows/execution_engine/entities/types.py +1433 -0
  747. roboflow_workflows/execution_engine/introspection/__init__.py +0 -0
  748. roboflow_workflows/execution_engine/introspection/blocks_loader.py +616 -0
  749. roboflow_workflows/execution_engine/introspection/connections_discovery.py +248 -0
  750. roboflow_workflows/execution_engine/introspection/entities.py +143 -0
  751. roboflow_workflows/execution_engine/introspection/schema_parser.py +507 -0
  752. roboflow_workflows/execution_engine/introspection/selectors_parser.py +122 -0
  753. roboflow_workflows/execution_engine/introspection/utils.py +52 -0
  754. roboflow_workflows/execution_engine/profiling/__init__.py +0 -0
  755. roboflow_workflows/execution_engine/profiling/core.py +268 -0
  756. roboflow_workflows/execution_engine/v1/__init__.py +0 -0
  757. roboflow_workflows/execution_engine/v1/compiler/__init__.py +0 -0
  758. roboflow_workflows/execution_engine/v1/compiler/cache.py +58 -0
  759. roboflow_workflows/execution_engine/v1/compiler/core.py +284 -0
  760. roboflow_workflows/execution_engine/v1/compiler/entities.py +279 -0
  761. roboflow_workflows/execution_engine/v1/compiler/graph_constructor.py +2035 -0
  762. roboflow_workflows/execution_engine/v1/compiler/graph_traversal.py +64 -0
  763. roboflow_workflows/execution_engine/v1/compiler/reference_type_checker.py +26 -0
  764. roboflow_workflows/execution_engine/v1/compiler/steps_initialiser.py +147 -0
  765. roboflow_workflows/execution_engine/v1/compiler/syntactic_parser.py +155 -0
  766. roboflow_workflows/execution_engine/v1/compiler/utils.py +167 -0
  767. roboflow_workflows/execution_engine/v1/compiler/validator.py +57 -0
  768. roboflow_workflows/execution_engine/v1/core.py +684 -0
  769. roboflow_workflows/execution_engine/v1/debugger/__init__.py +0 -0
  770. roboflow_workflows/execution_engine/v1/debugger/core.py +35 -0
  771. roboflow_workflows/execution_engine/v1/dynamic_blocks/__init__.py +0 -0
  772. roboflow_workflows/execution_engine/v1/dynamic_blocks/block_assembler.py +550 -0
  773. roboflow_workflows/execution_engine/v1/dynamic_blocks/block_duration.py +89 -0
  774. roboflow_workflows/execution_engine/v1/dynamic_blocks/block_scaffolding.py +601 -0
  775. roboflow_workflows/execution_engine/v1/dynamic_blocks/debug_logs.py +138 -0
  776. roboflow_workflows/execution_engine/v1/dynamic_blocks/entities.py +188 -0
  777. roboflow_workflows/execution_engine/v1/dynamic_blocks/error_utils.py +204 -0
  778. roboflow_workflows/execution_engine/v1/dynamic_blocks/modal_executor.py +2329 -0
  779. roboflow_workflows/execution_engine/v1/dynamic_blocks/representation_boundary.py +1455 -0
  780. roboflow_workflows/execution_engine/v1/dynamic_blocks/workflow_debug.py +197 -0
  781. roboflow_workflows/execution_engine/v1/entities.py +7 -0
  782. roboflow_workflows/execution_engine/v1/executor/__init__.py +0 -0
  783. roboflow_workflows/execution_engine/v1/executor/core.py +629 -0
  784. roboflow_workflows/execution_engine/v1/executor/execution_data_manager/__init__.py +0 -0
  785. roboflow_workflows/execution_engine/v1/executor/execution_data_manager/branching_manager.py +73 -0
  786. roboflow_workflows/execution_engine/v1/executor/execution_data_manager/dynamic_batches_manager.py +119 -0
  787. roboflow_workflows/execution_engine/v1/executor/execution_data_manager/execution_cache.py +413 -0
  788. roboflow_workflows/execution_engine/v1/executor/execution_data_manager/manager.py +701 -0
  789. roboflow_workflows/execution_engine/v1/executor/execution_data_manager/step_input_assembler.py +1101 -0
  790. roboflow_workflows/execution_engine/v1/executor/flow_coordinator.py +110 -0
  791. roboflow_workflows/execution_engine/v1/executor/output_constructor.py +618 -0
  792. roboflow_workflows/execution_engine/v1/executor/runtime_input_assembler.py +219 -0
  793. roboflow_workflows/execution_engine/v1/executor/runtime_input_validator.py +38 -0
  794. roboflow_workflows/execution_engine/v1/executor/utils.py +136 -0
  795. roboflow_workflows/execution_engine/v1/inner_workflow/__init__.py +43 -0
  796. roboflow_workflows/execution_engine/v1/inner_workflow/compiler_bridge.py +140 -0
  797. roboflow_workflows/execution_engine/v1/inner_workflow/composition.py +127 -0
  798. roboflow_workflows/execution_engine/v1/inner_workflow/constants.py +4 -0
  799. roboflow_workflows/execution_engine/v1/inner_workflow/dynamic_blocks_collection.py +143 -0
  800. roboflow_workflows/execution_engine/v1/inner_workflow/errors.py +106 -0
  801. roboflow_workflows/execution_engine/v1/inner_workflow/inline.py +665 -0
  802. roboflow_workflows/execution_engine/v1/inner_workflow/reference_resolution.py +227 -0
  803. roboflow_workflows/execution_engine/v1/introspection/__init__.py +0 -0
  804. roboflow_workflows/execution_engine/v1/introspection/inputs_discovery.py +371 -0
  805. roboflow_workflows/execution_engine/v1/introspection/kinds_schemas.py +159 -0
  806. roboflow_workflows/execution_engine/v1/introspection/kinds_schemas_register.py +35 -0
  807. roboflow_workflows/execution_engine/v1/introspection/outputs_discovery.py +126 -0
  808. roboflow_workflows/execution_engine/v1/introspection/types_discovery.py +25 -0
  809. roboflow_workflows/execution_engine/v1/step_error_handlers.py +21 -0
  810. roboflow_workflows/offline.py +70 -0
  811. roboflow_workflows/prototypes/__init__.py +0 -0
  812. roboflow_workflows/prototypes/background_tasks.py +13 -0
  813. roboflow_workflows/prototypes/block.py +594 -0
  814. roboflow_workflows/prototypes/cache.py +21 -0
  815. roboflow_workflows/prototypes/image_codec.py +293 -0
  816. roboflow_workflows/prototypes/models_provider.py +310 -0
  817. roboflow_workflows/prototypes/observer.py +155 -0
  818. roboflow_workflows/prototypes/platform_client.py +97 -0
  819. roboflow_workflows/prototypes/platform_errors.py +74 -0
  820. roboflow_workflows/prototypes/workspace_resolver.py +26 -0
  821. roboflow_workflows/utils/__init__.py +0 -0
  822. roboflow_workflows/utils/action_recognition.py +63 -0
  823. roboflow_workflows/utils/image_encoding.py +123 -0
  824. roboflow_workflows/utils/images.py +128 -0
  825. roboflow_workflows/utils/in_memory_cache.py +40 -0
  826. roboflow_workflows/utils/lru_cache.py +39 -0
  827. roboflow_workflows/utils/text.py +80 -0
  828. roboflow_workflows/utils/url_input.py +187 -0
  829. roboflow_workflows/warnings.py +2 -0
  830. roboflow_workflows-0.1.0.dist-info/METADATA +125 -0
  831. roboflow_workflows-0.1.0.dist-info/RECORD +834 -0
  832. roboflow_workflows-0.1.0.dist-info/WHEEL +5 -0
  833. roboflow_workflows-0.1.0.dist-info/licenses/LICENSE +7 -0
  834. roboflow_workflows-0.1.0.dist-info/top_level.txt +1 -0
File without changes
@@ -0,0 +1,52 @@
1
+ """Historic identifiers for the moved Workflows package.
2
+
3
+ Public identifiers must keep their pre-move dotted form so operator-facing
4
+ config (WORKFLOW_DISABLED_BLOCK_PATTERNS), user-visible error strings and
5
+ telemetry (fully_qualified_block_class_name, logger names) do not change
6
+ when the code lives under ``roboflow_workflows.*`` instead of
7
+ ``inference.core.workflows.*`` / ``inference.enterprise.workflows.enterprise_blocks.*``.
8
+
9
+ We map at read-time; ``class.__module__`` stays canonical so pickling and
10
+ ``importlib.import_module(cls.__module__)`` continue to work in a standalone
11
+ ``roboflow_workflows`` install where ``inference.*`` is not importable.
12
+ """
13
+
14
+ from __future__ import annotations
15
+
16
+ import logging
17
+
18
+ _CANONICAL_ROOT = "roboflow_workflows"
19
+ _ENTERPRISE_CANONICAL = "roboflow_workflows.enterprise_blocks"
20
+ _CORE_LEGACY = "inference.core.workflows"
21
+ _ENTERPRISE_LEGACY = "inference.enterprise.workflows.enterprise_blocks"
22
+
23
+
24
+ def to_legacy_module(module_name: str) -> str:
25
+ """Return the historic ``inference.*`` dotted form of a canonical module."""
26
+ if module_name == _ENTERPRISE_CANONICAL or module_name.startswith(
27
+ _ENTERPRISE_CANONICAL + "."
28
+ ):
29
+ return _ENTERPRISE_LEGACY + module_name[len(_ENTERPRISE_CANONICAL) :]
30
+ if module_name == _CANONICAL_ROOT or module_name.startswith(_CANONICAL_ROOT + "."):
31
+ return _CORE_LEGACY + module_name[len(_CANONICAL_ROOT) :]
32
+ return module_name
33
+
34
+
35
+ def get_logger(module_name: str) -> logging.Logger:
36
+ """``logging.getLogger`` under the historic ``inference.*`` name.
37
+
38
+ Keeps the logger tree rooted at the ``inference`` logger so handlers /
39
+ level configured on ``inference`` propagate as they did before the move.
40
+ """
41
+ return logging.getLogger(to_legacy_module(module_name))
42
+
43
+
44
+ def historic_type_display(type_obj: type) -> str:
45
+ """Fully-qualified type name using the historic module path.
46
+
47
+ Used by user-facing error strings that spell out ``type.__module__`` so
48
+ the string does not change when the code moves under ``roboflow_workflows``.
49
+ Unlike block identifiers, these errors historically included ``builtins``.
50
+ """
51
+ module = to_legacy_module(type_obj.__module__)
52
+ return f"{module}.{type_obj.__qualname__}"
@@ -0,0 +1,342 @@
1
+ """Injected configuration for `inference/core/workflows`.
2
+
3
+ Every value the module used to take from `inference.core.env` is a field of
4
+ `WorkflowsConfiguration`, which the host builds from its own already-resolved
5
+ settings and installs once per process with `configure_process`.
6
+
7
+ The configuration is PROCESS-WIDE in its entirety. Every configuration value
8
+ is read from a module constant frozen at import - `core_steps/loader.py`
9
+ branches on the tensor flag while it is being imported, `offline.py:34` reads
10
+ `SECURE_GATEWAY`, `block_assembler.py:100` reads the custom-Python
11
+ authorization flag - so there is no field a second, differing configuration
12
+ could change after the fact. `ensure_process_configuration_matches` therefore
13
+ refuses ANY difference rather than accepting a value nothing would honour.
14
+
15
+ Per-engine variance lives where it already did: the named init parameters
16
+ `workflows_core.{step_execution_mode, api_key, disable_sinks,
17
+ allow_access_to_file_system, allowed_write_directory,
18
+ allow_access_to_environmental_variables}`, resolved by
19
+ `steps_initialiser.retrieve_init_parameter_values`.
20
+
21
+ `default_configuration()` is the STANDALONE fallback, not the production path.
22
+ Its values are the ones `inference/core/env.py` resolves for an EMPTY
23
+ environment. Every normalisation `env.py` performs - `str2bool`, `.lower()`,
24
+ the `OFFLINE_MODE` / `SECURE_GATEWAY` rewrites, the `PROJECT`-dependent hosted
25
+ URLs, the api-key-transport validation - stays in `env.py`; the host builder
26
+ copies the RESOLVED attributes. `resolve_image_tensor_device` is the single
27
+ copied piece of logic and is pinned by a differential test against `env.py`.
28
+ """
29
+
30
+ import threading
31
+ from dataclasses import dataclass, field, fields, is_dataclass
32
+ from typing import Any, List, Optional, Tuple
33
+
34
+ from roboflow_workflows.errors import WorkflowEnvironmentConfigurationError
35
+
36
+
37
+ @dataclass(frozen=True)
38
+ class EngineConfiguration:
39
+ step_execution_mode: str = "local"
40
+ async_future_result_timeout: float = 60.0
41
+ max_inner_workflow_depth: int = 4
42
+ max_inner_workflow_count: int = 32
43
+ allow_custom_python_execution: bool = True
44
+ custom_python_execution_mode: str = "local"
45
+ allow_blocks_accessing_local_storage: bool = True
46
+ allow_blocks_accessing_environmental_variables: bool = True
47
+ blocks_write_directory: Optional[str] = None
48
+ # Tuples, not lists: the configuration is frozen and compared by value. The
49
+ # facade re-materialises the `list` the call sites see today.
50
+ disabled_block_types: Tuple[str, ...] = ()
51
+ disabled_block_patterns: Tuple[str, ...] = ()
52
+ allow_webhook_sink_to_non_global_addresses: bool = True
53
+ # PostgreSQL sink policy. Optional[Tuple] mirrors env.py's None-vs-set
54
+ # distinction (empty env var / unset). The sink reconstructs a `set`.
55
+ allow_postgresql_sink_to_non_global_addresses: bool = True
56
+ postgresql_sink_blacklisted_addresses: Optional[Tuple[str, ...]] = None
57
+ postgresql_sink_whitelisted_addresses: Optional[Tuple[str, ...]] = None
58
+
59
+
60
+ @dataclass(frozen=True)
61
+ class TensorConfiguration:
62
+ """Selects which block classes `core_steps/loader.py` imports and how
63
+ `WorkflowImageData` stores pixels. Block loading is process-global and
64
+ cached (`blocks_loader.py:252`), so these can never be per-engine."""
65
+
66
+ representation_enabled: bool = False
67
+ # `torch.device` when the flag is on and torch is importable, else None.
68
+ # Typed `Any` so this module never imports torch (an OPTIONAL dependency).
69
+ image_tensor_device: Optional[Any] = None
70
+ visualisation_validate_owners: bool = False
71
+ sam_video_mask_representation: str = "rle"
72
+ enforce_dense_instance_masks: bool = False
73
+
74
+
75
+ @dataclass(frozen=True)
76
+ class RemoteExecutionConfiguration:
77
+ api_target: str = "hosted"
78
+ api_key_transport: str = "both"
79
+ local_inference_api_url: str = "http://127.0.0.1:9001"
80
+ hosted_detect_url: str = "https://detect.roboflow.com"
81
+ hosted_classification_url: str = "https://classify.roboflow.com"
82
+ hosted_instance_segmentation_url: str = "https://outline.roboflow.com"
83
+ hosted_semantic_segmentation_url: str = "https://segment.roboflow.com"
84
+ hosted_core_model_url: str = "https://infer.roboflow.com"
85
+ max_step_batch_size: int = 1
86
+ max_step_concurrent_requests: int = 8
87
+ inner_workflow_remote_target: str = "https://serverless.roboflow.com"
88
+ inner_workflow_remote_dispatch_request_timeout: float = 300.0
89
+ openai_compatible_allowed_base_urls: Tuple[str, ...] = ("*",)
90
+
91
+
92
+ @dataclass(frozen=True)
93
+ class PlatformConfiguration:
94
+ api_base_url: str = "https://api.roboflow.com"
95
+ offline_mode: bool = False
96
+ secure_gateway: Optional[str] = None
97
+ gcp_serverless: bool = False
98
+ # LAMBDA runtime flag, mirrors inference.core.env.LAMBDA. Used by the
99
+ # PostgreSQL sink hosted-runtime gate together with gcp_serverless.
100
+ lambda_runtime: bool = False
101
+
102
+
103
+ @dataclass(frozen=True)
104
+ class FontsConfiguration:
105
+ allow_download: bool = True
106
+ model_cache_dir: str = "/tmp/cache"
107
+
108
+
109
+ @dataclass(frozen=True)
110
+ class ModelsConfiguration:
111
+ lmm_enabled: bool = False
112
+ clip_version_id: str = "ViT-B-16"
113
+ core_model_sam2_enabled: bool = True
114
+ core_model_sam3_enabled: bool = True
115
+ core_model_pe_enabled: bool = True
116
+ core_model_gaze_enabled: bool = True
117
+ sam3_exec_mode: str = "local"
118
+ sam3_3d_objects_enabled: bool = False
119
+ florence2_enabled: bool = True
120
+ qwen_2_5_enabled: bool = True
121
+ qwen_3_enabled: bool = True
122
+ qwen_3_5_enabled: bool = True
123
+ smolvlm2_enabled: bool = True
124
+ moondream2_enabled: bool = True
125
+ depth_estimation_enabled: bool = True
126
+ cosmos3_enabled: bool = True
127
+ glm_ocr_enabled: bool = True
128
+
129
+
130
+ @dataclass(frozen=True)
131
+ class ModalConfiguration:
132
+ token_id: Optional[str] = None
133
+ token_secret: Optional[str] = field(default=None, repr=False)
134
+ workspace_name: str = "roboflow"
135
+ allow_anonymous_execution: bool = False
136
+ anonymous_workspace_name: str = "anonymous"
137
+ app_name: str = "webexec-roboflow-platform"
138
+ executor_idle_ttl_seconds: int = 1800
139
+ jpeg_quality: int = 95
140
+ transport: str = "http"
141
+ ws_connect_timeout_seconds: int = 30
142
+ ws_read_timeout_seconds: int = 720
143
+ ws_connection_pool_size: int = 1
144
+ ws_fail_on_session_loss: bool = False
145
+ ws_idle_release_seconds: int = 120
146
+
147
+
148
+ @dataclass(frozen=True)
149
+ class SecretsConfiguration:
150
+ api_key: Optional[str] = field(default=None, repr=False)
151
+ roboflow_internal_service_name: Optional[str] = None
152
+ roboflow_internal_service_secret: Optional[str] = field(default=None, repr=False)
153
+
154
+
155
+ @dataclass(frozen=True)
156
+ class DebugConfiguration:
157
+ output_dir: Optional[str] = None
158
+
159
+
160
+ @dataclass(frozen=True)
161
+ class WorkflowsConfiguration:
162
+ engine: EngineConfiguration = field(default_factory=EngineConfiguration)
163
+ tensor: TensorConfiguration = field(default_factory=TensorConfiguration)
164
+ remote: RemoteExecutionConfiguration = field(
165
+ default_factory=RemoteExecutionConfiguration
166
+ )
167
+ platform: PlatformConfiguration = field(default_factory=PlatformConfiguration)
168
+ fonts: FontsConfiguration = field(default_factory=FontsConfiguration)
169
+ models: ModelsConfiguration = field(default_factory=ModelsConfiguration)
170
+ modal: ModalConfiguration = field(default_factory=ModalConfiguration)
171
+ secrets: SecretsConfiguration = field(default_factory=SecretsConfiguration)
172
+ debug: DebugConfiguration = field(default_factory=DebugConfiguration)
173
+
174
+
175
+ def default_configuration() -> WorkflowsConfiguration:
176
+ """The standalone fallback: every field at its documented default."""
177
+ return WorkflowsConfiguration()
178
+
179
+
180
+ def resolve_image_tensor_device(
181
+ representation_enabled: bool, device: Optional[str] = None
182
+ ) -> Optional[Any]:
183
+ """Materialise the tensor device exactly as `inference/core/env.py:1535-1547`.
184
+
185
+ `torch` is an OPTIONAL dependency, so both the import and the device are
186
+ deferred behind the flag AND guarded on torch's presence. Off-flag or
187
+ torch-less the value is `None`. An invalid device string raises whatever
188
+ `torch.device` raises, which is what `env.py` does too - it does not guard
189
+ that call either.
190
+
191
+ The `try` deliberately spans the import, the cuda autodetect AND the
192
+ materialisation, catching only `ImportError`, because that is exactly
193
+ `env.py:1536-1547`'s boundary (round-2 defect 5: the round-1 copy protected
194
+ only the import, so a `torch.cuda.is_available()` raising `ImportError`
195
+ would have propagated from the copy while `env.py` swallowed it).
196
+ `test_the_copy_preserves_the_originals_exception_boundary` pins both shapes.
197
+ """
198
+ if not representation_enabled:
199
+ return None
200
+ try:
201
+ import torch
202
+
203
+ if device is None:
204
+ device = "cuda" if torch.cuda.is_available() else "cpu"
205
+ return torch.device(device)
206
+ except ImportError:
207
+ return None
208
+
209
+
210
+ def describe_configuration_difference(
211
+ installed: WorkflowsConfiguration, candidate: WorkflowsConfiguration
212
+ ) -> List[str]:
213
+ """`['group.field: <installed> != <candidate>', ...]`, empty when equal.
214
+
215
+ Secret fields are compared but never rendered - the message says the field
216
+ differs, not what either value is.
217
+ """
218
+ differences = []
219
+ for group in fields(WorkflowsConfiguration):
220
+ installed_group = getattr(installed, group.name)
221
+ candidate_group = getattr(candidate, group.name)
222
+ if installed_group == candidate_group:
223
+ continue
224
+ if not is_dataclass(candidate_group):
225
+ differences.append(f"{group.name}: differs")
226
+ continue
227
+ for member in fields(installed_group):
228
+ left = getattr(installed_group, member.name)
229
+ right = getattr(candidate_group, member.name)
230
+ if left == right:
231
+ continue
232
+ if member.repr is False:
233
+ differences.append(f"{group.name}.{member.name}: differs (redacted)")
234
+ else:
235
+ differences.append(f"{group.name}.{member.name}: {left!r} != {right!r}")
236
+ return differences
237
+
238
+
239
+ _CONFIGURATION: Optional[WorkflowsConfiguration] = None
240
+ # One lock guards installation, the sticky fallback initialisation in
241
+ # `get_configuration` (which also assigns) and `reset_configuration`. Round-1
242
+ # review reproduced two conflicting installs both succeeding through an
243
+ # unlocked check-then-assign; Phase 10's image-codec registry locks for the
244
+ # same reason.
245
+ _INSTALL_LOCK = threading.RLock()
246
+
247
+
248
+ def configure_process(configuration: WorkflowsConfiguration) -> None:
249
+ """Install the process-wide configuration. Set-once, by value.
250
+
251
+ Installing the identical object, or an EQUAL one, is a no-op - frozen
252
+ dataclasses compare by value and the server memoises its instance.
253
+ Installing a DIFFERING one raises, naming every group and field that
254
+ differs.
255
+ """
256
+ global _CONFIGURATION
257
+ with _INSTALL_LOCK:
258
+ if _CONFIGURATION is not None and _CONFIGURATION != configuration:
259
+ differences = describe_configuration_difference(
260
+ _CONFIGURATION, configuration
261
+ )
262
+ raise WorkflowEnvironmentConfigurationError(
263
+ public_message=(
264
+ "A different WorkflowsConfiguration is already installed in "
265
+ "this process. Workflows configuration is process-level: "
266
+ "block registration and the image representation are decided "
267
+ "once, at import time, and every other value is frozen into "
268
+ "module constants. Install the configuration before importing "
269
+ "any workflows module, and install the same one everywhere. "
270
+ f"Differences: {differences}"
271
+ ),
272
+ context="workflow_configuration | process_installation",
273
+ )
274
+ _CONFIGURATION = configuration
275
+
276
+
277
+ def get_configuration() -> WorkflowsConfiguration:
278
+ """The installed configuration, falling back to the standalone default.
279
+
280
+ The fallback is STICKY: once read, it becomes the process configuration, so
281
+ a later `configure_process` with different values raises instead of
282
+ silently disagreeing with values already frozen into module constants.
283
+ """
284
+ global _CONFIGURATION
285
+ with _INSTALL_LOCK:
286
+ if _CONFIGURATION is None:
287
+ _CONFIGURATION = default_configuration()
288
+ return _CONFIGURATION
289
+
290
+
291
+ def reset_configuration() -> None:
292
+ """Test-only hook: forget the installed configuration."""
293
+ global _CONFIGURATION
294
+ with _INSTALL_LOCK:
295
+ _CONFIGURATION = None
296
+
297
+
298
+ def ensure_process_configuration_matches(configuration: Any) -> None:
299
+ """Refuse an engine-supplied configuration that differs from the process one.
300
+
301
+ `init_parameters["workflows_core.configuration"]` is a CONSISTENCY
302
+ ASSERTION, not an override channel: the composition roots pass the object
303
+ the host installed, and a mismatch means the process is mis-wired. Because
304
+ every value is read from a module constant frozen at import, accepting a
305
+ differing value would mean accepting a value nothing honours.
306
+
307
+ The caller decides PRESENCE (the engine calls this only when the key is in
308
+ `init_parameters`); this function judges the VALUE, and `None` is not a
309
+ valid value: an explicit `None` would be handed to every block that
310
+ declares `configuration` ahead of the registered default
311
+ (`steps_initialiser.py:124-125` prefers explicit values), so it is refused
312
+ like any other non-`WorkflowsConfiguration` (round-4 defect 1).
313
+ """
314
+ if not isinstance(configuration, WorkflowsConfiguration):
315
+ # Only ever reached through the DEDICATED init-parameter keys, so a
316
+ # foreign value there is a mis-wiring, never a plugin's own parameter
317
+ # (`v1/core.py` deliberately does not fall back to the bare name).
318
+ raise WorkflowEnvironmentConfigurationError(
319
+ public_message=(
320
+ "`workflows_core.configuration` must be a WorkflowsConfiguration, "
321
+ f"got {type(configuration).__name__}."
322
+ ),
323
+ context="workflow_compilation | engine_initialisation",
324
+ )
325
+ installed = get_configuration()
326
+ if configuration == installed:
327
+ return
328
+ differences = describe_configuration_difference(installed, configuration)
329
+ raise WorkflowEnvironmentConfigurationError(
330
+ public_message=(
331
+ "`workflows_core.configuration` differs from the WorkflowsConfiguration "
332
+ "installed in this process. Workflows configuration is process-level "
333
+ "and cannot be varied per engine; use the named init parameters "
334
+ "(`workflows_core.step_execution_mode`, `workflows_core.api_key`, "
335
+ "`workflows_core.disable_sinks`, "
336
+ "`workflows_core.allow_access_to_file_system`, "
337
+ "`workflows_core.allowed_write_directory`, "
338
+ "`workflows_core.allow_access_to_environmental_variables`) for "
339
+ f"per-engine values. Differences: {differences}"
340
+ ),
341
+ context="workflow_compilation | engine_initialisation",
342
+ )
File without changes
File without changes
@@ -0,0 +1,234 @@
1
+ from collections import Counter, defaultdict, deque
2
+ from math import sqrt
3
+ from typing import DefaultDict, Deque, Optional, Sequence, Tuple, Union
4
+
5
+ import numpy as np
6
+ import supervision as sv
7
+
8
+ from inference_models.models.base.instance_segmentation import InstanceDetections
9
+ from inference_models.models.base.object_detection import Detections
10
+ from inference_models.models.base.types import InstancesRLEMasks
11
+
12
+
13
+ def empty_detections_like(
14
+ detections: Union[Detections, InstanceDetections],
15
+ ) -> Union[Detections, InstanceDetections]:
16
+ bboxes_metadata = [] if isinstance(detections.bboxes_metadata, list) else None
17
+ if isinstance(detections, InstanceDetections):
18
+ mask = detections.mask
19
+ if isinstance(mask, InstancesRLEMasks):
20
+ mask = InstancesRLEMasks(image_size=mask.image_size, masks=[])
21
+ else:
22
+ mask = mask[0:0]
23
+ return InstanceDetections(
24
+ xyxy=detections.xyxy[0:0],
25
+ class_id=detections.class_id[0:0],
26
+ confidence=detections.confidence[0:0],
27
+ mask=mask,
28
+ image_metadata=detections.image_metadata,
29
+ bboxes_metadata=bboxes_metadata,
30
+ )
31
+ return Detections(
32
+ xyxy=detections.xyxy[0:0],
33
+ class_id=detections.class_id[0:0],
34
+ confidence=detections.confidence[0:0],
35
+ image_metadata=detections.image_metadata,
36
+ bboxes_metadata=bboxes_metadata,
37
+ )
38
+
39
+
40
+ _DEFAULT_LINE_ANCHORS = (
41
+ sv.Position.TOP_LEFT,
42
+ sv.Position.TOP_RIGHT,
43
+ sv.Position.BOTTOM_LEFT,
44
+ sv.Position.BOTTOM_RIGHT,
45
+ )
46
+
47
+
48
+ def _stack_anchor_coordinates(
49
+ xyxy: np.ndarray, anchors: Sequence[sv.Position]
50
+ ) -> np.ndarray:
51
+ center_x = (xyxy[:, 0] + xyxy[:, 2]) / 2
52
+ center_y = (xyxy[:, 1] + xyxy[:, 3]) / 2
53
+ result = np.empty((len(anchors), len(xyxy), 2), dtype=xyxy.dtype)
54
+ for index, anchor in enumerate(anchors):
55
+ if anchor == sv.Position.CENTER:
56
+ result[index, :, 0] = center_x
57
+ result[index, :, 1] = center_y
58
+ elif anchor == sv.Position.CENTER_OF_MASS:
59
+ raise ValueError(
60
+ "Cannot use `Position.CENTER_OF_MASS` without a detection mask."
61
+ )
62
+ elif anchor == sv.Position.CENTER_LEFT:
63
+ result[index, :, 0] = xyxy[:, 0]
64
+ result[index, :, 1] = center_y
65
+ elif anchor == sv.Position.CENTER_RIGHT:
66
+ result[index, :, 0] = xyxy[:, 2]
67
+ result[index, :, 1] = center_y
68
+ elif anchor == sv.Position.BOTTOM_CENTER:
69
+ result[index, :, 0] = center_x
70
+ result[index, :, 1] = xyxy[:, 3]
71
+ elif anchor == sv.Position.BOTTOM_LEFT:
72
+ result[index, :, 0] = xyxy[:, 0]
73
+ result[index, :, 1] = xyxy[:, 3]
74
+ elif anchor == sv.Position.BOTTOM_RIGHT:
75
+ result[index, :, 0] = xyxy[:, 2]
76
+ result[index, :, 1] = xyxy[:, 3]
77
+ elif anchor == sv.Position.TOP_CENTER:
78
+ result[index, :, 0] = center_x
79
+ result[index, :, 1] = xyxy[:, 1]
80
+ elif anchor == sv.Position.TOP_LEFT:
81
+ result[index, :, 0] = xyxy[:, 0]
82
+ result[index, :, 1] = xyxy[:, 1]
83
+ elif anchor == sv.Position.TOP_RIGHT:
84
+ result[index, :, 0] = xyxy[:, 2]
85
+ result[index, :, 1] = xyxy[:, 1]
86
+ else:
87
+ raise ValueError(f"{anchor} is not supported.")
88
+ return result
89
+
90
+
91
+ def anchor_coordinates(xyxy: np.ndarray, anchor: sv.Position) -> np.ndarray:
92
+ return _stack_anchor_coordinates(xyxy, (anchor,))[0]
93
+
94
+
95
+ class LeanLineZone:
96
+ def __init__(
97
+ self,
98
+ start: Tuple[float, float],
99
+ end: Tuple[float, float],
100
+ triggering_anchors: Optional[Sequence[sv.Position]] = None,
101
+ ) -> None:
102
+ self.start = start
103
+ self.end = end
104
+ self.triggering_anchors = tuple(
105
+ _DEFAULT_LINE_ANCHORS if triggering_anchors is None else triggering_anchors
106
+ )
107
+ if not self.triggering_anchors:
108
+ raise ValueError("Triggering anchors cannot be empty.")
109
+
110
+ minimum_crossing_threshold = 1
111
+ self.crossing_history_length = max(2, minimum_crossing_threshold + 1)
112
+ self.crossing_state_history: DefaultDict[
113
+ Tuple[int, Optional[int]], Deque[bool]
114
+ ] = defaultdict(lambda: deque(maxlen=self.crossing_history_length))
115
+ self._in_count_per_class: Counter = Counter()
116
+ self._out_count_per_class: Counter = Counter()
117
+
118
+ start_x, start_y = start
119
+ end_x, end_y = end
120
+ delta_x = end_x - start_x
121
+ delta_y = end_y - start_y
122
+ magnitude = sqrt(delta_x**2 + delta_y**2)
123
+ if magnitude == 0:
124
+ raise ValueError("The magnitude of the vector cannot be zero.")
125
+
126
+ unit_vector_x = delta_x / magnitude
127
+ unit_vector_y = delta_y / magnitude
128
+ perpendicular_vector_x = -unit_vector_y
129
+ perpendicular_vector_y = unit_vector_x
130
+ self._limit_starts = np.array([start, end], dtype=float)
131
+ self._limit_vectors = np.array(
132
+ [
133
+ [perpendicular_vector_x, perpendicular_vector_y],
134
+ [-perpendicular_vector_x, -perpendicular_vector_y],
135
+ ],
136
+ dtype=float,
137
+ )
138
+ self._line_vector = np.array([delta_x, delta_y], dtype=float)
139
+
140
+ @property
141
+ def in_count(self) -> int:
142
+ return sum(self._in_count_per_class.values())
143
+
144
+ @property
145
+ def out_count(self) -> int:
146
+ return sum(self._out_count_per_class.values())
147
+
148
+ def trigger(
149
+ self, xyxy: np.ndarray, tracker_ids: np.ndarray
150
+ ) -> Tuple[np.ndarray, np.ndarray]:
151
+ crossed_in = np.full(len(xyxy), False)
152
+ crossed_out = np.full(len(xyxy), False)
153
+ if len(xyxy) == 0:
154
+ return crossed_in, crossed_out
155
+
156
+ all_anchors = _stack_anchor_coordinates(xyxy, self.triggering_anchors)
157
+ limit_deltas = all_anchors[None, :, :, :] - self._limit_starts[:, None, None, :]
158
+ limit_cross_products = (
159
+ self._limit_vectors[:, 0, None, None] * limit_deltas[:, :, :, 1]
160
+ - self._limit_vectors[:, 1, None, None] * limit_deltas[:, :, :, 0]
161
+ )
162
+ in_limits = np.all(
163
+ (limit_cross_products[0] > 0) == (limit_cross_products[1] > 0),
164
+ axis=0,
165
+ )
166
+
167
+ line_deltas = all_anchors - np.asarray(self.start)
168
+ triggers = (
169
+ self._line_vector[0] * line_deltas[:, :, 1]
170
+ - self._line_vector[1] * line_deltas[:, :, 0]
171
+ ) < 0
172
+ has_any_left_trigger = np.any(triggers, axis=0)
173
+ has_any_right_trigger = np.any(~triggers, axis=0)
174
+
175
+ class_id = None
176
+ for index, tracker_id in enumerate(tracker_ids):
177
+ if not in_limits[index]:
178
+ continue
179
+ if has_any_left_trigger[index] and has_any_right_trigger[index]:
180
+ continue
181
+
182
+ tracker_state = has_any_left_trigger[index]
183
+ crossing_history = self.crossing_state_history[(tracker_id, class_id)]
184
+ crossing_history.append(tracker_state)
185
+ if len(crossing_history) < self.crossing_history_length:
186
+ continue
187
+
188
+ oldest_state = crossing_history[0]
189
+ if crossing_history.count(oldest_state) > 1:
190
+ continue
191
+
192
+ if tracker_state:
193
+ self._in_count_per_class[class_id] += 1
194
+ crossed_in[index] = True
195
+ else:
196
+ self._out_count_per_class[class_id] += 1
197
+ crossed_out[index] = True
198
+
199
+ return crossed_in, crossed_out
200
+
201
+
202
+ class LeanPolygonZone:
203
+ def __init__(
204
+ self,
205
+ polygon: np.ndarray,
206
+ triggering_anchors: Sequence[sv.Position],
207
+ ) -> None:
208
+ self.polygon = polygon.astype(int)
209
+ self.triggering_anchors = tuple(triggering_anchors)
210
+ if not self.triggering_anchors:
211
+ raise ValueError("Triggering anchors cannot be empty.")
212
+
213
+ self.current_count = 0
214
+ x_max, y_max = np.max(polygon, axis=0)
215
+ self.mask = sv.polygon_to_mask(
216
+ polygon=polygon, resolution_wh=(x_max + 2, y_max + 2)
217
+ )
218
+
219
+ def trigger(self, xyxy: np.ndarray) -> np.ndarray:
220
+ if len(xyxy) == 0:
221
+ self.current_count = 0
222
+ return np.array([], dtype=bool)
223
+
224
+ all_anchors = np.ceil(
225
+ _stack_anchor_coordinates(xyxy, self.triggering_anchors)
226
+ ).astype(int)
227
+ mask_h, mask_w = self.mask.shape
228
+ x, y = all_anchors[:, :, 0], all_anchors[:, :, 1]
229
+ in_bounds = (x >= 0) & (y >= 0) & (x < mask_w) & (y < mask_h)
230
+ x_safe = np.clip(x, 0, mask_w - 1)
231
+ y_safe = np.clip(y, 0, mask_h - 1)
232
+ is_in_zone = np.all(in_bounds & self.mask[y_safe, x_safe], axis=0)
233
+ self.current_count = int(np.sum(is_in_zone))
234
+ return is_in_zone.astype(bool)