|
@@ -105,19 +105,16 @@ def _convert_to_legacy_batch_info(new_info: Dict[str, Any]) -> Dict[str, Any]:
|
|
|
person["ptz_oss_url"] = oss_url_marked
|
|
person["ptz_oss_url"] = oss_url_marked
|
|
|
person["ptz_oss_url_original"] = oss_url_original
|
|
person["ptz_oss_url_original"] = oss_url_original
|
|
|
else:
|
|
else:
|
|
|
- # 全景相机检测时,也需要包含 ptz_position,使用当前云台位置
|
|
|
|
|
- current_ptz = new_info.get("current_ptz_position") or {}
|
|
|
|
|
|
|
+ # 全景相机检测时,复用当前检测框作为 ptz_bbox
|
|
|
person["ptz_position"] = {
|
|
person["ptz_position"] = {
|
|
|
- "pan": current_ptz.get("pan", 0),
|
|
|
|
|
- "tilt": current_ptz.get("tilt", 0),
|
|
|
|
|
- "zoom": current_ptz.get("zoom", 1),
|
|
|
|
|
|
|
+ "pan": 0, "tilt": 0, "zoom": 1,
|
|
|
}
|
|
}
|
|
|
- person["ptz_bbox"] = {}
|
|
|
|
|
- person["ptz_image_saved"] = False
|
|
|
|
|
- person["ptz_image_path"] = None
|
|
|
|
|
- person["ptz_image_original_path"] = None
|
|
|
|
|
- person["ptz_oss_url"] = None
|
|
|
|
|
- person["ptz_oss_url_original"] = None
|
|
|
|
|
|
|
+ person["ptz_bbox"] = {"x1": x1, "y1": y1, "x2": x2, "y2": y2}
|
|
|
|
|
+ person["ptz_image_saved"] = bool(marked_path and os.path.exists(marked_path))
|
|
|
|
|
+ person["ptz_image_path"] = marked_path
|
|
|
|
|
+ person["ptz_image_original_path"] = original_path
|
|
|
|
|
+ person["ptz_oss_url"] = oss_url_marked
|
|
|
|
|
+ person["ptz_oss_url_original"] = oss_url_original
|
|
|
|
|
|
|
|
persons.append(person)
|
|
persons.append(person)
|
|
|
|
|
|
|
@@ -130,7 +127,7 @@ def _convert_to_legacy_batch_info(new_info: Dict[str, Any]) -> Dict[str, Any]:
|
|
|
"timestamp": normalized_ts,
|
|
"timestamp": normalized_ts,
|
|
|
"datetime": datetime.fromtimestamp(normalized_ts).isoformat(),
|
|
"datetime": datetime.fromtimestamp(normalized_ts).isoformat(),
|
|
|
"total_persons": len(persons),
|
|
"total_persons": len(persons),
|
|
|
- "ptz_images_count": len(persons) if is_ptz else 0,
|
|
|
|
|
|
|
+ "ptz_images_count": len(persons),
|
|
|
"panorama": {
|
|
"panorama": {
|
|
|
"local_path": marked_path,
|
|
"local_path": marked_path,
|
|
|
"local_path_original": original_path,
|
|
"local_path_original": original_path,
|