TZYSJTU / Sketch-Generation-with-Drawing-Process-Guided-by-Vector-Flow-and-Grayscale

This is the official implementation of the AAAI 2021 accepted paper "Sketch Generation with Drawing Process Guided by Vector Flow and Grayscale"
Creative Commons Zero v1.0 Universal
288 stars 61 forks source link

dir_mask{}.png file not available #1

Closed nareshr8 closed 3 years ago

nareshr8 commented 3 years ago

Hi Team, I am excited to see this paper. I was trying to run your code. When I run the code, the dir_mask{}.png which the code expects to generate is unavailable. Kindly help me out with this.

Usage of the file: https://github.com/TZYSJTU/Sketch-Generation-with-Drawing-Process-Guided-by-Vector-Flow-and-Grayscale/blob/1cf79425ae51e0a89c55aed41ea26980d54ea214/cat.py#L126

TZYSJTU commented 3 years ago

Is this file not generated or can't be opened?

nareshr8 commented 3 years ago

Its not getting generated. I dont see where it would get generated as well

TZYSJTU commented 3 years ago
ETF_filter = ETF(input_path=input_path, output_path=output_path+'/mask',\
     dir_num=direction, kernel_radius=kernel_radius, iter_time=iter_time, background_dir=background_dir)
ETF_filter.forward()
print('ETF done')

Please improve your coding skills

nareshr8 commented 3 years ago

Thanks for suggesting about my coding skills.

Executing the code, Seems another issue has been raised for the same issue(https://github.com/TZYSJTU/Sketch-Generation-with-Drawing-Process-Guided-by-Vector-Flow-and-Grayscale/issues/2). Can you run the code once and see for yourself. The code you show is creating mask{} files. The file that is missing is dir_mask{}.

TZYSJTU commented 3 years ago
    for i in range(self.dir_num):
        if i==0:
            minimum = -90
            maximum = -90+length/2
            mask1 = 255*(((angle>minimum)+(angle==minimum))*(angle<maximum))
            maximum = 90
            minimum = 90-length/2
            mask2 = 255*((angle>minimum)+(angle==minimum))
            mask = mask1 + mask2
            cv2.imwrite(self.output_path+'./dir_mask{}.png'.format(i),np.uint8(mask.numpy()))
        else:
            minimum = -90+(i-1/2)*length   
            maximum = minimum + length  
            mask = 255*(((angle>minimum)+(angle==minimum))*(angle<maximum))
            cv2.imwrite(self.output_path+'./dir_mask{}.png'.format(i),np.uint8(mask.numpy()))

The corresponding code is in the file ETF/edge_tangent_flow.py Please check why these dir_mask{}.png files are not generated. In addition, my code can run on most people's machines.