Skip to content

Commit 498efe0

Browse files
committed
change ds_test to ds
1 parent 0405647 commit 498efe0

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

notebooks/how-to-finetune-rf-detr-on-segmentation-dataset-nvidia-launchable.ipynb

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -624,7 +624,7 @@
624624
"source": [
625625
"import supervision as sv\n",
626626
"\n",
627-
"ds_test = sv.DetectionDataset.from_coco(\n",
627+
"ds = sv.DetectionDataset.from_coco(\n",
628628
" images_directory_path=f\"{dataset.location}/test\",\n",
629629
" annotations_path=f\"{dataset.location}/test/_annotations.coco.json\",\n",
630630
" force_masks=True\n",
@@ -659,15 +659,15 @@
659659
"import matplotlib.pyplot as plt\n",
660660
"\n",
661661
"N = 16\n",
662-
"L = len(ds_test)\n",
662+
"L = len(ds)\n",
663663
"\n",
664664
"annotated_images = []\n",
665665
"\n",
666666
"for i in random.sample(range(L), N):\n",
667-
" path, _, annotations = ds_test[i]\n",
667+
" path, _, annotations = ds[i]\n",
668668
" image = Image.open(path)\n",
669669
" detections = model.predict(image, threshold=0.5)\n",
670-
" annotated_image = annotate(image, detections, classes={i: class_name for i, class_name in enumerate(ds_test.classes)})\n",
670+
" annotated_image = annotate(image, detections, classes={i: class_name for i, class_name in enumerate(ds.classes)})\n",
671671
" annotated_images.append(annotated_image)\n",
672672
"\n",
673673
"fig, axes = plt.subplots(4, 4, figsize=(12, 12))\n",
@@ -734,16 +734,16 @@
734734
"import matplotlib.pyplot as plt\n",
735735
"\n",
736736
"N = 16\n",
737-
"L = len(ds_test)\n",
737+
"L = len(ds)\n",
738738
"\n",
739739
"annotated_images = []\n",
740740
"\n",
741741
"for i in random.sample(range(L), N):\n",
742-
" path, _, annotations = ds_test[i]\n",
742+
" path, _, annotations = ds[i]\n",
743743
" image = Image.open(path)\n",
744744
" result = model_rf.infer(image, confidence=0.5)[0]\n",
745745
" detections = sv.Detections.from_inference(result)\n",
746-
" annotated_image = annotate(image, detections, classes={i: class_name for i, class_name in enumerate(ds_test.classes)})\n",
746+
" annotated_image = annotate(image, detections, classes={i: class_name for i, class_name in enumerate(ds.classes)})\n",
747747
" annotated_images.append(annotated_image)\n",
748748
"\n",
749749
"fig, axes = plt.subplots(4, 4, figsize=(12, 12))\n",

0 commit comments

Comments
 (0)