pfnet/PaintsChainer

Command Line Mode

Opened this issue · 5 comments

thr3a commented

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 ?

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.

@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?

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 )

@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?

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?