-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
61 changed files
with
2,836 additions
and
0 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+5.71 KB
.vs/YoloLabel/FileContentIndex/3acfb296-cc1e-45dd-987e-804df6a24e3e.vsidx
Binary file not shown.
Binary file added
BIN
+24.8 KB
.vs/YoloLabel/FileContentIndex/625d2dd1-ed34-45c1-933e-a9b987c8b043.vsidx
Binary file not shown.
Binary file added
BIN
+14.5 KB
.vs/YoloLabel/FileContentIndex/8faf2839-cb09-4810-9ac9-3c28bf289269.vsidx
Binary file not shown.
Binary file added
BIN
+36.6 KB
.vs/YoloLabel/FileContentIndex/b806682a-b841-47a3-8619-aa2137a8b125.vsidx
Binary file not shown.
Binary file added
BIN
+107 Bytes
.vs/YoloLabel/FileContentIndex/cd8f2bcf-c069-4071-ac1f-015933885c51.vsidx
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
{ | ||
"Version": 1, | ||
"WorkspaceRootPath": "E:\\CrossLane\\YoloLabel\\", | ||
"Documents": [ | ||
{ | ||
"AbsoluteMoniker": "D:0:0:{2ECBD749-81F5-4610-8FD0-03F4CC5F8168}|YoloLabel.csproj|e:\\crosslane\\yololabel\\form1.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", | ||
"RelativeMoniker": "D:0:0:{2ECBD749-81F5-4610-8FD0-03F4CC5F8168}|YoloLabel.csproj|solutionrelative:form1.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" | ||
}, | ||
{ | ||
"AbsoluteMoniker": "D:0:0:{2ECBD749-81F5-4610-8FD0-03F4CC5F8168}|YoloLabel.csproj|e:\\crosslane\\yololabel\\form1.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}|Form", | ||
"RelativeMoniker": "D:0:0:{2ECBD749-81F5-4610-8FD0-03F4CC5F8168}|YoloLabel.csproj|solutionrelative:form1.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}|Form" | ||
}, | ||
{ | ||
"AbsoluteMoniker": "D:0:0:{2ECBD749-81F5-4610-8FD0-03F4CC5F8168}|YoloLabel.csproj|e:\\crosslane\\yololabel\\classform.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", | ||
"RelativeMoniker": "D:0:0:{2ECBD749-81F5-4610-8FD0-03F4CC5F8168}|YoloLabel.csproj|solutionrelative:classform.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" | ||
}, | ||
{ | ||
"AbsoluteMoniker": "D:0:0:{2ECBD749-81F5-4610-8FD0-03F4CC5F8168}|YoloLabel.csproj|e:\\crosslane\\yololabel\\classform.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}|Form", | ||
"RelativeMoniker": "D:0:0:{2ECBD749-81F5-4610-8FD0-03F4CC5F8168}|YoloLabel.csproj|solutionrelative:classform.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}|Form" | ||
} | ||
], | ||
"DocumentGroupContainers": [ | ||
{ | ||
"Orientation": 0, | ||
"VerticalTabListWidth": 256, | ||
"DocumentGroups": [ | ||
{ | ||
"DockedWidth": 200, | ||
"SelectedChildIndex": 4, | ||
"Children": [ | ||
{ | ||
"$type": "Bookmark", | ||
"Name": "ST:0:0:{34e76e81-ee4a-11d0-ae2e-00a0c90fffc3}" | ||
}, | ||
{ | ||
"$type": "Bookmark", | ||
"Name": "ST:0:0:{1c4feeaa-4718-4aa9-859d-94ce25d182ba}" | ||
}, | ||
{ | ||
"$type": "Document", | ||
"DocumentIndex": 2, | ||
"Title": "ClassForm.cs", | ||
"DocumentMoniker": "E:\\CrossLane\\YoloLabel\\ClassForm.cs", | ||
"RelativeDocumentMoniker": "ClassForm.cs", | ||
"ToolTip": "E:\\CrossLane\\YoloLabel\\ClassForm.cs", | ||
"RelativeToolTip": "ClassForm.cs", | ||
"ViewState": "AQIAAAAAAAAAAAAAAAAuwBEAAAAiAAAA", | ||
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", | ||
"WhenOpened": "2024-04-14T07:45:18.234Z" | ||
}, | ||
{ | ||
"$type": "Document", | ||
"DocumentIndex": 3, | ||
"Title": "ClassForm.cs [\u8BBE\u8BA1]", | ||
"DocumentMoniker": "E:\\CrossLane\\YoloLabel\\ClassForm.cs", | ||
"RelativeDocumentMoniker": "ClassForm.cs", | ||
"ToolTip": "E:\\CrossLane\\YoloLabel\\ClassForm.cs [\u8BBE\u8BA1]", | ||
"RelativeToolTip": "ClassForm.cs [\u8BBE\u8BA1]", | ||
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", | ||
"WhenOpened": "2024-04-14T07:40:25.967Z", | ||
"EditorCaption": " [\u8BBE\u8BA1]" | ||
}, | ||
{ | ||
"$type": "Document", | ||
"DocumentIndex": 0, | ||
"Title": "Form1.cs", | ||
"DocumentMoniker": "E:\\CrossLane\\YoloLabel\\Form1.cs", | ||
"RelativeDocumentMoniker": "Form1.cs", | ||
"ToolTip": "E:\\CrossLane\\YoloLabel\\Form1.cs", | ||
"RelativeToolTip": "Form1.cs", | ||
"ViewState": "AQIAADcCAAAAAAAAAAAnwE8CAAAsAAAA", | ||
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", | ||
"WhenOpened": "2024-04-14T02:17:51.759Z", | ||
"EditorCaption": "" | ||
}, | ||
{ | ||
"$type": "Document", | ||
"DocumentIndex": 1, | ||
"Title": "Form1.cs [\u8BBE\u8BA1]", | ||
"DocumentMoniker": "E:\\CrossLane\\YoloLabel\\Form1.cs", | ||
"RelativeDocumentMoniker": "Form1.cs", | ||
"ToolTip": "E:\\CrossLane\\YoloLabel\\Form1.cs [\u8BBE\u8BA1]", | ||
"RelativeToolTip": "Form1.cs [\u8BBE\u8BA1]", | ||
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", | ||
"WhenOpened": "2024-04-14T02:16:38.89Z", | ||
"EditorCaption": " [\u8BBE\u8BA1]" | ||
} | ||
] | ||
} | ||
] | ||
} | ||
] | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,174 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.ComponentModel; | ||
using System.Data; | ||
using System.Drawing; | ||
using System.Linq; | ||
using System.Security.Permissions; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using System.Windows.Forms; | ||
|
||
namespace YoloLabel | ||
{ | ||
public partial class ClassForm : Form | ||
{ | ||
public ClassForm(string _labelPth) | ||
{ | ||
InitializeComponent(); | ||
if (!Directory.Exists(_labelPth)) | ||
{ | ||
Directory.CreateDirectory(_labelPth); | ||
} | ||
labelPath = _labelPth; | ||
var tblF = Path.Combine(labelPath, "classes.txt"); | ||
if (File.Exists(tblF)) | ||
{ | ||
var tbl = File.ReadAllLines(tblF); | ||
foreach (var c in tbl) | ||
{ | ||
if (!String.IsNullOrEmpty(c)) | ||
{ | ||
Classes.Add(c); | ||
} | ||
} | ||
listBox1.Items.Clear(); | ||
foreach (var c in Classes) | ||
{ | ||
listBox1.Items.Add(c); | ||
} | ||
} | ||
} | ||
|
||
public int Class = 0; | ||
public string labelPath; | ||
|
||
public void SetFolder(string _labelPth) | ||
{ | ||
if (!Directory.Exists(_labelPth)) | ||
{ | ||
Directory.CreateDirectory(_labelPth); | ||
} | ||
labelPath = _labelPth; | ||
var tblF = Path.Combine(labelPath, "classes.txt"); | ||
if (File.Exists(tblF)) | ||
{ | ||
var tbl = File.ReadAllLines(tblF); | ||
foreach (var c in tbl) | ||
{ | ||
if (!String.IsNullOrEmpty(c)) | ||
{ | ||
Classes.Add(c); | ||
} | ||
} | ||
listBox1.Items.Clear(); | ||
foreach (var c in Classes) | ||
{ | ||
listBox1.Items.Add(c); | ||
} | ||
} | ||
} | ||
|
||
public List<string> Classes = new List<string>(); | ||
|
||
private void button1_Click(object sender, EventArgs e) | ||
{ | ||
if (!String.IsNullOrEmpty(textBox1.Text)) | ||
{ | ||
Class = -1; | ||
for(int i = 0; i<Classes.Count; i++) | ||
{ | ||
if(textBox1.Text == Classes[i]) | ||
{ | ||
Class = i; break; | ||
} | ||
} | ||
if (Class >= 0) | ||
{ | ||
DialogResult = DialogResult.OK; | ||
} | ||
} | ||
} | ||
|
||
private void button2_Click(object sender, EventArgs e) | ||
{ | ||
DialogResult = DialogResult.Cancel; | ||
} | ||
|
||
private void listBox1_SelectedIndexChanged(object sender, EventArgs e) | ||
{ | ||
if (listBox1.SelectedItem != null) | ||
{ | ||
textBox1.Text = listBox1.SelectedItem.ToString(); | ||
} | ||
} | ||
|
||
private void listBox1_DoubleClick(object sender, EventArgs e) | ||
{ | ||
if (listBox1.SelectedItem != null) | ||
{ | ||
textBox1.Text = listBox1.SelectedItem.ToString(); | ||
Class = -1; | ||
for (int i = 0; i < Classes.Count; i++) | ||
{ | ||
if (textBox1.Text == Classes[i]) | ||
{ | ||
Class = i; break; | ||
} | ||
} | ||
if (Class >= 0) | ||
{ | ||
DialogResult = DialogResult.OK; | ||
} | ||
} | ||
} | ||
|
||
public void setMode(int mode) | ||
{ | ||
if(mode == 0) | ||
{ | ||
button3.Enabled = true; | ||
} | ||
else | ||
{ | ||
button3.Enabled = false; | ||
} | ||
} | ||
|
||
private void button3_Click(object sender, EventArgs e) | ||
{ | ||
if (!String.IsNullOrEmpty(textBox1.Text)) | ||
{ | ||
bool bex = false; | ||
for (int i = 0; i < Classes.Count; i++) | ||
{ | ||
if (Classes[i].Equals(textBox1.Text)) | ||
{ | ||
bex = true; | ||
break; | ||
} | ||
} | ||
if (!bex) | ||
{ | ||
Classes.Add(textBox1.Text); | ||
string contents = ""; | ||
Classes.Sort((a, b) => | ||
{ | ||
return a.CompareTo(b); | ||
}); | ||
foreach (var c in Classes) | ||
{ | ||
contents += c.ToString() + "\n"; | ||
} | ||
File.WriteAllText(Path.Combine(labelPath, "classes.txt"), contents); | ||
|
||
listBox1.Items.Clear(); | ||
foreach (var c in Classes) | ||
{ | ||
listBox1.Items.Add(c); | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.