(self, inputData)
| 29 | print(f'Save TFLite model to {self.model_path} successfully!') |
| 30 | |
| 31 | def run(self, inputData): |
| 32 | # Preprocess the image before sending to the network. |
| 33 | inputData = np.expand_dims(inputData, axis=0) |
| 34 | |
| 35 | # The actual detection. |
| 36 | self.interpreter.set_tensor(self.input_details[0]["index"], inputData) |
| 37 | self.interpreter.invoke() |
| 38 | |
| 39 | # Save the results. |
| 40 | output = self.interpreter.get_tensor(self.output_details[0]["index"])[0] |
| 41 | return output |
| 42 | |
| 43 | def get_weight(self, data, label_len=37): |
| 44 | # weight = self.run(data) |
no outgoing calls
no test coverage detected