set_image_batch #363
Unanswered
fredericotupinambauva
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm processing a batch of images and I get an error "AttributeError: “SamGeo2” object has no attribute “predictor"
I have something like this
sam2 = SamGeo2(
model_id="sam2-hiera-large",
automatic=True,
apply_postprocessing=False,
points_per_side=32,
points_per_batch=48,
pred_iou_thresh=0.8,
stability_score_thresh=0.92,
stability_score_offset=0.7,
crop_n_layers=1,
box_nms_thresh=0.7,
crop_n_points_downscale_factor=2,
min_mask_region_area=25.0,
use_m2m=True,
device="cpu"
)
List all files in the directory
images_files = os.listdir(tiles)
Filter out only image files (assuming they have .tif extension)
image_paths = [os.path.join(tiles, img_file) for img_file in images_files if img_file.endswith('.tif')]
sam2.set_image_batch(image_paths)
I haven't found any information on how to batch process images for SAM2, so I'm stuck with this procedure.
I'm counting on your help.
Thank you.
Fred_T_Simoes
Beta Was this translation helpful? Give feedback.
All reactions