first commit

This commit is contained in:
2023-06-25 13:55:22 +08:00
parent 01b2252266
commit 00d6bc25c5
35 changed files with 3229 additions and 0 deletions

24
utils/opfile.py Normal file
View File

@ -0,0 +1,24 @@
import h5py, os
from floder.config import cfg
def writef(uuid, num_id, feature):
fname = os.sep.join([cfg.hFile, uuid+'.h5'])
if not os.path.exists(fname):
f = h5py.File(fname, 'w')
f[str(num_id)] = feature
else:
f = h5py.File(fname, 'a')
f[str(num_id)] = feature
print('>>>>>>>have been write')
f.close()
def readf(uuid, num_id):
fname = os.sep.join([cfg.hFile, uuid+'.h5'])
f = h5py.File(fname, 'r')
value = f[str(num_id)][:]
f.close()
return value
def removef(uuid):
fname = os.sep.join([cfg.hFile, uuid+'.h5'])
os.remove(fname)