Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
python_open_ai
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
haojie
python_open_ai
Commits
e2581e79
Commit
e2581e79
authored
Apr 11, 2023
by
lei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
1627ef9c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
2 deletions
+2
-2
custom_oss_upload.py
+1
-1
image_split.py
+1
-1
No files found.
custom_oss_upload.py
View file @
e2581e79
...
@@ -11,7 +11,7 @@ class AliyunOss(object):
...
@@ -11,7 +11,7 @@ class AliyunOss(object):
self
.
endpoint
=
"oss-cn-shenzhen.aliyuncs.com"
# 阿里云从Bucket中查询到的endpoint
self
.
endpoint
=
"oss-cn-shenzhen.aliyuncs.com"
# 阿里云从Bucket中查询到的endpoint
self
.
bucket
=
oss2
.
Bucket
(
self
.
auth
,
self
.
endpoint
,
self
.
bucket_name
)
self
.
bucket
=
oss2
.
Bucket
(
self
.
auth
,
self
.
endpoint
,
self
.
bucket_name
)
def
put_object_from_file
(
self
,
name
,
file
):
async
def
put_object_from_file
(
self
,
name
,
file
):
"""
"""
:param name: 在阿里云Bucket中要保存的文件名
:param name: 在阿里云Bucket中要保存的文件名
...
...
image_split.py
View file @
e2581e79
...
@@ -192,7 +192,7 @@ class ImageSplit:
...
@@ -192,7 +192,7 @@ class ImageSplit:
logger
.
info
(
'图像增强结束'
)
logger
.
info
(
'图像增强结束'
)
# 上传阿里云
# 上传阿里云
name
=
f
"files/download/admin/{new_uuid}"
name
=
f
"files/download/admin/{new_uuid}"
result_img
=
AliyunOss
()
.
put_object_from_file
(
name
,
file_path
)
result_img
=
await
AliyunOss
()
.
put_object_from_file
(
name
,
file_path
)
if
result_img
:
if
result_img
:
# 回调
# 回调
await
self
.
task_callback
(
result_img
)
await
self
.
task_callback
(
result_img
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment