Repository navigation
Fix SDK data handling, error reporting, and transfers - #575
Open
mikhailbovt wants to merge 1 commit into
Open
mikhailbovt wants to merge 1 commit into
mikhailbovt wants to merge 1 commit into
Conversation
Preserve box coordinates when images are not resized, resolve COCO image references using contextual paths, and propagate upload and training failures. Refresh Vision Events endpoints after region changes. Stream video uploads and buffer downloads with byte progress and strict Content-Length validation. Replace weights only after a successful download, and distinguish completed dataset caches from interrupted downloads and unrelated directories. Keep upload_dataset's default None result and expose counts on request for the CLI. Reject packaging mismatches without prompting in CLI model uploads while retaining the SDK's interactive default. Discard SDK logs without retaining them in memory or failing on Unicode output. Preserve HTTP status through upload failures and map CLI errors to the documented authentication and not-found exit codes.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Fixes incorrect data handling and false success reporting across SDK operations, and reduces memory use and write overhead during transfers.
Type of Change
Testing
Test details:
Added 40 test methods, including parameterized subtests, and updated 8 existing test methods across 12 test files. Three test modules are new.
Added regression coverage:
tests/models/test_inference.py(new)tests/test_model_upload.py(new)tests/util/test_general.py(new)tests/models/test_object_detection.pytests/util/test_folderparser.pytests/test_version.pytests/test_workspace.pyNone; opt-in summaries count uploaded and duplicate images; all images are attempted before aggregate failures are raised; failed ZIP processing raises.tests/test_vision_events.pytests/cli/test_image_handler.py,tests/cli/test_model_handler.pyRuntimeError; packaging mismatches never prompt for input. Tests includeCliRunnerinvocations and real SDK initialization against mocked HTTP responses.Changes to existing tests:
interactive=Falseis passed.RoboflowErrorinstead of accepting a silent return.Validation results:
unittestdiscovery on Windows with Python 3.10.21 and 3.11.9: 1,318 tests on each, no failures, one expected skip per run.Local performance measurements:
Compared base commit
408c2fewithefd8687on Windows / Python 3.11.9 using the actual SDK transfer methods and a loopback HTTP server. Uploaded and downloaded bytes were verified with SHA-256.tracemallocThe traced allocation peak was approximately 99.7% lower, and the local download was approximately 7.8x faster. The video upload took longer in this single-run comparison; its measured benefit is lower memory use. These are local transfer measurements:
tracemallocexcludes native allocations and does not measure total process RSS, and the timings do not establish an end-to-end speedup against the Roboflow service. The benchmark is a manual measurement, separate from the unit test suite.Checklist
Additional Context
Failed uploads and training now raise exceptions instead of reporting success. Existing non-empty dataset directories without matching completion metadata require
overwrite=Trueor a new destination; interrupted downloads with matching SDK metadata can be retried.Successful per-image
upload_dataset()calls still returnNoneby default; counts are opt-in throughreturn_summary=True. SDK model packaging remains interactive by default, and API-key authentication failures remain catchable asRuntimeError.The changelog and affected public method docstrings are updated. No dependencies or CLI commands were added.