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
459f9aa0
Commit
459f9aa0
authored
Jul 27, 2023
by
Hyunseok_Sang
Browse files
Options
Downloads
Patches
Plain Diff
image processing 산출물들을 리턴하는 controller를 마무리했습니다.
parent
1514cbcf
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
image_processing_app/src/controllers/image_controller.py
+6
-1
6 additions, 1 deletion
image_processing_app/src/controllers/image_controller.py
with
6 additions
and
1 deletion
image_processing_app/src/controllers/image_controller.py
+
6
−
1
View file @
459f9aa0
...
@@ -2,6 +2,7 @@ from flask import Blueprint, request, jsonify
...
@@ -2,6 +2,7 @@ from flask import Blueprint, request, jsonify
from
services.aggregated_services.image_processing_service
import
ImageProcessingService
from
services.aggregated_services.image_processing_service
import
ImageProcessingService
from
utils.image.image_converter
import
ImageConverter
from
utils.image.image_converter
import
ImageConverter
from
utils.image.image_encoder
import
ImageEncoder
image_controller
=
Blueprint
(
'
image
'
,
__name__
)
image_controller
=
Blueprint
(
'
image
'
,
__name__
)
...
@@ -12,6 +13,10 @@ def process_image():
...
@@ -12,6 +13,10 @@ def process_image():
chop_image
=
request
.
args
.
get
(
'
chop_image
'
,
'
True
'
).
lower
()
==
'
true
'
chop_image
=
request
.
args
.
get
(
'
chop_image
'
,
'
True
'
).
lower
()
==
'
true
'
outpainting_size
=
int
(
request
.
args
.
get
(
'
outpainting_size
'
,
1024
))
outpainting_size
=
int
(
request
.
args
.
get
(
'
outpainting_size
'
,
1024
))
removed_border_pixel
=
int
(
request
.
args
.
get
(
'
removed_border_pixel
'
,
2
))
removed_border_pixel
=
int
(
request
.
args
.
get
(
'
removed_border_pixel
'
,
2
))
image_bytes
=
request
.
files
[
'
image_data
'
].
read
()
image_bytes
=
request
.
files
[
'
image_data
'
].
read
()
np_image
=
ImageConverter
().
convert_to_np_image
(
image_bytes
)
np_image
=
ImageConverter
().
convert_to_np_image
(
image_bytes
)
processed_np_image
,
x_offset
,
y_offset
=
ImageProcessingService
().
process
(
np_image
,
ratio
,
recover_size
,
chop_image
,
outpainting_size
,
removed_border_pixel
)
result
=
ImageProcessingService
().
process
(
np_image
,
ratio
,
recover_size
,
chop_image
,
outpainting_size
,
removed_border_pixel
)
\ No newline at end of file
result
[
"
result_image
"
][
"
image_data
"
]
=
ImageEncoder
().
encode_np_image_base64
(
result
[
"
result_image
"
][
"
image_data
"
])
return
jsonify
(
result
)
\ 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