fix(worker): 修复 dedup fingerprint JSON 序列化失败 - np.float32 转原生 float #239
Reference in New Issue
Block a user
Delete Branch "fix/dedup-float32-json"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
问题
GeneratedVideo 查重记录创建失败,报错
float32 is not JSON serializable。根因
cv2.normalize()返回np.float32数组,color_histograms直接存进VideoFingerprint.to_dict()后,SQLAlchemy JSON 字段序列化时 Python 原生json.dumps不支持 numpy 类型。修复
VideoFingerprint.to_dict()中统一转 Python 原生类型:color_histograms:np.float32→floatduration: 统一转floatresolution:np.int32→int影响范围
generate_video任务:查重记录创建render_edit_plan任务:查重记录创建7ad8f43575to1ccec767d1