sonusai 0.15.3__tar.gz → 0.15.5__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (127) hide show
  1. {sonusai-0.15.3 → sonusai-0.15.5}/PKG-INFO +5 -5
  2. {sonusai-0.15.3 → sonusai-0.15.5}/pyproject.toml +6 -6
  3. {sonusai-0.15.3 → sonusai-0.15.5}/sonusai/mixture/augmentation.py +26 -4
  4. {sonusai-0.15.3 → sonusai-0.15.5}/sonusai/mixture/eq_rule_is_valid.py +18 -2
  5. {sonusai-0.15.3 → sonusai-0.15.5}/sonusai/onnx_predict.py +3 -0
  6. {sonusai-0.15.3 → sonusai-0.15.5}/README.rst +0 -0
  7. {sonusai-0.15.3 → sonusai-0.15.5}/sonusai/__init__.py +0 -0
  8. {sonusai-0.15.3 → sonusai-0.15.5}/sonusai/aawscd_probwrite.py +0 -0
  9. {sonusai-0.15.3 → sonusai-0.15.5}/sonusai/calc_metric_spenh.py +0 -0
  10. {sonusai-0.15.3 → sonusai-0.15.5}/sonusai/data/__init__.py +0 -0
  11. {sonusai-0.15.3 → sonusai-0.15.5}/sonusai/data/genmixdb.yml +0 -0
  12. {sonusai-0.15.3 → sonusai-0.15.5}/sonusai/data/speech_ma01_01.wav +0 -0
  13. {sonusai-0.15.3 → sonusai-0.15.5}/sonusai/data/whitenoise.wav +0 -0
  14. {sonusai-0.15.3 → sonusai-0.15.5}/sonusai/data_generator/__init__.py +0 -0
  15. {sonusai-0.15.3 → sonusai-0.15.5}/sonusai/data_generator/dataset_from_mixdb.py +0 -0
  16. {sonusai-0.15.3 → sonusai-0.15.5}/sonusai/data_generator/keras_from_mixdb.py +0 -0
  17. {sonusai-0.15.3 → sonusai-0.15.5}/sonusai/data_generator/torch_from_mixdb.py +0 -0
  18. {sonusai-0.15.3 → sonusai-0.15.5}/sonusai/doc/__init__.py +0 -0
  19. {sonusai-0.15.3 → sonusai-0.15.5}/sonusai/doc/doc.py +0 -0
  20. {sonusai-0.15.3 → sonusai-0.15.5}/sonusai/doc.py +0 -0
  21. {sonusai-0.15.3 → sonusai-0.15.5}/sonusai/evaluate.py +0 -0
  22. {sonusai-0.15.3 → sonusai-0.15.5}/sonusai/genft.py +0 -0
  23. {sonusai-0.15.3 → sonusai-0.15.5}/sonusai/genmix.py +0 -0
  24. {sonusai-0.15.3 → sonusai-0.15.5}/sonusai/genmixdb.py +0 -0
  25. {sonusai-0.15.3 → sonusai-0.15.5}/sonusai/gentcst.py +0 -0
  26. {sonusai-0.15.3 → sonusai-0.15.5}/sonusai/keras_onnx.py +0 -0
  27. {sonusai-0.15.3 → sonusai-0.15.5}/sonusai/keras_predict.py +0 -0
  28. {sonusai-0.15.3 → sonusai-0.15.5}/sonusai/keras_train.py +0 -0
  29. {sonusai-0.15.3 → sonusai-0.15.5}/sonusai/lsdb.py +0 -0
  30. {sonusai-0.15.3 → sonusai-0.15.5}/sonusai/main.py +0 -0
  31. {sonusai-0.15.3 → sonusai-0.15.5}/sonusai/metrics/__init__.py +0 -0
  32. {sonusai-0.15.3 → sonusai-0.15.5}/sonusai/metrics/calc_class_weights.py +0 -0
  33. {sonusai-0.15.3 → sonusai-0.15.5}/sonusai/metrics/calc_optimal_thresholds.py +0 -0
  34. {sonusai-0.15.3 → sonusai-0.15.5}/sonusai/metrics/calc_pcm.py +0 -0
  35. {sonusai-0.15.3 → sonusai-0.15.5}/sonusai/metrics/calc_pesq.py +0 -0
  36. {sonusai-0.15.3 → sonusai-0.15.5}/sonusai/metrics/calc_sa_sdr.py +0 -0
  37. {sonusai-0.15.3 → sonusai-0.15.5}/sonusai/metrics/calc_sample_weights.py +0 -0
  38. {sonusai-0.15.3 → sonusai-0.15.5}/sonusai/metrics/calc_wer.py +0 -0
  39. {sonusai-0.15.3 → sonusai-0.15.5}/sonusai/metrics/calc_wsdr.py +0 -0
  40. {sonusai-0.15.3 → sonusai-0.15.5}/sonusai/metrics/class_summary.py +0 -0
  41. {sonusai-0.15.3 → sonusai-0.15.5}/sonusai/metrics/confusion_matrix_summary.py +0 -0
  42. {sonusai-0.15.3 → sonusai-0.15.5}/sonusai/metrics/one_hot.py +0 -0
  43. {sonusai-0.15.3 → sonusai-0.15.5}/sonusai/metrics/snr_summary.py +0 -0
  44. {sonusai-0.15.3 → sonusai-0.15.5}/sonusai/mixture/__init__.py +0 -0
  45. {sonusai-0.15.3 → sonusai-0.15.5}/sonusai/mixture/audio.py +0 -0
  46. {sonusai-0.15.3 → sonusai-0.15.5}/sonusai/mixture/class_count.py +0 -0
  47. {sonusai-0.15.3 → sonusai-0.15.5}/sonusai/mixture/config.py +0 -0
  48. {sonusai-0.15.3 → sonusai-0.15.5}/sonusai/mixture/constants.py +0 -0
  49. {sonusai-0.15.3 → sonusai-0.15.5}/sonusai/mixture/datatypes.py +0 -0
  50. {sonusai-0.15.3 → sonusai-0.15.5}/sonusai/mixture/feature.py +0 -0
  51. {sonusai-0.15.3 → sonusai-0.15.5}/sonusai/mixture/generation.py +0 -0
  52. {sonusai-0.15.3 → sonusai-0.15.5}/sonusai/mixture/helpers.py +0 -0
  53. {sonusai-0.15.3 → sonusai-0.15.5}/sonusai/mixture/log_duration_and_sizes.py +0 -0
  54. {sonusai-0.15.3 → sonusai-0.15.5}/sonusai/mixture/mapped_snr_f.py +0 -0
  55. {sonusai-0.15.3 → sonusai-0.15.5}/sonusai/mixture/mixdb.py +0 -0
  56. {sonusai-0.15.3 → sonusai-0.15.5}/sonusai/mixture/soundfile_audio.py +0 -0
  57. {sonusai-0.15.3 → sonusai-0.15.5}/sonusai/mixture/sox_audio.py +0 -0
  58. {sonusai-0.15.3 → sonusai-0.15.5}/sonusai/mixture/sox_augmentation.py +0 -0
  59. {sonusai-0.15.3 → sonusai-0.15.5}/sonusai/mixture/spectral_mask.py +0 -0
  60. {sonusai-0.15.3 → sonusai-0.15.5}/sonusai/mixture/target_class_balancing.py +0 -0
  61. {sonusai-0.15.3 → sonusai-0.15.5}/sonusai/mixture/targets.py +0 -0
  62. {sonusai-0.15.3 → sonusai-0.15.5}/sonusai/mixture/tokenized_shell_vars.py +0 -0
  63. {sonusai-0.15.3 → sonusai-0.15.5}/sonusai/mixture/torchaudio_audio.py +0 -0
  64. {sonusai-0.15.3 → sonusai-0.15.5}/sonusai/mixture/torchaudio_augmentation.py +0 -0
  65. {sonusai-0.15.3 → sonusai-0.15.5}/sonusai/mixture/truth.py +0 -0
  66. {sonusai-0.15.3 → sonusai-0.15.5}/sonusai/mixture/truth_functions/__init__.py +0 -0
  67. {sonusai-0.15.3 → sonusai-0.15.5}/sonusai/mixture/truth_functions/crm.py +0 -0
  68. {sonusai-0.15.3 → sonusai-0.15.5}/sonusai/mixture/truth_functions/data.py +0 -0
  69. {sonusai-0.15.3 → sonusai-0.15.5}/sonusai/mixture/truth_functions/energy.py +0 -0
  70. {sonusai-0.15.3 → sonusai-0.15.5}/sonusai/mixture/truth_functions/file.py +0 -0
  71. {sonusai-0.15.3 → sonusai-0.15.5}/sonusai/mixture/truth_functions/phoneme.py +0 -0
  72. {sonusai-0.15.3 → sonusai-0.15.5}/sonusai/mixture/truth_functions/sed.py +0 -0
  73. {sonusai-0.15.3 → sonusai-0.15.5}/sonusai/mixture/truth_functions/target.py +0 -0
  74. {sonusai-0.15.3 → sonusai-0.15.5}/sonusai/mkmanifest.py +0 -0
  75. {sonusai-0.15.3 → sonusai-0.15.5}/sonusai/mkwav.py +0 -0
  76. {sonusai-0.15.3 → sonusai-0.15.5}/sonusai/plot.py +0 -0
  77. {sonusai-0.15.3 → sonusai-0.15.5}/sonusai/post_spenh_targetf.py +0 -0
  78. {sonusai-0.15.3 → sonusai-0.15.5}/sonusai/queries/__init__.py +0 -0
  79. {sonusai-0.15.3 → sonusai-0.15.5}/sonusai/queries/queries.py +0 -0
  80. {sonusai-0.15.3 → sonusai-0.15.5}/sonusai/torchl_onnx.py +0 -0
  81. {sonusai-0.15.3 → sonusai-0.15.5}/sonusai/torchl_predict.py +0 -0
  82. {sonusai-0.15.3 → sonusai-0.15.5}/sonusai/torchl_train.py +0 -0
  83. {sonusai-0.15.3 → sonusai-0.15.5}/sonusai/tplot.py +0 -0
  84. {sonusai-0.15.3 → sonusai-0.15.5}/sonusai/utils/__init__.py +0 -0
  85. {sonusai-0.15.3 → sonusai-0.15.5}/sonusai/utils/asl_p56.py +0 -0
  86. {sonusai-0.15.3 → sonusai-0.15.5}/sonusai/utils/asr.py +0 -0
  87. {sonusai-0.15.3 → sonusai-0.15.5}/sonusai/utils/asr_functions/__init__.py +0 -0
  88. {sonusai-0.15.3 → sonusai-0.15.5}/sonusai/utils/asr_functions/aaware_whisper.py +0 -0
  89. {sonusai-0.15.3 → sonusai-0.15.5}/sonusai/utils/asr_functions/aixplain_whisper.py +0 -0
  90. {sonusai-0.15.3 → sonusai-0.15.5}/sonusai/utils/asr_functions/data.py +0 -0
  91. {sonusai-0.15.3 → sonusai-0.15.5}/sonusai/utils/asr_functions/deepgram.py +0 -0
  92. {sonusai-0.15.3 → sonusai-0.15.5}/sonusai/utils/asr_functions/fastwhisper.py +0 -0
  93. {sonusai-0.15.3 → sonusai-0.15.5}/sonusai/utils/asr_functions/google.py +0 -0
  94. {sonusai-0.15.3 → sonusai-0.15.5}/sonusai/utils/asr_functions/whisper.py +0 -0
  95. {sonusai-0.15.3 → sonusai-0.15.5}/sonusai/utils/asr_manifest_functions/__init__.py +0 -0
  96. {sonusai-0.15.3 → sonusai-0.15.5}/sonusai/utils/asr_manifest_functions/data.py +0 -0
  97. {sonusai-0.15.3 → sonusai-0.15.5}/sonusai/utils/asr_manifest_functions/librispeech.py +0 -0
  98. {sonusai-0.15.3 → sonusai-0.15.5}/sonusai/utils/asr_manifest_functions/vctk_noisy_speech.py +0 -0
  99. {sonusai-0.15.3 → sonusai-0.15.5}/sonusai/utils/braced_glob.py +0 -0
  100. {sonusai-0.15.3 → sonusai-0.15.5}/sonusai/utils/calculate_input_shape.py +0 -0
  101. {sonusai-0.15.3 → sonusai-0.15.5}/sonusai/utils/convert_string_to_number.py +0 -0
  102. {sonusai-0.15.3 → sonusai-0.15.5}/sonusai/utils/create_ts_name.py +0 -0
  103. {sonusai-0.15.3 → sonusai-0.15.5}/sonusai/utils/dataclass_from_dict.py +0 -0
  104. {sonusai-0.15.3 → sonusai-0.15.5}/sonusai/utils/db.py +0 -0
  105. {sonusai-0.15.3 → sonusai-0.15.5}/sonusai/utils/energy_f.py +0 -0
  106. {sonusai-0.15.3 → sonusai-0.15.5}/sonusai/utils/engineering_number.py +0 -0
  107. {sonusai-0.15.3 → sonusai-0.15.5}/sonusai/utils/get_frames_per_batch.py +0 -0
  108. {sonusai-0.15.3 → sonusai-0.15.5}/sonusai/utils/get_label_names.py +0 -0
  109. {sonusai-0.15.3 → sonusai-0.15.5}/sonusai/utils/grouper.py +0 -0
  110. {sonusai-0.15.3 → sonusai-0.15.5}/sonusai/utils/human_readable_size.py +0 -0
  111. {sonusai-0.15.3 → sonusai-0.15.5}/sonusai/utils/keras_utils.py +0 -0
  112. {sonusai-0.15.3 → sonusai-0.15.5}/sonusai/utils/max_text_width.py +0 -0
  113. {sonusai-0.15.3 → sonusai-0.15.5}/sonusai/utils/numeric_conversion.py +0 -0
  114. {sonusai-0.15.3 → sonusai-0.15.5}/sonusai/utils/onnx_utils.py +0 -0
  115. {sonusai-0.15.3 → sonusai-0.15.5}/sonusai/utils/parallel.py +0 -0
  116. {sonusai-0.15.3 → sonusai-0.15.5}/sonusai/utils/print_mixture_details.py +0 -0
  117. {sonusai-0.15.3 → sonusai-0.15.5}/sonusai/utils/ranges.py +0 -0
  118. {sonusai-0.15.3 → sonusai-0.15.5}/sonusai/utils/read_mixture_data.py +0 -0
  119. {sonusai-0.15.3 → sonusai-0.15.5}/sonusai/utils/read_predict_data.py +0 -0
  120. {sonusai-0.15.3 → sonusai-0.15.5}/sonusai/utils/reshape.py +0 -0
  121. {sonusai-0.15.3 → sonusai-0.15.5}/sonusai/utils/seconds_to_hms.py +0 -0
  122. {sonusai-0.15.3 → sonusai-0.15.5}/sonusai/utils/stacked_complex.py +0 -0
  123. {sonusai-0.15.3 → sonusai-0.15.5}/sonusai/utils/stratified_shuffle_split.py +0 -0
  124. {sonusai-0.15.3 → sonusai-0.15.5}/sonusai/utils/trim_docstring.py +0 -0
  125. {sonusai-0.15.3 → sonusai-0.15.5}/sonusai/utils/wave.py +0 -0
  126. {sonusai-0.15.3 → sonusai-0.15.5}/sonusai/utils/yes_or_no.py +0 -0
  127. {sonusai-0.15.3 → sonusai-0.15.5}/sonusai/vars.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: sonusai
3
- Version: 0.15.3
3
+ Version: 0.15.5
4
4
  Summary: Framework for building deep neural network models for sound, speech, and voice AI
5
5
  Home-page: https://aaware.com
6
6
  License: GPL-3.0-only
@@ -17,12 +17,12 @@ Classifier: Programming Language :: Python :: 3.11
17
17
  Requires-Dist: PyYAML (>=6.0.1,<7.0.0)
18
18
  Requires-Dist: aixplain (>=0.2.6,<0.3.0)
19
19
  Requires-Dist: dataclasses-json (>=0.6.1,<0.7.0)
20
- Requires-Dist: deepgram-sdk (>=2.11.0,<3.0.0)
20
+ Requires-Dist: deepgram-sdk (>=3.0.0,<4.0.0)
21
21
  Requires-Dist: docopt (>=0.6.2,<0.7.0)
22
22
  Requires-Dist: faster-whisper (>=0.10.0,<0.11.0)
23
23
  Requires-Dist: ffmpeg (>=1.4,<2.0)
24
24
  Requires-Dist: greenlet (>=3.0.1,<4.0.0)
25
- Requires-Dist: grpcio (==1.59.2)
25
+ Requires-Dist: grpcio (==1.60.0)
26
26
  Requires-Dist: jiwer (>=3.0.3,<4.0.0)
27
27
  Requires-Dist: keras-tuner (>=1.4.5,<2.0.0)
28
28
  Requires-Dist: librosa (>=0.10.1,<0.11.0)
@@ -35,7 +35,7 @@ Requires-Dist: pandas (>=2.1.1,<3.0.0)
35
35
  Requires-Dist: pesq (>=0.0.4,<0.0.5)
36
36
  Requires-Dist: pyaaware (>=1.5.3,<2.0.0)
37
37
  Requires-Dist: pydub (>=0.25.1,<0.26.0)
38
- Requires-Dist: pystoi (>=0.3.3,<0.4.0)
38
+ Requires-Dist: pystoi (>=0.4.0,<0.5.0)
39
39
  Requires-Dist: python-magic (>=0.4.27,<0.5.0)
40
40
  Requires-Dist: requests (>=2.31.0,<3.0.0)
41
41
  Requires-Dist: resampy (>=0.4.2,<0.5.0)
@@ -45,7 +45,7 @@ Requires-Dist: sh (>=2.0.6,<3.0.0)
45
45
  Requires-Dist: soundfile (>=0.12.1,<0.13.0)
46
46
  Requires-Dist: sox (>=1.4.1,<2.0.0)
47
47
  Requires-Dist: speechrecognition (>=3.10.0,<4.0.0)
48
- Requires-Dist: tensorflow (>=2.14.0,<3.0.0)
48
+ Requires-Dist: tensorflow (>=2.15.0,<3.0.0)
49
49
  Requires-Dist: tensorflow-addons (>=0.23.0,<0.24.0)
50
50
  Requires-Dist: tf2onnx (>=1.15.1,<2.0.0)
51
51
  Requires-Dist: torch (>=2.1.0,<3.0.0)
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "sonusai"
3
- version = "0.15.3"
3
+ version = "0.15.5"
4
4
  description = "Framework for building deep neural network models for sound, speech, and voice AI"
5
5
  authors = ["Chris Eddington <chris@aaware.com>", "Jason Calderwood <jason@aaware.com>"]
6
6
  maintainers = ["Chris Eddington <chris@aaware.com>", "Jason Calderwood <jason@aaware.com>"]
@@ -17,20 +17,20 @@ aawscd_probwrite = 'sonusai.aawscd_probwrite:main'
17
17
  PyYAML = "^6.0.1"
18
18
  aixplain = "^0.2.6"
19
19
  dataclasses-json = "^0.6.1"
20
- deepgram-sdk = "^2.11.0"
20
+ deepgram-sdk = "^3.0.0"
21
21
  docopt = "^0.6.2"
22
22
  #einops = "^0"
23
23
  faster-whisper = "^0.10.0"
24
24
  ffmpeg = "^1.4"
25
25
  greenlet = "^3.0.1"
26
- grpcio = "1.59.2"
26
+ grpcio = "1.60.0"
27
27
  jiwer = "^3.0.3"
28
28
  keras-tuner = "^1.4.5"
29
29
  librosa = "^0.10.1"
30
30
  lightning = "^2.1.0"
31
31
  matplotlib = "^3.8.0"
32
32
  onnx = "1.14.1"
33
- #onnxruntime-gpu = "^1"
33
+ #onnxruntime-gpu = "^1.16.1"
34
34
  onnxruntime = "^1.16.1"
35
35
  #openai-whisper = "^20231117"
36
36
  paho-mqtt = "^1.6.1"
@@ -38,7 +38,7 @@ pandas = "^2.1.1"
38
38
  pesq = "^0.0.4"
39
39
  pyaaware = "^1.5.3"
40
40
  pydub = "^0.25.1"
41
- pystoi = "^0.3.3"
41
+ pystoi = "^0.4.0"
42
42
  python = ">=3.9,<3.12"
43
43
  python-magic = "^0.4.27"
44
44
  requests = "^2.31.0"
@@ -49,7 +49,7 @@ sh = "^2.0.6"
49
49
  soundfile = "^0.12.1"
50
50
  sox = "^1.4.1"
51
51
  speechrecognition = "^3.10.0"
52
- tensorflow = "^2.14.0"
52
+ tensorflow = "^2.15.0"
53
53
  tensorflow-addons = "^0.23.0"
54
54
  tf2onnx = "^1.15.1"
55
55
  torch = "^2.1.0"
@@ -58,11 +58,14 @@ def _expand_rules(expanded_rules: list[dict], rule: dict) -> list[dict]:
58
58
  if not eq_rule_is_valid(rule[key]):
59
59
  raise SonusAIError(f'Invalid augmentation value for {key}: {rule[key]}')
60
60
 
61
- if all(isinstance(el, list) for el in rule[key]):
61
+ if all(isinstance(el, list) or (isinstance(el, str) and el == 'none') for el in rule[key]):
62
62
  # Expand multiple rules
63
63
  for value in rule[key]:
64
64
  expanded_rule = deepcopy(rule)
65
- expanded_rule[key] = deepcopy(value)
65
+ if isinstance(value, str) and value == 'none':
66
+ expanded_rule[key] = None
67
+ else:
68
+ expanded_rule[key] = deepcopy(value)
66
69
  _expand_rules(expanded_rules, expanded_rule)
67
70
  return expanded_rules
68
71
 
@@ -80,13 +83,31 @@ def _expand_rules(expanded_rules: list[dict], rule: dict) -> list[dict]:
80
83
  return expanded_rules
81
84
  else:
82
85
  rule[key] = convert_string_to_number(rule[key])
83
- if not (isinstance(rule[key], float | int) or rule[key].startswith('rand')):
86
+ if not (isinstance(rule[key], float | int) or
87
+ rule[key].startswith('rand') or
88
+ rule[key] == 'none'):
84
89
  raise SonusAIError(f'Invalid augmentation value for {key}: {rule[key]}')
85
90
 
86
91
  expanded_rules.append(rule)
87
92
  return expanded_rules
88
93
 
89
94
 
95
+ def _generate_none_rule(rule: dict) -> dict:
96
+ """Generate a new rule from a rule that contains 'none' directives
97
+
98
+ :param rule: Rule
99
+ :return: New rule
100
+ """
101
+ from copy import deepcopy
102
+
103
+ out_rule = deepcopy(rule)
104
+ for key in out_rule:
105
+ if out_rule[key] == 'none':
106
+ out_rule[key] = None
107
+
108
+ return out_rule
109
+
110
+
90
111
  def _generate_random_rule(rule: dict, num_ir: int = 0) -> dict:
91
112
  """Generate a new rule from a rule that contains 'rand' directives
92
113
 
@@ -238,7 +259,7 @@ def _parse_ir(rule: dict, num_ir: int) -> dict:
238
259
  from .helpers import generic_ids_to_list
239
260
 
240
261
  def _resolve_str(rule_in: str) -> str | list[int]:
241
- if rule_in == 'rand':
262
+ if rule_in in ['rand', 'none']:
242
263
  return rule_in
243
264
 
244
265
  rule_out = generic_ids_to_list(num_ir, rule_in)
@@ -308,6 +329,7 @@ def augmentation_from_rule(rule: AugmentationRule, num_ir: int) -> Augmentation:
308
329
 
309
330
  processed_rule = rule.to_dict()
310
331
  del processed_rule['mixup']
332
+ processed_rule = _generate_none_rule(processed_rule)
311
333
  if _rule_has_rand(processed_rule):
312
334
  processed_rule = _generate_random_rule(processed_rule, num_ir)
313
335
 
@@ -7,13 +7,16 @@ def eq_rule_is_valid(rule: Any) -> bool:
7
7
  An EQ rule must be a tuple of length 3 or a list of length 3 tuples.
8
8
  """
9
9
 
10
- # Must be a list
10
+ # Must be a list or string equal to 'none'
11
+ if isinstance(rule, str) and rule == 'none':
12
+ return True
13
+
11
14
  if not isinstance(rule, list):
12
15
  return False
13
16
 
14
17
  if len(rule) != 3:
15
18
  # If the length is not 3, then all elements must also be lists
16
- if not all(isinstance(el, list) and len(el) == 3 for el in rule):
19
+ if not all(_check_for_none(el) for el in rule):
17
20
  return False
18
21
  rules = rule
19
22
  else:
@@ -24,9 +27,22 @@ def eq_rule_is_valid(rule: Any) -> bool:
24
27
  if not all(isinstance(el, float | int | str) for el in r):
25
28
  return False
26
29
 
30
+ if isinstance(r, str) and r == 'none':
31
+ continue
32
+
27
33
  for el in r:
28
34
  # If a string, item must start with 'rand'
29
35
  if isinstance(el, str) and not el.startswith('rand'):
30
36
  return False
31
37
 
32
38
  return True
39
+
40
+
41
+ def _check_for_none(rule: Any) -> bool:
42
+ """Check if EQ rule is 'none'
43
+ """
44
+ if isinstance(rule, str) and rule == 'none':
45
+ return True
46
+ if isinstance(rule, list) and len(rule) == 3:
47
+ return True
48
+ return False
@@ -223,6 +223,9 @@ def pad_and_predict(feature: Feature,
223
223
  model = rt.InferenceSession(model_name, providers=['CPUExecutionProvider'])
224
224
 
225
225
  predict_arr = np.vstack(predict)
226
+ # Combine [sequences, batch_size, ...] into [frames, ...]
227
+ predict_shape = predict_arr.shape
228
+ predict_arr = np.reshape(predict_arr, [predict_shape[0] * predict_shape[1], *predict_shape[2:]])
226
229
  predict_arr, _ = reshape_outputs(predict=predict_arr, timesteps=timesteps)
227
230
  predict_arr = predict_arr[:frames, :]
228
231
 
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes