Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

모자이크 모듈화 #11

Merged
merged 3 commits into from
Mar 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
yolov5
wider face.v3i.yolov5pytorch
wider face.v3i.yolov5pytorch
Dataset
dist
build
myenv
5 changes: 4 additions & 1 deletion app.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import io
import os
import mosaic_jiyeon

from flask import (Flask, request, send_file)

Expand Down Expand Up @@ -28,14 +29,16 @@ def video(): # put application's code here
if file.filename == '':
return "No selected file", 400

image_paths = ["img.png", "img_1.png", "goognyoo.jpg"]
# 파일 저장 경로 지정, 여기서는 임시로 파일 이름으로 저장
filename = os.path.join('/tmp', file.filename)
file.save(filename)
filename = mosaic_jiyeon.mosaic(filename, image_paths)

# 여기서 파일을 처리하는 로직을 추가할 수 있습니다.
# 예를 들어, 처리된 파일을 다시 클라이언트에게 보낼 수 있습니다.
# 이 예시에서는 단순히 저장된 파일을 그대로 반환합니다.
return send_file(filename, mimetype='image/jpeg',as_attachment=True)
return send_file(filename, mimetype='video/mp4',as_attachment=True)


if __name__ == '__main__':
Expand Down
Loading