Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
danceformer
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
grzonkow
danceformer
Commits
be7af7b2
Commit
be7af7b2
authored
Feb 1, 2024
by
Cassandra Grzonkowski
Browse files
Options
Downloads
Patches
Plain Diff
only process if at least 2 files
parent
d278108f
No related branches found
No related tags found
1 merge request
!1
Instant spectograms
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
model_run.sbatch
+2
-2
2 additions, 2 deletions
model_run.sbatch
preprocess.py
+73
-71
73 additions, 71 deletions
preprocess.py
with
75 additions
and
73 deletions
model_run.sbatch
+
2
−
2
View file @
be7af7b2
...
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
preprocess.py
+
73
−
71
View file @
be7af7b2
...
...
@@ -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
))
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment