Skip to content

Commit 7925f8e

Browse files
committed
Remove rf-detr dummy class prepend
1 parent 1dd0500 commit 7925f8e

File tree

1 file changed

+0
-13
lines changed

1 file changed

+0
-13
lines changed

roboflow/util/model_processor.py

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,6 @@ def _process_rfdetr(model_type: str, model_path: str, filename: str) -> str:
271271
def get_classnames_txt_for_rfdetr(model_path: str, pt_file: str):
272272
class_names_path = os.path.join(model_path, "class_names.txt")
273273
if os.path.exists(class_names_path):
274-
maybe_prepend_dummy_class(class_names_path)
275274
return class_names_path
276275

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

288286
raise FileNotFoundError(
@@ -294,17 +292,6 @@ def get_classnames_txt_for_rfdetr(model_path: str, pt_file: str):
294292
)
295293

296294

297-
def maybe_prepend_dummy_class(class_name_file: str):
298-
with open(class_name_file) as f:
299-
class_names = f.readlines()
300-
301-
dummy_class = "background_class83422\n"
302-
if dummy_class not in class_names:
303-
class_names.insert(0, dummy_class)
304-
with open(class_name_file, "w") as f:
305-
f.writelines(class_names)
306-
307-
308295
def _process_huggingface(
309296
model_type: str, model_path: str, filename: str = "fine-tuned-paligemma-3b-pt-224.f16.npz"
310297
) -> str:

0 commit comments

Comments
 (0)