pfnet / PaintsChainer

line drawing colorization using chainer
https://paintschainer.preferred.tech/
MIT License
3.77k stars 557 forks source link

Command Line Mode #114

Open thr3a opened 7 years ago

thr3a commented 7 years ago

As far as documents are concerned, it seems to work only in server mode. How can I generate images from command line or post from Curl ?

taizan commented 7 years ago

you can call colorize function In cgi-bin/paint_x2_unet/cgi_exe.py It lookup [self.root]/line/[id_str].png & [self.root]/ref/[id_str].png , and put output to [self.root]/out_min/[id_str].png & [self.root]/out/[id_str].jpg the directory you need is in /images but if you call cgi-bin function directly, it may change directory relation.

wishforgood commented 6 years ago

@taizan Could you please provide any description of the procedure of generating a color image in normal size(e.g. 1024x1024) from a line image in the same size? I would like to have a try on this method but found it difficult to understand how it works exactly from the code. What is 'ref' image? Should input image be resized to 128x128?

taizan commented 6 years ago

ref image means hint color information for coloring This network is constructed by fully constitutional network , so input image size is not restricted. ( but trained for 1st stage 128px & 2nd stage 512px ) line and ref images are should be same size and dividable by 64. ( because for concat in U-net skip connection )

wishforgood commented 6 years ago

@taizan Thanks every much for your response! Actually my problem is this: now I have trained the 1st and 2nd stage with my own dataset, and I want to check if it works. My input is a line image and would expect a color image as the output. So how can I generate a corresponding ref image then?

wishforgood commented 6 years ago

I tried to use the normal color image as the ref image. However, in the code b, g, r, a channel information are needed. But a normal image can only be split to be b, g, r, without alpha channel. How can I generate an image with alpha channel information?