Skip to content

Commit

Permalink
fix : 배포 테스트를 위해 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
sycuuui committed Apr 17, 2024
1 parent dfd599a commit 6c5bc7d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 15 deletions.
31 changes: 16 additions & 15 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,21 +31,22 @@ def handle_video():
if file.filename == '':
return "No selected file", 400
print('file', file.filename)

# 파일 저장 경로 지정, 여기서는 임시로 파일 이름으로 저장
#filename = os.path.join('tmp', file.filename)
filename = file.filename
file.save(filename)
print('success file')

# 여기서 파일을 처리하는 로직을 추가할 수 있습니다.
# 예를 들어, 처리된 파일을 다시 클라이언트에게 보낼 수 있습니다.
# 이 예시에서는 단순히 저장된 파일을 그대로 반환합니다.
image_paths = ["./pytorch/train/Gongyoo/img.png", "./pytorch/train/Gongyoo/img_1.png", "./pytorch/train/Gongyoo/goognyoo.png", "./pytorch/train/Gongyoo/gongyoo2.jpg", "./pytorch/train/Gongyoo/img_2.png"]
print('start mosaic')
output_video_path = mosaic_jiyeon.mosaic(filename, image_paths)
print(output_video_path)
return send_file(output_video_path, mimetype='video/mp4', as_attachment=True)
#
# # 파일 저장 경로 지정, 여기서는 임시로 파일 이름으로 저장
# #filename = os.path.join('tmp', file.filename)
# filename = file.filename
# file.save(filename)
# print('success file')
#
# # 여기서 파일을 처리하는 로직을 추가할 수 있습니다.
# # 예를 들어, 처리된 파일을 다시 클라이언트에게 보낼 수 있습니다.
# # 이 예시에서는 단순히 저장된 파일을 그대로 반환합니다.
# image_paths = ["./pytorch/train/Gongyoo/img.png", "./pytorch/train/Gongyoo/img_1.png", "./pytorch/train/Gongyoo/goognyoo.png", "./pytorch/train/Gongyoo/gongyoo2.jpg", "./pytorch/train/Gongyoo/img_2.png"]
# print('start mosaic')
# output_video_path = mosaic_jiyeon.mosaic(filename, image_paths)
# print(output_video_path)
# return send_file(output_video_path, mimetype='video/mp4', as_attachment=True)
return "hi"

@app.route('/image', methods=['POST'])
def image_test():
Expand Down
Binary file modified requirements.txt
Binary file not shown.

0 comments on commit 6c5bc7d

Please sign in to comment.