hkchengrex / CascadePSP

[CVPR 2020] CascadePSP: Toward Class-Agnostic and Very High-Resolution Segmentation via Global and Local Refinement
https://hkchengrex.com/CascadePSP/
MIT License
826 stars 93 forks source link

run demo, there is a bug: Failed to establish a new connection: [Errno 101] Network is unreachable. #19

Closed github-luffy closed 4 years ago

github-luffy commented 4 years ago

Downloading the model file into: /home/dell/.segmentation-refinement/model... How to get model ?thanks

hkchengrex commented 4 years ago

Maybe your network cannot reach the model server. You can download it manually here and rename it to "model". Then you can pass the directory of the folder containing the model file to the "model_folder" argument.

Check the model loading code here: https://github.com/hkchengrex/CascadePSP/blob/master/segmentation-refinement/segmentation_refinement/main.py

github-luffy commented 4 years ago

The input image and mask can be of any size?or What is this demo used for? image = cv2.imread('test/aeroplane.jpg') mask = cv2.imread('test/aeroplane.png', cv2.IMREAD_GRAYSCALE)

hkchengrex commented 4 years ago

The input image/mask need to be of the same size. The demo images are located here: https://github.com/hkchengrex/CascadePSP/tree/master/segmentation-refinement/test.

github-luffy commented 4 years ago

The input image/mask need to be of the same size. The demo images are located here: https://github.com/hkchengrex/CascadePSP/tree/master/segmentation-refinement/test.

Thanks for replying. I want to test my own images. It doesn't work? Must I train my own dataset?

github-luffy commented 4 years ago

Train my own dataset, a bug as above: Traceback (most recent call last): File "train.py", line 124, in train_integrator.finalize('train', total_iter) File "/data/YXQ/CascadePSP/util/log_integrator.py", line 50, in finalize k, v = hook(self.values) File "/data/YXQ/CascadePSP/util/metrics_compute.py", line 16, in lambda x: get_new_iou_hook(x, '224'), lambda x: get_iou_gain(x, '224'), File "/data/YXQ/CascadePSP/util/metrics_compute.py", line 6, in get_new_iou_hook return 'iou/newiou%s'%size, values['iou/newi%s'%size]/values['iou/newu%s'%size] ZeroDivisionError: float division by zero

The bug has been fixed, but will it affect training?

hkchengrex commented 4 years ago

The input image/mask need to be of the same size. The demo images are located here: https://github.com/hkchengrex/CascadePSP/tree/master/segmentation-refinement/test.

Thanks for replying. I want to test my own images. It doesn't work? Must I train my own dataset?

How does not it work? Did it crash or just perform badly?

hkchengrex commented 4 years ago

Train my own dataset, a bug as above: Traceback (most recent call last): File "train.py", line 124, in train_integrator.finalize('train', total_iter) File "/data/YXQ/CascadePSP/util/log_integrator.py", line 50, in finalize k, v = hook(self.values) File "/data/YXQ/CascadePSP/util/metrics_compute.py", line 16, in lambda x: get_new_iou_hook(x, '224'), lambda x: get_iou_gain(x, '224'), File "/data/YXQ/CascadePSP/util/metrics_compute.py", line 6, in get_new_iou_hook return 'iou/newiou%s'%size, values['iou/newi%s'%size]/values['iou/newu%s'%size] ZeroDivisionError: float division by zero

The bug has been fixed, but will it affect training?

Probably because not even a single pixel has been predicted as foreground. Usually doesn't happen, but it's fine if it is just the early stage of training and the network adapt itself later on.

github-luffy commented 4 years ago

The input image/mask need to be of the same size. The demo images are located here: https://github.com/hkchengrex/CascadePSP/tree/master/segmentation-refinement/test.

Thanks for replying. I want to test my own images. It doesn't work? Must I train my own dataset?

How does not it work? Did it crash or just perform badly?

perform badly.

hkchengrex commented 4 years ago

I don't know what your test images are so I cannot comment on that. Training on your own images may help.

github-luffy commented 4 years ago

run demo.py for my own image and mask , make sure image and mask right, but get output image as below. nothing? output

hkchengrex commented 4 years ago

Can I take a look at the input image/mask? The output image isn't that useful.

hkchengrex commented 4 years ago
  1. We assume the input mask to be a grayscale 0~255 image. You need to change the code for loading your mask to achieve that.
  2. The face regions do not have clear boundaries (e.g. not an object, but semantic regions) which are indeed very different than our training images. Training on your own dataset (e.g. faces with these kinds of label) would definitely help.
github-luffy commented 4 years ago
  1. We assume the input mask to be a grayscale 0~255 image. You need to change the code for loading your mask to achieve that.
  2. The face regions do not have clear boundaries (e.g. not an object, but semantic regions) which are indeed very different than our training images. Training on your own dataset (e.g. faces with these kinds of label) would definitely help.

Thanks very much. Got it.