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
@@ -0,0 +1,701 @@
1
+ """Tensor-native sibling of `roboflow_core/roboflow_instance_segmentation_model@v2`.
2
+
3
+ Under ENABLE_TENSOR_DATA_REPRESENTATION this block emits a native
4
+ ``inference_models.InstanceDetections`` (torch tensors on
5
+ ``WORKFLOWS_IMAGE_TENSOR_DEVICE``; masks dense or RLE) under
6
+ ``TENSOR_NATIVE_INSTANCE_SEGMENTATION_PREDICTION_KIND`` /
7
+ ``TENSOR_NATIVE_RLE_INSTANCE_SEGMENTATION_PREDICTION_KIND`` instead of
8
+ ``sv.Detections``.
9
+
10
+ - LOCAL: ``ModelsProvider.run_tensor_native_inference`` returns
11
+ ``List[InstanceDetections]`` straight from the adapter. The mask carrier (dense
12
+ ``torch.Tensor`` vs ``InstancesRLEMasks``) is adapter-decided: the v2 manifest
13
+ exposes ``enforce_dense_masks_in_inference_models`` and the adapter consumes it
14
+ to choose dense vs RLE, so both carriers are possible and both are handled
15
+ downstream by the helpers and the tensor serialiser. The block applies
16
+ ``class_filter`` natively (the adapter/model does NOT read it on this path) and
17
+ attaches the producer contract (``image_metadata[class_names]`` + per-box
18
+ ``detection_id``) the tensor serialiser requires, via
19
+ ``attach_native_detection_metadata`` (it preserves masks + per-box metadata).
20
+ - REMOTE: standard inference instance-seg prediction dicts are rebuilt into a
21
+ native ``InstanceDetections`` via the in-file
22
+ ``_native_instance_detections_from_inference_predictions`` converter (never
23
+ ``sv.Detections``). The block requests ``response_mask_format="rle"`` and carries
24
+ RLE masks when the server honours it; it degrades gracefully to a dense mask
25
+ rasterised from polygon ``points`` when the server ignores that parameter
26
+ (older/alternative servers), matching the numpy flag-OFF polygon path.
27
+
28
+ This block creates ONLY this file; it reuses the already-registered tensor
29
+ serialiser for ``instance_segmentation_prediction`` /
30
+ ``rle_instance_segmentation_prediction`` (``serialise_sv_detections`` already
31
+ handles ``InstanceDetections``, dense or RLE). The numpy sibling lives in
32
+ ``.../instance_segmentation/v2.py``; this manifest is identical except the output
33
+ kinds.
34
+ """
35
+
36
+ import uuid
37
+ from typing import Dict, List, Literal, Optional, Type, Union
38
+
39
+ import numpy as np
40
+ import supervision as sv
41
+ import torch
42
+ from pydantic import ConfigDict, Field, PositiveInt
43
+ from roboflow_workflows.core_steps.common.entities import StepExecutionMode
44
+ from roboflow_workflows.core_steps.common.tensor_native import (
45
+ attach_native_detection_metadata,
46
+ build_native_image_metadata,
47
+ take_prediction_by_mask,
48
+ )
49
+ from roboflow_workflows.environment import (
50
+ HOSTED_INSTANCE_SEGMENTATION_URL,
51
+ LOCAL_INFERENCE_API_URL,
52
+ WORKFLOWS_ENFORCE_DENSE_INSTANCE_MASKS,
53
+ WORKFLOWS_IMAGE_TENSOR_DEVICE,
54
+ WORKFLOWS_REMOTE_API_KEY_TRANSPORT,
55
+ WORKFLOWS_REMOTE_API_TARGET,
56
+ WORKFLOWS_REMOTE_EXECUTION_MAX_STEP_BATCH_SIZE,
57
+ WORKFLOWS_REMOTE_EXECUTION_MAX_STEP_CONCURRENT_REQUESTS,
58
+ )
59
+ from roboflow_workflows.execution_engine.constants import (
60
+ CLASS_ID_KEY,
61
+ CLASS_NAME_KEY,
62
+ CONFIDENCE_KEY,
63
+ DETECTION_ID_KEY,
64
+ HEIGHT_KEY,
65
+ INFERENCE_ID_KEY,
66
+ POLYGON_KEY,
67
+ WIDTH_KEY,
68
+ X_KEY,
69
+ Y_KEY,
70
+ )
71
+ from roboflow_workflows.execution_engine.entities.base import (
72
+ Batch,
73
+ OutputDefinition,
74
+ WorkflowImageData,
75
+ )
76
+ from roboflow_workflows.execution_engine.entities.tensor_native_types import (
77
+ TENSOR_NATIVE_INSTANCE_SEGMENTATION_PREDICTION_KIND,
78
+ TENSOR_NATIVE_RLE_INSTANCE_SEGMENTATION_PREDICTION_KIND,
79
+ )
80
+ from roboflow_workflows.execution_engine.entities.types import (
81
+ BOOLEAN_KIND,
82
+ FLOAT_ZERO_TO_ONE_KIND,
83
+ IMAGE_KIND,
84
+ INFERENCE_ID_KIND,
85
+ INTEGER_KIND,
86
+ LIST_OF_VALUES_KIND,
87
+ ROBOFLOW_MODEL_ID_KIND,
88
+ ROBOFLOW_PROJECT_KIND,
89
+ STRING_KIND,
90
+ FloatZeroToOne,
91
+ ImageInputField,
92
+ RoboflowModelField,
93
+ Selector,
94
+ )
95
+ from roboflow_workflows.prototypes.block import (
96
+ BlockResult,
97
+ DependentResource,
98
+ WorkflowBlock,
99
+ WorkflowBlockManifest,
100
+ roboflow_platform_model,
101
+ roboflow_platform_project,
102
+ )
103
+ from roboflow_workflows.prototypes.models_provider import ModelsProvider
104
+
105
+ from inference_models.models.base.instance_segmentation import InstanceDetections
106
+ from inference_models.models.base.types import InstancesRLEMasks
107
+ from inference_sdk import InferenceConfiguration, InferenceHTTPClient
108
+
109
+ PREDICTION_TYPE = "instance-segmentation"
110
+
111
+ # Keys carrying the RLE mask in standard inference instance-seg prediction dicts.
112
+ # `InstanceSegmentationRLEPrediction` declares the mask under `rle`; some response
113
+ # paths use `rle_mask` (mirrors the numpy converter's `d.get("rle_mask") or d.get("rle")`).
114
+ RLE_MASK_KEYS = ("rle_mask", "rle")
115
+
116
+ LONG_DESCRIPTION = """
117
+ Run inference on an instance segmentation model hosted on or uploaded to Roboflow.
118
+
119
+ You can query any model that is private to your account, or any public model available
120
+ on [Roboflow Universe](https://universe.roboflow.com).
121
+
122
+ You will need to set your Roboflow API key in your Inference environment to use this
123
+ block. To learn more about setting your Roboflow API key, [refer to the Inference
124
+ documentation](https://inference.roboflow.com/quickstart/configure_api_key/).
125
+ """
126
+
127
+
128
+ class BlockManifest(WorkflowBlockManifest):
129
+ model_config = ConfigDict(
130
+ json_schema_extra={
131
+ "name": "Instance Segmentation Model",
132
+ "version": "v2",
133
+ "short_description": "Predict the shape, size, and location of objects.",
134
+ "long_description": LONG_DESCRIPTION,
135
+ "license": "Apache-2.0",
136
+ "block_type": "model",
137
+ "search_keywords": ["yolo", "rfdetr", "rf-detr"],
138
+ "ui_manifest": {
139
+ "section": "model",
140
+ "icon": "far fa-chart-network",
141
+ "blockPriority": 1,
142
+ "inference": True,
143
+ "popular": True,
144
+ },
145
+ },
146
+ protected_namespaces=(),
147
+ )
148
+ type: Literal["roboflow_core/roboflow_instance_segmentation_model@v2"]
149
+ images: Selector(kind=[IMAGE_KIND]) = ImageInputField
150
+ model_id: Union[Selector(kind=[ROBOFLOW_MODEL_ID_KIND]), str] = RoboflowModelField
151
+ confidence: Union[
152
+ FloatZeroToOne,
153
+ Selector(kind=[FLOAT_ZERO_TO_ONE_KIND]),
154
+ ] = Field(
155
+ default=0.4,
156
+ description="Confidence threshold for predictions.",
157
+ examples=[0.3, "$inputs.confidence_threshold"],
158
+ )
159
+ class_filter: Union[Optional[List[str]], Selector(kind=[LIST_OF_VALUES_KIND])] = (
160
+ Field(
161
+ default=None,
162
+ description="List of accepted classes. Classes must exist in the model's training set.",
163
+ examples=[["a", "b", "c"], "$inputs.class_filter"],
164
+ )
165
+ )
166
+ iou_threshold: Union[
167
+ FloatZeroToOne,
168
+ Selector(kind=[FLOAT_ZERO_TO_ONE_KIND]),
169
+ ] = Field(
170
+ default=0.3,
171
+ description="Minimum overlap threshold between boxes to combine them into a single detection, used in NMS. [Learn more](https://blog.roboflow.com/how-to-code-non-maximum-suppression-nms-in-plain-numpy/).",
172
+ examples=[0.4, "$inputs.iou_threshold"],
173
+ )
174
+ max_detections: Union[PositiveInt, Selector(kind=[INTEGER_KIND])] = Field(
175
+ default=300,
176
+ description="Maximum number of detections to return.",
177
+ examples=[300, "$inputs.max_detections"],
178
+ )
179
+ class_agnostic_nms: Union[bool, Selector(kind=[BOOLEAN_KIND])] = Field(
180
+ default=False,
181
+ description="Boolean flag to specify if NMS is to be used in class-agnostic mode.",
182
+ examples=[True, "$inputs.class_agnostic_nms"],
183
+ )
184
+ max_candidates: Union[PositiveInt, Selector(kind=[INTEGER_KIND])] = Field(
185
+ default=3000,
186
+ description="Maximum number of candidates as NMS input to be taken into account.",
187
+ examples=[3000, "$inputs.max_candidates"],
188
+ )
189
+ mask_decode_mode: Union[
190
+ Literal["accurate", "tradeoff", "fast"],
191
+ Selector(kind=[STRING_KIND]),
192
+ ] = Field(
193
+ default="accurate",
194
+ description="Parameter of mask decoding in prediction post-processing.",
195
+ examples=["accurate", "$inputs.mask_decode_mode"],
196
+ )
197
+ tradeoff_factor: Union[
198
+ FloatZeroToOne,
199
+ Selector(kind=[FLOAT_ZERO_TO_ONE_KIND]),
200
+ ] = Field(
201
+ default=0.0,
202
+ description="Post-processing parameter to dictate tradeoff between fast and accurate.",
203
+ examples=[0.3, "$inputs.tradeoff_factor"],
204
+ )
205
+ disable_active_learning: Union[bool, Selector(kind=[BOOLEAN_KIND])] = Field(
206
+ default=True,
207
+ description="Boolean flag to disable project-level active learning for this block.",
208
+ examples=[True, "$inputs.disable_active_learning"],
209
+ )
210
+ active_learning_target_dataset: Union[
211
+ Selector(kind=[ROBOFLOW_PROJECT_KIND]), Optional[str]
212
+ ] = Field(
213
+ default=None,
214
+ description="Target dataset for active learning, if enabled.",
215
+ examples=["my_project", "$inputs.al_target_project"],
216
+ )
217
+ enforce_dense_masks_in_inference_models: Union[
218
+ bool, Selector(kind=[BOOLEAN_KIND])
219
+ ] = Field(
220
+ default=True,
221
+ description="Boolean flag to enforce dense masks when inference models backend is in use "
222
+ "(irrelevant in other cases). Dense masks are faster to process, but require more memory. "
223
+ "Users can't tweak this flag when running on Roboflow serverless platform.",
224
+ examples=[True, "$inputs.enforce_dense_masks_in_inference_models"],
225
+ )
226
+
227
+ @classmethod
228
+ def get_compatible_task_types(cls) -> Optional[List[str]]:
229
+ return ["instance-segmentation"]
230
+
231
+ def discover_dependent_resources(self) -> Optional[List[DependentResource]]:
232
+ resources = [roboflow_platform_model(model_id=self.model_id)]
233
+ if self.disable_active_learning is True:
234
+ # Active learning literally disabled (the default) — the target
235
+ # project is dead configuration, not a dependency.
236
+ return resources
237
+ if self.active_learning_target_dataset is not None:
238
+ resources.append(
239
+ roboflow_platform_project(
240
+ project_url=self.active_learning_target_dataset
241
+ )
242
+ )
243
+ return resources
244
+
245
+ @classmethod
246
+ def get_parameters_accepting_batches(cls) -> List[str]:
247
+ return ["images"]
248
+
249
+ @classmethod
250
+ def describe_outputs(cls) -> List[OutputDefinition]:
251
+ return [
252
+ OutputDefinition(name=INFERENCE_ID_KEY, kind=[INFERENCE_ID_KIND]),
253
+ OutputDefinition(
254
+ name="predictions",
255
+ kind=[
256
+ TENSOR_NATIVE_RLE_INSTANCE_SEGMENTATION_PREDICTION_KIND,
257
+ TENSOR_NATIVE_INSTANCE_SEGMENTATION_PREDICTION_KIND,
258
+ ],
259
+ ),
260
+ OutputDefinition(name="model_id", kind=[ROBOFLOW_MODEL_ID_KIND]),
261
+ ]
262
+
263
+ @classmethod
264
+ def get_execution_engine_compatibility(cls) -> Optional[str]:
265
+ return ">=1.3.0,<2.0.0"
266
+
267
+
268
+ class RoboflowInstanceSegmentationModelBlockV2(WorkflowBlock):
269
+
270
+ def __init__(
271
+ self,
272
+ model_manager: ModelsProvider,
273
+ api_key: Optional[str],
274
+ step_execution_mode: StepExecutionMode,
275
+ ):
276
+ self._model_manager = model_manager
277
+ self._api_key = api_key
278
+ self._step_execution_mode = step_execution_mode
279
+
280
+ @classmethod
281
+ def get_init_parameters(cls) -> List[str]:
282
+ return ["model_manager", "api_key", "step_execution_mode"]
283
+
284
+ @classmethod
285
+ def get_manifest(cls) -> Type[WorkflowBlockManifest]:
286
+ return BlockManifest
287
+
288
+ def run(
289
+ self,
290
+ images: Batch[WorkflowImageData],
291
+ model_id: str,
292
+ class_agnostic_nms: Optional[bool],
293
+ class_filter: Optional[List[str]],
294
+ confidence: Optional[float],
295
+ iou_threshold: Optional[float],
296
+ max_detections: Optional[int],
297
+ max_candidates: Optional[int],
298
+ mask_decode_mode: Literal["accurate", "tradeoff", "fast"],
299
+ tradeoff_factor: Optional[float],
300
+ disable_active_learning: Optional[bool],
301
+ active_learning_target_dataset: Optional[str],
302
+ enforce_dense_masks_in_inference_models: bool,
303
+ ) -> BlockResult:
304
+ if self._step_execution_mode is StepExecutionMode.LOCAL:
305
+ return self.run_locally(
306
+ images=images,
307
+ model_id=model_id,
308
+ class_agnostic_nms=class_agnostic_nms,
309
+ class_filter=class_filter,
310
+ confidence=confidence,
311
+ iou_threshold=iou_threshold,
312
+ max_detections=max_detections,
313
+ max_candidates=max_candidates,
314
+ mask_decode_mode=mask_decode_mode,
315
+ tradeoff_factor=tradeoff_factor,
316
+ disable_active_learning=disable_active_learning,
317
+ active_learning_target_dataset=active_learning_target_dataset,
318
+ enforce_dense_masks_in_inference_models=enforce_dense_masks_in_inference_models,
319
+ )
320
+ elif self._step_execution_mode is StepExecutionMode.REMOTE:
321
+ return self.run_remotely(
322
+ images=images,
323
+ model_id=model_id,
324
+ class_agnostic_nms=class_agnostic_nms,
325
+ class_filter=class_filter,
326
+ confidence=confidence,
327
+ iou_threshold=iou_threshold,
328
+ max_detections=max_detections,
329
+ max_candidates=max_candidates,
330
+ mask_decode_mode=mask_decode_mode,
331
+ tradeoff_factor=tradeoff_factor,
332
+ disable_active_learning=disable_active_learning,
333
+ active_learning_target_dataset=active_learning_target_dataset,
334
+ )
335
+ else:
336
+ raise ValueError(
337
+ f"Unknown step execution mode: {self._step_execution_mode}"
338
+ )
339
+
340
+ def run_locally(
341
+ self,
342
+ images: Batch[WorkflowImageData],
343
+ model_id: str,
344
+ class_agnostic_nms: Optional[bool],
345
+ class_filter: Optional[List[str]],
346
+ confidence: Optional[float],
347
+ iou_threshold: Optional[float],
348
+ max_detections: Optional[int],
349
+ max_candidates: Optional[int],
350
+ mask_decode_mode: Literal["accurate", "tradeoff", "fast"],
351
+ tradeoff_factor: Optional[float],
352
+ disable_active_learning: Optional[bool],
353
+ active_learning_target_dataset: Optional[str],
354
+ enforce_dense_masks_in_inference_models: bool,
355
+ ) -> BlockResult:
356
+ # Feed the representation already materialised on the images to avoid forcing a
357
+ # numpy->device conversion: GPU tensors (RGB) only when every image in the batch
358
+ # already has one, otherwise the numpy frames (BGR) — matching the numpy block.
359
+ if all(image.is_tensor_materialised() for image in images):
360
+ model_inputs = [image.tensor_image for image in images]
361
+ image_color_format = "rgb"
362
+ else:
363
+ model_inputs = [image.numpy_image for image in images]
364
+ image_color_format = "bgr"
365
+ self._model_manager.add_model(model_id=model_id, api_key=self._api_key)
366
+ detections_batch: List[InstanceDetections] = (
367
+ self._model_manager.run_tensor_native_inference(
368
+ model_id=model_id,
369
+ images=model_inputs,
370
+ input_color_format=image_color_format,
371
+ confidence=confidence,
372
+ iou_threshold=iou_threshold,
373
+ class_agnostic_nms=class_agnostic_nms,
374
+ class_filter=class_filter,
375
+ max_detections=max_detections,
376
+ max_candidates=max_candidates,
377
+ mask_decode_mode=mask_decode_mode,
378
+ tradeoff_factor=tradeoff_factor,
379
+ disable_active_learning=disable_active_learning,
380
+ active_learning_target_dataset=active_learning_target_dataset,
381
+ enforce_dense_masks_in_inference_models=(
382
+ enforce_dense_masks_in_inference_models
383
+ or WORKFLOWS_ENFORCE_DENSE_INSTANCE_MASKS
384
+ ),
385
+ )
386
+ )
387
+ class_names = _class_names_map(self._model_manager.get_class_names(model_id))
388
+ results: List[dict] = []
389
+ for image, detections in zip(images, detections_batch):
390
+ # The adapter/model does NOT honour class_filter on the native path, so
391
+ # filter here (the only place it is applied for LOCAL execution).
392
+ detections = _filter_classes_native(detections, class_filter, class_names)
393
+ # Reuse the adapter-provided inference id when present (numpy parity:
394
+ # numpy v2 surfaces ``p.get(INFERENCE_ID_KEY)`` off the model dump);
395
+ # the tensor-native adapter normally attaches none, so fall back to a
396
+ # freshly minted uuid that is then shared with ``image_metadata``.
397
+ inference_id = getattr(detections, "inference_id", None) or str(
398
+ uuid.uuid4()
399
+ )
400
+ detections = attach_native_detection_metadata(
401
+ detections=detections,
402
+ image=image,
403
+ class_names=class_names,
404
+ prediction_type=PREDICTION_TYPE,
405
+ inference_id=inference_id,
406
+ )
407
+ results.append(
408
+ {
409
+ "inference_id": inference_id,
410
+ "predictions": detections,
411
+ "model_id": model_id,
412
+ }
413
+ )
414
+ return results
415
+
416
+ def run_remotely(
417
+ self,
418
+ images: Batch[WorkflowImageData],
419
+ model_id: str,
420
+ class_agnostic_nms: Optional[bool],
421
+ class_filter: Optional[List[str]],
422
+ confidence: Optional[float],
423
+ iou_threshold: Optional[float],
424
+ max_detections: Optional[int],
425
+ max_candidates: Optional[int],
426
+ mask_decode_mode: Literal["accurate", "tradeoff", "fast"],
427
+ tradeoff_factor: Optional[float],
428
+ disable_active_learning: Optional[bool],
429
+ active_learning_target_dataset: Optional[str],
430
+ ) -> BlockResult:
431
+ api_url = (
432
+ LOCAL_INFERENCE_API_URL
433
+ if WORKFLOWS_REMOTE_API_TARGET != "hosted"
434
+ else HOSTED_INSTANCE_SEGMENTATION_URL
435
+ )
436
+ client = InferenceHTTPClient(
437
+ api_url=api_url,
438
+ api_key=self._api_key,
439
+ )
440
+ if WORKFLOWS_REMOTE_API_TARGET == "hosted":
441
+ client.select_api_v0()
442
+ client_config = InferenceConfiguration(
443
+ api_key_transport=WORKFLOWS_REMOTE_API_KEY_TRANSPORT,
444
+ disable_active_learning=disable_active_learning,
445
+ active_learning_target_dataset=active_learning_target_dataset,
446
+ class_agnostic_nms=class_agnostic_nms,
447
+ class_filter=class_filter,
448
+ confidence_threshold=confidence,
449
+ iou_threshold=iou_threshold,
450
+ max_detections=max_detections,
451
+ max_candidates=max_candidates,
452
+ mask_decode_mode=mask_decode_mode,
453
+ tradeoff_factor=tradeoff_factor,
454
+ response_mask_format="rle",
455
+ max_batch_size=WORKFLOWS_REMOTE_EXECUTION_MAX_STEP_BATCH_SIZE,
456
+ max_concurrent_requests=WORKFLOWS_REMOTE_EXECUTION_MAX_STEP_CONCURRENT_REQUESTS,
457
+ source="workflow-execution",
458
+ )
459
+ client.configure(inference_configuration=client_config)
460
+ inference_images = [i.base64_image for i in images]
461
+ predictions = client.infer(
462
+ inference_input=inference_images,
463
+ model_id=model_id,
464
+ )
465
+ if not isinstance(predictions, list):
466
+ predictions = [predictions]
467
+ return self._post_process_remote_result(
468
+ images=images,
469
+ predictions=predictions,
470
+ class_filter=class_filter,
471
+ model_id=model_id,
472
+ )
473
+
474
+ def _post_process_remote_result(
475
+ self,
476
+ images: Batch[WorkflowImageData],
477
+ predictions: List[dict],
478
+ class_filter: Optional[List[str]],
479
+ model_id: str,
480
+ ) -> BlockResult:
481
+ # Fallback class_id -> name map from the model, used to name boxes whose
482
+ # remote prediction dict lacks a `class` key (otherwise the tensor
483
+ # serialiser hard-raises "class_id missing from mapping").
484
+ model_class_names = _class_names_map(
485
+ self._model_manager.get_class_names(model_id)
486
+ )
487
+ results: List[dict] = []
488
+ for image, response in zip(images, predictions):
489
+ inference_id = response.get(INFERENCE_ID_KEY) or str(uuid.uuid4())
490
+ detection_dicts = response.get("predictions", []) or []
491
+ if class_filter:
492
+ accepted = set(class_filter)
493
+ detection_dicts = [
494
+ d for d in detection_dicts if d.get(CLASS_NAME_KEY) in accepted
495
+ ]
496
+ detections = _native_instance_detections_from_inference_predictions(
497
+ image=image,
498
+ predictions=detection_dicts,
499
+ prediction_type=PREDICTION_TYPE,
500
+ inference_id=inference_id,
501
+ device=WORKFLOWS_IMAGE_TENSOR_DEVICE,
502
+ model_class_names=model_class_names,
503
+ )
504
+ results.append(
505
+ {
506
+ "inference_id": inference_id,
507
+ "predictions": detections,
508
+ "model_id": model_id,
509
+ }
510
+ )
511
+ return results
512
+
513
+
514
+ def _class_names_map(class_names: List[str]) -> Dict[int, str]:
515
+ return {index: name for index, name in enumerate(class_names)}
516
+
517
+
518
+ def _filter_classes_native(
519
+ detections: InstanceDetections,
520
+ class_filter: Optional[List[str]],
521
+ class_names: Dict[int, str],
522
+ ) -> InstanceDetections:
523
+ if not class_filter:
524
+ return detections
525
+ accepted = set(class_filter)
526
+ accepted_ids = sorted(
527
+ class_id for class_id, name in class_names.items() if name in accepted
528
+ )
529
+ if not accepted_ids:
530
+ return take_prediction_by_mask(
531
+ detections,
532
+ torch.zeros_like(detections.class_id, dtype=torch.bool),
533
+ )
534
+ accepted_tensor = torch.as_tensor(accepted_ids, device=detections.class_id.device)
535
+ keep = torch.isin(detections.class_id, accepted_tensor)
536
+ return take_prediction_by_mask(detections, keep)
537
+
538
+
539
+ def _extract_rle_mask(prediction: dict) -> Optional[dict]:
540
+ """Pull the COCO-RLE mask ({"size": [H, W], "counts": ...}) from a standard
541
+ inference instance-seg prediction dict, trying both response key variants."""
542
+ for key in RLE_MASK_KEYS:
543
+ mask = prediction.get(key)
544
+ if mask is not None:
545
+ return mask
546
+ return None
547
+
548
+
549
+ def _extract_polygon_points(prediction: dict) -> Optional[List[dict]]:
550
+ """Pull the polygon ``points`` ([{"x": .., "y": ..}, ...]) from a standard
551
+ inference instance-seg prediction dict that carries a polygon mask instead of
552
+ RLE. Returns ``None`` when the key is absent or the polygon is degenerate
553
+ (< 3 points) - mirroring supervision's ``Detections.from_inference`` / the numpy
554
+ ``filter_out_invalid_polygons``, which drop such instances entirely."""
555
+ points = prediction.get(POLYGON_KEY)
556
+ if points is not None and len(points) >= 3:
557
+ return points
558
+ return None
559
+
560
+
561
+ def _polygon_points_to_dense_mask(
562
+ points: List[dict], height: int, width: int
563
+ ) -> np.ndarray:
564
+ """Rasterise polygon ``points`` into a dense boolean ``(H, W)`` mask,
565
+ byte-identically to supervision's ``polygon_to_mask`` as used by
566
+ ``Detections.from_inference`` (the numpy REMOTE path): vertices are integer
567
+ *truncated* (``dtype=int``, NOT rounded), filled with ``cv2.fillPoly`` onto a
568
+ zero ``uint8`` canvas, then cast to ``bool``. Keeping the exact rasterisation
569
+ means the serialiser's mask->polygon re-contouring (``mask_to_polygon``, shared
570
+ verbatim with the numpy serialiser) reproduces the numpy ``points`` output."""
571
+ polygon = np.array([[point[X_KEY], point[Y_KEY]] for point in points], dtype=int)
572
+ return sv.polygon_to_mask(polygon, resolution_wh=(width, height)).astype(bool)
573
+
574
+
575
+ def _native_instance_detections_from_inference_predictions(
576
+ image: WorkflowImageData,
577
+ predictions: List[dict],
578
+ prediction_type: str,
579
+ inference_id: Optional[str] = None,
580
+ device: Optional[torch.device] = None,
581
+ model_class_names: Optional[Dict[int, str]] = None,
582
+ ) -> InstanceDetections:
583
+ """REMOTE-path converter: build a native ``InstanceDetections`` from standard
584
+ inference instance-segmentation prediction dicts.
585
+
586
+ The block requests ``response_mask_format="rle"`` so a current inference server
587
+ returns an RLE-encoded COCO mask (``{"size": [H, W], "counts": "<utf-8>"}``)
588
+ under ``rle`` / ``rle_mask``; those are carried as ``InstancesRLEMasks`` (counts
589
+ normalised from a utf-8 string to bytes, what ``pycocotools`` / the serialiser's
590
+ RLE decode path expect). To stay compatible with servers that ignore that
591
+ request parameter and return polygon ``points`` instead (older/alternative
592
+ inference servers), the converter degrades gracefully: when the response is not
593
+ fully RLE-backed it rebuilds the masks from the polygon ``points`` into a dense
594
+ ``torch.bool`` ``(N, H, W)`` carrier - the same masks the numpy flag-OFF REMOTE
595
+ path builds via ``sv.Detections.from_inference`` - so the serialised ``points``
596
+ output matches numpy's (the serialiser re-contours the dense mask with the same
597
+ ``mask_to_polygon``). Boxes are converted from center form to corner ``xyxy``.
598
+ The ``class_id -> name`` map (required by the tensor serialiser) and per-box
599
+ ``detection_id`` are built here too.
600
+
601
+ Degenerate (< 3-point) polygons are dropped exactly like the numpy path
602
+ (``filter_out_invalid_polygons`` / supervision's ``from_inference``). When a
603
+ prediction omits its ``class`` key, the class name is backfilled from
604
+ ``model_class_names`` (the model's ``get_class_names`` map) so the tensor
605
+ serialiser does not hard-raise on an unmapped ``class_id``.
606
+ """
607
+ height, width = image._read_shape_without_materialization()
608
+ # Prefer the RLE masks the block requests; fall back to dense polygon masks when
609
+ # the response is not fully RLE-backed (server ignored `response_mask_format`).
610
+ # `all([])` is True, so an empty response keeps the empty-RLE carrier unchanged.
611
+ use_rle = all(
612
+ _extract_rle_mask(prediction) is not None for prediction in predictions
613
+ )
614
+ if use_rle:
615
+ kept_predictions = predictions
616
+ else:
617
+ # Drop degenerate polygons up front so the surviving box arrays and masks
618
+ # stay aligned (matches the numpy path's instance drop).
619
+ kept_predictions = [
620
+ prediction
621
+ for prediction in predictions
622
+ if _extract_polygon_points(prediction) is not None
623
+ ]
624
+ xyxy: List[List[float]] = []
625
+ class_id: List[int] = []
626
+ confidence: List[float] = []
627
+ rle_counts: List[bytes] = []
628
+ dense_masks: List[np.ndarray] = []
629
+ bboxes_metadata: List[dict] = []
630
+ derived_class_names: Dict[int, str] = {}
631
+ for prediction in kept_predictions:
632
+ center_x = float(prediction[X_KEY])
633
+ center_y = float(prediction[Y_KEY])
634
+ box_width = float(prediction[WIDTH_KEY])
635
+ box_height = float(prediction[HEIGHT_KEY])
636
+ xyxy.append(
637
+ [
638
+ center_x - box_width / 2,
639
+ center_y - box_height / 2,
640
+ center_x + box_width / 2,
641
+ center_y + box_height / 2,
642
+ ]
643
+ )
644
+ prediction_class_id = int(prediction.get(CLASS_ID_KEY, 0))
645
+ class_id.append(prediction_class_id)
646
+ confidence.append(float(prediction.get(CONFIDENCE_KEY, 1.0)))
647
+ if CLASS_NAME_KEY in prediction:
648
+ derived_class_names[prediction_class_id] = str(prediction[CLASS_NAME_KEY])
649
+ elif model_class_names is not None and prediction_class_id in model_class_names:
650
+ derived_class_names[prediction_class_id] = model_class_names[
651
+ prediction_class_id
652
+ ]
653
+ if use_rle:
654
+ mask = _extract_rle_mask(prediction)
655
+ raw_counts = mask["counts"]
656
+ # Normalise to bytes: pycocotools (used by the serialiser's RLE decode)
657
+ # expects byte counts; the remote rle response carries them as utf-8 strings.
658
+ rle_counts.append(
659
+ raw_counts.encode("utf-8")
660
+ if isinstance(raw_counts, str)
661
+ else raw_counts
662
+ )
663
+ else:
664
+ dense_masks.append(
665
+ _polygon_points_to_dense_mask(
666
+ points=_extract_polygon_points(prediction),
667
+ height=height,
668
+ width=width,
669
+ )
670
+ )
671
+ bboxes_metadata.append(
672
+ {DETECTION_ID_KEY: str(prediction.get(DETECTION_ID_KEY) or uuid.uuid4())}
673
+ )
674
+ number_of_detections = len(xyxy)
675
+ image_metadata = build_native_image_metadata(
676
+ image=image,
677
+ class_names=derived_class_names,
678
+ prediction_type=prediction_type,
679
+ inference_id=inference_id,
680
+ )
681
+ if use_rle:
682
+ mask_carrier: Union[torch.Tensor, InstancesRLEMasks] = InstancesRLEMasks(
683
+ image_size=(height, width), masks=rle_counts
684
+ )
685
+ elif dense_masks:
686
+ mask_carrier = torch.as_tensor(
687
+ np.stack(dense_masks), dtype=torch.bool, device=device
688
+ )
689
+ else:
690
+ # No surviving polygons: an empty dense carrier the serialiser handles.
691
+ mask_carrier = torch.zeros((0, height, width), dtype=torch.bool, device=device)
692
+ return InstanceDetections(
693
+ xyxy=torch.as_tensor(xyxy, dtype=torch.float32, device=device).reshape(-1, 4),
694
+ class_id=torch.as_tensor(class_id, dtype=torch.long, device=device).reshape(-1),
695
+ confidence=torch.as_tensor(
696
+ confidence, dtype=torch.float32, device=device
697
+ ).reshape(-1),
698
+ mask=mask_carrier,
699
+ image_metadata=image_metadata,
700
+ bboxes_metadata=bboxes_metadata if number_of_detections > 0 else None,
701
+ )