Explore data with SAM#

In this example we once again use the napari-easy-augment-batch-dl plugin to view an image series. This time we use the Mobile SAM option to test Mobile SAM on our lady bug images.

from cellpose import models, io
import os
import numpy as np
import napari
from napari_easy_augment_batch_dl import easy_augment_batch_dl

viewer = napari.Viewer()

batch_dl = easy_augment_batch_dl.NapariEasyAugmentBatchDL(viewer, label_only = False)

viewer.window.add_dock_widget(
    batch_dl
)

data_path = r'../../data'
parent_path = os.path.join(data_path, 'ladybugs_SAM')

batch_dl.load_image_directory(parent_path)
VIT checkpoint loaded successfully
found class  PytorchSemanticModel
found class  CellPoseInstanceModel
creating new log file
2024-10-28 13:58:00,154 [INFO] WRITING LOG OUTPUT TO C:\Users\bnort\.cellpose\run.log
2024-10-28 13:58:00,155 [INFO] 
cellpose version: 	3.0.9 
platform:       	win32 
python version: 	3.10.14 
torch version:  	2.2.2+cu118
found class  MobileSAMModel
found class  YoloSAMModel