Skip to content

Commit

Permalink
Updated the preprocessing script as well as readmes
Browse files Browse the repository at this point in the history
  • Loading branch information
Christoffer Edlund committed Jun 11, 2021
1 parent 916aa0a commit 1f65e25
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ trained and evaluated on LIVECell.
## How to access LIVECell

All images in LIVECell are available following [this link](http://livecell-dataset.s3.eu-central-1.amazonaws.com/LIVECell_dataset_2021/images.zip) (requires 1.3 GB). Annotations for the different experiments are linked below.
To see a more details regarding benchmarks and how to use our models, see [this link](model/README.md).

### LIVECell-wide train and evaluate

Expand Down
10 changes: 9 additions & 1 deletion code/preprocessing.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def preprocess(input_image, magnification_downsample_factor=1.0):
x = int(dims[1]*magnification_downsample_factor)

#apply resizing image to account for different magnifications
output_image = cv2.resize(output_image, (x, y), interpolation = cv2.INTER_AREA)
output_image = cv2.resize(output_image, (x,y), interpolation = cv2.INTER_AREA)

#clip here to regular 0-255 range to avoid any odd median filter results
output_image[output_image > 255] = 255
Expand All @@ -50,3 +50,11 @@ def preprocess(input_image, magnification_downsample_factor=1.0):
output_image = output_image.astype('uint8')

return output_image

def preprocess_fluorescence(input_image, bInvert=True, magnification_downsample_factor=1.0):
#invert to bring background up to 128
img = (255-input_image)/2
if not bInvert:
img = 255-img
output_image = preprocess(img, magnification_downsample_factor=magnification_downsample_factor)
return output_image
4 changes: 4 additions & 0 deletions model/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -250,3 +250,7 @@ python train_net.py --config-file livecell_config.yaml --eval-only MODEL.WEIGHT
For further details on training, testing and inference,
visit the [centermask2](https://github.com/youngwanLEE/centermask2#evaluation) or
[detectron2-ResNeSt](https://github.com/chongruo/detectron2-ResNeSt/blob/resnest/GETTING_STARTED.md) docs

## One-shot usage
For LIVECell experiments with zero-shot learning of EVICAN and Cellpose the input images was preprocessed using the
preprocessing-script preprocessing.py found under the [code folder](code/preprocessing.py).

0 comments on commit 1f65e25

Please sign in to comment.