hrnet-pytorch
hrnet-pytorch copied to clipboard
为什么目标像素点为1
”需要改成,背景的像素点值为0,目标的像素点值为1“这是为什么呢,目标像素值为255不是与背景的对比度更高吗
"I need to change it to, the pixel value of the background is 0, and the pixel value of the target is 1" Why, the target pixel value of 255 is not higher contrast with the background
对比度高可还行……你是对图片分类又不是标签分类
There is a error "FileNotFoundError: [Errno 2] No such file or directory: 'VOCdevkit/VOC2007/JPEGImages/train/20160402_150942.jpg'",but I do not konw how to go about fixing it. In train.py file,the dataset path was be set to "VOCdevkit_path = 'VOCdevkit/'",while the code of reading images is "jpg = Image.open(os.path.join(os.path.join(self.dataset_path,"VOC2007/"),name))" in dataloader.py file. It is right path that be presented in this error and the images are no problem.
You cut a picture for me, about the wrong picture
Thanks, the issue has been solved,but here exist another problem.when I finished to train the net 5 epoch,the error "FileNotFoundError: [Errno 2] No such file or directory: '/opt/data/private/hrnet-pytorch-main/VOCdevkit/VOC2007/SegmentationClass/JPEGImages/val/20160222_080850.jpg.png'" is been presented,in the meanwhile the error also says "File "/opt/data/private/hrnet-pytorch-main/utils/utils_metrics.py", line 82, in compute_mIoU label = np.array(Image.open(gt_imgs[ind]))". So I find the utils_metrics.py and search the variable----gt_imgs.we can find it was been defined in the code----"gt_imgs = [join(gt_dir, x + ".png") for x in png_name_list]".Then I saw that the png_name_list is a Morphological parameters of the founction----compute_mIoU that was been imported in callbacks.py file and repluced by self.image_ids during the use of compute_mIoU.Shortly afterward,I located the codes "for image_id in tqdm(self.image_ids):" and "self.image_ids = [image_id.split()[0] for image_id in image_ids]" in the in callbacks.py file.However,my .txt file style is different from your,for example "JPEGImages/train/20160222_080933.jpg SegmentationClass/train/20160222_080933_mask.png" is a line .So the code "image.save(os.path.join(pred_dir,image_id + ".png"))" does not find the right path. But in situation of maintaining my .txt file I dont know how to modify the code.I think that I should redefine image_id.But I dont know how to do.
Why has ACC kept at 100 during the training process? And,most of the time during the training process,the loss kept at 0.501
- I think you should try to download a VOC dataset. I provide VOC_ Annotation.py, used to generate TXT for the division of training set and test set.
- This should be because your data set format is wrong. Maybe you should show me how your label is.
This is my dataset format.
This is a picture of my label which had been made that its target pixel value is equal to 1.
these features of my dataset are the same as your ,but the only different is the .txt files format.Such as "JPEGImages/train/20160330_170922.jpg SegmentationClass/train/20160330_170922_mask.png" is one line of content,which contains not only names of image and label, but also relative paths of them.In order to find right images or labels paths, I had modified the codes which can extract the pictures or labels names from the .txt files.I think this will fit your codes.
That's OK. Can loss converge normally?