SOLD2 icon indicating copy to clipboard operation
SOLD2 copied to clipboard

Visualization error

Open liangjxiong opened this issue 4 years ago • 6 comments

Hello, I'm a novice. I encountered the following error. How should I modify the code?

Reference data

ref_img = data1['ref_image'].numpy().squeeze() ref_junc = data1['ref_junctions'].numpy() ref_line_map = data1['ref_line_map'].numpy() ref_line_points = data1['ref_line_points'].numpy()

Target data

target_img = data1['target_image'].numpy().squeeze() target_junc = data1['target_junctions'].numpy() target_line_map = data1['target_line_map'].numpy() target_line_points = data1['target_line_points'].numpy()

Draw the points and lines

ref_img_with_junc = plot_junctions(ref_img, ref_junc, junc_size=2) ref_line_segments = plot_line_segments(ref_img, ref_junc, ref_line_map, junc_size=1) target_img_with_junc = plot_junctions(target_img, target_junc, junc_size=2) target_line_segments = plot_line_segments(target_img, target_junc, target_line_map, junc_size=1)

Plot the images

plot_images([ref_img_with_junc, ref_line_segments], ['Junctions', 'Line segments']) plot_images([target_img_with_junc, target_line_segments], ['Warped junctions', 'Warped line segments'])

KeyError Traceback (most recent call last) Input In [22], in <cell line: 6>() 3 data1 = wireframe_dataset[index] 5 # Reference data ----> 6 ref_img = data1['ref_image'].numpy().squeeze() 7 ref_junc = data1['ref_junctions'].numpy() 8 ref_line_map = data1['ref_line_map'].numpy() KeyError: 'ref_image'

liangjxiong avatar Mar 16 '22 07:03 liangjxiong

Hi, I guess you loaded the wireframe dataset via a config. In the config file, the 'return_type' needs to be set to 'paired_desc' to have access to the pair of images.

rpautrat avatar Mar 16 '22 07:03 rpautrat

Hi, I guess you loaded the wireframe dataset via a config. In the config file, the 'return_type' needs to be set to 'paired_desc' to have access to the pair of images.

hi,thanks for your work very much. I'm in the same trouble, and I modified the return_type to "paired_desc" in wireframe_dataset.yaml Line 10. But it doesn't work, do I work in the right place? Thanks you!

shijian97 avatar Apr 04 '22 13:04 shijian97

Hi, which code did you run and what error do you get exactly?

rpautrat avatar Apr 04 '22 14:04 rpautrat

Hi, which code did you run and what error do you get exactly?

I run the visualize_exported_dataset.ipynb, and I get

KeyError                                  Traceback (most recent call last)
<ipython-input-6-305d3e19684b> in <module>
      4 
      5 # Reference data
----> 6 ref_img = data1['ref_image'].numpy().squeeze()
      7 ref_junc = data1['ref_junctions'].numpy()
      8 ref_line_map = data1['ref_line_map'].numpy()

KeyError: 'ref_image'

I find that data1 has no attribute 'ref_image', 'ref_junctions' and so on. I changed return_type to "paired_desc" in wireframe_dataset.yaml Line 10, but it doesn't work. And I find that because I dont have "gt_source_test" in wireframe_dataset.yaml, what should I modify here? what do you mean the "Fill with your own export file" I download the wireframe.zip, should I write its path here?

shijian97 avatar Apr 04 '22 15:04 shijian97

As explained in the Readme, "gt_source_test" should point to the h5 file generated in step 3. So I think your issue is that you did not use the right path here.

rpautrat avatar Apr 04 '22 16:04 rpautrat

As explained in the Readme, "gt_source_test" should point to the h5 file generated in step 3. So I think your issue is that you did not use the right path here.

ok, thank you, and I'll try it!

shijian97 avatar Apr 04 '22 16:04 shijian97