Comments (4)
My skills with c# are better than Python.
I did by this way, after process on labelme2yolo:
//generated by labelme2yolo
var lstClassesWrong = new List<string>() { "person", "bicycle", "car", "motorbike", "aeroplane" };
var lstClassesCorrect = new List<string>() { "aeroplane", "bicycle", "motorbike", "car", "person" };
string rootDir = ".\labels";
string[] filess = Directory.GetFiles(rootDir, "*.txt", SearchOption.AllDirectories);
foreach (string _file in filess)
{
List<string> lines = new List<string>();
using (StreamReader sr = new StreamReader(_file))
{
string line;
while ((line = sr.ReadLine()) != null)
{
string[] parts = line.Split(' ');
if (parts.Length > 0)
{
int idxClassWrong = int.Parse(parts[0]);
string classWrong = lstClassesWrong[idxClassWrong];
int idxClassCorrect = lstClassesCorrect.IndexOf(classWrong);
if (idxClassWrong != idxClassCorrect)
parts[0] = idxClassCorrect.ToString();
}
lines.Add(string.Join(" ", parts));
}
}
using (StreamWriter sw = new StreamWriter(_file))
{
foreach (string line in lines)
{
sw.WriteLine(line);
}
}
Console.WriteLine($"File {_file} changed!");
}
Console.WriteLine("Finished!");
from labelme2yolo.
Hi, @terasadi. Are you mean manually assigning the order of the labels before you start?
labelme2yolo --json_dir <YOUR DATASET DIR> --val_size 0.15 --classes person bicycle car motorbike aeroplane
from labelme2yolo.
This is a good idea, and we will implement it soon.
from labelme2yolo.
hi, @terasadi. Thank you for your feedback. This implementation of remapping label seems pretty good.
from labelme2yolo.
Related Issues (13)
- Polygon Conversion issue for YOLOv8 Semantic Segmentation HOT 3
- Train, Validation and Test split overlap HOT 4
- I tested in the example folder of labelme, and the resulting folders were all empty. HOT 1
- Error on convert only one file HOT 1
- Doubt about the result format HOT 2
- Cannot convert to yolov8n segmentation format HOT 2
- Issue converting labelme JSON to YOLODataset HOT 2
- labelme2yolo some error HOT 1
- Double fields HOT 2
- the pip package output a different file name HOT 4
- file name changed HOT 3
- Multiprocessing error on high core count maschines HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from labelme2yolo.