Skip to content

Commit bdae0c2

Browse files
committed
Fix some simple issues
1 parent c032f69 commit bdae0c2

File tree

4 files changed

+5
-7
lines changed

4 files changed

+5
-7
lines changed
File renamed without changes.
File renamed without changes.

targetgen-lib/src/backgrounds/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ impl BackgroundLoader {
5353
warn!("Failed to load image: {}", path_name);
5454
}
5555

56-
debug!("Loaded image in {}ms: {}", start.elapsed().as_millis(), path_name);
56+
debug!("Loaded image in {}ms: {}", start.elapsed().as_millis(), path_name.to_string().replace("\\", "/"));
5757
});
5858

5959
let x = Ok(Self { // don't ask why we need to make a variable here, it just works

targetgen-lib/src/generator/mod.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ pub mod config;
2626
const COLLISION_ATTEMPTS: u32 = 15;
2727

2828
pub 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

3837
impl 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 {
205203
pub 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() {
221219
pub 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

Comments
 (0)