Ejemplo n.º 1
0
def remote_result_produce():
    composition = request.files.get('composition')
    sketch_1024 = request.files.get('sketch_1024')
    points = request.json['points']
    result = result_produce(sketch_1024=sketch_1024, points=points, composition=composition)
    cv2.imwrite('result.jpg', result)
    return static_file('result.jpg', root='.')
Ejemplo n.º 2
0
def remote_composition_determine():
    baby = request.files.get('baby')
    sketch_256 = request.files.get('sketch_256')
    sketch_1024 = request.files.get('sketch_1024')
    points = request.json['points']
    composition = composition_determine(sketch_256=sketch_256, baby=baby)
    result = result_produce(sketch_1024=sketch_1024, points=points, composition=composition)
    cv2.imwrite('result.jpg', result)
    return static_file('result.jpg', root='.')
Ejemplo n.º 3
0
def remote_sketch_norm():
    sketch = request.files.get('sketch')
    sketch.save('sketch_norm.jpg')
    sketch = cv2.imread('sketch_norm.jpg')
    points = points_ping
    sketch_1024, sketch_256, sketch_128 = sketch_norm(sketch=sketch)
    baby = baby_determine(sketch_128=sketch_128, points=points)
    composition = composition_determine(sketch_256=sketch_256, baby=baby)
    result = result_produce(sketch_1024=sketch_1024, points=points, composition=composition)
    cv2.imwrite('result.jpg', result)
    return static_file('result.jpg', root='.')
Ejemplo n.º 4
0
def remote_string_to_sketch():
    data = request.json
    image = data['image']
    points = data['points']
    sketch = string_to_sketch(image=image, points=points)
    sketch = sketch_blurry(sketch=sketch)
    std = judge_improve(sketch=sketch)
    if std:
        sketch = continue_improve(sketch=sketch)
    sketch = go_gray(sketch=sketch)
    sketch_1024, sketch_256, sketch_128 = sketch_norm(sketch=sketch)
    baby = baby_determine(sketch_128=sketch_128, points=points)
    composition = composition_determine(sketch_256=sketch_256, baby=baby)
    result = result_produce(sketch_1024=sketch_1024, points=points, composition=composition)
    cv2.imwrite('result.jpg', result)
    return static_file('result.jpg', root='.')
Ejemplo n.º 5
0
def remote_baby_determine():
    sketch_128 = request.files.get('sketch_128')
    sketch_256 = request.files.get('sketch_256')
    sketch_1024 = request.files.get('sketch_1024')
    sketch_128.save('sketch_128.jpg')
    sketch_256.save('sketch_256.jpg')
    sketch_1024.save('sketch_1024.jpg')
    sketch_128 = cv2.imread('sketch_128.jpg')
    sketch_256 = cv2.imread('sketch_256.jpg')
    sketch_1024 = cv2.imread('sketch_1024.jpg')
    points = points_ping
    baby = baby_determine(sketch_128=sketch_128, points=points)
    composition = composition_determine(sketch_256=sketch_256, baby=baby)
    result = result_produce(sketch_1024=sketch_1024, points=points, composition=composition)
    cv2.imwrite('result.jpg', result)
    return static_file('result.jpg', root='.')