Blame view

SpkDiarMonitor.h 2.9 KB
3f2992b2c   bostx   V1.0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
  #ifndef SPKDIARMONITOR_H
  #define SPKDIARMONITOR_H
  
  #include <QWidget>
  #include <QGroupBox>
  #include <QCheckBox>
  #include <QRadioButton>
  #include <QLabel>
  #include <QTextEdit>
  
  #include <armadillo>
  
  #include "UtteranceTreeWidget.h"
  
  class SpkDiarMonitor: public QWidget
  {
    Q_OBJECT
    
   public:
    SpkDiarMonitor(int treeWidth = 480, int treeHeight = 200, bool global = false, QWidget *parent = 0);
    void exportResults();
  
    public slots:
      void setDiarData(const arma::mat &E, const arma::mat &Sigma, const arma::mat &W);
      void setSpks(QList<int> spkIdx);
      void setSpeakers(QList<QString> speakers, QMap<QString, qreal> spkWeight);
      void getCurrentPattern(const QList<QPair<int, qreal>> &subFeatures);
      void getPatternFirstShot(const QList<QPair<int, qreal>> &subFeatures);
      void getPatternSecondShot(const QList<QPair<int, qreal>> &subFeatures);
      void activL2();
      void activMahal();
      void activSigmaInv();
      void activWInv();
      void normalizeVectors(bool checked);
      void activMin();
      void activMax();
      void activMean();
      void activWard();
      void activSilhouette();
      void activBipartition();
      void weightInstances(bool);
      void playSubtitle(QList<int> utter);
      void currentSubtitle(int subIdx);
      void constrainClustering(bool checked);
      void releasePosition(bool released);
      void setLocalDer(const QString &score);
      void setGlobalDer(const QString &score);
  
   signals:
      void updateUtteranceTree(const arma::mat &S, const arma::mat &W, const arma::umat &V, const arma::mat &SigmaInv);
      void updateUtteranceTreeShot1(const arma::mat &S, const arma::mat &W, const arma::umat &V, const arma::mat &SigmaInv);
      void updateUtteranceTreeShot2(const arma::mat &S, const arma::mat &W, const arma::umat &V, const arma::mat &SigmaInv);
      void clearUtteranceTree();
      void setDistance(UtteranceTree::DistType dist);
      void setCovInv(const arma::mat &SigmaInv);
      void normVectors(bool checked);
      void setAgrCrit(UtteranceTree::AgrCrit agr);
      void setPartitionMethod(UtteranceTree::PartMeth partMeth);
      void setWeight(const arma::mat &W);
      void playSub(QList<int> utter);
      void currSubtitle(int subIdx);
      void setDiff(const arma::mat &Diff);
      void setSpeakerPartition(QList<QList<int>> partition);
      void releasePos(bool released);
  
  private:
      QVector<QString> m_speakers;
      QMap<QString, qreal> m_spkWeight;
      QLabel *m_locDer;
      QLabel *m_globDer;
      QTextEdit *m_spks;
      QRadioButton *m_l2;
      QRadioButton *m_mahal;
      QGroupBox *m_covBox;
      QCheckBox *m_norm;
      UtteranceTreeWidget *m_utterTree;
      UtteranceTreeWidget *m_utterTreeShot1;
      UtteranceTreeWidget *m_utterTreeShot2;
      QCheckBox *m_weight;
      arma::mat E;
      arma::mat CovInv;
      arma::mat SigmaInv;
      arma::mat WInv;
      QList<QPair<int, qreal>> m_currSubFeatures;
      QList<QPair<int, qreal>> m_currSubFeaturesShot1;
      QList<QPair<int, qreal>> m_currSubFeaturesShot2;
  };
  
  #endif