Move numpy_inputs initialization to correct position

Repositioned the `numpy_inputs` initialization to align with the input shape processing logic. This ensures consistency in buffer management and clarifies the flow of code execution related to input handling.
This commit is contained in:
DevTekVE
2025-01-19 21:54:47 +01:00
parent 1ad6d00728
commit fa3e861f2b
+2 -2
View File
@@ -65,8 +65,6 @@ class ModelState:
self.full_features_20Hz = np.zeros((ModelConstants.FULL_HISTORY_BUFFER_LEN, ModelConstants.FEATURE_LEN), dtype=np.float32)
self.desire_20Hz = np.zeros((ModelConstants.FULL_HISTORY_BUFFER_LEN + 1, ModelConstants.DESIRE_LEN), dtype=np.float32)
# img buffers are managed in openCL transform code
self.numpy_inputs = {}
with open(METADATA_PATH, 'rb') as f:
model_metadata = pickle.load(f)
@@ -74,6 +72,8 @@ class ModelState:
self.output_slices = model_metadata['output_slices']
# img buffers are managed in openCL transform code
self.numpy_inputs = {}
for key, shape in self.input_shapes.items():
if key not in self.frames: # Managed by opencl
self.numpy_inputs[key] = np.zeros(shape, dtype=np.float32)