python-detector-worker/feeder/sender/base.py
Pongsatorn Kanjanasantisak b7d8b3266f add StrongSORT Tacker
2025-08-10 01:23:09 +07:00

21 lines
No EOL
533 B
Python

import numpy as np
import json
class NumpyArrayEncoder(json.JSONEncoder):
def default(self, obj):
if isinstance(obj, np.integer):
return int(obj)
elif isinstance(obj, np.floating):
return float(obj)
elif isinstance(obj, np.ndarray):
return obj.tolist()
else:
return super(NumpyArrayEncoder, self).default(obj)
class BasSender:
def __init__(self) -> None:
pass
def send(self, messages):
raise NotImplementedError()