Skip to content

Commit

Permalink
Expose tracking model settings as env variables in settings
Browse files Browse the repository at this point in the history
  • Loading branch information
msschwartz21 committed Jul 30, 2019
1 parent 51d9c95 commit ceecf01
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 10 deletions.
20 changes: 10 additions & 10 deletions redis_consumer/consumers.py
Original file line number Diff line number Diff line change
Expand Up @@ -908,12 +908,12 @@ def _get_tracker(self, redis_hash, hvalues, raw, segmented):
features = {'appearance', 'distance', 'neighborhood', 'regionprop'}
tracker = tracking.cell_tracker(raw, segmented,
tracking_model,
max_distance=50,
track_length=5,
division=0.9,
birth=0.95,
death=0.95,
neighborhood_scale_size=30,
max_distance=settings.MAX_DISTANCE,
track_length=settings.TRACK_LENGTH,
division=settings.DIVISION,
birth=settings.BIRTH,
death=settings.DEATH,
neighborhood_scale_size=settings.NEIGHBORHOOD_SCALE_SIZE,
features=features)

self.logger.debug('Created tracker!')
Expand Down Expand Up @@ -980,10 +980,10 @@ def _load_data(self, hvalues, subdir, fname):
'identity_upload': self.hostname,
'input_file_name': upload_file_name,
'original_name': segment_fname,
'model_name': 'HeLaS3watershed',
'model_version': 2,
'postprocess_function': 'watershed',
'cuts': 0,
'model_name': settings.MODEL_NAME,
'model_version': settings.MODEL_VERSION,
'postprocess_function': settings.POSTPROCESS_FUNCTION,
'cuts': settings.CUTS,
'status': 'new',
'created_at': current_timestamp,
'updated_at': current_timestamp,
Expand Down
14 changes: 14 additions & 0 deletions redis_consumer/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,3 +124,17 @@ def _strip(x):
'retinanet': processing.retinanet_to_label_image
},
}

# Tracking settings
MODEL_NAME = config('MODEL_NAME', default='HeLaS3watershed')
MODEL_VERSION = config('MODEL_VERSION', default=2)
POSTPROCESS_FUNCTION = config('POSTPROCESS_FUNCTION', default='watershed')
CUTS = config('CUTS', default=0)

# tracking.cell_tracker settings
MAX_DISTANCE = config('MAX_DISTANCE', default=50)
TRACK_LENGTH = config('TRACK_LENGTH', default=5)
DIVISION = config('DIVISION', default=0.9)
BIRTH = config('BIRTH', default=0.95)
DEATH = config('DEATH', default=0.95)
NEIGHBORHOOD_SCALE_SIZE = config('NEIGHBORHOOD_SCALE_SIZE', default=30)

0 comments on commit ceecf01

Please sign in to comment.