Skip to content

Instantly share code, notes, and snippets.

View hbredin's full-sized avatar

Hervé BREDIN hbredin

View GitHub Profile
@hbredin
hbredin / gist:10251189
Created April 9, 2014 10:17
PyAnnote 101 > Create new annotation
from pyannote import Annotation, Segment
# uri (optional) uniform resource identifier
uri = 'GameOfThrones.Season01.Episode01'
# modality (optional)
modality = 'scene'
#
a = Annotation(uri=uri, modality=modality)
import simplejson as json
import itertools
LABELS = ['howard', 'leonard', 'non_speech',
'other', 'penny', 'raj', 'sheldon']
def loss(gold, pred, durations=None):
# convert '0' to 'howard', '1' to 'leonard', etc...
gold = [LABELS[int(k)] for k in gold]
pred = [LABELS[int(k)] for k in pred]
@hbredin
hbredin / load.json
Created November 10, 2015 08:26
TVD
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {
"collapsed": false
},
"outputs": [
{
@hbredin
hbredin / todo.md
Last active February 16, 2016 09:31
MediaEval Person Discovery 2016

Dataset

  • Collection
  • Re-encoding
  • Usage agreement
  • Distribution

Baseline

@hbredin
hbredin / cooccurrence.ipynb
Created February 17, 2016 13:40
Cooccurrence matrix
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@hbredin
hbredin / TVD_SpeakerLabeledSubtitles.ipynb
Last active February 26, 2016 10:01
TVD | How to generate speaker-labeled subtitles
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@hbredin
hbredin / approach.py
Last active March 18, 2016 13:49
Modular code
"""This module defines functions that do the actual work"""
def time_based_propagation(speaker_diarization, pronounced_names, neighborhood=20.0):
"""Perform time-based propagation and return 'who speaks when' hypothesis as pyannote.core.Annotation"""
hypothesis = Annotation()
# do something with speaker_diarization, pronounced_names and neighborhood
return hypothesis
@hbredin
hbredin / Python 2.7.11 + pip + boost + dlib
Last active March 25, 2016 09:53
Cluster install logs
export PATH=/people/bredin/cluster/bin:$PATH
export LD_LIBRARY_PATH=/people/bredin/cluster/lib:/people/bredin/cluster/lib64:$LD_LIBRARY_PATH
# GCC suivant la procédure d'Eric
# OpenSSL
wget https://www.openssl.org/source/openssl-1.0.2g.tar.gz
tar xzvf openssl-1.0.2g.tar.gz
cd openssl-1.0.2g
CFLAGS=-fPIC ./config shared --openssldir=/people/bredin/cluster
@hbredin
hbredin / notebook.ipynb
Last active January 26, 2017 19:41
On the evaluation of speaker turn segmentation
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@hbredin
hbredin / TristouNet.SCD.ipynb
Created September 4, 2017 10:12
TristouNet-based speaker change detection
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.