diff --git a/robots-at-runes/research/dataset/image_0.jpg b/robots-at-runes/research/dataset/image_0.jpg deleted file mode 100644 index 9c6c7cd5625d5ab7d3c6bb23ee418924b5b71462..0000000000000000000000000000000000000000 Binary files a/robots-at-runes/research/dataset/image_0.jpg and /dev/null differ diff --git a/robots-at-runes/research/dataset/image_1.jpg b/robots-at-runes/research/dataset/image_1.jpg deleted file mode 100644 index 9a0a6c29bca1b92490be75a2594dc0f72920dfd6..0000000000000000000000000000000000000000 Binary files a/robots-at-runes/research/dataset/image_1.jpg and /dev/null differ diff --git a/robots-at-runes/research/dataset/image_2.jpg b/robots-at-runes/research/dataset/image_2.jpg deleted file mode 100644 index 6d04b0e6bf8cec414a37ac2d8f1b533653b5a2da..0000000000000000000000000000000000000000 Binary files a/robots-at-runes/research/dataset/image_2.jpg and /dev/null differ diff --git a/robots-at-runes/research/dataset/image_3.jpg b/robots-at-runes/research/dataset/image_3.jpg deleted file mode 100644 index dcaded1944be9cf7717adf9524ce5f5daa0b054f..0000000000000000000000000000000000000000 Binary files a/robots-at-runes/research/dataset/image_3.jpg and /dev/null differ diff --git a/robots-at-runes/research/dataset/image_4.jpg b/robots-at-runes/research/dataset/image_4.jpg deleted file mode 100644 index 366c39b5293874af672610c52592b6081340ddcf..0000000000000000000000000000000000000000 Binary files a/robots-at-runes/research/dataset/image_4.jpg and /dev/null differ diff --git a/robots-at-runes/research/dataset/image_5.jpg b/robots-at-runes/research/dataset/image_5.jpg deleted file mode 100644 index 4b75f879769a5c88f2ca3cdd784f143370fa606e..0000000000000000000000000000000000000000 Binary files a/robots-at-runes/research/dataset/image_5.jpg and /dev/null differ diff --git a/robots-at-runes/research/dataset/image_6.jpg b/robots-at-runes/research/dataset/image_6.jpg deleted file mode 100644 index 1ac5e17d5d0162fcc91603c7006da49d2871cf94..0000000000000000000000000000000000000000 Binary files a/robots-at-runes/research/dataset/image_6.jpg and /dev/null differ diff --git a/robots-at-runes/research/dataset/image_7.jpg b/robots-at-runes/research/dataset/image_7.jpg deleted file mode 100644 index 55810a0206211abe58a5f4488502d59e705f9292..0000000000000000000000000000000000000000 Binary files a/robots-at-runes/research/dataset/image_7.jpg and /dev/null differ diff --git a/robots-at-runes/research/dataset/image_8.jpg b/robots-at-runes/research/dataset/image_8.jpg deleted file mode 100644 index 8c4920ee54d01c80b212d359a809d9317c2157b7..0000000000000000000000000000000000000000 Binary files a/robots-at-runes/research/dataset/image_8.jpg and /dev/null differ diff --git a/robots-at-runes/research/dataset/image_9.jpg b/robots-at-runes/research/dataset/image_9.jpg deleted file mode 100644 index 14afbaeedd546d5dc5cac6a1f5c8e6880103a532..0000000000000000000000000000000000000000 Binary files a/robots-at-runes/research/dataset/image_9.jpg and /dev/null differ diff --git a/robots-at-runes/research/dataset/labels.xml b/robots-at-runes/research/dataset/labels.xml deleted file mode 100644 index 4feb5cee2f49ffb39cb4360a618ed9eb20f4ebe2..0000000000000000000000000000000000000000 --- a/robots-at-runes/research/dataset/labels.xml +++ /dev/null @@ -1,73 +0,0 @@ -<?xml version="1.0" ?> -<annotations> - <object> - <filename>image_0.jpg</filename> - <xmin>753</xmin> - <ymin>831</ymin> - <xmax>970</xmax> - <ymax>1289</ymax> - </object> - <object> - <filename>image_1.jpg</filename> - <xmin>598</xmin> - <ymin>192</ymin> - <xmax>832</xmax> - <ymax>538</ymax> - </object> - <object> - <filename>image_2.jpg</filename> - <xmin>190</xmin> - <ymin>729</ymin> - <xmax>482</xmax> - <ymax>1202</ymax> - </object> - <object> - <filename>image_3.jpg</filename> - <xmin>11</xmin> - <ymin>91</ymin> - <xmax>234</xmax> - <ymax>461</ymax> - </object> - <object> - <filename>image_4.jpg</filename> - <xmin>51</xmin> - <ymin>613</ymin> - <xmax>359</xmax> - <ymax>1106</ymax> - </object> - <object> - <filename>image_5.jpg</filename> - <xmin>689</xmin> - <ymin>253</ymin> - <xmax>890</xmax> - <ymax>588</ymax> - </object> - <object> - <filename>image_6.jpg</filename> - <xmin>423</xmin> - <ymin>1425</ymin> - <xmax>678</xmax> - <ymax>1790</ymax> - </object> - <object> - <filename>image_7.jpg</filename> - <xmin>180</xmin> - <ymin>256</ymin> - <xmax>484</xmax> - <ymax>748</ymax> - </object> - <object> - <filename>image_8.jpg</filename> - <xmin>885</xmin> - <ymin>1450</ymin> - <xmax>1137</xmax> - <ymax>1874</ymax> - </object> - <object> - <filename>image_9.jpg</filename> - <xmin>292</xmin> - <ymin>1497</ymin> - <xmax>455</xmax> - <ymax>1798</ymax> - </object> -</annotations> diff --git a/robots-at-runes/research/dataset/superposition/examples/.gitignore b/robots-at-runes/research/dataset/superposition/examples/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..5a10d97c38620fc4a6f8de2a1c1ce2cfd08c80b6 --- /dev/null +++ b/robots-at-runes/research/dataset/superposition/examples/.gitignore @@ -0,0 +1,2 @@ +/image_*.jpg +/labels.xml \ No newline at end of file diff --git a/robots-at-runes/research/images_sup/back1.jpg b/robots-at-runes/research/dataset/superposition/examples/back1.jpg similarity index 100% rename from robots-at-runes/research/images_sup/back1.jpg rename to robots-at-runes/research/dataset/superposition/examples/back1.jpg diff --git a/robots-at-runes/research/images_sup/logo.png b/robots-at-runes/research/dataset/superposition/examples/logo.png similarity index 100% rename from robots-at-runes/research/images_sup/logo.png rename to robots-at-runes/research/dataset/superposition/examples/logo.png diff --git a/robots-at-runes/research/superposition.py b/robots-at-runes/research/dataset/superposition/superposition.py similarity index 92% rename from robots-at-runes/research/superposition.py rename to robots-at-runes/research/dataset/superposition/superposition.py index 2a5b80e6d070bd0dd3764aa19aac16f3a943e648..dc164893b69f52e54d5a445b57a37e72264f9bfa 100644 --- a/robots-at-runes/research/superposition.py +++ b/robots-at-runes/research/dataset/superposition/superposition.py @@ -8,6 +8,8 @@ import matplotlib.pyplot as plt import numpy as np from imutils import rotate_bound +EXAMPLES_DIR = Path(__file__).parent / "examples" + # Facteur de redimensionnement. La taille de l'image sera divisée ou multipliée par ce chiffre au maximum FACT_RESIZE = 1 @@ -105,19 +107,19 @@ def rotate_percentage(img_base, percent): return rotate_bound(img_base, angle) -path_background = "images_sup/back1.jpg" -path_sticker = "images_sup/logo.png" +path_background = EXAMPLES_DIR / "back1.jpg" +path_sticker = EXAMPLES_DIR / "logo.png" -background = preprocess_background(path_background) -sticker = preprocess_sticker(path_sticker) +background = preprocess_background(str(path_background)) +sticker = preprocess_sticker(str(path_sticker)) labels = [] filenames = [] for i in range(10): - folder = "dataset/" + folder = EXAMPLES_DIR filename = "image_" + str(i) + ".jpg" filenames.append(filename) - _, label = generate_one(background, sticker, to_print=False, save_name=folder + filename) + _, label = generate_one(background, sticker, to_print=False, save_name=str(folder / filename)) labels.append(label) @@ -138,7 +140,7 @@ for i, [xmin, ymin, xmax, ymax] in enumerate(labels): dom = parseString(ET.tostring(data).decode("utf-8")) pretty_xml = dom.toprettyxml() -myfile = Path("dataset/labels.xml") +myfile = EXAMPLES_DIR / "labels.xml" myfile.write_text(pretty_xml) # with open('dataset/labels.txt', 'w') as f: