Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
A
automated_image_processing
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Admin message
During summer vacation, Gitlab will be restart frequently. Use it carefully.
Show more breadcrumbs
Hyunseok_Sang
automated_image_processing
Commits
046f3b67
Commit
046f3b67
authored
Jul 25, 2023
by
Hyunseok_Sang
Browse files
Options
Downloads
Patches
Plain Diff
이미지 관련 컨트롤러 추가
parent
c2f51902
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
back-end2/src/controllers/image_controller.py
+17
-0
17 additions, 0 deletions
back-end2/src/controllers/image_controller.py
with
17 additions
and
0 deletions
back-end2/src/controllers/image_controller.py
0 → 100644
+
17
−
0
View file @
046f3b67
from
flask
import
Blueprint
,
request
,
jsonify
from
services.aggregated_services.image_processing_service
import
ImageProcessingService
from
utils.image.image_converter
import
ImageConverter
image_controller
=
Blueprint
(
'
image
'
,
__name__
)
@image_controller.route
(
'
/ProcessImage
'
,
methods
=
[
'
POST
'
])
def
process_image
():
ratio
=
int
(
request
.
args
.
get
(
'
ratio
'
,
50
))
# ratio 파라미터가 없으면 기본값 50 사용
recover_size
=
request
.
args
.
get
(
'
recover_size
'
,
'
True
'
).
lower
()
==
'
true
'
chop_image
=
request
.
args
.
get
(
'
chop_image
'
,
'
True
'
).
lower
()
==
'
true
'
outpainting_size
=
int
(
request
.
args
.
get
(
'
outpainting_size
'
,
1024
))
removed_border_pixel
=
int
(
request
.
args
.
get
(
'
removed_border_pixel
'
,
2
))
image_bytes
=
request
.
files
[
'
image_data
'
].
read
()
np_image
=
ImageConverter
().
convert_to_np_image
(
image_bytes
)
processed_np_image
=
ImageProcessingService
().
process
(
np_image
,
ratio
,
recover_size
,
chop_image
,
outpainting_size
,
removed_border_pixel
)
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment