Skip to content

Commit dd9d8e1

Browse files
committed
yolov12 doesnt belong in this PR
1 parent fa9547a commit dd9d8e1

File tree

1 file changed

+0
-43
lines changed

1 file changed

+0
-43
lines changed

roboflow/util/model_processor.py

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,6 @@ def _get_processor_function(model_type: str) -> Callable:
5858
if "yolonas" in model_type:
5959
return _process_yolonas
6060

61-
if "yolov12" in model_type:
62-
return _process_yolov12
63-
6461
if "rfdetr" in model_type:
6562
return _process_rfdetr
6663

@@ -227,46 +224,6 @@ def _process_yolo(model_type: str, model_path: str, filename: str) -> str:
227224
return zip_file_name
228225

229226

230-
def _process_yolov12(model_type: str, model_path: str, filename: str) -> str:
231-
# For YOLOv12, since it uses a special Ultralytics version,
232-
# state dict extraction and model artifacts are handled during model conversion
233-
234-
print(
235-
"Note: Model must be trained using ultralytics from https://github.com/sunsmarterjie/yolov12 "
236-
"or through the Roboflow platform"
237-
)
238-
239-
# Check if model_path exists
240-
if not os.path.exists(model_path):
241-
raise FileNotFoundError(f"Model path {model_path} does not exist.")
242-
243-
# Find any .pt file in model path
244-
model_files = os.listdir(model_path)
245-
pt_file = next((f for f in model_files if f.endswith(".pt")), None)
246-
247-
if pt_file is None:
248-
raise RuntimeError("No .pt model file found in the provided path")
249-
250-
# Copy the .pt file to weights.pt if not already named weights.pt
251-
if pt_file != "weights.pt":
252-
shutil.copy(os.path.join(model_path, pt_file), os.path.join(model_path, "weights.pt"))
253-
254-
required_files = ["weights.pt"]
255-
256-
optional_files = ["results.csv", "results.png", "model_artifacts.json"]
257-
258-
zip_file_name = "roboflow_deploy.zip"
259-
with zipfile.ZipFile(os.path.join(model_path, zip_file_name), "w") as zipMe:
260-
for file in required_files:
261-
zipMe.write(os.path.join(model_path, file), arcname=file, compress_type=zipfile.ZIP_DEFLATED)
262-
263-
for file in optional_files:
264-
if os.path.exists(os.path.join(model_path, file)):
265-
zipMe.write(os.path.join(model_path, file), arcname=file, compress_type=zipfile.ZIP_DEFLATED)
266-
267-
return zip_file_name
268-
269-
270227
def _process_rfdetr(model_type: str, model_path: str, filename: str) -> str:
271228
_supported_types = ["rfdetr-base", "rfdetr-large"]
272229
if model_type not in _supported_types:

0 commit comments

Comments
 (0)