nkululeko 0.77.4__tar.gz → 0.77.6__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 (181) hide show
  1. {nkululeko-0.77.4 → nkululeko-0.77.6}/CHANGELOG.md +8 -0
  2. {nkululeko-0.77.4/nkululeko.egg-info → nkululeko-0.77.6}/PKG-INFO +11 -1
  3. {nkululeko-0.77.4 → nkululeko-0.77.6}/README.md +1 -0
  4. {nkululeko-0.77.4 → nkululeko-0.77.6}/nkululeko/aug_train.py +12 -9
  5. {nkululeko-0.77.4 → nkululeko-0.77.6}/nkululeko/augmenting/augmenter.py +10 -2
  6. {nkululeko-0.77.4 → nkululeko-0.77.6}/nkululeko/augmenting/randomsplicer.py +11 -2
  7. {nkululeko-0.77.4 → nkululeko-0.77.6}/nkululeko/constants.py +1 -1
  8. {nkululeko-0.77.4 → nkululeko-0.77.6}/nkululeko/experiment.py +2 -2
  9. {nkululeko-0.77.4 → nkululeko-0.77.6}/nkululeko/feat_extract/feats_analyser.py +4 -1
  10. {nkululeko-0.77.4 → nkululeko-0.77.6}/nkululeko/models/model.py +2 -2
  11. {nkululeko-0.77.4 → nkululeko-0.77.6}/nkululeko/models/model_cnn.py +1 -1
  12. {nkululeko-0.77.4 → nkululeko-0.77.6}/nkululeko/models/model_mlp.py +1 -1
  13. {nkululeko-0.77.4 → nkululeko-0.77.6}/nkululeko/nkululeko.py +15 -12
  14. {nkululeko-0.77.4 → nkululeko-0.77.6}/nkululeko/plots.py +1 -1
  15. {nkululeko-0.77.4 → nkululeko-0.77.6}/nkululeko/utils/util.py +17 -5
  16. {nkululeko-0.77.4 → nkululeko-0.77.6/nkululeko.egg-info}/PKG-INFO +11 -1
  17. {nkululeko-0.77.4 → nkululeko-0.77.6}/nkululeko.egg-info/SOURCES.txt +1 -18
  18. {nkululeko-0.77.4 → nkululeko-0.77.6}/nkululeko.egg-info/requires.txt +1 -0
  19. {nkululeko-0.77.4 → nkululeko-0.77.6}/setup.cfg +1 -0
  20. {nkululeko-0.77.4 → nkululeko-0.77.6}/venv/bin/activate_this.py +1 -1
  21. nkululeko-0.77.4/venv/bin/ina_speech_segmenter.py +0 -81
  22. nkululeko-0.77.4/venv/bin/ina_speech_segmenter_pyro_client.py +0 -57
  23. nkululeko-0.77.4/venv/bin/ina_speech_segmenter_pyro_client_setjobs.py +0 -37
  24. nkululeko-0.77.4/venv/bin/ina_speech_segmenter_pyro_server.py +0 -76
  25. nkululeko-0.77.4/venv/bin/pyannote_hmm.py +0 -126
  26. nkululeko-0.77.4/venv/bin/rst2html.py +0 -23
  27. nkululeko-0.77.4/venv/bin/rst2html4.py +0 -26
  28. nkululeko-0.77.4/venv/bin/rst2html5.py +0 -33
  29. nkululeko-0.77.4/venv/bin/rst2latex.py +0 -26
  30. nkululeko-0.77.4/venv/bin/rst2man.py +0 -27
  31. nkululeko-0.77.4/venv/bin/rst2odt.py +0 -28
  32. nkululeko-0.77.4/venv/bin/rst2odt_prepstyles.py +0 -20
  33. nkululeko-0.77.4/venv/bin/rst2pseudoxml.py +0 -23
  34. nkululeko-0.77.4/venv/bin/rst2s5.py +0 -24
  35. nkululeko-0.77.4/venv/bin/rst2xetex.py +0 -27
  36. nkululeko-0.77.4/venv/bin/rst2xml.py +0 -23
  37. nkululeko-0.77.4/venv/bin/rstpep2html.py +0 -25
  38. {nkululeko-0.77.4 → nkululeko-0.77.6}/LICENSE +0 -0
  39. {nkululeko-0.77.4 → nkululeko-0.77.6}/data/aesdd/process_database.py +0 -0
  40. {nkululeko-0.77.4 → nkululeko-0.77.6}/data/androids/process_database.py +0 -0
  41. {nkululeko-0.77.4 → nkululeko-0.77.6}/data/androids_orig/process_database.py +0 -0
  42. {nkululeko-0.77.4 → nkululeko-0.77.6}/data/androids_test/process_database.py +0 -0
  43. {nkululeko-0.77.4 → nkululeko-0.77.6}/data/ased/process_database.py +0 -0
  44. {nkululeko-0.77.4 → nkululeko-0.77.6}/data/asvp-esd/process_database.py +0 -0
  45. {nkululeko-0.77.4 → nkululeko-0.77.6}/data/baved/process_database.py +0 -0
  46. {nkululeko-0.77.4 → nkululeko-0.77.6}/data/cafe/process_database.py +0 -0
  47. {nkululeko-0.77.4 → nkululeko-0.77.6}/data/clac/process_database.py +0 -0
  48. {nkululeko-0.77.4 → nkululeko-0.77.6}/data/cmu-mosei/process_database.py +0 -0
  49. {nkululeko-0.77.4 → nkululeko-0.77.6}/data/crema-d/process_database.py +0 -0
  50. {nkululeko-0.77.4 → nkululeko-0.77.6}/data/demos/process_database.py +0 -0
  51. {nkululeko-0.77.4 → nkululeko-0.77.6}/data/ekorpus/process_database.py +0 -0
  52. {nkululeko-0.77.4 → nkululeko-0.77.6}/data/emns/process_database.py +0 -0
  53. {nkululeko-0.77.4 → nkululeko-0.77.6}/data/emofilm/convert_to_16k.py +0 -0
  54. {nkululeko-0.77.4 → nkululeko-0.77.6}/data/emofilm/process_database.py +0 -0
  55. {nkululeko-0.77.4 → nkululeko-0.77.6}/data/emorynlp/process_database.py +0 -0
  56. {nkululeko-0.77.4 → nkululeko-0.77.6}/data/emov-db/process_database.py +0 -0
  57. {nkululeko-0.77.4 → nkululeko-0.77.6}/data/emovo/process_database.py +0 -0
  58. {nkululeko-0.77.4 → nkululeko-0.77.6}/data/emozionalmente/create.py +0 -0
  59. {nkululeko-0.77.4 → nkululeko-0.77.6}/data/enterface/process_database.py +0 -0
  60. {nkululeko-0.77.4 → nkululeko-0.77.6}/data/esd/process_database.py +0 -0
  61. {nkululeko-0.77.4 → nkululeko-0.77.6}/data/gerparas/process_database.py +0 -0
  62. {nkululeko-0.77.4 → nkululeko-0.77.6}/data/iemocap/process_database.py +0 -0
  63. {nkululeko-0.77.4 → nkululeko-0.77.6}/data/jl/process_database.py +0 -0
  64. {nkululeko-0.77.4 → nkululeko-0.77.6}/data/jtes/process_database.py +0 -0
  65. {nkululeko-0.77.4 → nkululeko-0.77.6}/data/meld/process_database.py +0 -0
  66. {nkululeko-0.77.4 → nkululeko-0.77.6}/data/mesd/process_database.py +0 -0
  67. {nkululeko-0.77.4 → nkululeko-0.77.6}/data/mess/process_database.py +0 -0
  68. {nkululeko-0.77.4 → nkululeko-0.77.6}/data/mlendsnd/process_database.py +0 -0
  69. {nkululeko-0.77.4 → nkululeko-0.77.6}/data/msp-improv/process_database2.py +0 -0
  70. {nkululeko-0.77.4 → nkululeko-0.77.6}/data/msp-podcast/process_database.py +0 -0
  71. {nkululeko-0.77.4 → nkululeko-0.77.6}/data/oreau2/process_database.py +0 -0
  72. {nkululeko-0.77.4 → nkululeko-0.77.6}/data/portuguese/process_database.py +0 -0
  73. {nkululeko-0.77.4 → nkululeko-0.77.6}/data/ravdess/process_database.py +0 -0
  74. {nkululeko-0.77.4 → nkululeko-0.77.6}/data/ravdess/process_database_speaker.py +0 -0
  75. {nkululeko-0.77.4 → nkululeko-0.77.6}/data/savee/process_database.py +0 -0
  76. {nkululeko-0.77.4 → nkululeko-0.77.6}/data/shemo/process_database.py +0 -0
  77. {nkululeko-0.77.4 → nkululeko-0.77.6}/data/subesco/process_database.py +0 -0
  78. {nkululeko-0.77.4 → nkululeko-0.77.6}/data/tess/process_database.py +0 -0
  79. {nkululeko-0.77.4 → nkululeko-0.77.6}/data/thorsten-emotional/process_database.py +0 -0
  80. {nkululeko-0.77.4 → nkululeko-0.77.6}/data/urdu/process_database.py +0 -0
  81. {nkululeko-0.77.4 → nkululeko-0.77.6}/data/vivae/process_database.py +0 -0
  82. {nkululeko-0.77.4 → nkululeko-0.77.6}/docs/source/conf.py +0 -0
  83. {nkululeko-0.77.4 → nkululeko-0.77.6}/meta/demos/demo_best_model.py +0 -0
  84. {nkululeko-0.77.4 → nkululeko-0.77.6}/meta/demos/multiple_exeriments/do_experiments.py +0 -0
  85. {nkululeko-0.77.4 → nkululeko-0.77.6}/meta/demos/multiple_exeriments/parse_nkulu.py +0 -0
  86. {nkululeko-0.77.4 → nkululeko-0.77.6}/meta/demos/my_experiment.py +0 -0
  87. {nkululeko-0.77.4 → nkululeko-0.77.6}/meta/demos/my_experiment_local.py +0 -0
  88. {nkululeko-0.77.4 → nkululeko-0.77.6}/meta/demos/plot_faster_anim.py +0 -0
  89. {nkululeko-0.77.4 → nkululeko-0.77.6}/nkululeko/__init__.py +0 -0
  90. {nkululeko-0.77.4 → nkululeko-0.77.6}/nkululeko/augment.py +0 -0
  91. {nkululeko-0.77.4 → nkululeko-0.77.6}/nkululeko/augmenting/__init__.py +0 -0
  92. {nkululeko-0.77.4 → nkululeko-0.77.6}/nkululeko/augmenting/randomsplicing.py +0 -0
  93. {nkululeko-0.77.4 → nkululeko-0.77.6}/nkululeko/augmenting/resampler.py +0 -0
  94. {nkululeko-0.77.4 → nkululeko-0.77.6}/nkululeko/autopredict/__init__.py +0 -0
  95. {nkululeko-0.77.4 → nkululeko-0.77.6}/nkululeko/autopredict/ap_age.py +0 -0
  96. {nkululeko-0.77.4 → nkululeko-0.77.6}/nkululeko/autopredict/ap_arousal.py +0 -0
  97. {nkululeko-0.77.4 → nkululeko-0.77.6}/nkululeko/autopredict/ap_dominance.py +0 -0
  98. {nkululeko-0.77.4 → nkululeko-0.77.6}/nkululeko/autopredict/ap_gender.py +0 -0
  99. {nkululeko-0.77.4 → nkululeko-0.77.6}/nkululeko/autopredict/ap_mos.py +0 -0
  100. {nkululeko-0.77.4 → nkululeko-0.77.6}/nkululeko/autopredict/ap_pesq.py +0 -0
  101. {nkululeko-0.77.4 → nkululeko-0.77.6}/nkululeko/autopredict/ap_sdr.py +0 -0
  102. {nkululeko-0.77.4 → nkululeko-0.77.6}/nkululeko/autopredict/ap_snr.py +0 -0
  103. {nkululeko-0.77.4 → nkululeko-0.77.6}/nkululeko/autopredict/ap_stoi.py +0 -0
  104. {nkululeko-0.77.4 → nkululeko-0.77.6}/nkululeko/autopredict/ap_valence.py +0 -0
  105. {nkululeko-0.77.4 → nkululeko-0.77.6}/nkululeko/autopredict/estimate_snr.py +0 -0
  106. {nkululeko-0.77.4 → nkululeko-0.77.6}/nkululeko/cacheddataset.py +0 -0
  107. {nkululeko-0.77.4 → nkululeko-0.77.6}/nkululeko/data/__init__.py +0 -0
  108. {nkululeko-0.77.4 → nkululeko-0.77.6}/nkululeko/data/dataset.py +0 -0
  109. {nkululeko-0.77.4 → nkululeko-0.77.6}/nkululeko/data/dataset_csv.py +0 -0
  110. {nkululeko-0.77.4 → nkululeko-0.77.6}/nkululeko/demo.py +0 -0
  111. {nkululeko-0.77.4 → nkululeko-0.77.6}/nkululeko/demo_predictor.py +0 -0
  112. {nkululeko-0.77.4 → nkululeko-0.77.6}/nkululeko/explore.py +0 -0
  113. {nkululeko-0.77.4 → nkululeko-0.77.6}/nkululeko/export.py +0 -0
  114. {nkululeko-0.77.4 → nkululeko-0.77.6}/nkululeko/feat_extract/__init__.py +0 -0
  115. {nkululeko-0.77.4 → nkululeko-0.77.6}/nkululeko/feat_extract/feats_agender.py +0 -0
  116. {nkululeko-0.77.4 → nkululeko-0.77.6}/nkululeko/feat_extract/feats_agender_agender.py +0 -0
  117. {nkululeko-0.77.4 → nkululeko-0.77.6}/nkululeko/feat_extract/feats_audmodel.py +0 -0
  118. {nkululeko-0.77.4 → nkululeko-0.77.6}/nkululeko/feat_extract/feats_audmodel_dim.py +0 -0
  119. {nkululeko-0.77.4 → nkululeko-0.77.6}/nkululeko/feat_extract/feats_clap.py +0 -0
  120. {nkululeko-0.77.4 → nkululeko-0.77.6}/nkululeko/feat_extract/feats_hubert.py +0 -0
  121. {nkululeko-0.77.4 → nkululeko-0.77.6}/nkululeko/feat_extract/feats_import.py +0 -0
  122. {nkululeko-0.77.4 → nkululeko-0.77.6}/nkululeko/feat_extract/feats_mld.py +0 -0
  123. {nkululeko-0.77.4 → nkululeko-0.77.6}/nkululeko/feat_extract/feats_mos.py +0 -0
  124. {nkululeko-0.77.4 → nkululeko-0.77.6}/nkululeko/feat_extract/feats_opensmile.py +0 -0
  125. {nkululeko-0.77.4 → nkululeko-0.77.6}/nkululeko/feat_extract/feats_oxbow.py +0 -0
  126. {nkululeko-0.77.4 → nkululeko-0.77.6}/nkululeko/feat_extract/feats_praat.py +0 -0
  127. {nkululeko-0.77.4 → nkululeko-0.77.6}/nkululeko/feat_extract/feats_snr.py +0 -0
  128. {nkululeko-0.77.4 → nkululeko-0.77.6}/nkululeko/feat_extract/feats_spectra.py +0 -0
  129. {nkululeko-0.77.4 → nkululeko-0.77.6}/nkululeko/feat_extract/feats_spkrec.py +0 -0
  130. {nkululeko-0.77.4 → nkululeko-0.77.6}/nkululeko/feat_extract/feats_squim.py +0 -0
  131. {nkululeko-0.77.4 → nkululeko-0.77.6}/nkululeko/feat_extract/feats_trill.py +0 -0
  132. {nkululeko-0.77.4 → nkululeko-0.77.6}/nkululeko/feat_extract/feats_wav2vec2.py +0 -0
  133. {nkululeko-0.77.4 → nkululeko-0.77.6}/nkululeko/feat_extract/feats_wavlm.py +0 -0
  134. {nkululeko-0.77.4 → nkululeko-0.77.6}/nkululeko/feat_extract/featureset.py +0 -0
  135. {nkululeko-0.77.4 → nkululeko-0.77.6}/nkululeko/feat_extract/feinberg_praat.py +0 -0
  136. {nkululeko-0.77.4 → nkululeko-0.77.6}/nkululeko/feature_extractor.py +0 -0
  137. {nkululeko-0.77.4 → nkululeko-0.77.6}/nkululeko/file_checker.py +0 -0
  138. {nkululeko-0.77.4 → nkululeko-0.77.6}/nkululeko/filter_data.py +0 -0
  139. {nkululeko-0.77.4 → nkululeko-0.77.6}/nkululeko/glob_conf.py +0 -0
  140. {nkululeko-0.77.4 → nkululeko-0.77.6}/nkululeko/losses/__init__.py +0 -0
  141. {nkululeko-0.77.4 → nkululeko-0.77.6}/nkululeko/losses/loss_ccc.py +0 -0
  142. {nkululeko-0.77.4 → nkululeko-0.77.6}/nkululeko/losses/loss_softf1loss.py +0 -0
  143. {nkululeko-0.77.4 → nkululeko-0.77.6}/nkululeko/modelrunner.py +0 -0
  144. {nkululeko-0.77.4 → nkululeko-0.77.6}/nkululeko/models/__init__.py +0 -0
  145. {nkululeko-0.77.4 → nkululeko-0.77.6}/nkululeko/models/model_bayes.py +0 -0
  146. {nkululeko-0.77.4 → nkululeko-0.77.6}/nkululeko/models/model_gmm.py +0 -0
  147. {nkululeko-0.77.4 → nkululeko-0.77.6}/nkululeko/models/model_knn.py +0 -0
  148. {nkululeko-0.77.4 → nkululeko-0.77.6}/nkululeko/models/model_knn_reg.py +0 -0
  149. {nkululeko-0.77.4 → nkululeko-0.77.6}/nkululeko/models/model_lin_reg.py +0 -0
  150. {nkululeko-0.77.4 → nkululeko-0.77.6}/nkululeko/models/model_mlp_regression.py +0 -0
  151. {nkululeko-0.77.4 → nkululeko-0.77.6}/nkululeko/models/model_svm.py +0 -0
  152. {nkululeko-0.77.4 → nkululeko-0.77.6}/nkululeko/models/model_svr.py +0 -0
  153. {nkululeko-0.77.4 → nkululeko-0.77.6}/nkululeko/models/model_tree.py +0 -0
  154. {nkululeko-0.77.4 → nkululeko-0.77.6}/nkululeko/models/model_tree_reg.py +0 -0
  155. {nkululeko-0.77.4 → nkululeko-0.77.6}/nkululeko/models/model_xgb.py +0 -0
  156. {nkululeko-0.77.4 → nkululeko-0.77.6}/nkululeko/models/model_xgr.py +0 -0
  157. {nkululeko-0.77.4 → nkululeko-0.77.6}/nkululeko/predict.py +0 -0
  158. {nkululeko-0.77.4 → nkululeko-0.77.6}/nkululeko/reporter.py +0 -0
  159. {nkululeko-0.77.4 → nkululeko-0.77.6}/nkululeko/reporting/__init__.py +0 -0
  160. {nkululeko-0.77.4 → nkululeko-0.77.6}/nkululeko/reporting/defines.py +0 -0
  161. {nkululeko-0.77.4 → nkululeko-0.77.6}/nkululeko/reporting/latex_writer.py +0 -0
  162. {nkululeko-0.77.4 → nkululeko-0.77.6}/nkululeko/reporting/report.py +0 -0
  163. {nkululeko-0.77.4 → nkululeko-0.77.6}/nkululeko/reporting/report_item.py +0 -0
  164. {nkululeko-0.77.4 → nkululeko-0.77.6}/nkululeko/resample.py +0 -0
  165. {nkululeko-0.77.4 → nkululeko-0.77.6}/nkululeko/result.py +0 -0
  166. {nkululeko-0.77.4 → nkululeko-0.77.6}/nkululeko/runmanager.py +0 -0
  167. {nkululeko-0.77.4 → nkululeko-0.77.6}/nkululeko/scaler.py +0 -0
  168. {nkululeko-0.77.4 → nkululeko-0.77.6}/nkululeko/segment.py +0 -0
  169. {nkululeko-0.77.4 → nkululeko-0.77.6}/nkululeko/segmenting/__init__.py +0 -0
  170. {nkululeko-0.77.4 → nkululeko-0.77.6}/nkululeko/segmenting/seg_inaspeechsegmenter.py +0 -0
  171. {nkululeko-0.77.4 → nkululeko-0.77.6}/nkululeko/segmenting/seg_silero.py +0 -0
  172. {nkululeko-0.77.4 → nkululeko-0.77.6}/nkululeko/syllable_nuclei.py +0 -0
  173. {nkululeko-0.77.4 → nkululeko-0.77.6}/nkululeko/test.py +0 -0
  174. {nkululeko-0.77.4 → nkululeko-0.77.6}/nkululeko/test_predictor.py +0 -0
  175. {nkululeko-0.77.4 → nkululeko-0.77.6}/nkululeko/utils/__init__.py +0 -0
  176. {nkululeko-0.77.4 → nkululeko-0.77.6}/nkululeko/utils/files.py +0 -0
  177. {nkululeko-0.77.4 → nkululeko-0.77.6}/nkululeko/utils/stats.py +0 -0
  178. {nkululeko-0.77.4 → nkululeko-0.77.6}/nkululeko.egg-info/dependency_links.txt +0 -0
  179. {nkululeko-0.77.4 → nkululeko-0.77.6}/nkululeko.egg-info/top_level.txt +0 -0
  180. {nkululeko-0.77.4 → nkululeko-0.77.6}/pyproject.toml +0 -0
  181. {nkululeko-0.77.4 → nkululeko-0.77.6}/setup.py +0 -0
@@ -1,6 +1,14 @@
1
1
  Changelog
2
2
  =========
3
3
 
4
+ Version 0.77.6
5
+ --------------
6
+ * added functions to call modules with config file path directly
7
+
8
+ Version 0.77.5
9
+ --------------
10
+ * fixed augmentation bug for python version 10
11
+
4
12
  Version 0.77.4
5
13
  --------------
6
14
  * made traditional augmentations (audiomentation module) configurable
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: nkululeko
3
- Version: 0.77.4
3
+ Version: 0.77.6
4
4
  Summary: Machine learning audio prediction experiments based on templates
5
5
  Home-page: https://github.com/felixbur/nkululeko
6
6
  Author: Felix Burkhardt
@@ -19,6 +19,7 @@ Requires-Dist: audinterface
19
19
  Requires-Dist: audiofile
20
20
  Requires-Dist: audiomentations
21
21
  Requires-Dist: audonnx
22
+ Requires-Dist: cylimiter
22
23
  Requires-Dist: datasets
23
24
  Requires-Dist: imageio
24
25
  Requires-Dist: imbalanced-learn
@@ -189,6 +190,7 @@ Here is an overview of the interfaces:
189
190
  * **nkululeko.test**: predict a series of files with the current best model
190
191
  * **nkululeko.explore**: perform data exploration
191
192
  * **nkululeko.augment**: augment the current training data
193
+ * **nkululeko.aug_train**: augment the current training data and do a training including this data
192
194
  * **nkululeko.predict**: predict features like SNR, MOS, arousal/valence, age/gender, with DNN models
193
195
  * **nkululeko.segment**: segment a database based on VAD (voice activity detection)
194
196
  * **nkululeko.resample**: check on all sampling rates and change to 16kHz
@@ -310,6 +312,14 @@ F. Burkhardt, Johannes Wagner, Hagen Wierstorf, Florian Eyben and Björn Schulle
310
312
  Changelog
311
313
  =========
312
314
 
315
+ Version 0.77.6
316
+ --------------
317
+ * added functions to call modules with config file path directly
318
+
319
+ Version 0.77.5
320
+ --------------
321
+ * fixed augmentation bug for python version 10
322
+
313
323
  Version 0.77.4
314
324
  --------------
315
325
  * made traditional augmentations (audiomentation module) configurable
@@ -144,6 +144,7 @@ Here is an overview of the interfaces:
144
144
  * **nkululeko.test**: predict a series of files with the current best model
145
145
  * **nkululeko.explore**: perform data exploration
146
146
  * **nkululeko.augment**: augment the current training data
147
+ * **nkululeko.aug_train**: augment the current training data and do a training including this data
147
148
  * **nkululeko.predict**: predict features like SNR, MOS, arousal/valence, age/gender, with DNN models
