@@ -26,7 +26,6 @@ pub mod config;
2626const COLLISION_ATTEMPTS : u32 = 15 ;
2727
2828pub struct TargetGenerator {
29- output : PathBuf ,
3029 backgrounds_path : PathBuf ,
3130 pub object_manager : ObjectManager ,
3231 background_loader : BackgroundLoader ,
@@ -36,7 +35,7 @@ pub struct TargetGenerator {
3635}
3736
3837impl TargetGenerator {
39- pub fn new < Q : AsRef < Path > > ( output : Q , background_path : Q , objects_path : Q , annotations_path : Q ) -> Result < Self , GenerationError > {
38+ pub fn new < Q : AsRef < Path > > ( background_path : Q , objects_path : Q , annotations_path : Q ) -> Result < Self , GenerationError > {
4039
4140 let mut object_manager = ObjectManager :: new ( objects_path) ;
4241 object_manager. load_objects ( ) ?;
@@ -51,7 +50,6 @@ impl TargetGenerator {
5150 . build ( ) ;
5251
5352 Ok ( Self {
54- output : output. as_ref ( ) . to_path_buf ( ) ,
5553 backgrounds_path : background_path. as_ref ( ) . to_path_buf ( ) ,
5654 object_manager,
5755 background_loader : BackgroundLoader :: new ( background_path) ?,
@@ -155,7 +153,7 @@ impl TargetGenerator {
155153 b. save ( path. clone ( ) ) . unwrap ( ) ;
156154 }
157155
158- debug ! ( "Saved generated target to {}" , path. display( ) ) ;
156+ debug ! ( "Saved generated target to {}" , path. display( ) . to_string ( ) . replace ( " \\ " , "/" ) ) ;
159157 } ) ;
160158 } ) ;
161159
@@ -205,7 +203,7 @@ impl TargetGenerator {
205203pub fn test_generate_target ( ) {
206204 SimpleLogger :: new ( ) . with_level ( LevelFilter :: Debug ) . init ( ) . unwrap ( ) ;
207205
208- let mut tg = TargetGenerator :: new ( "output" , " backgrounds", "objects" , "output/annotations.json" ) . unwrap ( ) ;
206+ let mut tg = TargetGenerator :: new ( "backgrounds" , "objects" , "output/annotations.json" ) . unwrap ( ) ;
209207 tg. config . permit_duplicates = true ;
210208 tg. config . permit_collisions = false ;
211209 let b = tg. generate_target ( STANDARD_PPM , 5 ) . unwrap ( ) ;
@@ -221,7 +219,7 @@ pub fn test_generate_target() {
221219pub fn test_generate_targets ( ) {
222220 SimpleLogger :: new ( ) . with_level ( LevelFilter :: Debug ) . init ( ) . unwrap ( ) ;
223221
224- let mut tg = TargetGenerator :: new ( "../output" , "../ backgrounds", "../objects" , "../output/annotations.json" ) . unwrap ( ) ;
222+ let mut tg = TargetGenerator :: new ( "../backgrounds" , "../objects" , "../output/annotations.json" ) . unwrap ( ) ;
225223 tg. config . permit_duplicates = true ;
226224 tg. config . permit_collisions = false ;
227225 tg. config . visualize_bboxes = true ;
0 commit comments