From ab18126e578300f50dc8f71f07a9cec5614069f0 Mon Sep 17 00:00:00 2001 From: Sidney Trzepacz <74916637+Sid220@users.noreply.github.com> Date: Sat, 20 Jan 2024 12:16:57 -0500 Subject: [PATCH] Fix issue with files containing jpg --- retrain_efficientdet_model_maker_tf2.ipynb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/retrain_efficientdet_model_maker_tf2.ipynb b/retrain_efficientdet_model_maker_tf2.ipynb index 8bfe953..c97022d 100644 --- a/retrain_efficientdet_model_maker_tf2.ipynb +++ b/retrain_efficientdet_model_maker_tf2.ipynb @@ -330,7 +330,7 @@ " test_count = int(len(filenames) * test_split)\n", " for i, file in enumerate(filenames):\n", " source_dir, filename = os.path.split(file)\n", - " annot_file = os.path.join(annotations_path, filename.replace(\"jpg\", \"xml\"))\n", + " annot_file = os.path.join(annotations_path, os.path.splitext(filename)[0] + \".xml\")\n", " if i \u003c val_count:\n", " shutil.copy(file, IMAGES_VAL_DIR)\n", " shutil.copy(annot_file, ANNOT_VAL_DIR)\n",