Caricature generation by deep learning. Use WarpGAN on iOS. [with converted model]*jBWuIeXeHbpDTfXm

Original Source Here

Caricature generation by deep learning. Use WarpGAN on iOS. [with converted model]

WarpGAN that can generate caricatures .

If you convert to Core ML, you can generate a caricature just by inputting an image from Image Picker Controller etc.
It became CoreMLTools4.0 and can be converted (it could not be converted with tfcoreml).
Converted Core ML model

1. Make the graph in pbtxt format.

#, '', 'warpgan.pbtxt')

* allow_pickle had to be set

# detect_face.pydata_dict = np.load(data_path, encoding='latin1',allow_pickle=True).item()

2. Make a freezing graph from checkpoints.

from import freeze_graphgraph_def_file = ‘warpgan.pbtxt’
checkpoint_file = ‘warpgan_pretrained/ckpt-100000’
frozen_model_file = ‘./frozen_model.pb’
output_node_names = ‘Decoder/Decoder/images_rendered’
input_saver=””, input_binary=False,
output_graph=frozen_model_file, clear_devices=True,

3. Convert with coremltools.

import coremltools as ct 
image_input = ct.ImageType(shape=(1, 256, 256, 3,), scale=2/255,bias=[-1,-1,-1])
coreml_model = ct.convert(“frozen_model.pb”,
inputs=[image_input], )“warpgan.mlmodel”)

You can convert it beautifully by cropping it around your face with Vision and then applying it to the model.



Request for work:

We send information related to machine learning.



Trending AI/ML Article Identified & Digested via Granola by Ramsey Elbasheer; a Machine-Driven RSS Bot

%d bloggers like this: