Commit 36c1e2a9 authored by Elias's avatar Elias

correction importation

parent 7ca451f3
...@@ -115,7 +115,7 @@ python3 decouper_wav_mots_uniquement.py annotation file "mot1" "mot2" "mot3" ... ...@@ -115,7 +115,7 @@ python3 decouper_wav_mots_uniquement.py annotation file "mot1" "mot2" "mot3" ...
``` ```
## 2. Matching with similarity ## 2. Matching with similarity
### • This script (inspired by [the github of the paper : Spoken-Term Discovery using Discrete Speech Units](https://github.com/bshall/dusted)) assumes you have a dusted folder with the match_2.py script in the folder ### • This script (inspired by [the github of the paper : Spoken-Term Discovery using Discrete Speech Units](https://github.com/bshall/dusted)). The match_2.py script is adapted from the match.py script of the github of DUSTED
**matchQueryHS.py :** Output : csv files for every query with score of matching **matchQueryHS.py :** Output : csv files for every query with score of matching
```bash ```bash
......
...@@ -12,8 +12,8 @@ import numba ...@@ -12,8 +12,8 @@ import numba
def print_dtw_terminal(x_tokens, y_tokens, W1, W2, threshold): def print_dtw_terminal(x_tokens, y_tokens, W1, W2, threshold):
from dusted.match_2 import match_rescore from match_2 import match_rescore
from dusted.match_2 import score from match_2 import score
x_tokens = np.array(x_tokens, dtype=np.int64) x_tokens = np.array(x_tokens, dtype=np.int64)
y_tokens = np.array(y_tokens, dtype=np.int64) y_tokens = np.array(y_tokens, dtype=np.int64)
print(x_tokens) print(x_tokens)
...@@ -94,7 +94,7 @@ def process_pair(target_path, match, sim, query_path, W1, W2, threshold=None, mi ...@@ -94,7 +94,7 @@ def process_pair(target_path, match, sim, query_path, W1, W2, threshold=None, mi
def do_match(args, query_path, W1_value, W2_value, out_path, visualize=False): def do_match(args, query_path, W1_value, W2_value, out_path, visualize=False):
segment_paths = sorted(args.segments_dir.rglob("*.npz")) segment_paths = sorted(args.segments_dir.rglob("*.npz"))
from dusted.match_2 import match_rescore as match_fn from match_2 import match_rescore as match_fn
print(segment_paths) print(segment_paths)
all_tokens = [] all_tokens = []
for seg_path in segment_paths + [query_path]: for seg_path in segment_paths + [query_path]:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment