Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
root = true

[*]
indent_size = 4
indent_style = space
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,18 @@ pyscenedetect (0.5)

The demo has been tested with the package versions shown above, but may also work on other versions.

### Docker

Build
```sh
docker-compose build
```

Exec bash
```sh
docker-compose run syncnet bin/bash
```

## Demo

SyncNet demo:
Expand Down
7 changes: 7 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
version: '2.3'
services:
syncnet:
build: ./docker
runtime: nvidia
volumes:
- ./src:/home
46 changes: 46 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
FROM nvidia/cuda:9.0-cudnn7-devel

RUN apt-get update \
&& apt-get upgrade -y \
&& apt-get install -y --no-install-recommends \
gcc \
git \
make \
wget \
curl \
unzip \
cmake \
libsm6 \
libxext6 \
libpq-dev \
libxrender1 \
libglib2.0-0 \
liblapack-dev \
libxrender-dev \
libopenblas-dev \
build-essential \
ca-certificates \
python-pip \
python2.7 \
python2.7-dev \
python-tk \
&& curl -kL https://bootstrap.pypa.io/get-pip.py | python

# pip
COPY ./requirements.txt /tmp
RUN pip install --upgrade pip setuptools \
&& pip install -r /tmp/requirements.txt \
&& rm -rf /tmp/requirements.txt

# ffmpeg
RUN mkdir /tmp/ffmepg \
&& wget -O /tmp/ffmepg/ffmpeg.tar.xz https://johnvansickle.com/ffmpeg/releases/ffmpeg-release-amd64-static.tar.xz \
&& tar xvf /tmp/ffmepg/ffmpeg.tar.xz -C /tmp/ffmepg --strip-components 1 \
&& cp /tmp/ffmepg/ffmpeg /usr/local/bin \
&& cp /tmp/ffmepg/ffprobe /usr/local/bin \
&& rm -rf /tmp/ffmepg

RUN apt-get clean \
&& rm -rf /var/chache/apt/archives/* /var/lib/apt/lists/*


7 changes: 7 additions & 0 deletions docker/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
torch==1.1.0
numpy==1.14.3
scipy==1.0.1
opencv-python==3.4.0.14
python_speech_features==0.6
tensorflow==1.4
scenedetect==0.5
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion download_model.sh → src/download_model.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ unzip facedet.zip -d protos/
rm -f facedet.zip

cat /dev/null > protos/__init__.py
cat /dev/null > utils/__init__.py
cat /dev/null > utils/__init__.py
File renamed without changes.
6 changes: 3 additions & 3 deletions run_syncnet.py → src/run_syncnet.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
# ==================== GET OFFSETS ====================

with open(os.path.join(opt.work_dir,opt.reference,'tracks.pckl'), 'rb') as fil:
tracks = pickle.load(fil, encoding='latin1')
tracks = pickle.load(fil)

dists = []
offsets = []
Expand All @@ -42,13 +42,13 @@
offsets.append(offset)
dists.append(dist)
confs.append(conf)

# ==================== PRINT RESULTS TO FILE ====================

with open(os.path.join(opt.work_dir,opt.reference,'offsets.txt'), 'w') as fil:
fil.write('FILENAME\tOFFSET\tCONF\n')
for ii, track in enumerate(tracks):
fil.write('%05d.avi\t%d\t%.3f\n'%(ii, offsets[ii], confs[ii]))

with open(os.path.join(opt.work_dir,opt.reference,'activesd.pckl'), 'wb') as fil:
pickle.dump(dists, fil)
4 changes: 2 additions & 2 deletions run_visualise.py → src/run_visualise.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@
# ==================== LOAD FILES ====================

with open(os.path.join(opt.work_dir,opt.reference,'tracks.pckl'), 'rb') as fil:
tracks = pickle.load(fil, encoding='latin1')
tracks = pickle.load(fil)

with open(os.path.join(opt.work_dir,opt.reference,'activesd.pckl'), 'rb') as fil:
dists = pickle.load(fil, encoding='latin1')
dists = pickle.load(fil)

# ==================== SMOOTH FACES ====================

Expand Down
File renamed without changes.