Skip to content
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 do I visualize the output? #4

Closed
asunyz opened this issue Jul 21, 2019 · 11 comments
Closed

How do I visualize the output? #4

asunyz opened this issue Jul 21, 2019 · 11 comments
Labels
enhancement New feature or request

Comments

@asunyz
Copy link

asunyz commented Jul 21, 2019

  1. I tried running "python ./post.py --plot --thresholds="0.010,0.015" logs/RUN/npz/ITERATION post/RUN-ITERATION" after I have trained the neural network, and I get error messages like this:

(lcnn) yus174@yixing:~/lcnn$ python ./post.py --plot --thresholds="0.010,0.015" logs/190719-160137-437ef29-baseline/npz/000480000 post/test
Processing logs/190719-160137-437ef29-baseline/npz/000480000/000000.npz
Processing logs/190719-160137-437ef29-baseline/npz/000480000/000001.npz
Processing logs/190719-160137-437ef29-baseline/npz/000480000/000002.npz
Processing logs/190719-160137-437ef29-baseline/npz/000480000/000003.npz
Processing logs/190719-160137-437ef29-baseline/npz/000480000/000004.npz
Processing logs/190719-160137-437ef29-baseline/npz/000480000/000005.npz
Processing logs/190719-160137-437ef29-baseline/npz/000480000/000006.npz
Processing logs/190719-160137-437ef29-baseline/npz/000480000/000007.npz
Processing logs/190719-160137-437ef29-baseline/npz/000480000/000008.npz
Processing logs/190719-160137-437ef29-baseline/npz/000480000/000009.npz
Processing logs/190719-160137-437ef29-baseline/npz/000480000/000010.npz
Processing logs/190719-160137-437ef29-baseline/npz/000480000/000011.npz
Process Process-4:
Traceback (most recent call last):
File "/home/yus174/anaconda3/envs/lcnn/lib/python3.7/site-packages/matplotlib/axes/_axes.py", line 4277, in _parse_scatter_color_args
colors = mcolors.to_rgba_array(c)
File "/home/yus174/anaconda3/envs/lcnn/lib/python3.7/site-packages/matplotlib/colors.py", line 286, in to_rgba_array
result[i] = to_rgba(cc, alpha)
File "/home/yus174/anaconda3/envs/lcnn/lib/python3.7/site-packages/matplotlib/colors.py", line 177, in to_rgba
rgba = _to_rgba_no_colorcycle(c, alpha)
File "/home/yus174/anaconda3/envs/lcnn/lib/python3.7/site-packages/matplotlib/colors.py", line 231, in _to_rgba_no_colorcycle
raise ValueError("Invalid RGBA argument: {!r}".format(orig_c))
ValueError: Invalid RGBA argument: 's'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/yus174/anaconda3/envs/lcnn/lib/python3.7/multiprocessing/process.py", line 297, in _bootstrap
self.run()
File "/home/yus174/anaconda3/envs/lcnn/lib/python3.7/multiprocessing/process.py", line 99, in run
self._target(*self._args, **self._kwargs)
File "/home/yus174/lcnn/lcnn/utils.py", line 75, in __parallel_handle
q_out.put((i, f(x)))
File "./post.py", line 182, in handle
plt.scatter(a[1], a[0], *PLTOPTS)
File "/home/yus174/anaconda3/envs/lcnn/lib/python3.7/site-packages/matplotlib/pyplot.py", line 2841, in scatter
None else {}), **kwargs)
File "/home/yus174/anaconda3/envs/lcnn/lib/python3.7/site-packages/matplotlib/init.py", line 1589, in inner
return func(ax, *map(sanitize_sequence, args), **kwargs)
File "/home/yus174/anaconda3/envs/lcnn/lib/python3.7/site-packages/matplotlib/axes/_axes.py", line 4446, in scatter
get_next_color_func=self._get_patches_for_fill.get_next_color)
File "/home/yus174/anaconda3/envs/lcnn/lib/python3.7/site-packages/matplotlib/axes/_axes.py", line 4298, in _parse_scatter_color_args
.format(c) # note: could be long depending on c
ValueError: 'c' argument must be a mpl color, a sequence of mpl colors or a sequence of numbers, not s.
Process Process-8:
Traceback (most recent call last):
File "/home/yus174/anaconda3/envs/lcnn/lib/python3.7/site-packages/matplotlib/axes/_axes.py", line 4277, in _parse_scatter_color_args
colors = mcolors.to_rgba_array(c)
File "/home/yus174/anaconda3/envs/lcnn/lib/python3.7/site-packages/matplotlib/colors.py", line 286, in to_rgba_array
result[i] = to_rgba(cc, alpha)
File "/home/yus174/anaconda3/envs/lcnn/lib/python3.7/site-packages/matplotlib/colors.py", line 177, in to_rgba
rgba = _to_rgba_no_colorcycle(c, alpha)
File "/home/yus174/anaconda3/envs/lcnn/lib/python3.7/site-packages/matplotlib/colors.py", line 231, in _to_rgba_no_colorcycle
raise ValueError("Invalid RGBA argument: {!r}".format(orig_c))
ValueError: Invalid RGBA argument: 's'
......
(The rest truncated for brevity)
The other two evaluations without post-processing worked fine for me.

  1. It seems this script is processing and visualizing the test results generated during training. How do I generate results on novel images that are not included in the test set?
