forked from TeamCookCaps/ImageClassification
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUpload.py
More file actions
28 lines (24 loc) · 746 Bytes
/
Upload.py
File metadata and controls
28 lines (24 loc) · 746 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# Set your Cloudinary credentials
# ==============================
from dotenv import load_dotenv
load_dotenv()
# Import the Cloudinary libraries
# ==============================
import cloudinary
import cloudinary.uploader
import cloudinary.api
# config
config = cloudinary.config(secure=False)
class Upload():
def __init__(self,img_url):
self.img_url = img_url
# 클라우드 서버에 이미지 업로든
def upload_cloudinary(self):
print("클라우드 서버로 이미지 업로드")
try:
response = cloudinary.uploader.upload(self.img_url)
print(response)
return response
except:
response = "error image upload"
return response