diff --git a/src/classifier/lab_boosted_classifier.rs b/src/classifier/lab_boosted_classifier.rs index 4ad8749..469dcd0 100644 --- a/src/classifier/lab_boosted_classifier.rs +++ b/src/classifier/lab_boosted_classifier.rs @@ -19,11 +19,13 @@ use super::Score; use crate::feat::LabBoostedFeatureMap; +#[derive(Clone)] pub struct LabBoostedClassifier { features: Vec<(i32, i32)>, base_classifiers: Vec, } +#[derive(Clone)] struct BaseClassifier { weights: Vec, thresh: f32, diff --git a/src/classifier/mod.rs b/src/classifier/mod.rs index 6a1eb1b..9d7a878 100644 --- a/src/classifier/mod.rs +++ b/src/classifier/mod.rs @@ -54,6 +54,7 @@ impl Score { } } +#[derive(Clone)] pub enum Classifier { SurfMlp(SurfMlpClassifier), LabBoosted(LabBoostedClassifier), diff --git a/src/classifier/surf_mlp_classifier.rs b/src/classifier/surf_mlp_classifier.rs index 331090b..9930dd0 100644 --- a/src/classifier/surf_mlp_classifier.rs +++ b/src/classifier/surf_mlp_classifier.rs @@ -68,6 +68,7 @@ impl SurfMlpBuffers { } } +#[derive(Clone)] pub struct SurfMlpClassifier { feature_ids: Vec, thresh: f32, @@ -156,6 +157,7 @@ impl SurfMlpClassifier { } } +#[derive(Clone)] struct Layer { input_dim: usize, output_dim: usize, diff --git a/src/model/mod.rs b/src/model/mod.rs index 10a124b..4ef7d25 100644 --- a/src/model/mod.rs +++ b/src/model/mod.rs @@ -24,6 +24,7 @@ use std::io; use crate::classifier::{Classifier, ClassifierKind, LabBoostedClassifier, SurfMlpClassifier}; use byteorder::{LittleEndian, ReadBytesExt}; +#[derive(Clone)] pub struct Model { classifiers: Vec, wnd_src_id: Vec>,