148
149
  * **nkululeko.segment**: segment a database based on VAD (voice activity detection)
149
150
  * **nkululeko.resample**: check on all sampling rates and change to 16kHz
@@ -11,15 +11,7 @@ import nkululeko.glob_conf as glob_conf
11
11
  from nkululeko.augment import doit as augment
12
12
 
13
13
 
14
- def main(src_dir):
15
- parser = argparse.ArgumentParser(description="Call the nkululeko framework.")
16
- parser.add_argument("--config", default="exp.ini", help="The base configuration")
17
- args = parser.parse_args()
18
- if args.config is not None:
19
- config_file = args.config
20
- else:
21
- config_file = f"{src_dir}/exp.ini"
22
-
14
+ def doit(config_file):
23
15
  # test if the configuration file exists
24
16
  if not os.path.isfile(config_file):
25
17
  print(f"ERROR: no such file: {config_file}")
@@ -87,6 +79,17 @@ def main(src_dir):
87
79
  print("DONE")
88
80
 
89
81
 
82
+ def main(src_dir):
83
+ parser = argparse.ArgumentParser(description="Call the nkululeko framework.")
84
+ parser.add_argument("--config", default="exp.ini", help="The base configuration")
85
+ args = parser.parse_args()
86
+ if args.config is not None:
87
+ config_file = args.config
88
+ else:
89
+ config_file = f"{src_dir}/exp.ini"
90
+ doit(config_file)
91
+
92
+
90
93
  if __name__ == "__main__":
91
94
  cwd = os.path.dirname(os.path.abspath(__file__))
92
95
  main(cwd) # use this if you want to state the config file path on command line
@@ -60,7 +60,15 @@ class Augmenter:
60
60
  audiofile.write(new_full_name, signal=sig_aug, sampling_rate=sr)
61
61
  index_map[f] = new_full_name
62
62
  df_ret = self.df.copy()
63
- file_index = df_ret.index.levels[0].map(lambda x: index_map[x]).values
64
- df_ret = df_ret.set_index(df_ret.index.set_levels(file_index, level="file"))
63
+
64
+ file_index = df_ret.index.to_series().map(lambda x: index_map[x[0]]).values
65
+ # workaround because i just couldn't get this easier...
66
+ arrays = [
67
+ file_index,
68
+ list(df_ret.index.get_level_values(1)),
69
+ list(df_ret.index.get_level_values(2)),
70
+ ]
71
+ new_index = pd.MultiIndex.from_arrays(arrays, names=("file", "start", "end"))
72
+ df_ret = df_ret.set_index(new_index)
65
73
 
66
74
  return df_ret
@@ -68,6 +68,15 @@ class Randomsplicer:
68
68
  index_map[f] = new_full_name
69
69
 
70
70
  df_ret = self.df.copy()
71
- file_index = df_ret.index.levels[0].map(lambda x: index_map[x]).values
72
- df_ret = df_ret.set_index(df_ret.index.set_levels(file_index, level="file"))
71
+
72
+ file_index = df_ret.index.to_series().map(lambda x: index_map[x[0]]).values
73
+ # workaround because i just couldn't get this easier...
74
+ arrays = [
75
+ file_index,
76
+ list(df_ret.index.get_level_values(1)),
77
+ list(df_ret.index.get_level_values(2)),
78
+ ]
79
+ new_index = pd.MultiIndex.from_arrays(arrays, names=("file", "start", "end"))
80
+ df_ret = df_ret.set_index(new_index)
81
+
73
82
  return df_ret
@@ -1,2 +1,2 @@
1
- VERSION="0.77.4"
1
+ VERSION="0.77.6"
2
2
  SAMPLING_RATE = 16000
@@ -261,11 +261,11 @@ class Experiment:
261
261
  if type(test_cats) == np.ndarray:
262
262
  self.util.debug(f"Categories test (nd.array): {test_cats}")
263
263
  else:
264
- self.util.debug(f"Categories test (list): {test_cats.to_list()}")
264
+ self.util.debug(f"Categories test (list): {list(test_cats)}")
265
265
  if type(train_cats) == np.ndarray:
266
266
  self.util.debug(f"Categories train (nd.array): {train_cats}")
267
267
  else:
268
- self.util.debug(f"Categories train (list): {train_cats.to_list()}")
268
+ self.util.debug(f"Categories train (list): {list(train_cats)}")
269
269
 
270
270
  # encode the labels as numbers
271
271
  self.label_encoder = LabelEncoder()
@@ -7,7 +7,6 @@ from sklearn.tree import DecisionTreeClassifier
7
7
  from sklearn.linear_model import LinearRegression
8
8
  from sklearn.tree import DecisionTreeRegressor
9
9
  import matplotlib.pyplot as plt
10
- from xgboost import XGBClassifier, XGBRegressor
11
10
  from nkululeko.utils.util import Util
12
11
  from nkululeko.utils.stats import normalize
13
12
  from nkululeko.plots import Plots
@@ -126,6 +125,8 @@ class FeatureAnalyser:
126
125
  plots = Plots()
127
126
  plots.plot_tree(model, self.features)
128
127
  elif model_s == "xgb":
128
+ from xgboost import XGBClassifier
129
+
129
130
  model = XGBClassifier(enable_categorical=True, tree_method="hist")
130
131
  self.labels = self.labels.astype("category")
131
132
  result_importances[model_s] = self._get_importance(
@@ -171,6 +172,8 @@ class FeatureAnalyser:
171
172
  model, permutation
172
173
  )
173
174
  elif model_s == "xgr":
175
+ from xgboost import XGBClassifier
176
+
174
177
  model = XGBRegressor()
175
178
  result_importances[model_s] = self._get_importance(
176
179
  model, permutation
@@ -137,11 +137,11 @@ class Model:
137
137
  groups=annos["fold"],
138
138
  ):
139
139
  train_x = feats.iloc[train_index].to_numpy()
140
- train_y = targets[train_index]
140
+ train_y = targets.iloc[train_index]
141
141
  self.clf.fit(train_x, train_y)
142
142
 
143
143
  truth_x = feats.iloc[test_index].to_numpy()
144
- truth_y = targets[test_index]
144
+ truth_y = targets.iloc[test_index]
145
145
  predict_y = self.clf.predict(truth_x)
146
146
  report = Reporter(truth_y.astype(float), predict_y, self.run, self.epoch)
147
147
  result = report.get_result().get_test_result()
@@ -113,7 +113,7 @@ class CNN_model(Model):
113
113
  img_path = self.df_feats.iloc[idx, 0]
114
114
  image = Image.open(img_path)
115
115
  # Get emotion label
116
- label = self.df_labels[self.target][idx]
116
+ label = self.df_labels[self.target].iloc[idx]
117
117
  if self.transform:
118
118
  image = self.transform(image)
119
119
  return image, label
@@ -115,7 +115,7 @@ class MLP_model(Model):
115
115
  def get_loader(self, df_x, df_y, shuffle):
116
116
  data = []
117
117
  for i in range(len(df_x)):
118
- data.append([df_x.values[i], df_y[self.target][i]])
118
+ data.append([df_x.values[i], df_y[self.target].iloc[i]])
119
119
  return torch.utils.data.DataLoader(
120
120
  data, shuffle=shuffle, batch_size=self.batch_size
121
121
  )
@@ -9,15 +9,7 @@ from nkululeko.utils.util import Util
9
9
  from nkululeko.constants import VERSION
10
10
 
11
11
 
12
- def main(src_dir):
13
- parser = argparse.ArgumentParser(description="Call the nkululeko framework.")
14
- parser.add_argument("--config", default="exp.ini", help="The base configuration")
15
- args = parser.parse_args()
16
- if args.config is not None:
17
- config_file = args.config
18
- else:
19
- config_file = f"{src_dir}/exp.ini"
20
-
12
+ def doit(config_file):
21
13
  # test if the configuration file exists
22
14
  if not os.path.isfile(config_file):
23
15
  print(f"ERROR: no such file: {config_file}")
@@ -54,11 +46,22 @@ def main(src_dir):
54
46
  expr.init_runmanager()
55
47
 
56
48
  # run the experiment
57
- expr.run()
58
-
49
+ reports = expr.run()
50
+ result = reports[-1].result.test
59
51
  expr.store_report()
60
-
61
52
  print("DONE")
53
+ return result
54
+
55
+
56
+ def main(src_dir):
57
+ parser = argparse.ArgumentParser(description="Call the nkululeko framework.")
58
+ parser.add_argument("--config", default="exp.ini", help="The base configuration")
59
+ args = parser.parse_args()
60
+ if args.config is not None:
61
+ config_file = args.config
62
+ else:
63
+ config_file = f"{src_dir}/exp.ini"
64
+ doit(config_file)
62
65
 
63
66
 
64
67
  if __name__ == "__main__":
@@ -279,7 +279,7 @@ class Plots:
279
279
  res_pval = int(res_pval[1] * 1000) / 1000
280
280
  caption = f"{ylab} {df.shape[0]}. P-val chi2: {res_pval}"
281
281
  ax = (
282
- df.groupby(col1)[col2]
282
+ df.groupby(col1, observed=False)[col2]
283
283
  .value_counts()
284
284
  .unstack()
285
285
  .plot(kind="bar", stacked=True, title=caption, rot=0)
@@ -11,9 +11,24 @@ import audformat
11
11
 
12
12
  class Util:
13
13
  # a list of words that need not to be warned upon if default values are used
14
- stopvals = [False, "False", "classification", "png", "audio_path"]
14
+ stopvals = [
15
+ "all",
16
+ False,
17
+ "False",
18
+ "classification",
19
+ "png",
20
+ "audio_path",
21
+ "kde",
22
+ "pkl",
23
+ "eGeMAPSv02",
24
+ "functionals",
25
+ ]
15
26
 
16
27
  def __init__(self, caller=None, has_config=True):
28
+ if caller is not None:
29
+ self.caller = caller
30
+ else:
31
+ self.caller = ""
17
32
  if has_config:
18
33
  import nkululeko.glob_conf as glob_conf
19
34
 
@@ -25,10 +40,7 @@ class Util:
25
40
  self.error(f"no such file: {self.got_data_roots}")
26
41
  self.data_roots = configparser.ConfigParser()
27
42
  self.data_roots.read(self.got_data_roots)
28
- if caller is not None:
29
- self.caller = caller
30
- else:
31
- self.caller = ""
43
+ self.debug(f"getting data roots from {self.got_data_roots}")
32
44
 
33
45
  def get_path(self, entry):
34
46
  """
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: nkululeko
3
- Version: 0.77.4
3
+ Version: 0.77.6
4
4
  Summary: Machine learning audio prediction experiments based on templates
5
5
  Home-page: https://github.com/felixbur/nkululeko
6
6
  Author: Felix Burkhardt
@@ -19,6 +19,7 @@ Requires-Dist: audinterface
19
19
  Requires-Dist: audiofile
20
20
  Requires-Dist: audiomentations
21
21
  Requires-Dist: audonnx
22
+ Requires-Dist: cylimiter
22
23
  Requires-Dist: datasets
23
24
  Requires-Dist: imageio
24
25
  Requires-Dist: imbalanced-learn
@@ -189,6 +190,7 @@ Here is an overview of the interfaces:
189
190
  * **nkululeko.test**: predict a series of files with the current best model
190
191
  * **nkululeko.explore**: perform data exploration
191
192
  * **nkululeko.augment**: augment the current training data
193
+ * **nkululeko.aug_train**: augment the current training data and do a training including this data
192
194
  * **nkululeko.predict**: predict features like SNR, MOS, arousal/valence, age/gender, with DNN models
193
195
  * **nkululeko.segment**: segment a database based on VAD (voice activity detection)
194
196
  * **nkululeko.resample**: check on all sampling rates and change to 16kHz
@@ -310,6 +312,14 @@ F. Burkhardt, Johannes Wagner, Hagen Wierstorf, Florian Eyben and Björn Schulle
310
312
  Changelog
311
313
  =========
312
314
 
315
+ Version 0.77.6
316
+ --------------
317
+ * added functions to call modules with config file path directly
318
+
319
+ Version 0.77.5
320
+ --------------
321
+ * fixed augmentation bug for python version 10
322
+
313
323
  Version 0.77.4
314
324
  --------------
315
325
  * made traditional augmentations (audiomentation module) configurable
@@ -160,21 +160,4 @@ nkululeko/utils/__init__.py
160
160
  nkululeko/utils/files.py
161
161
  nkululeko/utils/stats.py
162
162
  nkululeko/utils/util.py
163
- venv/bin/activate_this.py
164
- venv/bin/ina_speech_segmenter.py
165
- venv/bin/ina_speech_segmenter_pyro_client.py
166
- venv/bin/ina_speech_segmenter_pyro_client_setjobs.py
167
- venv/bin/ina_speech_segmenter_pyro_server.py
168
- venv/bin/pyannote_hmm.py
169
- venv/bin/rst2html.py
170
- venv/bin/rst2html4.py
171
- venv/bin/rst2html5.py
172
- venv/bin/rst2latex.py
173
- venv/bin/rst2man.py
174
- venv/bin/rst2odt.py
175
- venv/bin/rst2odt_prepstyles.py
176
- venv/bin/rst2pseudoxml.py
177
- venv/bin/rst2s5.py
178
- venv/bin/rst2xetex.py
179
- venv/bin/rst2xml.py
180
- venv/bin/rstpep2html.py
163
+ venv/bin/activate_this.py
@@ -4,6 +4,7 @@ audinterface
4
4
  audiofile
5
5
  audiomentations
6
6
  audonnx
7
+ cylimiter
7
8
  datasets
8
9
  imageio
9
10
  imbalanced-learn
@@ -23,6 +23,7 @@ install_requires =
23
23
  audiofile
24
24
  audiomentations
25
25
  audonnx
26
+ cylimiter
26
27
  datasets
27
28
  imageio
28
29
  imbalanced-learn
@@ -23,7 +23,7 @@ os.environ["VIRTUAL_ENV"] = base # virtual env is right above bin directory
23
23
 
24
24
  # add the virtual environments libraries to the host python import mechanism
25
25
  prev_length = len(sys.path)
26
- for lib in "../lib/python3.8/site-packages".split(os.pathsep):
26
+ for lib in "../lib/python3.10/site-packages".split(os.pathsep):
27
27
  path = os.path.realpath(os.path.join(bin_dir, lib))
28
28
  site.addsitedir(path.decode("utf-8") if "" else path)
29
29
  sys.path[:] = sys.path[prev_length:] + sys.path[0:prev_length]
@@ -1,81 +0,0 @@
1
- #!/home/audeering.local/fburkhardt/research/nkululeko/venv/bin/python
2
- # encoding: utf-8
3
-
4
- # The MIT License
5
-
6
- # Copyright (c) 2018 Ina (David Doukhan, Eliott Lechapt - http://www.ina.fr/)
7
-
8
- # Permission is hereby granted, free of charge, to any person obtaining a copy
9
- # of this software and associated documentation files (the "Software"), to deal
10
- # in the Software without restriction, including without limitation the rights
11
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12
- # copies of the Software, and to permit persons to whom the Software is
13
- # furnished to do so, subject to the following conditions:
14
-
15
- # The above copyright notice and this permission notice shall be included in
16
- # all copies or substantial portions of the Software.
17
-
18
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24
- # THE SOFTWARE.
25
-
26
- import argparse
27
- import glob
28
- import os
29
- import distutils.util
30
- import warnings
31
-
32
- # TODO
33
- # * allow to use external activity or speech music segmentations
34
- # * describe URL management in help and interference with glob
35
-
36
- description = """Do Speech/Music(/Noise) and Male/Female segmentation and store segmentations into CSV files. Segments labelled 'noEnergy' are discarded from music, noise, speech and gender analysis. 'speech', 'male' and 'female' labels include speech over music and speech over noise. 'music' and 'noise' labels are pure segments that are not supposed to contain speech.
37
- """
38
- epilog="""
39
- Detailled description of this framework is presented in the following study:
40
- Doukhan, D., Carrive, J., Vallet, F., Larcher, A., & Meignier, S. (2018, April). An open-source speaker gender detection framework for monitoring gender equality. In 2018 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP) (pp. 5214-5218). IEEE.
41
- """
42
-
43
-
44
- # Configure command line parsing
45
- parser = argparse.ArgumentParser(description=description, epilog=epilog)
46
- parser.add_argument('-i', '--input', nargs='+', help='Input media to analyse. May be a full path to a media (/home/david/test.mp3), a list of full paths (/home/david/test.mp3 /tmp/mymedia.avi), a regex input pattern ("/home/david/myaudiobooks/*.mp3"), an url with http protocol (http://url_of_the_file)', required=True)
47
- parser.add_argument('-o', '--output_directory', help='Directory used to store segmentations. Resulting segmentations have same base name as the corresponding input media, with csv extension. Ex: mymedia.MPG will result in mymedia.csv', required=True)
48
- parser.add_argument('-s', '--batch_size', type=int, default=32, help="(default: 32 - we recommend 1024). Size of batches to be sent to the GPU. Larger values allow faster processings, but require GPU with more memories. Default 32 size is fine even with a baseline laptop GPU.")
49
- parser.add_argument('-d', '--vad_engine', choices=['sm', 'smn'], default='smn', help="Voice activity detection (VAD) engine to be used (default: 'smn'). 'smn' split signal into 'speech', 'music' and 'noise' (better). 'sm' split signal into 'speech' and 'music' and do not take noise into account, which is either classified as music or speech. Results presented in ICASSP were obtained using 'sm' option")
50
- parser.add_argument('-g', '--detect_gender', choices = ['true', 'false'], default='True', help="(default: 'true'). If set to 'true', segments detected as speech will be splitted into 'male' and 'female' segments. If set to 'false', segments corresponding to speech will be labelled as 'speech' (faster)")
51
- parser.add_argument('-b', '--ffmpeg_binary', default='ffmpeg', help='Your custom binary of ffmpeg', required=False)
52
- parser.add_argument('-e', '--export_format', choices = ['csv', 'textgrid'], default='csv', help="(default: 'csv'). If set to 'csv', result will be exported in csv. If set to 'textgrid', results will be exported to praat Textgrid")
53
- parser.add_argument('-r', '--energy_ratio', default=0.03, type=float, help="(default: 0.03). Energetic threshold used to detect activity (percentage of mean energy of the signal)")
54
-
55
- args = parser.parse_args()
56
-
57
- # Preprocess arguments and check their consistency
58
- input_files = []
59
- for e in args.input:
60
- if e.startswith("http"):
61
- input_files += [e]
62
- else:
63
- input_files += glob.glob(e)
64
- assert len(input_files) > 0, 'No existing media selected for analysis! Bad values provided to -i (%s)' % args.input
65
-
66
- odir = args.output_directory.strip(" \t\n\r").rstrip('/')
67
- assert os.access(odir, os.W_OK), 'Directory %s is not writable!' % odir
68
-
69
- # Do processings
70
- from inaSpeechSegmenter import Segmenter, seg2csv
71
-
72
- # load neural network into memory, may last few seconds
73
- detect_gender = bool(distutils.util.strtobool(args.detect_gender))
74
- seg = Segmenter(vad_engine=args.vad_engine, detect_gender=detect_gender, ffmpeg=args.ffmpeg_binary, energy_ratio=args.energy_ratio, batch_size=args.batch_size)
75
-
76
- with warnings.catch_warnings():
77
- warnings.simplefilter("ignore")
78
- base = [os.path.splitext(os.path.basename(e))[0] for e in input_files]
79
- output_files = [os.path.join(odir, e + '.' + args.export_format) for e in base]
80
- seg.batch_process(input_files, output_files, verbose=True, output_format=args.export_format)
81
-
@@ -1,57 +0,0 @@
1
- #!/home/audeering.local/fburkhardt/research/nkululeko/venv/bin/python
2
- # encoding: utf-8
3
-
4
- # The MIT License
5
-
6
- # Copyright (c) 2018 Ina (David Doukhan - http://www.ina.fr/)
7
-
8
- # Permission is hereby granted, free of charge, to any person obtaining a copy
9
- # of this software and associated documentation files (the "Software"), to deal
10
- # in the Software without restriction, including without limitation the rights
11
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12
- # copies of the Software, and to permit persons to whom the Software is
13
- # furnished to do so, subject to the following conditions:
14
-
15
- # The above copyright notice and this permission notice shall be included in
16
- # all copies or substantial portions of the Software.
17
-
18
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24
- # THE SOFTWARE.
25
-
26
-
27
- import Pyro4
28
- import sys
29
- import os
30
- import socket
31
-
32
- from inaSpeechSegmenter import Segmenter
33
-
34
-
35
- if __name__ == '__main__':
36
- dname = os.path.dirname(os.path.realpath(__file__))
37
-
38
- hostname = socket.gethostname()
39
-
40
- uri = sys.argv[1]
41
- jobserver = Pyro4.Proxy(uri)
42
-
43
- ret = -1
44
- outname = 'init'
45
-
46
- # batch size set at 1024. Use lower values with small gpus
47
- g = Segmenter(batch_size=1024)
48
-
49
- while True:
50
- lsrc, ldst = jobserver.get_njobs('%s %s' % (hostname, ret))
51
-
52
- print(lsrc, ldst)
53
- if len(lsrc) == 0:
54
- print('job list finished')
55
- break
56
-
57
- ret = g.batch_process(lsrc, ldst, skipifexist=True, nbtry=3)
@@ -1,37 +0,0 @@
1
- #!/home/audeering.local/fburkhardt/research/nkululeko/venv/bin/python
2
- # encoding: utf-8
3
-
4
- # The MIT License
5
-
6
- # Copyright (c) 2018 Ina (David Doukhan - http://www.ina.fr/)
7
-
8
- # Permission is hereby granted, free of charge, to any person obtaining a copy
9
- # of this software and associated documentation files (the "Software"), to deal
10
- # in the Software without restriction, including without limitation the rights
11
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12
- # copies of the Software, and to permit persons to whom the Software is
13
- # furnished to do so, subject to the following conditions:
14
-
15
- # The above copyright notice and this permission notice shall be included in
16
- # all copies or substantial portions of the Software.
17
-
18
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24
- # THE SOFTWARE.
25
-
26
-
27
- import Pyro4
28
- import sys
29
-
30
- if __name__ == '__main__':
31
- uri = sys.argv[1]
32
- csvfname = sys.argv[2]
33
-
34
- jobserver = Pyro4.Proxy(uri)
35
-
36
- ret = jobserver.set_jobs(csvfname)
37
- print(ret)
@@ -1,76 +0,0 @@
1
- #!/home/audeering.local/fburkhardt/research/nkululeko/venv/bin/python
2
- # encoding: utf-8
3
-
4
- # The MIT License
5
-
6
- # Copyright (c) 2018 Ina (David Doukhan - http://www.ina.fr/)
7
-
8
- # Permission is hereby granted, free of charge, to any person obtaining a copy
9
- # of this software and associated documentation files (the "Software"), to deal
10
- # in the Software without restriction, including without limitation the rights
11
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12
- # copies of the Software, and to permit persons to whom the Software is
13
- # furnished to do so, subject to the following conditions:
14
-
15
- # The above copyright notice and this permission notice shall be included in
16
- # all copies or substantial portions of the Software.
17
-
18
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24
- # THE SOFTWARE.
25
-
26
- import sys
27
- import Pyro4
28
- import numpy as np
29
- import pandas as pd
30
-
31
-
32
- @Pyro4.expose
33
- class GenderJobServer(object):
34
- def __init__(self, csvjobs):
35
- self.set_jobs(csvjobs)
36
-
37
- def set_jobs(self, csvjobs):
38
- # csv configuration file with 2 columns: source_path, dest_path
39
- df = pd.read_csv(csvjobs)
40
- df.source_path = df.source_path.str.strip()
41
- df.dest_path = df.dest_path.str.strip()
42
- df = df.drop_duplicates().sample(frac=1).reset_index(drop=True)
43
- print('setting jobs')
44
- print('random source & dest path:', df.source_path[0], ' ',df.dest_path[0])
45
- print('number of files to process:', len(df))
46
- self.lsource = list(df.source_path)
47
- self.ldest = list(df.dest_path)
48
- self.i = 0
49
- return '%s jobs have been set' % csvjobs
50
-
51
- def get_job(self, msg):
52
- print('job %d: %s' % (self.i, msg))
53
- self.i += 1
54
- return (self.lsource.pop(0), self.ldest.pop(0))
55
-
56
- def get_njobs(self, msg, nbjobs=20):
57
- print('jobs %d-%d: %s' % (self.i, self.i + nbjobs, msg))
58
- ret = (self.lsource[:nbjobs], self.ldest[:nbjobs])
59
- if len(ret[0]) == 0:
60
- print('All jobs dispatched')
61
- self.lsource = self.lsource[nbjobs:]
62
- self.ldest = self.ldest[nbjobs:]
63
- self.i += nbjobs
64
- return ret
65
-
66
-
67
-
68
- if __name__ == '__main__':
69
- # full name of the host to be used by remote clients
70
- Pyro4.config.HOST = sys.argv[1]
71
-
72
- daemon = Pyro4.Daemon() # make a Pyro daemon\n",
73
- uri = daemon.register(GenderJobServer(sys.argv[2])) # register the greeting maker as a Pyro object\n",
74
- print("Ready. Object uri =", uri)
75
- daemon.requestLoop()
76
-