amiretefaghi / E2F-GAN

6 stars 3 forks source link

'scatter' in test.py line 157 #1

Open jisoo1738 opened 2 years ago

jisoo1738 commented 2 years ago

what's the 'scatter'?? I can't find it in codes...

amiretefaghi commented 2 years ago

My apologies for this mistake. The scatter is the predicted edges for an input image, and I have now updated this code to include scatter. I accidentally removed this part of the code.

jisoo1738 commented 2 years ago

Can i ask you more questions?

  1. I made a folder named 'pretrained_path' and put weights files into it. Is it right?

  2. Where can i find /fine_encoder_100_weights.h5 file?? if pretrained_fine_encoder == True: gan.fine_encoder.load_weights(f'./fine_encoder_100_weights.h5')

  3. How do I fix this error Traceback (most recent call last): File "test.py", line 140, in pretrained_fine_encoder = pretrained_fine_encoder) NameError: name 'pretrained_fine_encoder' is not defined

I really want to run this code...

amiretefaghi commented 2 years ago

Yes, of course, you can ask more questions.

  1. you can put weights in any direction and this direction was set to ./weights by default.
  2. this was part of our experiment to use a pre-trained fine encoder but this experiment showed us that it is not useful.
  3. As mentioned above this was part of our experiment To make our test code more understandable, I have removed every part of the code that relates to the 'pre-trained fine encoder experiment', you can also remove these parts.
jisoo1738 commented 2 years ago

File "test.py", line 156, in edge = canny(img_gray,sigma=1,mask=mask_gray).astype(float) File "/usr/local/lib/python3.7/dist-packages/skimage/feature/_canny.py", line 182, in canny smoothed = smooth_with_function_and_mask(image, fsmooth, mask) File "/usr/local/lib/python3.7/dist-packages/skimage/feature/_canny.py", line 47, in smooth_with_function_and_mask masked_image[mask] = image[mask] IndexError: too many indices for array: array is 2-dimensional, but 3 were indexed

Because of this error I reshaped maskd_gray to 2D mask_gray = rgb2gray(mask).astype(bool).reshape(256,256) Is it correct?

amiretefaghi commented 2 years ago

Yes, it is correct