-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Minor fixes; add logging; bump version to 1.0.1
- Loading branch information
Showing
8 changed files
with
31 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,17 @@ | ||
import os.path | ||
import shutil | ||
|
||
from demucs.pretrained import DEFAULT_MODEL | ||
|
||
from unmixer.constants import ISOLATED_TRACK_FORMATS | ||
|
||
|
||
def is_isolated_track(file_path: str) -> bool: | ||
return os.path.splitext(file_path)[1].lower().lstrip('.') in ISOLATED_TRACK_FORMATS | ||
|
||
|
||
def cleanup_intermediate_dir(output_dir_path: str) -> None: | ||
intermediate_dir = os.path.join(output_dir_path, DEFAULT_MODEL) | ||
if os.path.exists(intermediate_dir) and not os.listdir(intermediate_dir): | ||
print(f'Removing intermediate directory {intermediate_dir}.') | ||
shutil.rmtree(intermediate_dir) |