diff --git a/Cargo.toml b/Cargo.toml index 18494bd..c773246 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -14,7 +14,7 @@ indicatif = "0.17.6" owo-colors = "3.5.0" serde = { version = "1.0.181", features = ["derive"] } serde_derive = "1.0.181" -serde_json = "1.0.104" +serde_json = "1.0.132" serde_yaml = "0.9.25" sorted-list = "0.2.0" ort = { version = "2.0.0-alpha.4", optional=true,features = ["tensorrt", "load-dynamic", "copy-dylibs", "download-binaries", "cuda"] } diff --git a/src/label.rs b/src/label.rs index 704fb51..6503258 100644 --- a/src/label.rs +++ b/src/label.rs @@ -87,7 +87,7 @@ impl YoloBbox { ], group_id: Some(self.confidence.to_string()), shape_type: String::from("rectangle"), - flags: HashMap::new(), + flags: Some(HashMap::new()), }), CoordinateType::Normalized => { bail!("[error]::YoloBBox: please convert coordinate type to screen first ! (using YoloBBox::to_screen)") @@ -239,7 +239,7 @@ impl OutputFormat for YoloAnnotation { points: vec![vec![self.xmin, self.ymin], vec![self.w, self.h]], group_id: Some(self.confidence.to_string()), shape_type: String::from("rectangle"), - flags: HashMap::new(), + flags: Some(HashMap::new()), }]) } fn to_labelme( @@ -362,7 +362,7 @@ pub struct Shape { pub points: Vec>, pub group_id: Option, pub shape_type: String, - pub flags: HashMap, + pub flags: Option>, } impl Shape { @@ -448,7 +448,7 @@ impl OutputFormat for Embeddings { points: xy_coords, shape_type: shape.to_owned(), group_id: Some(gid_idx.to_string()), - flags: flags.to_owned(), + flags: Some(flags.to_owned()), }; shape_vec.push(_shape); }