Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 0 additions & 13 deletions roboflow/util/model_processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,6 @@ def _process_rfdetr(model_type: str, model_path: str, filename: str) -> str:
def get_classnames_txt_for_rfdetr(model_path: str, pt_file: str):
class_names_path = os.path.join(model_path, "class_names.txt")
if os.path.exists(class_names_path):
maybe_prepend_dummy_class(class_names_path)
return class_names_path

import torch
Expand All @@ -282,7 +281,6 @@ def get_classnames_txt_for_rfdetr(model_path: str, pt_file: str):
with open(class_names_path, "w") as f:
for class_name in args["class_names"]:
f.write(class_name + "\n")
maybe_prepend_dummy_class(class_names_path)
return class_names_path

raise FileNotFoundError(
Expand All @@ -294,17 +292,6 @@ def get_classnames_txt_for_rfdetr(model_path: str, pt_file: str):
)


def maybe_prepend_dummy_class(class_name_file: str):
with open(class_name_file) as f:
class_names = f.readlines()

dummy_class = "background_class83422\n"
if dummy_class not in class_names:
class_names.insert(0, dummy_class)
with open(class_name_file, "w") as f:
f.writelines(class_names)


def _process_huggingface(
model_type: str, model_path: str, filename: str = "fine-tuned-paligemma-3b-pt-224.f16.npz"
) -> str:
Expand Down