From 65e430588d76adbcf435db6b2e3aec791de651d0 Mon Sep 17 00:00:00 2001
From: Alexey <AlexeyAB@users.noreply.github.com>
Date: Sat, 26 May 2018 13:36:30 +0000
Subject: [PATCH] Merge pull request #909 from jing-vision/master
---
src/data.c | 27 ++++-----------------------
1 files changed, 4 insertions(+), 23 deletions(-)
diff --git a/src/data.c b/src/data.c
index 8da1234..a429862 100644
--- a/src/data.c
+++ b/src/data.c
@@ -213,12 +213,7 @@
void fill_truth_swag(char *path, float *truth, int classes, int flip, float dx, float dy, float sx, float sy)
{
char labelpath[4096];
- find_replace(path, "images", "labels", labelpath);
- find_replace(labelpath, "JPEGImages", "labels", labelpath);
- find_replace(labelpath, ".jpg", ".txt", labelpath);
- find_replace(labelpath, ".JPG", ".txt", labelpath);
- find_replace(labelpath, ".JPEG", ".txt", labelpath);
- find_replace(labelpath, ".ppm", ".txt", labelpath);
+ replace_image_to_label(path, labelpath);
int count = 0;
box_label *boxes = read_boxes(labelpath, &count);
@@ -252,15 +247,9 @@
void fill_truth_region(char *path, float *truth, int classes, int num_boxes, int flip, float dx, float dy, float sx, float sy)
{
char labelpath[4096];
- find_replace(path, "images", "labels", labelpath);
- find_replace(labelpath, "JPEGImages", "labels", labelpath);
+ replace_image_to_label(path, labelpath);
- find_replace(labelpath, ".jpg", ".txt", labelpath);
- find_replace(labelpath, ".png", ".txt", labelpath);
- find_replace(labelpath, ".JPG", ".txt", labelpath);
- find_replace(labelpath, ".JPEG", ".txt", labelpath);
- find_replace(labelpath, ".ppm", ".txt", labelpath);
- int count = 0;
+ int count = 0;
box_label *boxes = read_boxes(labelpath, &count);
randomize_boxes(boxes, count);
correct_boxes(boxes, count, dx, dy, sx, sy, flip);
@@ -302,16 +291,8 @@
int small_object, int net_w, int net_h)
{
char labelpath[4096];
- find_replace(path, "images", "labels", labelpath);
- find_replace(labelpath, "JPEGImages", "labels", labelpath);
+ replace_image_to_label(path, labelpath);
- find_replace(labelpath, "raw", "labels", labelpath);
- find_replace(labelpath, ".jpg", ".txt", labelpath);
- find_replace(labelpath, ".png", ".txt", labelpath);
- find_replace(labelpath, ".bmp", ".txt", labelpath);
- find_replace(labelpath, ".JPG", ".txt", labelpath);
- find_replace(labelpath, ".JPEG", ".txt", labelpath);
- find_replace(labelpath, ".ppm", ".txt", labelpath);
int count = 0;
int i;
box_label *boxes = read_boxes(labelpath, &count);
--
Gitblit v1.10.0