update edge

This commit is contained in:
2023-11-23 15:09:39 +08:00
parent a56f93d2b5
commit 3c95ccdd85
3 changed files with 73 additions and 11 deletions

View File

@ -1,15 +1,8 @@
import h5py, os
import h5py, os, sys, logging, obs
from floder.config import cfg
from obs import ObsClient
import obs
obsClient = ObsClient(
access_key_id='LHXJC7GIC2NNUUHHTNVI',
secret_access_key='sVWvEItrFKWPp5DxeMvX8jLFU69iXPpzkjuMX3iM',
server='https://obs.cn-east-3.myhuaweicloud.com')
bucketName = 'ieemoo-ai'
headers = obs.SetObjectMetadataHeader()
headers.cacheControl = "no-cache"
from up_load_file import up_load
up_load_data = up_load()
def writef(uuid, num_id, feature):
fname = os.sep.join([cfg.hFile, uuid+'.h5'])
if not os.path.exists(fname):
@ -36,4 +29,10 @@ def uploadf(video_name, num, file_path):
time = video_name.split('-')[0]
objectkey = video_name.split('.')[0]+'_'+str(num)+'.mp4'
objectkey = 'conpurchase/'+time+'/'+objectkey
resp = obsClient.putFile(bucketName, objectkey, file_path, headers=headers)
up_load_data.upLoad(objectkey, file_path)
#if obs:
# obsClient, headers = obsInit()
# resp = obsClient.putFile(cfg.obs_bucketName, objectkey, file_path, headers=headers)
#if cos:
# upLoadCos(cfg.cos_Bucket, objectkey, file_path)