New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
how to output the gray image without random.randint? #18
Comments
Hi rui, You can try to change one code line like as bellow. predict method in predict.py seg_img = convert_seg_gray_to_color(lbl_pred, n_classes, colors=colors) to seg_img = lbl_pred Thanks |
Thanks for your guidance! Did you split the train and test manual in advance, or can it implement With regards |
Hi, when I input different size of images it feedback an inconsistent tensor, also I am still looking in split the dataset automatically...is there any way? Best regards, |
Hi, I am wondering why for binary segmentation, I have to set the n_classes as 256 to train, other than 2, is this according to the pixel values? |
I think it may need to add a pixel value normalization process like but where should I put it...could you give me more guidance ? With great appreciation |
Hi, I want to output the gray image for the binary classfication, how should I edit it?
I try to edit this part but failed:
`random.seed(0)
class_colors = [(random.randint(0, 255), random.randint(
0, 255), random.randint(0, 255)) for _ in range(5000)]
def convert_seg_gray_to_color(input, n_classes, output_path=None, colors=class_colors):
if isinstance(input, six.string_types):
seg = cv2.imread(input, flags=cv2.IMREAD_GRAYSCALE)
elif type(input) is np.ndarray:
assert len(input.shape) == 2, "Input should be h,w "
seg = input
Can you give me some guidance?
Thanks!
The text was updated successfully, but these errors were encountered: