spreka / biomagdsb

This repository contains the codes to run the nuclei segmentation pipeline of the BIOMAG group inspired by Kaggle's Data Science Bowl 2018 competition
52 stars 15 forks source link

No provided Mask RCNN and black output #11

Closed Lukeception closed 4 years ago

Lukeception commented 4 years ago

Hello,

I've tried running the start_prediction_full.sh script but I got an error from the python script saying ModuleNotFoundError: No module named 'config'. So I downloaded the Mask RCNN folder from matterport and pasted the required files into ./FinalModel. The script runs fine after that. However, the output I get is always a completely black image.

I've tried to run the detection on the image you see below (its resolution is 256 x 256) as well as the three included test images. The console states that the count of nuclei is greater than 0 but in the output folder under "postprocessing" as well as "presegment" I only find one tiff image per input image that is completely black.

I've tried using only files from the Mask RCNN that are tagged with v2.1 (as that's the version you seem to be using) which did nothing. I've also tried replacing the skimage.io.imsave(...) line with cv2.imwrite(...) but no luck with that either.

he-002-01-01-0

Lukeception commented 4 years ago

UPDATE: The problem was with the .tiff file codec. The output look completely black on the default image view on both Windows and MacOS. Even reading the image cv2.imread(...) gives a completely black image. The solution was to use the tifffile and imagecodecs package. Using the following code I can normally read and display the masks:

import tifffile as tif
img = tif.imread("path/to/image.tiff")