Skip to content
Snippets Groups Projects

Harmonizing algorithms from bob.pad.face and bob.pad.voice, fixes issue#16

Merged Pavel KORSHUNOV requested to merge harmonize_algorithms into master
4 unresolved threads

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
23 """
24
25 feature_vectors = []
26
27 frame_dictionary = {}
28
29 for frame in frame_container:
30 frame_dictionary[frame[0]] = frame[1]
31
32 for idx, _ in enumerate(frame_container):
33 # Frames are stored in a mixed order, therefore we get them using incrementing frame index:
34 feature_vectors.append(frame_dictionary[str(idx)])
35
36 features_array = np.vstack(feature_vectors)
37
38 return features_array
  • 82
    83 ``features_array`` : 2D :py:class:`numpy.ndarray`
    84 An array containing features for all frames of all individuals.
    85 """
    86
    87 feature_vectors = []
    88
    89 for frame_container in frame_containers:
    90 video_features_array = self.convert_frame_cont_to_array(
    91 frame_container)
    92
    93 feature_vectors.append(video_features_array)
    94
    95 features_array = np.vstack(feature_vectors)
    96
    97 return features_array
  • 583
    584 data = [np.copy(real)] # only real class used for training
    585
    586 # free the memory of unnecessary data
    587 del real
    588 del attack
    589
    590 machine = trainer.train(data) # train the machine
    591
    592 if mean_std_norm_flag:
    593 machine.input_subtract = features_mean # subtract the mean of train data
    594 machine.input_divide = features_std # divide by std of train data
    595
    596 del data
    597
    598 return machine
  • 210 for further details. Each frame container contains one feature vector.
    211 """
    212
    213 frame_container_list = []
    214
    215 for idx, vec in enumerate(data):
    216
    217 frame_container = bob.bio.video.FrameContainer(
    218 ) # initialize the FrameContainer
    219
    220 frame_container.add(0, vec)
    221
    222 frame_container_list.append(
    223 frame_container) # add current frame to FrameContainer
    224
    225 return frame_container_list
  • @amohammadi Baby steps. For now, I just copied stuff from bob.pad.face and at least moved some of the obvious generic functions to utils, since there is a lot of copy/paste going on in bob.pad.face.

    Let me make it work first, then move the rest of the algorithms, then optimize.

    It takes some effort to clear up all this mess.

  • added 1 commit

    Compare with previous version

  • added 1 commit

    • 9fcb42b2 - Moved one class GMM from bob.pad.face

    Compare with previous version

  • added 1 commit

    • 28210018 - Moved LR algo from bob.pad.face

    Compare with previous version

  • added 1 commit

    • 6bb1384c - wrong name for scikit-learn package

    Compare with previous version

  • added 1 commit

    • 7dc1d670 - small correction of imports

    Compare with previous version

  • added 1 commit

    • 3d59656e - Moved SVM Cascade from bob.pad.face

    Compare with previous version

  • added 1 commit

    • 3a9170c9 - adding missing bob.learn.linear

    Compare with previous version

  • added 1 commit

    Compare with previous version

  • Pavel KORSHUNOV mentioned in commit 91857aa2

    mentioned in commit 91857aa2

  • Please register or sign in to reply
    Loading