ONE - On-device Neural Engine
Loading...
Searching...
No Matches
jpeg2hdf5 Namespace Reference

Variables

str helpstr
 
list supported_frameworks = ['tfl', 'caf']
 
dict args = {}
 
 argc = len(sys.argv)
 
 arg = sys.argv[i]
 
dict fw = args['-f']
 
dict indirname = args['-t']
 
str inputname = 'data'
 
 nproc
 
 proc_num
 
dict remove_existing = args['-r']
 
dict gen_binary = args['-b']
 
 testcases = glob.glob(indirname + '/testcase*/')
 
int number = 0
 
 infilename = glob.glob(testcase + 'input/*.JPEG')
 
str outfilename = testcase + 'input/' + infilename.split('/')[-1] + '.hdf5'
 
str binoutfilename = testcase + 'input/' + infilename.split('/')[-1] + '.dat'
 
int found_hdf = 0
 
int found_bin = 0
 
 h = im.size[0]
 
 w = im.size[1]
 
 s = im.split()
 
 r = s[0]
 
 g = s[0]
 
 b = s[0]
 
 rf = r.convert('F')
 
 gf = g.convert('F')
 
 bf = b.convert('F')
 
 rfb = rf.tobytes()
 
 gfb = gf.tobytes()
 
 bfb = bf.tobytes()
 
bool made_hdf = False
 
 reds = np.fromstring(rfb, count=(h * w), dtype='float32')
 
 greens = np.fromstring(gfb, count=(h * w), dtype='float32')
 
 blues = np.fromstring(bfb, count=(h * w), dtype='float32')
 
tuple dset_shape = (1, h, w, 3)
 
 narr = np.ndarray(shape=(0))
 
list mixed_ch = []
 
 dset = f.require_dataset(inputname, dset_shape, dtype='>f4')
 
 l = narr.tolist()
 

Variable Documentation

◆ arg

jpeg2hdf5.arg = sys.argv[i]

Definition at line 39 of file jpeg2hdf5.py.

◆ argc

jpeg2hdf5.argc = len(sys.argv)

Definition at line 37 of file jpeg2hdf5.py.

◆ args

dict jpeg2hdf5.args = {}

Definition at line 31 of file jpeg2hdf5.py.

◆ b

jpeg2hdf5.b = s[0]

Definition at line 105 of file jpeg2hdf5.py.

◆ bf

jpeg2hdf5.bf = b.convert('F')

Definition at line 112 of file jpeg2hdf5.py.

◆ bfb

jpeg2hdf5.bfb = bf.tobytes()

Definition at line 115 of file jpeg2hdf5.py.

◆ binoutfilename

str jpeg2hdf5.binoutfilename = testcase + 'input/' + infilename.split('/')[-1] + '.dat'

Definition at line 95 of file jpeg2hdf5.py.

◆ blues

jpeg2hdf5.blues = np.fromstring(bfb, count=(h * w), dtype='float32')

Definition at line 122 of file jpeg2hdf5.py.

◆ dset

jpeg2hdf5.dset = f.require_dataset(inputname, dset_shape, dtype='>f4')

Definition at line 143 of file jpeg2hdf5.py.

◆ dset_shape

tuple jpeg2hdf5.dset_shape = (1, h, w, 3)

Definition at line 124 of file jpeg2hdf5.py.

◆ found_bin

int jpeg2hdf5.found_bin = 0

Definition at line 97 of file jpeg2hdf5.py.

◆ found_hdf

int jpeg2hdf5.found_hdf = 0

Definition at line 96 of file jpeg2hdf5.py.

◆ fw

dict jpeg2hdf5.fw = args['-f']

Definition at line 63 of file jpeg2hdf5.py.

◆ g

jpeg2hdf5.g = s[0]

Definition at line 105 of file jpeg2hdf5.py.

◆ gen_binary

dict jpeg2hdf5.gen_binary = args['-b']

Definition at line 80 of file jpeg2hdf5.py.

◆ gf

jpeg2hdf5.gf = g.convert('F')

Definition at line 111 of file jpeg2hdf5.py.

◆ gfb

jpeg2hdf5.gfb = gf.tobytes()

Definition at line 114 of file jpeg2hdf5.py.

◆ greens

jpeg2hdf5.greens = np.fromstring(gfb, count=(h * w), dtype='float32')

Definition at line 121 of file jpeg2hdf5.py.

◆ h

jpeg2hdf5.h = im.size[0]

Definition at line 101 of file jpeg2hdf5.py.

◆ helpstr

str jpeg2hdf5.helpstr
Initial value:
1= 'Usage: -f (tfl | caf) ' + \
2 '-t <testcases_directory> ' + \
3 '[-i <input_layer_name>] ' + \
4 '[-r] [-b]' + \
5 '[-p <number_of_processes> <process number>]'

Definition at line 24 of file jpeg2hdf5.py.

◆ indirname

dict jpeg2hdf5.indirname = args['-t']

Definition at line 68 of file jpeg2hdf5.py.

◆ infilename

jpeg2hdf5.infilename = glob.glob(testcase + 'input/*.JPEG')

Definition at line 90 of file jpeg2hdf5.py.

◆ inputname

dict jpeg2hdf5.inputname = 'data'

Definition at line 72 of file jpeg2hdf5.py.

◆ l

jpeg2hdf5.l = narr.tolist()

Definition at line 149 of file jpeg2hdf5.py.

◆ made_hdf

bool jpeg2hdf5.made_hdf = False

Definition at line 117 of file jpeg2hdf5.py.

◆ mixed_ch

list jpeg2hdf5.mixed_ch = []

Definition at line 126 of file jpeg2hdf5.py.

◆ narr

jpeg2hdf5.narr = np.ndarray(shape=(0))

Definition at line 125 of file jpeg2hdf5.py.

◆ nproc

jpeg2hdf5.nproc

Definition at line 78 of file jpeg2hdf5.py.

◆ number

int jpeg2hdf5.number = 0

Definition at line 87 of file jpeg2hdf5.py.

◆ outfilename

str jpeg2hdf5.outfilename = testcase + 'input/' + infilename.split('/')[-1] + '.hdf5'

Definition at line 94 of file jpeg2hdf5.py.

◆ proc_num

jpeg2hdf5.proc_num

Definition at line 78 of file jpeg2hdf5.py.

◆ r

jpeg2hdf5.r = s[0]

Definition at line 105 of file jpeg2hdf5.py.

◆ reds

jpeg2hdf5.reds = np.fromstring(rfb, count=(h * w), dtype='float32')

Definition at line 120 of file jpeg2hdf5.py.

◆ remove_existing

dict jpeg2hdf5.remove_existing = args['-r']

Definition at line 79 of file jpeg2hdf5.py.

◆ rf

jpeg2hdf5.rf = r.convert('F')

Definition at line 110 of file jpeg2hdf5.py.

◆ rfb

jpeg2hdf5.rfb = rf.tobytes()

Definition at line 113 of file jpeg2hdf5.py.

◆ s

jpeg2hdf5.s = im.split()

Definition at line 103 of file jpeg2hdf5.py.

◆ supported_frameworks

list jpeg2hdf5.supported_frameworks = ['tfl', 'caf']

Definition at line 30 of file jpeg2hdf5.py.

◆ testcases

jpeg2hdf5.testcases = glob.glob(indirname + '/testcase*/')

Definition at line 83 of file jpeg2hdf5.py.

◆ w

jpeg2hdf5.w = im.size[1]

Definition at line 102 of file jpeg2hdf5.py.