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='.')
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='.')