Exemplo n.º 1
0
    def __init__(self, gpu=0):

        print("start")

        OSHelper.detect_environment()

        self.root = "./images/"
        self.gpu = gpu

        print("load model")
        if self.gpu >= 0:
            cuda.get_device(self.gpu).use()
            cuda.set_max_workspace_size(64 * 1024 * 1024)  # 64MB
            chainer.Function.type_check_enable = False
        self.cnn_128 = unet.UNET()
        self.cnn = unet.UNET()
        if self.gpu >= 0:
            self.cnn_128.to_gpu()
            self.cnn.to_gpu()

        serializers.load_npz(
            "./cgi-bin/paint_x2_unet/models/unet_128_standard", self.cnn_128)
        serializers.load_npz(
            "./cgi-bin/paint_x2_unet/models/unet_512_standard", self.cnn)
Exemplo n.º 2
0
 def __init__(self, req, client_addr, server):
     OSHelper.detect_environment()
     http.server.CGIHTTPRequestHandler.__init__(self, req, client_addr,
                                                server)
Exemplo n.º 3
0
 def __init__(self, gpu=0):
     print("start")
     OSHelper.detect_environment()
     self.painter = cgi_exe.Painter(gpu=gpu)