Skip to content

Commit 32e91ef

Browse files
committed
new FastSAM example
1 parent b4e0f38 commit 32e91ef

1 file changed

Lines changed: 7 additions & 6 deletions

File tree

examples/example_patch_based_inference.ipynb

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -808,7 +808,7 @@
808808
}
809809
],
810810
"source": [
811-
"from ultralytics import FastSAM\n",
811+
"from ultralytics import YOLO\n",
812812
"import matplotlib.pyplot as plt\n",
813813
"\n",
814814
"# Load the image \n",
@@ -872,7 +872,7 @@
872872
"source": [
873873
"element_crops = MakeCropsDetectThem(\n",
874874
" image=img,\n",
875-
" model=FastSAM('FastSAM-x.pt'),\n",
875+
" model=YOLO('FastSAM-x.pt'),\n",
876876
" model_path=\"yolov8m.pt\",\n",
877877
" segment=True,\n",
878878
" show_crops=True,\n",
@@ -882,14 +882,15 @@
882882
" overlap_y=50,\n",
883883
" conf=0.3,\n",
884884
" iou=0.8,\n",
885+
" imgsz=1024,\n",
885886
")\n",
886-
"result = CombineDetections(element_crops, nms_threshold=0.40)\n",
887+
"result = CombineDetections(element_crops, nms_threshold=0.4)\n",
887888
"\n",
888889
"print('Basic FastSAM inference:')\n",
889890
"visualize_results_usual_yolo_inference(\n",
890891
" img,\n",
891-
" model=FastSAM('FastSAM-x.pt') ,\n",
892-
" imgsz=640,\n",
892+
" model=YOLO('FastSAM-x.pt') ,\n",
893+
" imgsz=1024,\n",
893894
" conf=0.3,\n",
894895
" iou=0.8,\n",
895896
" segment=True,\n",
@@ -1392,7 +1393,7 @@
13921393
],
13931394
"metadata": {
13941395
"kernelspec": {
1395-
"display_name": "WORK",
1396+
"display_name": "patched_yolo_infer",
13961397
"language": "python",
13971398
"name": "python3"
13981399
},

0 commit comments

Comments
 (0)