So please change the corresponding part of output_fn function in inference.py
Below is the my modification:
for result in prediction_output:
if 'boxes' in result._keys and result.boxes is not None:
infer['boxes'] = result.boxes.numpy().data.tolist()
if 'masks' in result._keys and result.masks is not None:
infer['masks'] = result.masks.numpy().data.tolist()
if 'keypoints' in result._keys and result.keypoints is not None:
infer['keypoints'] = result.keypoints.numpy().data.tolist()
if 'probs' in result._keys and result.probs is not None:
infer['probs'] = result.probs.numpy().data.tolist()
The root cause is that the attribute "keys" of ultralytics.engine.results.Results was changed to "_keys". please refer to https://docs.ultralytics.com/reference/engine/results/#ultralytics.engine.results.Results
So please change the corresponding part of output_fn function in inference.py Below is the my modification:
for result in prediction_output: if 'boxes' in result._keys and result.boxes is not None: infer['boxes'] = result.boxes.numpy().data.tolist() if 'masks' in result._keys and result.masks is not None: infer['masks'] = result.masks.numpy().data.tolist() if 'keypoints' in result._keys and result.keypoints is not None: infer['keypoints'] = result.keypoints.numpy().data.tolist() if 'probs' in result._keys and result.probs is not None: infer['probs'] = result.probs.numpy().data.tolist()