Commit 08deaba6 authored by Fernando Perez-Garcia's avatar Fernando Perez-Garcia

Merge branch 'master' of weisslab.cs.ucl.ac.uk:FernandoPerezGarcia/vesseg

parents e6d270f9 931fc026
......@@ -16,10 +16,10 @@ combinations = (
(DSA, T1, T1_GAD),
)
applications = 'Vessels', 'Vessels_Reuben'
applications = 'Vessels', # 'Vessels_Reuben'
networks = 233, 223, 222
batch_sizes = 1, 2, 3, 4
learning_rates = 0.01, 0.02, 0.05, 0.1, 0.2, 0.5, 1, 2, 5
learning_rates = 0.01, 0.1, 1
jobs = []
......@@ -45,7 +45,11 @@ for application in applications:
model.set_images_and_labels_paths()
model.make_csv_files(split_type='subject')
model.config_all()
model.config_training(learning_rate=lr)
model.config_training(
learning_rate=lr,
tensorboard_every_n=20,
validation_every_n=100,
)
model.config_network(
network_name=network,
batch_size=batch_size,
......@@ -59,11 +63,9 @@ for application in applications:
progress_bar = tqdm(jobs)
for job in progress_bar:
progress_bar.set_description(f'Creating {job.path}...')
progress_bar.set_description(f'Creating {job.path.name}...')
job.write()
progress_bar = tqdm(jobs)
if len(sys.argv) > 1 and sys.argv[1] == '--submit':
for job in progress_bar:
# progress_bar.set_description(f'Submitting {model_name}...')
for job in jobs:
job.submit()
......@@ -3,9 +3,10 @@ from pathlib import Path
import numpy as np
from . import metrics
from ...nifti import load
from ...utils import get_os
def get_mip_collage(images_dict, metrics_dict=None, fontsize=72):
def get_mip_collage(images_dict, metrics_dict=None):
"""
Example:
images_dict = {
......@@ -51,7 +52,15 @@ def get_mip_collage(images_dict, metrics_dict=None, fontsize=72):
f'Recall: {recall:.3f}',
]
text = '\n'.join(lines)
font_path = '/usr/share/fonts/truetype/ubuntu/Ubuntu-R.ttf'
os = get_os()
if os == 'linux':
font_path = '/usr/share/fonts/truetype/ubuntu/Ubuntu-R.ttf'
fontsize = 48
elif os == 'mac':
fonts_dir = Path('/ Users/fernando/Library/Fonts')
font_path = fonts_dir / 'Meslo LG M DZ Regular for Powerline.ttf'
fontsize = 36
font = ImageFont.truetype(str(font_path), fontsize)
image = Image.new('RGB', (sj, sj), (0, 0, 0))
draw = ImageDraw.Draw(image)
image_size_x, image_size_y = image.size
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment