Skip to content

Fix model download issue: Download both .xml and .bin files #3012

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: latest
Choose a base branch
from

Conversation

ezelanza
Copy link

Fix model download and execution issues for person detection and re-identification

What changed

This PR addresses an issue where the model downloader was only fetching the .xml (model architecture) file but not the corresponding .bin (model weights) file for OpenVINO models. This mismatch caused runtime errors like:

Why this was needed

Both the .xml and .bin files are required for OpenVINO IR (Intermediate Representation) models to run inference. Without the weights file, the model can't load or perform any predictions. Users trying to run the person detection (person-detection-0202) or person re-identification (person-reidentification-retail-0287) pipelines were hitting this error.

What models are impacted

  • person-detection-0202
  • person-reidentification-retail-0287

These models are often used together for multi-step pipelines (e.g., detect a person, then re-identify them across frames or cameras).

What I did

  • Updated the download logic to ensure both the .xml and .bin files for each model are downloaded and available at runtime.
  • Ran end-to-end tests on both models to confirm they load successfully and perform inference without errors.
  • Cleaned up leftover cell outputs in the notebook for readability and to prevent confusion when users open the notebook.

How to test

  1. Run the notebook end-to-end.
  2. Confirm that both models load without errors.
  3. Check that both .xml and .bin files exist in the expected download directory.

Before this fix:

Running inference would fail with missing weights error.

After this fix:

Both models load successfully and inference runs as expected.


- Updates model download code to properly download both .xml (architecture) and .bin (weights) files
- Fixes RuntimeError: 'Empty weights data in bin file or bin file cannot be found!'
- Ensures both person-detection-0202 and person-reidentification-retail-0287 models work correctly
- Cleans up execution outputs from notebook cells
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@@ -172,23 +172,34 @@
"# A directory where the model will be downloaded.\n",
Copy link
Collaborator

@aleksandr-mokrov aleksandr-mokrov Jul 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line #15.        download_ir_model(download_det_model_xml_url, Path(base_model_dir) / detection_model_name / precision)

download_ir_model accepts xml url, and then download bin and xml files. It checks separately if each of them already exists and downloads if not. So, it is enough to removeif not detection_model_path.exists(): and if not reidentification_model_path.exists():


Reply via ReviewNB

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants