Skip to content

Commit

Permalink
Merge pull request #1051 from roboflow/fix/patch_workflows_data_proce…
Browse files Browse the repository at this point in the history
…ssing_on_windows

Fix workflows batch processing for Windows paths
  • Loading branch information
PawelPeczek-Roboflow authored Feb 24, 2025
2 parents df52c39 + 11238bc commit ae8ed64
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion inference/core/version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = "0.40.0rc1"
__version__ = "0.40.0rc2"


if __name__ == "__main__":
Expand Down
9 changes: 8 additions & 1 deletion inference_cli/lib/workflows/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,9 @@ def aggregate_batch_processing_results(
decoded_content = []
for result_path in track(all_results, description="Grabbing processing results..."):
content = read_json(path=result_path)
processed_file = result_path.split("/")[-2]
processed_file = extract_processed_image_name_from_predictions_path(
predictions_path=result_path
)
content["image"] = processed_file
decoded_content.append(content)
if aggregation_format is OutputFileType.JSONL:
Expand All @@ -232,6 +234,11 @@ def aggregate_batch_processing_results(
return aggregated_results_path


def extract_processed_image_name_from_predictions_path(predictions_path: str) -> str:
# we expect path to be <out_dir>/<image_name>/results.json - hence we extract basename of parent dir
return os.path.basename(os.path.dirname(predictions_path))


def dump_objects_to_json(value: Any) -> Any:
if isinstance(value, set):
value = list(value)
Expand Down

0 comments on commit ae8ed64

Please sign in to comment.