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.
- roboflow_workflows/__init__.py +0 -0
- roboflow_workflows/_compat_names.py +52 -0
- roboflow_workflows/configuration.py +342 -0
- roboflow_workflows/core_steps/__init__.py +0 -0
- roboflow_workflows/core_steps/analytics/__init__.py +0 -0
- roboflow_workflows/core_steps/analytics/_zone_geometry.py +234 -0
- roboflow_workflows/core_steps/analytics/data_aggregator/__init__.py +0 -0
- roboflow_workflows/core_steps/analytics/data_aggregator/v1.py +493 -0
- roboflow_workflows/core_steps/analytics/detection_event_log/__init__.py +0 -0
- roboflow_workflows/core_steps/analytics/detection_event_log/v1.py +478 -0
- roboflow_workflows/core_steps/analytics/detection_event_log/v1_tensor.py +482 -0
- roboflow_workflows/core_steps/analytics/line_counter/__init__.py +0 -0
- roboflow_workflows/core_steps/analytics/line_counter/v1.py +203 -0
- roboflow_workflows/core_steps/analytics/line_counter/v1_tensor.py +221 -0
- roboflow_workflows/core_steps/analytics/line_counter/v2.py +250 -0
- roboflow_workflows/core_steps/analytics/line_counter/v2_tensor.py +280 -0
- roboflow_workflows/core_steps/analytics/overlap/__init__.py +0 -0
- roboflow_workflows/core_steps/analytics/overlap/v1.py +178 -0
- roboflow_workflows/core_steps/analytics/overlap/v1_tensor.py +191 -0
- roboflow_workflows/core_steps/analytics/path_deviation/__init__.py +0 -0
- roboflow_workflows/core_steps/analytics/path_deviation/v1.py +252 -0
- roboflow_workflows/core_steps/analytics/path_deviation/v1_tensor.py +271 -0
- roboflow_workflows/core_steps/analytics/path_deviation/v2.py +264 -0
- roboflow_workflows/core_steps/analytics/path_deviation/v2_tensor.py +284 -0
- roboflow_workflows/core_steps/analytics/time_in_zone/__init__.py +0 -0
- roboflow_workflows/core_steps/analytics/time_in_zone/v1.py +272 -0
- roboflow_workflows/core_steps/analytics/time_in_zone/v1_tensor.py +300 -0
- roboflow_workflows/core_steps/analytics/time_in_zone/v2.py +279 -0
- roboflow_workflows/core_steps/analytics/time_in_zone/v2_tensor.py +307 -0
- roboflow_workflows/core_steps/analytics/time_in_zone/v3.py +384 -0
- roboflow_workflows/core_steps/analytics/time_in_zone/v3_tensor.py +410 -0
- roboflow_workflows/core_steps/analytics/velocity/__init__.py +0 -0
- roboflow_workflows/core_steps/analytics/velocity/v1.py +289 -0
- roboflow_workflows/core_steps/analytics/velocity/v1_tensor.py +392 -0
- roboflow_workflows/core_steps/cache/__init__.py +0 -0
- roboflow_workflows/core_steps/cache/cache_get/__init__.py +0 -0
- roboflow_workflows/core_steps/cache/cache_get/v1.py +169 -0
- roboflow_workflows/core_steps/cache/cache_set/__init__.py +0 -0
- roboflow_workflows/core_steps/cache/cache_set/v1.py +180 -0
- roboflow_workflows/core_steps/cache/common.py +24 -0
- roboflow_workflows/core_steps/cache/memory_cache.py +43 -0
- roboflow_workflows/core_steps/classical_cv/__init__.py +0 -0
- roboflow_workflows/core_steps/classical_cv/auto_rotate_on_edges/__init__.py +0 -0
- roboflow_workflows/core_steps/classical_cv/auto_rotate_on_edges/v1.py +421 -0
- roboflow_workflows/core_steps/classical_cv/background_subtraction/__init__.py +0 -0
- roboflow_workflows/core_steps/classical_cv/background_subtraction/v1.py +159 -0
- roboflow_workflows/core_steps/classical_cv/camera_focus/__init__.py +0 -0
- roboflow_workflows/core_steps/classical_cv/camera_focus/v1.py +243 -0
- roboflow_workflows/core_steps/classical_cv/camera_focus/v2.py +1048 -0
- roboflow_workflows/core_steps/classical_cv/contours/__init__.py +0 -0
- roboflow_workflows/core_steps/classical_cv/contours/v1.py +195 -0
- roboflow_workflows/core_steps/classical_cv/contrast_enhancement/__init__.py +1 -0
- roboflow_workflows/core_steps/classical_cv/contrast_enhancement/v1.py +292 -0
- roboflow_workflows/core_steps/classical_cv/contrast_enhancement/v1_tensor.py +115 -0
- roboflow_workflows/core_steps/classical_cv/contrast_equalization/__init__.py +0 -0
- roboflow_workflows/core_steps/classical_cv/contrast_equalization/v1.py +177 -0
- roboflow_workflows/core_steps/classical_cv/contrast_equalization/v1_tensor.py +124 -0
- roboflow_workflows/core_steps/classical_cv/convert_grayscale/__init__.py +0 -0
- roboflow_workflows/core_steps/classical_cv/convert_grayscale/v1.py +129 -0
- roboflow_workflows/core_steps/classical_cv/convert_grayscale/v1_tensor.py +70 -0
- roboflow_workflows/core_steps/classical_cv/detections_nearest_neighbor/__init__.py +0 -0
- roboflow_workflows/core_steps/classical_cv/detections_nearest_neighbor/v1.py +440 -0
- roboflow_workflows/core_steps/classical_cv/detections_nearest_neighbor/v1_tensor.py +373 -0
- roboflow_workflows/core_steps/classical_cv/distance_measurement/__init__.py +0 -0
- roboflow_workflows/core_steps/classical_cv/distance_measurement/v1.py +468 -0
- roboflow_workflows/core_steps/classical_cv/distance_measurement/v1_tensor.py +516 -0
- roboflow_workflows/core_steps/classical_cv/dominant_color/__init__.py +0 -0
- roboflow_workflows/core_steps/classical_cv/dominant_color/v1.py +206 -0
- roboflow_workflows/core_steps/classical_cv/dominant_color/v1_tensor.py +70 -0
- roboflow_workflows/core_steps/classical_cv/image_blur/__init__.py +0 -0
- roboflow_workflows/core_steps/classical_cv/image_blur/v1.py +206 -0
- roboflow_workflows/core_steps/classical_cv/image_blur/v1_tensor.py +180 -0
- roboflow_workflows/core_steps/classical_cv/image_preprocessing/__init__.py +0 -0
- roboflow_workflows/core_steps/classical_cv/image_preprocessing/v1.py +286 -0
- roboflow_workflows/core_steps/classical_cv/image_preprocessing/v1_tensor.py +217 -0
- roboflow_workflows/core_steps/classical_cv/mask_area_measurement/__init__.py +0 -0
- roboflow_workflows/core_steps/classical_cv/mask_area_measurement/v1.py +181 -0
- roboflow_workflows/core_steps/classical_cv/mask_area_measurement/v1_tensor.py +201 -0
- roboflow_workflows/core_steps/classical_cv/mask_edge_snap/__init__.py +0 -0
- roboflow_workflows/core_steps/classical_cv/mask_edge_snap/v1.py +578 -0
- roboflow_workflows/core_steps/classical_cv/mask_edge_snap/v1_tensor.py +625 -0
- roboflow_workflows/core_steps/classical_cv/morphological_transformation/__init__.py +0 -0
- roboflow_workflows/core_steps/classical_cv/morphological_transformation/v1.py +230 -0
- roboflow_workflows/core_steps/classical_cv/morphological_transformation/v2.py +202 -0
- roboflow_workflows/core_steps/classical_cv/motion_detection/__init__.py +0 -0
- roboflow_workflows/core_steps/classical_cv/motion_detection/v1.py +379 -0
- roboflow_workflows/core_steps/classical_cv/motion_detection/v1_tensor.py +422 -0
- roboflow_workflows/core_steps/classical_cv/pixel_color_count/__init__.py +0 -0
- roboflow_workflows/core_steps/classical_cv/pixel_color_count/v1.py +206 -0
- roboflow_workflows/core_steps/classical_cv/pixel_color_count/v1_tensor.py +96 -0
- roboflow_workflows/core_steps/classical_cv/sift/__init__.py +0 -0
- roboflow_workflows/core_steps/classical_cv/sift/v1.py +170 -0
- roboflow_workflows/core_steps/classical_cv/sift_comparison/__init__.py +0 -0
- roboflow_workflows/core_steps/classical_cv/sift_comparison/v1.py +157 -0
- roboflow_workflows/core_steps/classical_cv/sift_comparison/v2.py +346 -0
- roboflow_workflows/core_steps/classical_cv/size_measurement/__init__.py +0 -0
- roboflow_workflows/core_steps/classical_cv/size_measurement/v1.py +307 -0
- roboflow_workflows/core_steps/classical_cv/size_measurement/v1_tensor.py +314 -0
- roboflow_workflows/core_steps/classical_cv/template_matching/__init__.py +0 -0
- roboflow_workflows/core_steps/classical_cv/template_matching/v1.py +236 -0
- roboflow_workflows/core_steps/classical_cv/template_matching/v1_tensor.py +269 -0
- roboflow_workflows/core_steps/classical_cv/threshold/__init__.py +0 -0
- roboflow_workflows/core_steps/classical_cv/threshold/v1.py +271 -0
- roboflow_workflows/core_steps/classical_cv/threshold/v1_tensor.py +261 -0
- roboflow_workflows/core_steps/common/__init__.py +0 -0
- roboflow_workflows/core_steps/common/deserializers.py +705 -0
- roboflow_workflows/core_steps/common/deserializers_tensor.py +689 -0
- roboflow_workflows/core_steps/common/entities.py +14 -0
- roboflow_workflows/core_steps/common/inference_response_entities.py +105 -0
- roboflow_workflows/core_steps/common/keypoints.py +60 -0
- roboflow_workflows/core_steps/common/openrouter.py +1083 -0
- roboflow_workflows/core_steps/common/operators.py +39 -0
- roboflow_workflows/core_steps/common/query_language/__init__.py +0 -0
- roboflow_workflows/core_steps/common/query_language/entities/__init__.py +0 -0
- roboflow_workflows/core_steps/common/query_language/entities/enums.py +122 -0
- roboflow_workflows/core_steps/common/query_language/entities/introspection.py +33 -0
- roboflow_workflows/core_steps/common/query_language/entities/operations.py +1063 -0
- roboflow_workflows/core_steps/common/query_language/entities/types.py +4 -0
- roboflow_workflows/core_steps/common/query_language/errors.py +25 -0
- roboflow_workflows/core_steps/common/query_language/evaluation_engine/__init__.py +0 -0
- roboflow_workflows/core_steps/common/query_language/evaluation_engine/core.py +310 -0
- roboflow_workflows/core_steps/common/query_language/evaluation_engine/detection/__init__.py +0 -0
- roboflow_workflows/core_steps/common/query_language/evaluation_engine/detection/geometry.py +14 -0
- roboflow_workflows/core_steps/common/query_language/introspection/__init__.py +0 -0
- roboflow_workflows/core_steps/common/query_language/introspection/core.py +130 -0
- roboflow_workflows/core_steps/common/query_language/operations/__init__.py +0 -0
- roboflow_workflows/core_steps/common/query_language/operations/booleans/__init__.py +0 -0
- roboflow_workflows/core_steps/common/query_language/operations/booleans/base.py +17 -0
- roboflow_workflows/core_steps/common/query_language/operations/classification_results/__init__.py +0 -0
- roboflow_workflows/core_steps/common/query_language/operations/classification_results/base.py +382 -0
- roboflow_workflows/core_steps/common/query_language/operations/core.py +219 -0
- roboflow_workflows/core_steps/common/query_language/operations/detection/__init__.py +0 -0
- roboflow_workflows/core_steps/common/query_language/operations/detection/base.py +253 -0
- roboflow_workflows/core_steps/common/query_language/operations/detections/__init__.py +0 -0
- roboflow_workflows/core_steps/common/query_language/operations/detections/base.py +1644 -0
- roboflow_workflows/core_steps/common/query_language/operations/dictionaries/__init__.py +0 -0
- roboflow_workflows/core_steps/common/query_language/operations/dictionaries/base.py +29 -0
- roboflow_workflows/core_steps/common/query_language/operations/frame_metadata/__init__.py +0 -0
- roboflow_workflows/core_steps/common/query_language/operations/frame_metadata/base.py +43 -0
- roboflow_workflows/core_steps/common/query_language/operations/generic/__init__.py +0 -0
- roboflow_workflows/core_steps/common/query_language/operations/generic/base.py +42 -0
- roboflow_workflows/core_steps/common/query_language/operations/images/__init__.py +0 -0
- roboflow_workflows/core_steps/common/query_language/operations/images/base.py +101 -0
- roboflow_workflows/core_steps/common/query_language/operations/numbers/__init__.py +0 -0
- roboflow_workflows/core_steps/common/query_language/operations/numbers/base.py +74 -0
- roboflow_workflows/core_steps/common/query_language/operations/sequences/__init__.py +0 -0
- roboflow_workflows/core_steps/common/query_language/operations/sequences/base.py +165 -0
- roboflow_workflows/core_steps/common/query_language/operations/strings/__init__.py +0 -0
- roboflow_workflows/core_steps/common/query_language/operations/strings/base.py +65 -0
- roboflow_workflows/core_steps/common/query_language/operations/timestamps/__init__.py +0 -0
- roboflow_workflows/core_steps/common/query_language/operations/timestamps/base.py +16 -0
- roboflow_workflows/core_steps/common/query_language/operations/utils.py +11 -0
- roboflow_workflows/core_steps/common/reasoning.py +138 -0
- roboflow_workflows/core_steps/common/rle_compact.py +236 -0
- roboflow_workflows/core_steps/common/segmentation_entities.py +98 -0
- roboflow_workflows/core_steps/common/serializers.py +464 -0
- roboflow_workflows/core_steps/common/serializers_tensor.py +829 -0
- roboflow_workflows/core_steps/common/tensor_native.py +1060 -0
- roboflow_workflows/core_steps/common/token_usage.py +80 -0
- roboflow_workflows/core_steps/common/utils.py +768 -0
- roboflow_workflows/core_steps/common/utils_tensor.py +69 -0
- roboflow_workflows/core_steps/common/vlm_decoding/__init__.py +90 -0
- roboflow_workflows/core_steps/common/vlm_decoding/classification.py +199 -0
- roboflow_workflows/core_steps/common/vlm_decoding/detection_formats.py +545 -0
- roboflow_workflows/core_steps/common/vlm_decoding/detections.py +195 -0
- roboflow_workflows/core_steps/common/vlm_decoding/json_extraction.py +106 -0
- roboflow_workflows/core_steps/common/vlm_decoding/outputs.py +164 -0
- roboflow_workflows/core_steps/common/vlm_decoding/tensor_native.py +387 -0
- roboflow_workflows/core_steps/common/vlm_decoding/utils.py +35 -0
- roboflow_workflows/core_steps/common/vlm_json.py +135 -0
- roboflow_workflows/core_steps/common/vlms.py +82 -0
- roboflow_workflows/core_steps/flow_control/__init__.py +0 -0
- roboflow_workflows/core_steps/flow_control/continue_if/__init__.py +0 -0
- roboflow_workflows/core_steps/flow_control/continue_if/v1.py +165 -0
- roboflow_workflows/core_steps/flow_control/delta_filter/__init__.py +0 -0
- roboflow_workflows/core_steps/flow_control/delta_filter/v1.py +132 -0
- roboflow_workflows/core_steps/flow_control/inner_workflow/__init__.py +0 -0
- roboflow_workflows/core_steps/flow_control/inner_workflow/v1.py +377 -0
- roboflow_workflows/core_steps/flow_control/rate_limiter/__init__.py +0 -0
- roboflow_workflows/core_steps/flow_control/rate_limiter/v1.py +160 -0
- roboflow_workflows/core_steps/flow_control/switch_case/__init__.py +0 -0
- roboflow_workflows/core_steps/flow_control/switch_case/v1.py +181 -0
- roboflow_workflows/core_steps/formatters/__init__.py +0 -0
- roboflow_workflows/core_steps/formatters/csv/__init__.py +0 -0
- roboflow_workflows/core_steps/formatters/csv/v1.py +215 -0
- roboflow_workflows/core_steps/formatters/current_time/__init__.py +0 -0
- roboflow_workflows/core_steps/formatters/current_time/v1.py +158 -0
- roboflow_workflows/core_steps/formatters/expression/__init__.py +0 -0
- roboflow_workflows/core_steps/formatters/expression/v1.py +240 -0
- roboflow_workflows/core_steps/formatters/first_non_empty_or_default/__init__.py +0 -0
- roboflow_workflows/core_steps/formatters/first_non_empty_or_default/v1.py +143 -0
- roboflow_workflows/core_steps/formatters/json_parser/__init__.py +0 -0
- roboflow_workflows/core_steps/formatters/json_parser/v1.py +203 -0
- roboflow_workflows/core_steps/formatters/property_definition/__init__.py +0 -0
- roboflow_workflows/core_steps/formatters/property_definition/v1.py +158 -0
- roboflow_workflows/core_steps/formatters/string_template/__init__.py +0 -0
- roboflow_workflows/core_steps/formatters/string_template/v1.py +270 -0
- roboflow_workflows/core_steps/formatters/vlm_as_classifier/__init__.py +0 -0
- roboflow_workflows/core_steps/formatters/vlm_as_classifier/v1.py +330 -0
- roboflow_workflows/core_steps/formatters/vlm_as_classifier/v1_tensor.py +390 -0
- roboflow_workflows/core_steps/formatters/vlm_as_classifier/v2.py +338 -0
- roboflow_workflows/core_steps/formatters/vlm_as_classifier/v2_tensor.py +396 -0
- roboflow_workflows/core_steps/formatters/vlm_as_detector/__init__.py +0 -0
- roboflow_workflows/core_steps/formatters/vlm_as_detector/anthropic_detection_parsing.py +136 -0
- roboflow_workflows/core_steps/formatters/vlm_as_detector/gemini_detection_parsing.py +122 -0
- roboflow_workflows/core_steps/formatters/vlm_as_detector/muse_detection_parsing.py +191 -0
- roboflow_workflows/core_steps/formatters/vlm_as_detector/openai_detection_parsing.py +137 -0
- roboflow_workflows/core_steps/formatters/vlm_as_detector/qwen_detection_parsing.py +221 -0
- roboflow_workflows/core_steps/formatters/vlm_as_detector/spacexai_detection_parsing.py +147 -0
- roboflow_workflows/core_steps/formatters/vlm_as_detector/v1.py +382 -0
- roboflow_workflows/core_steps/formatters/vlm_as_detector/v1_tensor.py +570 -0
- roboflow_workflows/core_steps/formatters/vlm_as_detector/v2.py +622 -0
- roboflow_workflows/core_steps/formatters/vlm_as_detector/v2_tensor.py +985 -0
- roboflow_workflows/core_steps/fusion/__init__.py +0 -0
- roboflow_workflows/core_steps/fusion/buffer/__init__.py +0 -0
- roboflow_workflows/core_steps/fusion/buffer/v1.py +154 -0
- roboflow_workflows/core_steps/fusion/detections_classes_replacement/__init__.py +0 -0
- roboflow_workflows/core_steps/fusion/detections_classes_replacement/v1.py +441 -0
- roboflow_workflows/core_steps/fusion/detections_classes_replacement/v1_tensor.py +592 -0
- roboflow_workflows/core_steps/fusion/detections_consensus/__init__.py +0 -0
- roboflow_workflows/core_steps/fusion/detections_consensus/v1.py +735 -0
- roboflow_workflows/core_steps/fusion/detections_consensus/v1_tensor.py +1178 -0
- roboflow_workflows/core_steps/fusion/detections_difference/__init__.py +0 -0
- roboflow_workflows/core_steps/fusion/detections_difference/v1.py +335 -0
- roboflow_workflows/core_steps/fusion/detections_difference/v1_tensor.py +396 -0
- roboflow_workflows/core_steps/fusion/detections_list_rollup/__init__.py +0 -0
- roboflow_workflows/core_steps/fusion/detections_list_rollup/v1.py +1042 -0
- roboflow_workflows/core_steps/fusion/detections_list_rollup/v1_tensor.py +1305 -0
- roboflow_workflows/core_steps/fusion/detections_stitch/__init__.py +0 -0
- roboflow_workflows/core_steps/fusion/detections_stitch/v1.py +305 -0
- roboflow_workflows/core_steps/fusion/detections_stitch/v1_tensor.py +1168 -0
- roboflow_workflows/core_steps/fusion/dimension_collapse/__init__.py +0 -0
- roboflow_workflows/core_steps/fusion/dimension_collapse/v1.py +126 -0
- roboflow_workflows/core_steps/fusion/frame_delay/__init__.py +0 -0
- roboflow_workflows/core_steps/fusion/frame_delay/v1.py +268 -0
- roboflow_workflows/core_steps/fusion/frame_delay/v1_tensor.py +141 -0
- roboflow_workflows/core_steps/fusion/image_stack/__init__.py +0 -0
- roboflow_workflows/core_steps/fusion/image_stack/v1.py +248 -0
- roboflow_workflows/core_steps/fusion/overlap_analysis/__init__.py +0 -0
- roboflow_workflows/core_steps/fusion/overlap_analysis/v1.py +212 -0
- roboflow_workflows/core_steps/fusion/overlap_analysis/v1_tensor.py +397 -0
- roboflow_workflows/core_steps/loader.py +2009 -0
- roboflow_workflows/core_steps/math/__init__.py +0 -0
- roboflow_workflows/core_steps/math/cosine_similarity/__init__.py +0 -0
- roboflow_workflows/core_steps/math/cosine_similarity/v1.py +124 -0
- roboflow_workflows/core_steps/math/cosine_similarity/v1_tensor.py +131 -0
- roboflow_workflows/core_steps/models/__init__.py +0 -0
- roboflow_workflows/core_steps/models/foundation/__init__.py +0 -0
- roboflow_workflows/core_steps/models/foundation/anthropic_claude/__init__.py +0 -0
- roboflow_workflows/core_steps/models/foundation/anthropic_claude/model_capabilities.py +165 -0
- roboflow_workflows/core_steps/models/foundation/anthropic_claude/v1.py +723 -0
- roboflow_workflows/core_steps/models/foundation/anthropic_claude/v2.py +852 -0
- roboflow_workflows/core_steps/models/foundation/anthropic_claude/v3.py +1014 -0
- roboflow_workflows/core_steps/models/foundation/anthropic_claude/v4.py +1195 -0
- roboflow_workflows/core_steps/models/foundation/anthropic_claude/v5.py +1272 -0
- roboflow_workflows/core_steps/models/foundation/clip/__init__.py +0 -0
- roboflow_workflows/core_steps/models/foundation/clip/v1.py +250 -0
- roboflow_workflows/core_steps/models/foundation/clip/v1_tensor.py +257 -0
- roboflow_workflows/core_steps/models/foundation/clip_comparison/__init__.py +0 -0
- roboflow_workflows/core_steps/models/foundation/clip_comparison/v1.py +233 -0
- roboflow_workflows/core_steps/models/foundation/clip_comparison/v1_tensor.py +255 -0
- roboflow_workflows/core_steps/models/foundation/clip_comparison/v2.py +302 -0
- roboflow_workflows/core_steps/models/foundation/clip_comparison/v2_tensor.py +335 -0
- roboflow_workflows/core_steps/models/foundation/cog_vlm/__init__.py +0 -0
- roboflow_workflows/core_steps/models/foundation/cog_vlm/v1.py +190 -0
- roboflow_workflows/core_steps/models/foundation/cosmos3/__init__.py +0 -0
- roboflow_workflows/core_steps/models/foundation/cosmos3/v1.py +263 -0
- roboflow_workflows/core_steps/models/foundation/depth_estimation/__init__.py +0 -0
- roboflow_workflows/core_steps/models/foundation/depth_estimation/v1.py +290 -0
- roboflow_workflows/core_steps/models/foundation/depth_estimation/v1_tensor.py +325 -0
- roboflow_workflows/core_steps/models/foundation/easy_ocr/__init__.py +0 -0
- roboflow_workflows/core_steps/models/foundation/easy_ocr/v1.py +300 -0
- roboflow_workflows/core_steps/models/foundation/easy_ocr/v1_tensor.py +363 -0
- roboflow_workflows/core_steps/models/foundation/flex/__init__.py +0 -0
- roboflow_workflows/core_steps/models/foundation/flex/inpainting/__init__.py +0 -0
- roboflow_workflows/core_steps/models/foundation/florence2/__init__.py +0 -0
- roboflow_workflows/core_steps/models/foundation/florence2/v1.py +695 -0
- roboflow_workflows/core_steps/models/foundation/florence2/v1_tensor.py +376 -0
- roboflow_workflows/core_steps/models/foundation/florence2/v2.py +92 -0
- roboflow_workflows/core_steps/models/foundation/florence2/v2_tensor.py +43 -0
- roboflow_workflows/core_steps/models/foundation/gaze/__init__.py +0 -0
- roboflow_workflows/core_steps/models/foundation/gaze/v1.py +147 -0
- roboflow_workflows/core_steps/models/foundation/glm_ocr/__init__.py +0 -0
- roboflow_workflows/core_steps/models/foundation/glm_ocr/v1.py +407 -0
- roboflow_workflows/core_steps/models/foundation/google_gemini/__init__.py +0 -0
- roboflow_workflows/core_steps/models/foundation/google_gemini/v1.py +759 -0
- roboflow_workflows/core_steps/models/foundation/google_gemini/v2.py +903 -0
- roboflow_workflows/core_steps/models/foundation/google_gemini/v3.py +1054 -0
- roboflow_workflows/core_steps/models/foundation/google_gemini/v4.py +1089 -0
- roboflow_workflows/core_steps/models/foundation/google_gemini/v5.py +1149 -0
- roboflow_workflows/core_steps/models/foundation/google_gemini/v6.py +1209 -0
- roboflow_workflows/core_steps/models/foundation/google_gemma/__init__.py +0 -0
- roboflow_workflows/core_steps/models/foundation/google_gemma/v1.py +667 -0
- roboflow_workflows/core_steps/models/foundation/google_gemma/v2.py +262 -0
- roboflow_workflows/core_steps/models/foundation/google_gemma/v3.py +309 -0
- roboflow_workflows/core_steps/models/foundation/google_gemma/v4.py +357 -0
- roboflow_workflows/core_steps/models/foundation/google_vision_ocr/__init__.py +0 -0
- roboflow_workflows/core_steps/models/foundation/google_vision_ocr/v1.py +307 -0
- roboflow_workflows/core_steps/models/foundation/google_vision_ocr/v1_tensor.py +342 -0
- roboflow_workflows/core_steps/models/foundation/kimi_openrouter/__init__.py +0 -0
- roboflow_workflows/core_steps/models/foundation/kimi_openrouter/v1.py +667 -0
- roboflow_workflows/core_steps/models/foundation/kimi_openrouter/v2.py +264 -0
- roboflow_workflows/core_steps/models/foundation/kimi_openrouter/v3.py +316 -0
- roboflow_workflows/core_steps/models/foundation/llama_vision/__init__.py +0 -0
- roboflow_workflows/core_steps/models/foundation/llama_vision/v1.py +664 -0
- roboflow_workflows/core_steps/models/foundation/llama_vision/v2.py +265 -0
- roboflow_workflows/core_steps/models/foundation/lmm/__init__.py +0 -0
- roboflow_workflows/core_steps/models/foundation/lmm/v1.py +454 -0
- roboflow_workflows/core_steps/models/foundation/lmm_classifier/__init__.py +0 -0
- roboflow_workflows/core_steps/models/foundation/lmm_classifier/v1.py +294 -0
- roboflow_workflows/core_steps/models/foundation/meta_vlm/__init__.py +0 -0
- roboflow_workflows/core_steps/models/foundation/meta_vlm/v1.py +630 -0
- roboflow_workflows/core_steps/models/foundation/meta_vlm/v2.py +699 -0
- roboflow_workflows/core_steps/models/foundation/meta_vlm/v3.py +755 -0
- roboflow_workflows/core_steps/models/foundation/moondream2/__init__.py +0 -0
- roboflow_workflows/core_steps/models/foundation/moondream2/v1.py +272 -0
- roboflow_workflows/core_steps/models/foundation/moondream2/v1_tensor.py +264 -0
- roboflow_workflows/core_steps/models/foundation/ocr/__init__.py +0 -0
- roboflow_workflows/core_steps/models/foundation/ocr/v1.py +226 -0
- roboflow_workflows/core_steps/models/foundation/ocr/v1_tensor.py +249 -0
- roboflow_workflows/core_steps/models/foundation/openai/__init__.py +0 -0
- roboflow_workflows/core_steps/models/foundation/openai/v1.py +350 -0
- roboflow_workflows/core_steps/models/foundation/openai/v2.py +602 -0
- roboflow_workflows/core_steps/models/foundation/openai/v3.py +716 -0
- roboflow_workflows/core_steps/models/foundation/openai/v4.py +996 -0
- roboflow_workflows/core_steps/models/foundation/openai/v5.py +1403 -0
- roboflow_workflows/core_steps/models/foundation/openai/v6.py +1448 -0
- roboflow_workflows/core_steps/models/foundation/openai/v7.py +1559 -0
- roboflow_workflows/core_steps/models/foundation/openai_compatible/__init__.py +0 -0
- roboflow_workflows/core_steps/models/foundation/openai_compatible/v1.py +483 -0
- roboflow_workflows/core_steps/models/foundation/openrouter/__init__.py +0 -0
- roboflow_workflows/core_steps/models/foundation/openrouter/v1.py +282 -0
- roboflow_workflows/core_steps/models/foundation/openrouter/v2.py +339 -0
- roboflow_workflows/core_steps/models/foundation/openrouter/v3.py +455 -0
- roboflow_workflows/core_steps/models/foundation/perception_encoder/__init__.py +0 -0
- roboflow_workflows/core_steps/models/foundation/perception_encoder/v1.py +253 -0
- roboflow_workflows/core_steps/models/foundation/perception_encoder/v1_tensor.py +267 -0
- roboflow_workflows/core_steps/models/foundation/pp_ocr/__init__.py +0 -0
- roboflow_workflows/core_steps/models/foundation/pp_ocr/v1.py +255 -0
- roboflow_workflows/core_steps/models/foundation/pp_ocr/v1_tensor.py +333 -0
- roboflow_workflows/core_steps/models/foundation/qwen/__init__.py +0 -0
- roboflow_workflows/core_steps/models/foundation/qwen/v1.py +278 -0
- roboflow_workflows/core_steps/models/foundation/qwen3_5_openrouter/__init__.py +0 -0
- roboflow_workflows/core_steps/models/foundation/qwen3_5_openrouter/v1.py +679 -0
- roboflow_workflows/core_steps/models/foundation/qwen3_5vl/__init__.py +0 -0
- roboflow_workflows/core_steps/models/foundation/qwen3_5vl/v1.py +327 -0
- roboflow_workflows/core_steps/models/foundation/qwen3_5vl/v1_tensor.py +174 -0
- roboflow_workflows/core_steps/models/foundation/qwen3_5vl/v2.py +274 -0
- roboflow_workflows/core_steps/models/foundation/qwen3_5vl/v2_tensor.py +151 -0
- roboflow_workflows/core_steps/models/foundation/qwen3_6_openrouter/__init__.py +0 -0
- roboflow_workflows/core_steps/models/foundation/qwen3_6_openrouter/v1.py +676 -0
- roboflow_workflows/core_steps/models/foundation/qwen3vl/__init__.py +0 -0
- roboflow_workflows/core_steps/models/foundation/qwen3vl/v1.py +275 -0
- roboflow_workflows/core_steps/models/foundation/qwen3vl/v1_tensor.py +168 -0
- roboflow_workflows/core_steps/models/foundation/qwen_vlm/__init__.py +0 -0
- roboflow_workflows/core_steps/models/foundation/qwen_vlm/v1.py +995 -0
- roboflow_workflows/core_steps/models/foundation/qwen_vlm/v2.py +1389 -0
- roboflow_workflows/core_steps/models/foundation/qwen_vlm/v3.py +1443 -0
- roboflow_workflows/core_steps/models/foundation/qwen_vlm/v4.py +1509 -0
- roboflow_workflows/core_steps/models/foundation/seg_preview/__init__.py +0 -0
- roboflow_workflows/core_steps/models/foundation/seg_preview/v1.py +357 -0
- roboflow_workflows/core_steps/models/foundation/seg_preview/v1_tensor.py +366 -0
- roboflow_workflows/core_steps/models/foundation/segment_anything2/__init__.py +0 -0
- roboflow_workflows/core_steps/models/foundation/segment_anything2/v1.py +561 -0
- roboflow_workflows/core_steps/models/foundation/segment_anything2/v1_tensor.py +652 -0
- roboflow_workflows/core_steps/models/foundation/segment_anything2_video/__init__.py +0 -0
- roboflow_workflows/core_steps/models/foundation/segment_anything2_video/v1.py +414 -0
- roboflow_workflows/core_steps/models/foundation/segment_anything2_video/v1_tensor.py +383 -0
- roboflow_workflows/core_steps/models/foundation/segment_anything3/__init__.py +0 -0
- roboflow_workflows/core_steps/models/foundation/segment_anything3/v1.py +591 -0
- roboflow_workflows/core_steps/models/foundation/segment_anything3/v1_tensor.py +658 -0
- roboflow_workflows/core_steps/models/foundation/segment_anything3/v2.py +680 -0
- roboflow_workflows/core_steps/models/foundation/segment_anything3/v2_tensor.py +797 -0
- roboflow_workflows/core_steps/models/foundation/segment_anything3/v3.py +938 -0
- roboflow_workflows/core_steps/models/foundation/segment_anything3/v3_tensor.py +587 -0
- roboflow_workflows/core_steps/models/foundation/segment_anything3_3d/__init__.py +0 -0
- roboflow_workflows/core_steps/models/foundation/segment_anything3_3d/v1.py +306 -0
- roboflow_workflows/core_steps/models/foundation/segment_anything3_3d/v1_tensor.py +310 -0
- roboflow_workflows/core_steps/models/foundation/segment_anything3_interactive/__init__.py +0 -0
- roboflow_workflows/core_steps/models/foundation/segment_anything3_interactive/v1.py +622 -0
- roboflow_workflows/core_steps/models/foundation/segment_anything3_interactive/v1_tensor.py +888 -0
- roboflow_workflows/core_steps/models/foundation/segment_anything3_video/__init__.py +0 -0
- roboflow_workflows/core_steps/models/foundation/segment_anything3_video/v1.py +648 -0
- roboflow_workflows/core_steps/models/foundation/segment_anything3_video/v1_tensor.py +727 -0
- roboflow_workflows/core_steps/models/foundation/segment_anything_common/__init__.py +1 -0
- roboflow_workflows/core_steps/models/foundation/segment_anything_common/prompts.py +161 -0
- roboflow_workflows/core_steps/models/foundation/segment_anything_common/streaming_video.py +340 -0
- roboflow_workflows/core_steps/models/foundation/segment_anything_common/streaming_video_tensor.py +169 -0
- roboflow_workflows/core_steps/models/foundation/segment_anything_common/visual_prompt.py +38 -0
- roboflow_workflows/core_steps/models/foundation/smolvlm/__init__.py +0 -0
- roboflow_workflows/core_steps/models/foundation/smolvlm/v1.py +245 -0
- roboflow_workflows/core_steps/models/foundation/smolvlm/v1_tensor.py +148 -0
- roboflow_workflows/core_steps/models/foundation/spacexai/__init__.py +0 -0
- roboflow_workflows/core_steps/models/foundation/spacexai/v1.py +996 -0
- roboflow_workflows/core_steps/models/foundation/spacexai/v2.py +1048 -0
- roboflow_workflows/core_steps/models/foundation/spacexai/v3.py +1096 -0
- roboflow_workflows/core_steps/models/foundation/stability_ai/__init__.py +0 -0
- roboflow_workflows/core_steps/models/foundation/stability_ai/image_gen/__init__.py +0 -0
- roboflow_workflows/core_steps/models/foundation/stability_ai/image_gen/v1.py +205 -0
- roboflow_workflows/core_steps/models/foundation/stability_ai/inpainting/__init__.py +0 -0
- roboflow_workflows/core_steps/models/foundation/stability_ai/inpainting/v1.py +238 -0
- roboflow_workflows/core_steps/models/foundation/stability_ai/inpainting/v1_tensor.py +245 -0
- roboflow_workflows/core_steps/models/foundation/stability_ai/outpainting/__init__.py +0 -0
- roboflow_workflows/core_steps/models/foundation/stability_ai/outpainting/v1.py +288 -0
- roboflow_workflows/core_steps/models/foundation/yolo_world/__init__.py +0 -0
- roboflow_workflows/core_steps/models/foundation/yolo_world/v1.py +297 -0
- roboflow_workflows/core_steps/models/foundation/yolo_world/v1_tensor.py +167 -0
- roboflow_workflows/core_steps/models/foundation/zai_vlm/__init__.py +0 -0
- roboflow_workflows/core_steps/models/foundation/zai_vlm/v1.py +742 -0
- roboflow_workflows/core_steps/models/foundation/zai_vlm/v2.py +804 -0
- roboflow_workflows/core_steps/models/roboflow/__init__.py +0 -0
- roboflow_workflows/core_steps/models/roboflow/action_recognition/__init__.py +0 -0
- roboflow_workflows/core_steps/models/roboflow/action_recognition/entities.py +29 -0
- roboflow_workflows/core_steps/models/roboflow/action_recognition/v1.py +617 -0
- roboflow_workflows/core_steps/models/roboflow/action_recognition/v1_tensor.py +58 -0
- roboflow_workflows/core_steps/models/roboflow/instance_segmentation/__init__.py +0 -0
- roboflow_workflows/core_steps/models/roboflow/instance_segmentation/v1.py +398 -0
- roboflow_workflows/core_steps/models/roboflow/instance_segmentation/v1_tensor.py +701 -0
- roboflow_workflows/core_steps/models/roboflow/instance_segmentation/v2.py +403 -0
- roboflow_workflows/core_steps/models/roboflow/instance_segmentation/v2_tensor.py +701 -0
- roboflow_workflows/core_steps/models/roboflow/instance_segmentation/v3.py +801 -0
- roboflow_workflows/core_steps/models/roboflow/instance_segmentation/v3_tensor.py +742 -0
- roboflow_workflows/core_steps/models/roboflow/instance_segmentation/v4.py +441 -0
- roboflow_workflows/core_steps/models/roboflow/instance_segmentation/v4_tensor.py +729 -0
- roboflow_workflows/core_steps/models/roboflow/keypoint_detection/__init__.py +0 -0
- roboflow_workflows/core_steps/models/roboflow/keypoint_detection/v1.py +374 -0
- roboflow_workflows/core_steps/models/roboflow/keypoint_detection/v1_tensor.py +639 -0
- roboflow_workflows/core_steps/models/roboflow/keypoint_detection/v2.py +378 -0
- roboflow_workflows/core_steps/models/roboflow/keypoint_detection/v2_tensor.py +641 -0
- roboflow_workflows/core_steps/models/roboflow/keypoint_detection/v3.py +417 -0
- roboflow_workflows/core_steps/models/roboflow/keypoint_detection/v3_tensor.py +674 -0
- roboflow_workflows/core_steps/models/roboflow/multi_class_classification/__init__.py +0 -0
- roboflow_workflows/core_steps/models/roboflow/multi_class_classification/v1.py +271 -0
- roboflow_workflows/core_steps/models/roboflow/multi_class_classification/v1_tensor.py +471 -0
- roboflow_workflows/core_steps/models/roboflow/multi_class_classification/v2.py +279 -0
- roboflow_workflows/core_steps/models/roboflow/multi_class_classification/v2_tensor.py +477 -0
- roboflow_workflows/core_steps/models/roboflow/multi_class_classification/v3.py +323 -0
- roboflow_workflows/core_steps/models/roboflow/multi_class_classification/v3_tensor.py +520 -0
- roboflow_workflows/core_steps/models/roboflow/multi_label_classification/__init__.py +0 -0
- roboflow_workflows/core_steps/models/roboflow/multi_label_classification/v1.py +274 -0
- roboflow_workflows/core_steps/models/roboflow/multi_label_classification/v1_tensor.py +453 -0
- roboflow_workflows/core_steps/models/roboflow/multi_label_classification/v2.py +277 -0
- roboflow_workflows/core_steps/models/roboflow/multi_label_classification/v2_tensor.py +454 -0
- roboflow_workflows/core_steps/models/roboflow/multi_label_classification/v3.py +322 -0
- roboflow_workflows/core_steps/models/roboflow/multi_label_classification/v3_tensor.py +493 -0
- roboflow_workflows/core_steps/models/roboflow/object_detection/__init__.py +0 -0
- roboflow_workflows/core_steps/models/roboflow/object_detection/v1.py +354 -0
- roboflow_workflows/core_steps/models/roboflow/object_detection/v1_tensor.py +440 -0
- roboflow_workflows/core_steps/models/roboflow/object_detection/v2.py +358 -0
- roboflow_workflows/core_steps/models/roboflow/object_detection/v2_tensor.py +440 -0
- roboflow_workflows/core_steps/models/roboflow/object_detection/v3.py +400 -0
- roboflow_workflows/core_steps/models/roboflow/object_detection/v3_tensor.py +479 -0
- roboflow_workflows/core_steps/models/roboflow/semantic_segmentation/__init__.py +0 -0
- roboflow_workflows/core_steps/models/roboflow/semantic_segmentation/v1.py +321 -0
- roboflow_workflows/core_steps/models/roboflow/semantic_segmentation/v1_tensor.py +643 -0
- roboflow_workflows/core_steps/models/roboflow/semantic_segmentation/v2.py +382 -0
- roboflow_workflows/core_steps/models/roboflow/semantic_segmentation/v2_tensor.py +702 -0
- roboflow_workflows/core_steps/models/third_party/__init__.py +0 -0
- roboflow_workflows/core_steps/models/third_party/barcode_detection/__init__.py +0 -0
- roboflow_workflows/core_steps/models/third_party/barcode_detection/v1.py +132 -0
- roboflow_workflows/core_steps/models/third_party/barcode_detection/v1_tensor.py +158 -0
- roboflow_workflows/core_steps/models/third_party/qr_code_detection/__init__.py +0 -0
- roboflow_workflows/core_steps/models/third_party/qr_code_detection/v1.py +140 -0
- roboflow_workflows/core_steps/models/third_party/qr_code_detection/v1_tensor.py +160 -0
- roboflow_workflows/core_steps/sampling/__init__.py +0 -0
- roboflow_workflows/core_steps/sampling/identify_changes/__init__.py +0 -0
- roboflow_workflows/core_steps/sampling/identify_changes/v1.py +388 -0
- roboflow_workflows/core_steps/sampling/identify_changes/v1_tensor.py +405 -0
- roboflow_workflows/core_steps/sampling/identify_outliers/__init__.py +0 -0
- roboflow_workflows/core_steps/sampling/identify_outliers/v1.py +263 -0
- roboflow_workflows/core_steps/sampling/identify_outliers/v1_tensor.py +265 -0
- roboflow_workflows/core_steps/secrets_providers/__init__.py +0 -0
- roboflow_workflows/core_steps/secrets_providers/environment_secrets_store/__init__.py +0 -0
- roboflow_workflows/core_steps/secrets_providers/environment_secrets_store/v1.py +145 -0
- roboflow_workflows/core_steps/sinks/__init__.py +0 -0
- roboflow_workflows/core_steps/sinks/email_notification/__init__.py +0 -0
- roboflow_workflows/core_steps/sinks/email_notification/v1.py +507 -0
- roboflow_workflows/core_steps/sinks/email_notification/v2.py +1089 -0
- roboflow_workflows/core_steps/sinks/local_file/__init__.py +0 -0
- roboflow_workflows/core_steps/sinks/local_file/v1.py +432 -0
- roboflow_workflows/core_steps/sinks/noop.py +14 -0
- roboflow_workflows/core_steps/sinks/onvif_movement/__init__.py +0 -0
- roboflow_workflows/core_steps/sinks/onvif_movement/v1.py +990 -0
- roboflow_workflows/core_steps/sinks/onvif_movement/v1_tensor.py +1028 -0
- roboflow_workflows/core_steps/sinks/s3/__init__.py +0 -0
- roboflow_workflows/core_steps/sinks/s3/v1.py +464 -0
- roboflow_workflows/core_steps/sinks/slack/__init__.py +0 -0
- roboflow_workflows/core_steps/sinks/slack/notification/__init__.py +0 -0
- roboflow_workflows/core_steps/sinks/slack/notification/v1.py +418 -0
- roboflow_workflows/core_steps/sinks/twilio/__init__.py +0 -0
- roboflow_workflows/core_steps/sinks/twilio/sms/__init__.py +0 -0
- roboflow_workflows/core_steps/sinks/twilio/sms/v1.py +437 -0
- roboflow_workflows/core_steps/sinks/twilio/sms/v2.py +799 -0
- roboflow_workflows/core_steps/sinks/webhook/__init__.py +0 -0
- roboflow_workflows/core_steps/sinks/webhook/v1.py +586 -0
- roboflow_workflows/core_steps/trackers/__init__.py +0 -0
- roboflow_workflows/core_steps/trackers/_base.py +181 -0
- roboflow_workflows/core_steps/trackers/_base_tensor.py +318 -0
- roboflow_workflows/core_steps/trackers/botsort/__init__.py +0 -0
- roboflow_workflows/core_steps/trackers/botsort/v1.py +326 -0
- roboflow_workflows/core_steps/trackers/botsort/v1_tensor.py +327 -0
- roboflow_workflows/core_steps/trackers/bytetrack/__init__.py +0 -0
- roboflow_workflows/core_steps/trackers/bytetrack/v1.py +208 -0
- roboflow_workflows/core_steps/trackers/bytetrack/v1_tensor.py +215 -0
- roboflow_workflows/core_steps/trackers/ocsort/__init__.py +0 -0
- roboflow_workflows/core_steps/trackers/ocsort/v1.py +224 -0
- roboflow_workflows/core_steps/trackers/ocsort/v1_tensor.py +224 -0
- roboflow_workflows/core_steps/trackers/sort/__init__.py +0 -0
- roboflow_workflows/core_steps/trackers/sort/v1.py +195 -0
- roboflow_workflows/core_steps/trackers/sort/v1_tensor.py +202 -0
- roboflow_workflows/core_steps/transformations/__init__.py +0 -0
- roboflow_workflows/core_steps/transformations/absolute_static_crop/__init__.py +0 -0
- roboflow_workflows/core_steps/transformations/absolute_static_crop/v1.py +170 -0
- roboflow_workflows/core_steps/transformations/absolute_static_crop/v1_tensor.py +186 -0
- roboflow_workflows/core_steps/transformations/bounding_rect/__init__.py +0 -0
- roboflow_workflows/core_steps/transformations/bounding_rect/v1.py +176 -0
- roboflow_workflows/core_steps/transformations/bounding_rect/v1_tensor.py +249 -0
- roboflow_workflows/core_steps/transformations/byte_tracker/__init__.py +0 -0
- roboflow_workflows/core_steps/transformations/byte_tracker/v1.py +199 -0
- roboflow_workflows/core_steps/transformations/byte_tracker/v1_tensor.py +282 -0
- roboflow_workflows/core_steps/transformations/byte_tracker/v2.py +219 -0
- roboflow_workflows/core_steps/transformations/byte_tracker/v2_tensor.py +302 -0
- roboflow_workflows/core_steps/transformations/byte_tracker/v3.py +284 -0
- roboflow_workflows/core_steps/transformations/byte_tracker/v3_tensor.py +380 -0
- roboflow_workflows/core_steps/transformations/camera_calibration/__init__.py +0 -0
- roboflow_workflows/core_steps/transformations/camera_calibration/v1.py +285 -0
- roboflow_workflows/core_steps/transformations/detection_offset/__init__.py +0 -0
- roboflow_workflows/core_steps/transformations/detection_offset/v1.py +213 -0
- roboflow_workflows/core_steps/transformations/detection_offset/v1_tensor.py +317 -0
- roboflow_workflows/core_steps/transformations/detections_combine/__init__.py +0 -0
- roboflow_workflows/core_steps/transformations/detections_combine/v1.py +123 -0
- roboflow_workflows/core_steps/transformations/detections_combine/v1_tensor.py +341 -0
- roboflow_workflows/core_steps/transformations/detections_filter/__init__.py +0 -0
- roboflow_workflows/core_steps/transformations/detections_filter/v1.py +179 -0
- roboflow_workflows/core_steps/transformations/detections_merge/__init__.py +0 -0
- roboflow_workflows/core_steps/transformations/detections_merge/v1.py +180 -0
- roboflow_workflows/core_steps/transformations/detections_merge/v1_tensor.py +265 -0
- roboflow_workflows/core_steps/transformations/detections_transformation/__init__.py +0 -0
- roboflow_workflows/core_steps/transformations/detections_transformation/v1.py +265 -0
- roboflow_workflows/core_steps/transformations/dynamic_crop/__init__.py +0 -0
- roboflow_workflows/core_steps/transformations/dynamic_crop/v1.py +316 -0
- roboflow_workflows/core_steps/transformations/dynamic_crop/v1_tensor.py +603 -0
- roboflow_workflows/core_steps/transformations/dynamic_zones/__init__.py +0 -0
- roboflow_workflows/core_steps/transformations/dynamic_zones/v1.py +387 -0
- roboflow_workflows/core_steps/transformations/dynamic_zones/v1_tensor.py +463 -0
- roboflow_workflows/core_steps/transformations/geotag_detection/__init__.py +0 -0
- roboflow_workflows/core_steps/transformations/geotag_detection/v1.py +294 -0
- roboflow_workflows/core_steps/transformations/geotag_detection/v1_tensor.py +327 -0
- roboflow_workflows/core_steps/transformations/image_slicer/__init__.py +0 -0
- roboflow_workflows/core_steps/transformations/image_slicer/v1.py +236 -0
- roboflow_workflows/core_steps/transformations/image_slicer/v2.py +288 -0
- roboflow_workflows/core_steps/transformations/per_class_confidence_filter/__init__.py +0 -0
- roboflow_workflows/core_steps/transformations/per_class_confidence_filter/v1.py +164 -0
- roboflow_workflows/core_steps/transformations/per_class_confidence_filter/v1_tensor.py +209 -0
- roboflow_workflows/core_steps/transformations/perspective_correction/__init__.py +0 -0
- roboflow_workflows/core_steps/transformations/perspective_correction/v1.py +881 -0
- roboflow_workflows/core_steps/transformations/perspective_correction/v1_tensor.py +1368 -0
- roboflow_workflows/core_steps/transformations/qr_code_generator/__init__.py +0 -0
- roboflow_workflows/core_steps/transformations/qr_code_generator/v1.py +405 -0
- roboflow_workflows/core_steps/transformations/relative_static_crop/__init__.py +0 -0
- roboflow_workflows/core_steps/transformations/relative_static_crop/v1.py +173 -0
- roboflow_workflows/core_steps/transformations/stabilize_detections/__init__.py +0 -0
- roboflow_workflows/core_steps/transformations/stabilize_detections/v1.py +337 -0
- roboflow_workflows/core_steps/transformations/stabilize_detections/v1_tensor.py +524 -0
- roboflow_workflows/core_steps/transformations/stitch_images/__init__.py +0 -0
- roboflow_workflows/core_steps/transformations/stitch_images/v1.py +269 -0
- roboflow_workflows/core_steps/transformations/stitch_ocr_detections/__init__.py +0 -0
- roboflow_workflows/core_steps/transformations/stitch_ocr_detections/v1.py +339 -0
- roboflow_workflows/core_steps/transformations/stitch_ocr_detections/v1_tensor.py +403 -0
- roboflow_workflows/core_steps/transformations/stitch_ocr_detections/v2.py +881 -0
- roboflow_workflows/core_steps/transformations/stitch_ocr_detections/v2_tensor.py +955 -0
- roboflow_workflows/core_steps/transformations/track_class_lock/__init__.py +0 -0
- roboflow_workflows/core_steps/transformations/track_class_lock/v1.py +460 -0
- roboflow_workflows/core_steps/transformations/track_class_lock/v1_tensor.py +413 -0
- roboflow_workflows/core_steps/visualizations/__init__.py +0 -0
- roboflow_workflows/core_steps/visualizations/background_color/__init__.py +0 -0
- roboflow_workflows/core_steps/visualizations/background_color/v1.py +163 -0
- roboflow_workflows/core_steps/visualizations/background_color/v1_tensor.py +169 -0
- roboflow_workflows/core_steps/visualizations/blur/__init__.py +0 -0
- roboflow_workflows/core_steps/visualizations/blur/v1.py +130 -0
- roboflow_workflows/core_steps/visualizations/blur/v1_tensor.py +140 -0
- roboflow_workflows/core_steps/visualizations/bounding_box/__init__.py +0 -0
- roboflow_workflows/core_steps/visualizations/bounding_box/v1.py +175 -0
- roboflow_workflows/core_steps/visualizations/bounding_box/v1_tensor.py +525 -0
- roboflow_workflows/core_steps/visualizations/circle/__init__.py +0 -0
- roboflow_workflows/core_steps/visualizations/circle/v1.py +162 -0
- roboflow_workflows/core_steps/visualizations/circle/v1_tensor.py +174 -0
- roboflow_workflows/core_steps/visualizations/classification_label/__init__.py +0 -0
- roboflow_workflows/core_steps/visualizations/classification_label/v1.py +564 -0
- roboflow_workflows/core_steps/visualizations/classification_label/v1_tensor.py +661 -0
- roboflow_workflows/core_steps/visualizations/color/__init__.py +0 -0
- roboflow_workflows/core_steps/visualizations/color/v1.py +166 -0
- roboflow_workflows/core_steps/visualizations/color/v1_tensor.py +178 -0
- roboflow_workflows/core_steps/visualizations/common/__init__.py +0 -0
- roboflow_workflows/core_steps/visualizations/common/annotators/__init__.py +0 -0
- roboflow_workflows/core_steps/visualizations/common/annotators/background_color.py +69 -0
- roboflow_workflows/core_steps/visualizations/common/annotators/halo.py +125 -0
- roboflow_workflows/core_steps/visualizations/common/annotators/model_comparison.py +140 -0
- roboflow_workflows/core_steps/visualizations/common/annotators/polygon.py +137 -0
- roboflow_workflows/core_steps/visualizations/common/base.py +115 -0
- roboflow_workflows/core_steps/visualizations/common/base_colorable.py +165 -0
- roboflow_workflows/core_steps/visualizations/common/base_colorable_tensor.py +165 -0
- roboflow_workflows/core_steps/visualizations/common/base_tensor.py +437 -0
- roboflow_workflows/core_steps/visualizations/common/fonts/README.md +109 -0
- roboflow_workflows/core_steps/visualizations/common/fonts/__init__.py +178 -0
- roboflow_workflows/core_steps/visualizations/common/fonts/assets/anonymous_pro/AnonymousPro-Regular.ttf +0 -0
- roboflow_workflows/core_steps/visualizations/common/fonts/assets/anonymous_pro/OFL.txt +94 -0
- roboflow_workflows/core_steps/visualizations/common/fonts/assets/courier_prime/CourierPrime-Regular.ttf +0 -0
- roboflow_workflows/core_steps/visualizations/common/fonts/assets/courier_prime/OFL.txt +93 -0
- roboflow_workflows/core_steps/visualizations/common/fonts/assets/fira_code/FiraCode[wght].ttf +0 -0
- roboflow_workflows/core_steps/visualizations/common/fonts/assets/fira_code/OFL.txt +93 -0
- roboflow_workflows/core_steps/visualizations/common/fonts/assets/geist/Geist-Regular.ttf +0 -0
- roboflow_workflows/core_steps/visualizations/common/fonts/assets/geist/OFL.txt +93 -0
- roboflow_workflows/core_steps/visualizations/common/fonts/assets/geist_mono/GeistMono-Regular.ttf +0 -0
- roboflow_workflows/core_steps/visualizations/common/fonts/assets/geist_mono/OFL.txt +93 -0
- roboflow_workflows/core_steps/visualizations/common/fonts/assets/ibm_plex_mono/IBMPlexMono-Regular.ttf +0 -0
- roboflow_workflows/core_steps/visualizations/common/fonts/assets/ibm_plex_mono/OFL.txt +93 -0
- roboflow_workflows/core_steps/visualizations/common/fonts/assets/inconsolata/Inconsolata[wdth,wght].ttf +0 -0
- roboflow_workflows/core_steps/visualizations/common/fonts/assets/inconsolata/OFL.txt +93 -0
- roboflow_workflows/core_steps/visualizations/common/fonts/assets/inter/Inter[opsz,wght].ttf +0 -0
- roboflow_workflows/core_steps/visualizations/common/fonts/assets/inter/OFL.txt +93 -0
- roboflow_workflows/core_steps/visualizations/common/fonts/assets/jetbrains_mono/JetBrainsMono[wght].ttf +0 -0
- roboflow_workflows/core_steps/visualizations/common/fonts/assets/jetbrains_mono/OFL.txt +93 -0
- roboflow_workflows/core_steps/visualizations/common/fonts/assets/lato/Lato-Regular.ttf +0 -0
- roboflow_workflows/core_steps/visualizations/common/fonts/assets/lato/OFL.txt +93 -0
- roboflow_workflows/core_steps/visualizations/common/fonts/assets/montserrat/Montserrat[wght].ttf +0 -0
- roboflow_workflows/core_steps/visualizations/common/fonts/assets/montserrat/OFL.txt +93 -0
- roboflow_workflows/core_steps/visualizations/common/fonts/assets/noto_sans/NotoSans-Regular.ttf +0 -0
- roboflow_workflows/core_steps/visualizations/common/fonts/assets/noto_sans/OFL.txt +94 -0
- roboflow_workflows/core_steps/visualizations/common/fonts/assets/nunito_sans/NunitoSans[YTLC,opsz,wdth,wght].ttf +0 -0
- roboflow_workflows/core_steps/visualizations/common/fonts/assets/nunito_sans/OFL.txt +93 -0
- roboflow_workflows/core_steps/visualizations/common/fonts/assets/open_sans/OFL.txt +92 -0
- roboflow_workflows/core_steps/visualizations/common/fonts/assets/open_sans/OpenSans[wdth,wght].ttf +0 -0
- roboflow_workflows/core_steps/visualizations/common/fonts/assets/pt_mono/OFL.txt +93 -0
- roboflow_workflows/core_steps/visualizations/common/fonts/assets/pt_mono/PTM55FT.ttf +0 -0
- roboflow_workflows/core_steps/visualizations/common/fonts/assets/roboto/OFL.txt +93 -0
- roboflow_workflows/core_steps/visualizations/common/fonts/assets/roboto/Roboto[wdth,wght].ttf +0 -0
- roboflow_workflows/core_steps/visualizations/common/fonts/assets/roboto_mono/OFL.txt +93 -0
- roboflow_workflows/core_steps/visualizations/common/fonts/assets/roboto_mono/RobotoMono[wght].ttf +0 -0
- roboflow_workflows/core_steps/visualizations/common/fonts/assets/source_code_pro/OFL.txt +93 -0
- roboflow_workflows/core_steps/visualizations/common/fonts/assets/source_code_pro/SourceCodePro[wght].ttf +0 -0
- roboflow_workflows/core_steps/visualizations/common/fonts/assets/space_mono/OFL.txt +93 -0
- roboflow_workflows/core_steps/visualizations/common/fonts/assets/space_mono/SpaceMono-Regular.ttf +0 -0
- roboflow_workflows/core_steps/visualizations/common/fonts/assets/work_sans/OFL.txt +93 -0
- roboflow_workflows/core_steps/visualizations/common/fonts/assets/work_sans/WorkSans[wght].ttf +0 -0
- roboflow_workflows/core_steps/visualizations/common/fonts/downloader.py +162 -0
- roboflow_workflows/core_steps/visualizations/common/fonts/registry.py +298 -0
- roboflow_workflows/core_steps/visualizations/common/fonts/schema.py +60 -0
- roboflow_workflows/core_steps/visualizations/common/label_text.py +117 -0
- roboflow_workflows/core_steps/visualizations/common/utils.py +69 -0
- roboflow_workflows/core_steps/visualizations/corner/__init__.py +0 -0
- roboflow_workflows/core_steps/visualizations/corner/v1.py +174 -0
- roboflow_workflows/core_steps/visualizations/corner/v1_tensor.py +186 -0
- roboflow_workflows/core_steps/visualizations/crop/__init__.py +0 -0
- roboflow_workflows/core_steps/visualizations/crop/v1.py +205 -0
- roboflow_workflows/core_steps/visualizations/crop/v1_tensor.py +213 -0
- roboflow_workflows/core_steps/visualizations/dot/__init__.py +0 -0
- roboflow_workflows/core_steps/visualizations/dot/v1.py +196 -0
- roboflow_workflows/core_steps/visualizations/dot/v1_tensor.py +204 -0
- roboflow_workflows/core_steps/visualizations/ellipse/__init__.py +0 -0
- roboflow_workflows/core_steps/visualizations/ellipse/v1.py +186 -0
- roboflow_workflows/core_steps/visualizations/ellipse/v1_tensor.py +198 -0
- roboflow_workflows/core_steps/visualizations/grid/__init__.py +0 -0
- roboflow_workflows/core_steps/visualizations/grid/v1.py +276 -0
- roboflow_workflows/core_steps/visualizations/halo/__init__.py +0 -0
- roboflow_workflows/core_steps/visualizations/halo/v1.py +193 -0
- roboflow_workflows/core_steps/visualizations/halo/v1_tensor.py +203 -0
- roboflow_workflows/core_steps/visualizations/halo/v2.py +193 -0
- roboflow_workflows/core_steps/visualizations/halo/v2_tensor.py +203 -0
- roboflow_workflows/core_steps/visualizations/heatmap/__init__.py +0 -0
- roboflow_workflows/core_steps/visualizations/heatmap/v1.py +339 -0
- roboflow_workflows/core_steps/visualizations/heatmap/v1_tensor.py +351 -0
- roboflow_workflows/core_steps/visualizations/icon/__init__.py +0 -0
- roboflow_workflows/core_steps/visualizations/icon/v1.py +393 -0
- roboflow_workflows/core_steps/visualizations/icon/v1_tensor.py +402 -0
- roboflow_workflows/core_steps/visualizations/keypoint/__init__.py +0 -0
- roboflow_workflows/core_steps/visualizations/keypoint/v1.py +327 -0
- roboflow_workflows/core_steps/visualizations/keypoint/v1_tensor.py +304 -0
- roboflow_workflows/core_steps/visualizations/label/__init__.py +0 -0
- roboflow_workflows/core_steps/visualizations/label/v1.py +280 -0
- roboflow_workflows/core_steps/visualizations/label/v1_tensor.py +1188 -0
- roboflow_workflows/core_steps/visualizations/label/v2.py +268 -0
- roboflow_workflows/core_steps/visualizations/label/v2_tensor.py +147 -0
- roboflow_workflows/core_steps/visualizations/line_zone/__init__.py +0 -0
- roboflow_workflows/core_steps/visualizations/line_zone/v1.py +210 -0
- roboflow_workflows/core_steps/visualizations/mask/__init__.py +0 -0
- roboflow_workflows/core_steps/visualizations/mask/v1.py +197 -0
- roboflow_workflows/core_steps/visualizations/mask/v1_tensor.py +631 -0
- roboflow_workflows/core_steps/visualizations/model_comparison/__init__.py +0 -0
- roboflow_workflows/core_steps/visualizations/model_comparison/v1.py +224 -0
- roboflow_workflows/core_steps/visualizations/model_comparison/v1_tensor.py +233 -0
- roboflow_workflows/core_steps/visualizations/pixelate/__init__.py +0 -0
- roboflow_workflows/core_steps/visualizations/pixelate/v1.py +134 -0
- roboflow_workflows/core_steps/visualizations/pixelate/v1_tensor.py +144 -0
- roboflow_workflows/core_steps/visualizations/polygon/__init__.py +0 -0
- roboflow_workflows/core_steps/visualizations/polygon/v1.py +181 -0
- roboflow_workflows/core_steps/visualizations/polygon/v1_tensor.py +188 -0
- roboflow_workflows/core_steps/visualizations/polygon/v2.py +180 -0
- roboflow_workflows/core_steps/visualizations/polygon/v2_tensor.py +187 -0
- roboflow_workflows/core_steps/visualizations/polygon_zone/__init__.py +0 -0
- roboflow_workflows/core_steps/visualizations/polygon_zone/v1.py +178 -0
- roboflow_workflows/core_steps/visualizations/reference_path/__init__.py +0 -0
- roboflow_workflows/core_steps/visualizations/reference_path/v1.py +156 -0
- roboflow_workflows/core_steps/visualizations/rich_label/__init__.py +0 -0
- roboflow_workflows/core_steps/visualizations/rich_label/v1.py +365 -0
- roboflow_workflows/core_steps/visualizations/rich_label/v1_tensor.py +151 -0
- roboflow_workflows/core_steps/visualizations/text_display/__init__.py +0 -0
- roboflow_workflows/core_steps/visualizations/text_display/utils.py +350 -0
- roboflow_workflows/core_steps/visualizations/text_display/v1.py +483 -0
- roboflow_workflows/core_steps/visualizations/trace/__init__.py +0 -0
- roboflow_workflows/core_steps/visualizations/trace/v1.py +240 -0
- roboflow_workflows/core_steps/visualizations/trace/v1_tensor.py +248 -0
- roboflow_workflows/core_steps/visualizations/triangle/__init__.py +0 -0
- roboflow_workflows/core_steps/visualizations/triangle/v1.py +212 -0
- roboflow_workflows/core_steps/visualizations/triangle/v1_tensor.py +220 -0
- roboflow_workflows/enterprise_blocks/__init__.py +0 -0
- roboflow_workflows/enterprise_blocks/loader.py +47 -0
- roboflow_workflows/enterprise_blocks/sinks/PLC_modbus/__init__.py +0 -0
- roboflow_workflows/enterprise_blocks/sinks/PLC_modbus/v1.py +200 -0
- roboflow_workflows/enterprise_blocks/sinks/PLCethernetIP/__init__.py +0 -0
- roboflow_workflows/enterprise_blocks/sinks/PLCethernetIP/v1.py +226 -0
- roboflow_workflows/enterprise_blocks/sinks/__init__.py +0 -0
- roboflow_workflows/enterprise_blocks/sinks/event_writer/__init__.py +0 -0
- roboflow_workflows/enterprise_blocks/sinks/event_writer/v1.py +725 -0
- roboflow_workflows/enterprise_blocks/sinks/microsoft_sql_server/__init__.py +0 -0
- roboflow_workflows/enterprise_blocks/sinks/microsoft_sql_server/v1.py +428 -0
- roboflow_workflows/enterprise_blocks/sinks/mqtt_writer/__init__.py +0 -0
- roboflow_workflows/enterprise_blocks/sinks/mqtt_writer/v1.py +412 -0
- roboflow_workflows/enterprise_blocks/sinks/opc_writer/__init__.py +0 -0
- roboflow_workflows/enterprise_blocks/sinks/opc_writer/v1.py +1558 -0
- roboflow_workflows/enterprise_blocks/sinks/plc/__init__.py +0 -0
- roboflow_workflows/enterprise_blocks/sinks/plc/client.py +232 -0
- roboflow_workflows/enterprise_blocks/sinks/plc/direct.py +286 -0
- roboflow_workflows/enterprise_blocks/sinks/plc/v1.py +572 -0
- roboflow_workflows/enterprise_blocks/sinks/postgresql/__init__.py +0 -0
- roboflow_workflows/enterprise_blocks/sinks/postgresql/v1.py +630 -0
- roboflow_workflows/environment.py +159 -0
- roboflow_workflows/errors.py +298 -0
- roboflow_workflows/execution_engine/__init__.py +0 -0
- roboflow_workflows/execution_engine/constants.py +87 -0
- roboflow_workflows/execution_engine/core.py +155 -0
- roboflow_workflows/execution_engine/entities/__init__.py +0 -0
- roboflow_workflows/execution_engine/entities/base.py +750 -0
- roboflow_workflows/execution_engine/entities/engine.py +38 -0
- roboflow_workflows/execution_engine/entities/tensor_native_types.py +742 -0
- roboflow_workflows/execution_engine/entities/types.py +1433 -0
- roboflow_workflows/execution_engine/introspection/__init__.py +0 -0
- roboflow_workflows/execution_engine/introspection/blocks_loader.py +616 -0
- roboflow_workflows/execution_engine/introspection/connections_discovery.py +248 -0
- roboflow_workflows/execution_engine/introspection/entities.py +143 -0
- roboflow_workflows/execution_engine/introspection/schema_parser.py +507 -0
- roboflow_workflows/execution_engine/introspection/selectors_parser.py +122 -0
- roboflow_workflows/execution_engine/introspection/utils.py +52 -0
- roboflow_workflows/execution_engine/profiling/__init__.py +0 -0
- roboflow_workflows/execution_engine/profiling/core.py +268 -0
- roboflow_workflows/execution_engine/v1/__init__.py +0 -0
- roboflow_workflows/execution_engine/v1/compiler/__init__.py +0 -0
- roboflow_workflows/execution_engine/v1/compiler/cache.py +58 -0
- roboflow_workflows/execution_engine/v1/compiler/core.py +284 -0
- roboflow_workflows/execution_engine/v1/compiler/entities.py +279 -0
- roboflow_workflows/execution_engine/v1/compiler/graph_constructor.py +2035 -0
- roboflow_workflows/execution_engine/v1/compiler/graph_traversal.py +64 -0
- roboflow_workflows/execution_engine/v1/compiler/reference_type_checker.py +26 -0
- roboflow_workflows/execution_engine/v1/compiler/steps_initialiser.py +147 -0
- roboflow_workflows/execution_engine/v1/compiler/syntactic_parser.py +155 -0
- roboflow_workflows/execution_engine/v1/compiler/utils.py +167 -0
- roboflow_workflows/execution_engine/v1/compiler/validator.py +57 -0
- roboflow_workflows/execution_engine/v1/core.py +684 -0
- roboflow_workflows/execution_engine/v1/debugger/__init__.py +0 -0
- roboflow_workflows/execution_engine/v1/debugger/core.py +35 -0
- roboflow_workflows/execution_engine/v1/dynamic_blocks/__init__.py +0 -0
- roboflow_workflows/execution_engine/v1/dynamic_blocks/block_assembler.py +550 -0
- roboflow_workflows/execution_engine/v1/dynamic_blocks/block_duration.py +89 -0
- roboflow_workflows/execution_engine/v1/dynamic_blocks/block_scaffolding.py +601 -0
- roboflow_workflows/execution_engine/v1/dynamic_blocks/debug_logs.py +138 -0
- roboflow_workflows/execution_engine/v1/dynamic_blocks/entities.py +188 -0
- roboflow_workflows/execution_engine/v1/dynamic_blocks/error_utils.py +204 -0
- roboflow_workflows/execution_engine/v1/dynamic_blocks/modal_executor.py +2329 -0
- roboflow_workflows/execution_engine/v1/dynamic_blocks/representation_boundary.py +1455 -0
- roboflow_workflows/execution_engine/v1/dynamic_blocks/workflow_debug.py +197 -0
- roboflow_workflows/execution_engine/v1/entities.py +7 -0
- roboflow_workflows/execution_engine/v1/executor/__init__.py +0 -0
- roboflow_workflows/execution_engine/v1/executor/core.py +629 -0
- roboflow_workflows/execution_engine/v1/executor/execution_data_manager/__init__.py +0 -0
- roboflow_workflows/execution_engine/v1/executor/execution_data_manager/branching_manager.py +73 -0
- roboflow_workflows/execution_engine/v1/executor/execution_data_manager/dynamic_batches_manager.py +119 -0
- roboflow_workflows/execution_engine/v1/executor/execution_data_manager/execution_cache.py +413 -0
- roboflow_workflows/execution_engine/v1/executor/execution_data_manager/manager.py +701 -0
- roboflow_workflows/execution_engine/v1/executor/execution_data_manager/step_input_assembler.py +1101 -0
- roboflow_workflows/execution_engine/v1/executor/flow_coordinator.py +110 -0
- roboflow_workflows/execution_engine/v1/executor/output_constructor.py +618 -0
- roboflow_workflows/execution_engine/v1/executor/runtime_input_assembler.py +219 -0
- roboflow_workflows/execution_engine/v1/executor/runtime_input_validator.py +38 -0
- roboflow_workflows/execution_engine/v1/executor/utils.py +136 -0
- roboflow_workflows/execution_engine/v1/inner_workflow/__init__.py +43 -0
- roboflow_workflows/execution_engine/v1/inner_workflow/compiler_bridge.py +140 -0
- roboflow_workflows/execution_engine/v1/inner_workflow/composition.py +127 -0
- roboflow_workflows/execution_engine/v1/inner_workflow/constants.py +4 -0
- roboflow_workflows/execution_engine/v1/inner_workflow/dynamic_blocks_collection.py +143 -0
- roboflow_workflows/execution_engine/v1/inner_workflow/errors.py +106 -0
- roboflow_workflows/execution_engine/v1/inner_workflow/inline.py +665 -0
- roboflow_workflows/execution_engine/v1/inner_workflow/reference_resolution.py +227 -0
- roboflow_workflows/execution_engine/v1/introspection/__init__.py +0 -0
- roboflow_workflows/execution_engine/v1/introspection/inputs_discovery.py +371 -0
- roboflow_workflows/execution_engine/v1/introspection/kinds_schemas.py +159 -0
- roboflow_workflows/execution_engine/v1/introspection/kinds_schemas_register.py +35 -0
- roboflow_workflows/execution_engine/v1/introspection/outputs_discovery.py +126 -0
- roboflow_workflows/execution_engine/v1/introspection/types_discovery.py +25 -0
- roboflow_workflows/execution_engine/v1/step_error_handlers.py +21 -0
- roboflow_workflows/offline.py +70 -0
- roboflow_workflows/prototypes/__init__.py +0 -0
- roboflow_workflows/prototypes/background_tasks.py +13 -0
- roboflow_workflows/prototypes/block.py +594 -0
- roboflow_workflows/prototypes/cache.py +21 -0
- roboflow_workflows/prototypes/image_codec.py +293 -0
- roboflow_workflows/prototypes/models_provider.py +310 -0
- roboflow_workflows/prototypes/observer.py +155 -0
- roboflow_workflows/prototypes/platform_client.py +97 -0
- roboflow_workflows/prototypes/platform_errors.py +74 -0
- roboflow_workflows/prototypes/workspace_resolver.py +26 -0
- roboflow_workflows/utils/__init__.py +0 -0
- roboflow_workflows/utils/action_recognition.py +63 -0
- roboflow_workflows/utils/image_encoding.py +123 -0
- roboflow_workflows/utils/images.py +128 -0
- roboflow_workflows/utils/in_memory_cache.py +40 -0
- roboflow_workflows/utils/lru_cache.py +39 -0
- roboflow_workflows/utils/text.py +80 -0
- roboflow_workflows/utils/url_input.py +187 -0
- roboflow_workflows/warnings.py +2 -0
- roboflow_workflows-0.1.0.dist-info/METADATA +125 -0
- roboflow_workflows-0.1.0.dist-info/RECORD +834 -0
- roboflow_workflows-0.1.0.dist-info/WHEEL +5 -0
- roboflow_workflows-0.1.0.dist-info/licenses/LICENSE +7 -0
- 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
|
+
)
|