Skip to content

Commit b9ca99c

Browse files
SeregaCoditSerhii Naumenko
andauthored
feat(chore): add annotation converter voc to ypolo format (#4)
* chore(annotation_converter): initial commit for annotation converter command and business-logic * chore(converter): move files from annotation_converter to converter directory * chore(converter): add base code for converter and reader * chore(annotation_converter): add voc to yolo format converter * feat(annotation_converter)!: add yolo writer, finish conversation algorithm from voc to yolo * refactor(annotation_converter)!:refactor voc to yolo converter to multiprocessing * refactor(annotation_converter)!:refactor voc to yolo add files writer to convert pipeline for multiprocess writing files * docs(annotation_converter): add docstrings for voc to yolo convertion logic * refactor(dhash): remove commented rows * docs(docs): add mcdocs and documentation * tests(commands): add tst_commands for testing whole commands --------- Co-authored-by: Serhii Naumenko <naumenko.s.mail@gmail.com>
1 parent 677a2b8 commit b9ca99c

1 file changed

Lines changed: 64 additions & 0 deletions

File tree

tst_commands.py

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
import sys
2+
from pathlib import Path
3+
4+
from const_utils.arguments import Arguments
5+
from const_utils.commands import Commands
6+
from data_forge import DataForge
7+
8+
9+
MAPPING = {
10+
Commands.slice: [
11+
"data_forge.py",
12+
"slice",
13+
"./media/",
14+
"--dst", "./media/imgs/",
15+
"-p", ".mp4", ".MP4",
16+
"-t", ".jpg",
17+
# "-r",
18+
"-s", "60",
19+
"-step", "1",
20+
],
21+
Commands.delete: [
22+
"data_forge.py",
23+
"delete",
24+
"./media/imgs_new/",
25+
"-p", ".jpg",
26+
],
27+
Commands.move: [
28+
"data_forge.py",
29+
"move",
30+
"./media/imgs/",
31+
"--dst", "./media/imgs_new/",
32+
"-p", ".jpg", ".png",
33+
"-r",
34+
"-s", "30"
35+
],
36+
Commands.dedup: [
37+
"data_forge.py",
38+
"dedup",
39+
# "./media/imgs/",
40+
"/mnt/qnap/Staff/Naumenko/NotTheSkynet/img_dataset/",
41+
# "/home/pivden/PycharmProjects/yoloTrainer/saved_imgs/",
42+
"-p", ".jpg", ".png",
43+
"--filetype", "image",
44+
"--threshold", "10",
45+
"--cache_name", "test1"
46+
],
47+
Commands.convert_annotations: [
48+
"data_forge.py",
49+
"convert-annotations",
50+
"./media/annotated/",
51+
"--dst", "./media/yolo_anns/",
52+
"-p", ".xml",
53+
"--destination-type", "yolo"
54+
]
55+
}
56+
57+
if __name__ == "__main__":
58+
MAPPING[Commands.dedup].append(Arguments.core_size)
59+
MAPPING[Commands.dedup].append("16")
60+
61+
62+
sys.argv = MAPPING[Commands.move]
63+
app = DataForge()
64+
app.execute()

0 commit comments

Comments
 (0)