image-segmentation

Unable to load model weights while predicting (using pytorch)

对着背影说爱祢 提交于 2020-08-10 18:56:40
问题 I have trained a Mask RCNN network using PyTorch and am trying to use the obtained weights to predict the location of apples in an image.. I am using the dataset from this paper, and here is the github link to code being used I am simply following the instructions as provided in the ReadMe file.. Here is the command i wrote in prompt (removed personal info) python predict_rcnn.py --data_path "my_directory\datasets\apples-minneapple\detection" --output_file "my_directory\samples\apples

Finding each centroid of multiple connected objects

和自甴很熟 提交于 2020-07-23 06:45:16
问题 I am SUPER new to python coding and would like some help. I was able to segment each cell outline within a biological tissue (super cool!) and now I am trying to find the centroid of each cell within a tissue using this: I am using this code: img = cv2.imread('/Users/kate/Desktop/SegmenterTest/SegmentedCells/Seg1.png') image = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) thresh = cv2.threshold(image, 60, 255, cv2.THRESH_BINARY)[1] cnts = cv2.findContours(thresh.copy(), cv2.RETR_EXTERNAL, cv2.CHAIN

Keras ImageDataGenerator for segmentaion with images and masks in separate directories

ε祈祈猫儿з 提交于 2020-07-07 11:51:03
问题 I am trying to build a semantic segmentation model using tensorflow.keras . The dataset that I am using has the images and masks stored in separate directories and each filename has is an id for mapping an image file with its respective mask. Following is the structure of my dataset directory: new - rendered_imges - render - image_1.tif - image_2.tif - image_3.tif - ground_truths - masks - mask_1.tif - mask_2.tif - mask_3.tif In the above directory structure, image_{i}.tif corresponds to mask

Channel wise CrossEntropyLoss for image segmentation in pytorch

倾然丶 夕夏残阳落幕 提交于 2020-07-05 12:11:32
问题 I am doing an image segmentation task. There are 7 classes in total so the final outout is a tensor like [batch, 7, height, width] which is a softmax output. Now intuitively I wanted to use CrossEntropy loss but the pytorch implementation doesn't work on channel wise one-hot encoded vector So I was planning to make a function on my own. With a help from some stackoverflow, My code so far looks like this from torch.autograd import Variable import torch import torch.nn.functional as F def cross