@zhou13
Copy link
Owner

zhou13 commented Jul 24, 2019

  1. This is a problem caused by matplotlib 3.0 upgrade. It is fixed in master now.

  2. Currently, there is no one-stop method to do this. I am working on a script. But if you need it right now you can refer to dataset/wireframe.py to make your dataset and change the content of lines to arbitrary values.

@asunyz
Copy link
Author

asunyz commented Jul 24, 2019

Thank you for your help. =)

@zhou13 zhou13 added the enhancement New feature or request label Jul 31, 2019
@siyuada
Copy link

siyuada commented Aug 8, 2019

Hey, If I just wanna test my own image, how this line sample module work, since there are no static and dynamic sample groundtruth?

@zhou13
Copy link
Owner

zhou13 commented Aug 8, 2019

If you need it right now you can refer to dataset/wireframe.py to make your dataset and change the content of lines to arbitrary values. The static and dynamic samplers are not used during testing.

@Uni-Summer
Copy link

Hi, when I run dataset/wireframe.py on my own dataset, there is no .json file. So can you tell me where this file comes from? That's very kind of you.

@zhou13
Copy link
Owner

zhou13 commented Sep 18, 2019

You can refer to the "Processing the Dataset" section to download the json files.

@Uni-Summer
Copy link

You can refer to the "Processing the Dataset" section to download the json files.

OK. Thank you for your quick reply.

@DaddyWesker
Copy link

DaddyWesker commented Jan 23, 2020

You can refer to the "Processing the Dataset" section to download the json files.

I guess question is - how to create json files for random dataset since json file contains lines' coordinates (ground truth data)? And is this labels necessary if i'm just want to run your network on some of my images?
__
So, main question is (because you referring to this issue in the issue "how to test model on a single image" i'm asking it there) - how to test your code on a random image which has no GT data? Since process.py reads directory with images (loader = torch.utils.data.DataLoader(WireframeDataset...) ) and npz data and considers folder empty if no npz data could be found.

@DaddyWesker
Copy link

Oh well... I've somehow made it. Just used one of your npz files and placed it near my image
000000_0

But maybe there are way to not use those npz's?

@zhou13 zhou13 closed this as completed in 5d2bd1b Jan 24, 2020
@zhou13
Copy link
Owner

zhou13 commented Jan 24, 2020

See the updated README.

@jamesbc123
Copy link

If you need it right now you can refer to dataset/wireframe.py to make your dataset and change the content of lines to arbitrary values. The static and dynamic samplers are not used during testing.

It seems to me that the sample_lines function is run during validation and testing. And in this function is requires N, which is the length of junc (from the ground truth). The demo initialises a tensor ("junc": torch.zeros(1, 2).to(device)) which doesn't have this information of course, but I get errors because I'm indexing out of range.

Is there not a way to completely separate train from test and val? I don't like that the forward function in line_vectoriser requires the gt. I would like to completely separate this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

6 participants