Skip to content
Snippets Groups Projects
Commit be7af7b2 authored by Cassandra Grzonkowski's avatar Cassandra Grzonkowski
Browse files

only process if at least 2 files

parent d278108f
No related branches found
No related tags found
1 merge request!1Instant spectograms
......@@ -6,8 +6,8 @@
#SBATCH -n 5 # use 5 tasks
#SBATCH --cpus-per-task=1 # use 1 thread per taks
#SBATCH -N 1 # request slots on 1 node
#SBATCH --output=/scratch/grzonkow/model_0102.txt # capture output
#SBATCH --error=/scratch/grzonkow/err_0102.txt # and error streams
#SBATCH --output=/scratch/grzonkow/model_new.txt # capture output
#SBATCH --error=/scratch/grzonkow/err_new.txt # and error streams
......
......@@ -121,6 +121,8 @@ def get_paths_diff_charts(song_dirs, indexed_vocabulary, device):
all_paths_old_len = len(all_paths)
audio_exists = False
list_items = os.listdir(song_dir)
# no runthrough, need at least 2 files, sm and audio file
if len(list_items) >= 2:
for item in os.listdir(song_dir):
if item.endswith('.sm'):
opened_file = simfile.open(f"{song_dir}/{item}")
......@@ -136,10 +138,10 @@ def get_paths_diff_charts(song_dirs, indexed_vocabulary, device):
# sample notes over time, return list of NoteData and [] if empy (for now)
converted_charts = []
if idx > 2500:
print(
f"File: {item}, Number_charts: {len(charts)}, Song: {idx}, Processed charts: {num_charts}, "
f"Elapsed time: {elapsed_second_step}, Time: {now}")
#if idx > 2500:
# print(
# f"File: {item}, Number_charts: {len(charts)}, Song: {idx}, Processed charts: {num_charts}, "
# f"Elapsed time: {elapsed_second_step}, Time: {now}")
for i, chart in enumerate(charts):
num_charts += 1
notes_per_time = process_chart(opened_file, sm_file, chart, indexed_vocabulary, device)
......@@ -148,10 +150,10 @@ def get_paths_diff_charts(song_dirs, indexed_vocabulary, device):
if max_len_charts < len(notes_per_time):
max_len_charts = len(notes_per_time)
converted_charts.append(notes_per_time)
if idx > 2500:
print(
f"File: {item}, Chart: {i}, "
f"Elapsed time: {elapsed_second_step}, Time: {now}")
# if idx > 2500:
# print(
# f"File: {item}, Chart: {i}, "
# f"Elapsed time: {elapsed_second_step}, Time: {now}")
all_difficulties.extend(difficulties)
all_charts.extend(converted_charts)
assert (len(converted_charts) == len(difficulties))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment