vagheshpatel commited on
Commit
cf6214a
·
verified ·
1 Parent(s): 04359c8

Sync catalog updates from GitHub (ec63768)

Browse files
Files changed (2) hide show
  1. README.md +1 -0
  2. export_and_quantize.sh +7 -2
README.md CHANGED
@@ -93,6 +93,7 @@ source .venv/bin/activate
93
  Run the provided script to download, export to OpenVINO IR, and optionally quantize:
94
 
95
  ```bash
 
96
  chmod +x export_and_quantize.sh
97
  ./export_and_quantize.sh
98
  ```
 
93
  Run the provided script to download, export to OpenVINO IR, and optionally quantize:
94
 
95
  ```bash
96
+ wget https://huggingface.co/Intel/crowd-detection/resolve/main/export_and_quantize.sh
97
  chmod +x export_and_quantize.sh
98
  ./export_and_quantize.sh
99
  ```
export_and_quantize.sh CHANGED
@@ -132,13 +132,18 @@ from pathlib import Path
132
  import openvino as ov
133
  import torch
134
  import yaml
135
- from transformers import DetrForObjectDetection
136
 
137
  model_name, half_flag, size = sys.argv[1], sys.argv[2] == "True", int(sys.argv[3])
138
  model_id = f"facebook/{model_name}"
139
 
140
  # The "no_timm" revision uses the transformers ResNet backbone (no timm dependency).
141
- detr = DetrForObjectDetection.from_pretrained(model_id, revision="no_timm").eval()
 
 
 
 
 
142
  id2label = detr.config.id2label
143
  # DETR predicts 91 COCO category ids (with "N/A" gaps) plus a no-object class.
144
  # Keep the 80 real categories so class ids match YOLO26 (person = 0).
 
132
  import openvino as ov
133
  import torch
134
  import yaml
135
+ from transformers import DetrConfig, DetrForObjectDetection
136
 
137
  model_name, half_flag, size = sys.argv[1], sys.argv[2] == "True", int(sys.argv[3])
138
  model_id = f"facebook/{model_name}"
139
 
140
  # The "no_timm" revision uses the transformers ResNet backbone (no timm dependency).
141
+ config_dict, _ = DetrConfig.get_config_dict(model_id, revision="no_timm")
142
+ # Older no_timm configs serialize the standard non-dilated backbone as null.
143
+ if config_dict.get("dilation") is None:
144
+ config_dict["dilation"] = False
145
+ config = DetrConfig.from_dict(config_dict)
146
+ detr = DetrForObjectDetection.from_pretrained(model_id, revision="no_timm", config=config).eval()
147
  id2label = detr.config.id2label
148
  # DETR predicts 91 COCO category ids (with "N/A" gaps) plus a no-object class.
149
  # Keep the 80 real categories so class ids match YOLO26 (person = 0).