ivanpuhachov / line-drawing-vectorization-polyvector-flow

Code for "Keypoint-Driven Line Drawing Vectorization via PolyVector Flow"
31 stars 7 forks source link

Some problems with the size of input image to usemodel.py #7

Closed Endauvor closed 1 month ago

Endauvor commented 2 months ago

For some reason prediction of keypoints doesn't work well for different resolutions of input image. For some sizes it works well, for some it doesn't work at all (I get just white output). I attached a few examples: 1) For input 1 I get just white output 5 2) For input 3 I get output 4 (you can see some bad new details) 3) On output 2 there are some missed vertices

Could you please advice me how can to fix these bags?

1 2 3 4 5 5.png

ivanpuhachov commented 2 months ago

For input 1 I get just white output 5

My best guess is that there is a problem with image encoding. If I just take a screenshot of you image and put it into the pipeline the results are as expected

Input: testimg

Output: image

ivanpuhachov commented 2 months ago

For some reason prediction of keypoints doesn't work well for different resolutions of input image. For some sizes it works well, for some it doesn't work at all (I get just white output)

  1. For input 3 I get output 4 (you can see some bad new details)

Yes, the keypoint detector is not perfect. We did not augment it with possible compression artifacts. We assume that the input image is relatively clean, and the subject is in the centre of the frame. To fix input 1 and 3 please check the input processing part, I believe you need to modify png_to_numpy() in sketchyimage.py. As I mentioned above, the problem might simply be in image encoding.

  1. On output 2 there are some missed vertices

For output 2, "missing" keypoints are ambiguous - our pipeline naturally resolves y-junctions (smooth connections) and we did not require these points to be detected. We show the results of our vectorization on this input on Fig. 15. If you absolutely need those points detected I guess the only option is to retrain the detector.