Skip to content

Commit f0f15f0

Browse files
committed
Rename folder to match dataset name
1 parent 7a5ed72 commit f0f15f0

31 files changed

+15
-15
lines changed

app/NegativeSamples/ExtractDocuments.py renamed to app/MZKBlank/ExtractDocuments.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@
88
query = scraper.get_search_query(access="open", licenses="public", doctypes="sheetmusic")
99
document_ids = scraper.get_search_results(query, pages="all")
1010

11-
with open("app/NegativeSamples/scraped_data/documents.json", "w", encoding="utf8") as f:
11+
with open("app/MZKBlank/scraped_data/documents.json", "w", encoding="utf8") as f:
1212
json.dump(document_ids, f, indent=4)

app/NegativeSamples/ExtractPages.py renamed to app/MZKBlank/ExtractPages.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@
55
from mzkscraper.Scraper import MZKScraper
66
from mzkscraper.PageData import PageDataEncoder
77

8-
with open("app/NegativeSamples/valid_labels.json", "r", encoding="utf8") as f:
8+
with open("app/MZKBlank/valid_labels.json", "r", encoding="utf8") as f:
99
labels = json.load(f)
1010

1111
VALID_LABELS = labels["VALID_LABELS"]
1212

1313
scraper = MZKScraper()
1414

1515
# GET PAGES FROM DOCUMENTS
16-
with open("app/NegativeSamples/scraped_data/documents.json", "r", encoding="utf8") as f:
16+
with open("app/MZKBlank/scraped_data/documents.json", "r", encoding="utf8") as f:
1717
document_ids = json.load(f)
1818

1919
output = {
@@ -55,5 +55,5 @@
5555
except Exception as e:
5656
print(e)
5757

58-
with open(f"app/NegativeSamples/scraped_data/pages.json", "w", encoding="utf-8") as f:
58+
with open(f"app/MZKBlank/scraped_data/pages.json", "w", encoding="utf-8") as f:
5959
json.dump(output, f, indent=4, cls=PageDataEncoder)

app/NegativeSamples/Gridder.py renamed to app/MZKBlank/Gridder.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
import json
33
from pathlib import Path
44

5-
DATASET_DIR = Path("datasets/NegativeSamples")
5+
DATASET_DIR = Path("datasets/MZKBlank")
66

7-
with open("app/NegativeSamples/scraped_data/chosen.json", "r", encoding="utf8") as f:
7+
with open("app/MZKBlank/scraped_data/chosen.json", "r", encoding="utf8") as f:
88
data = json.load(f)
99

1010
dimensions = {
@@ -28,4 +28,4 @@
2828

2929
images = list(DATASET_DIR.rglob(f"{key}_*.png"))
3030
ImageUtils.combine_images_into_grid(images, *dimensions[key], size=(200, 200),
31-
output_path=f"app/NegativeSamples/docs/{key}_grid.png")
31+
output_path=f"app/MZKBlank/docs/{key}_grid.png")
File renamed without changes.
File renamed without changes.

app/NegativeSamples/TakeRepre.py renamed to app/MZKBlank/TakeRepre.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import math
33
import random
44

5-
with open("app/NegativeSamples/scraped_data/pages.json", "r", encoding="utf8") as f:
5+
with open("app/MZKBlank/scraped_data/pages.json", "r", encoding="utf8") as f:
66
data = json.load(f)
77

88
total = data["count"]
@@ -41,5 +41,5 @@
4141
unique_id += 1
4242

4343
# save data
44-
with open("app/NegativeSamples/scraped_data/chosen.json", "w", encoding="utf8") as f:
44+
with open("app/MZKBlank/scraped_data/chosen.json", "w", encoding="utf8") as f:
4545
json.dump(data, f, indent=4)
File renamed without changes.
File renamed without changes.
File renamed without changes.

app/NegativeSamples/build.py renamed to app/MZKBlank/build.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22

33
from . import Utils
44

5-
DATASET_DIR = Path("datasets/NegativeSamples")
5+
DATASET_DIR = Path("datasets/MZKBlank")
66
data = DATASET_DIR.rglob("*.png")
77
Utils.create_annotations(list(data), DATASET_DIR / "json")
File renamed without changes.

app/NegativeSamples/download.py renamed to app/MZKBlank/download.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44
import json
55

66
# load data
7-
with open("app/NegativeSamples/scraped_data/chosen.json", "r", encoding="utf8") as f:
7+
with open("app/MZKBlank/scraped_data/chosen.json", "r", encoding="utf8") as f:
88
data = json.load(f)
99

1010
scraper = MZKScraper()
11-
OUTPUT_DIR = Path("datasets/NegativeSamples/img")
11+
OUTPUT_DIR = Path("datasets/MZKBlank/img")
1212
if OUTPUT_DIR.exists():
1313
print("Dataset already downloaded.")
1414
quit()

app/Utils/build.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,12 @@ def build():
3232

3333
# create annotations for Negative Samples dataset
3434
print_header("Creating annotations for negative samples:")
35-
os.system("python3 -m app.NegativeSamples.build")
35+
os.system("python3 -m app.MZKBlank.build")
3636
print_done("Annotations created.")
3737

3838
# collect all datasets and combine them into a single one
3939
print_header("Combining all datasets into one.")
4040
dataset_name = f"{datetime.now().strftime('%Y_%m_%d_%H_%M_%S')}_final_dataset"
4141
os.system(
42-
f"python3 -m app ./datasets/{dataset_name} --stad ./datasets/al2_gs ./datasets/mpp_gs ./datasets/Lieder-main ./datasets/NegativeSamples")
42+
f"python3 -m app ./datasets/{dataset_name} --stad ./datasets/al2_gs ./datasets/mpp_gs ./datasets/Lieder-main ./datasets/MZKBlank")
4343
print_done(f"Datasets combined successfully, the final dataset is at {Path(dataset_name).resolve().absolute()}")

app/Utils/download.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@ def download():
99
print_done("Datasets downloaded.")
1010

1111
print_header("Downloading negative samples:")
12-
os.system("python3 -m app.NegativeSamples.download")
12+
os.system("python3 -m app.MZKBlank.download")
1313
print_done("Negative samples downloaded.")

0 commit comments

Comments
 (0)