List PT Datum
def listData(modelFile = checkFile):
model = torch.load(modelFile, weights_only=False, map_location='cpu')
for key in model:
node = model[key]
print(key)
if isinstance(node, dict):
for subkey in node:
print(key, subkey)
subkey = 'names'
if hasattr(node, subkey):
print(key, subkey, node.names)
Update PT Datum
alpha = ['class-01', 'class-02', 'class-03', 'class-04', 'class-05', 'class-06', 'class-07', 'class-08', 'class-09']
def updateData(data, modelFile = checkFile):
model = torch.load(modelFile, weights_only=False, map_location='cpu')
model['model'].names = data
torch.save(model, 'data/new_fireworks.pt')
statistic
96x128 => 32*3 32*4 => Speed: 0.3ms pre-process, 50.0ms inference, 0.4ms NMS per image at shape (1, 3, 128, 128)
96x160 => 32*3 32*5 => Speed: 0.3ms pre-process, 60.0ms inference, 0.4ms NMS per image at shape (1, 3, 160, 160)
128x192 => 32*4 32*6 => Speed: 0.2ms pre-process, 74.0ms inference, 0.5ms NMS per image at shape (1, 3, 192, 192)