Update demo.py
Browse files
demo.py
CHANGED
@@ -55,7 +55,7 @@ def load_surgvlp_encoder(device):
|
|
55 |
"""
|
56 |
config_path = './utils/config_surgvlp.py'
|
57 |
configs = Config.fromfile(config_path)['config']
|
58 |
-
encoder_model, encoder_preprocess = surgvlp.load(configs.model_config, device=device, pretrain='
|
59 |
encoder_model.eval()
|
60 |
return encoder_model, encoder_preprocess
|
61 |
|
@@ -80,8 +80,8 @@ def main():
|
|
80 |
|
81 |
# Define the directories containing images and corresponding label files.
|
82 |
global image_files
|
83 |
-
images_dir = "./test_data/images/
|
84 |
-
labels_dir = "./test_data/labels/
|
85 |
image_files = [os.path.join(images_dir, f) for f in sorted(os.listdir(images_dir)) if f.lower().endswith('.png')]
|
86 |
random.shuffle(image_files)
|
87 |
# Get first 20 images.
|
|
|
55 |
"""
|
56 |
config_path = './utils/config_surgvlp.py'
|
57 |
configs = Config.fromfile(config_path)['config']
|
58 |
+
encoder_model, encoder_preprocess = surgvlp.load(configs.model_config, device=device, pretrain='SurgVLP2.pth')
|
59 |
encoder_model.eval()
|
60 |
return encoder_model, encoder_preprocess
|
61 |
|
|
|
80 |
|
81 |
# Define the directories containing images and corresponding label files.
|
82 |
global image_files
|
83 |
+
images_dir = "./test_data/images/VID01/"
|
84 |
+
labels_dir = "./test_data/labels/VID01/"
|
85 |
image_files = [os.path.join(images_dir, f) for f in sorted(os.listdir(images_dir)) if f.lower().endswith('.png')]
|
86 |
random.shuffle(image_files)
|
87 |
# Get first 20 images.
|