Skip to content

Instantly share code, notes, and snippets.

系统Ubuntu

参考文档

克隆工程

$ git clone 	https://github.com/cmusatyalab/openface
$ cd openface

安装依赖

  • torch
@jaypei
jaypei / Cargo.toml
Created September 1, 2016 02:42
clap_static_test
[package]
name = "clap_static_test"
version = "0.1.0"
authors = ["jaypei <jaypei97159@gmail.com>"]
[dependencies]
clap = {version = "2", features = ["yaml"]}
lazy_static = "0.2.1"
@jaypei
jaypei / use_c_sleep.go
Last active July 17, 2023 06:26
Golang的调度机制决定Sleep是用户态实现的。但实现存在一个问题,若go程序在Sleep的过程中系统时间发生变化,Sleep会不准确,因为runtime中的实现是通过时间列表判断每个goroutine的挂起时间,而这个时间就是用的系统时间。这段代码是用cgo调用C的sleep规避这个问题的实现。
package main
/*
#include <unistd.h>
*/
import "C"
import (
"fmt"
"time"
)
@jaypei
jaypei / subprocess-bufsize-test.py
Last active January 26, 2022 10:05
使用subprocess。避免在子程序大量输出时因buffer size满,导致父进程hang住。
#!/usr/bin/python
# -*- coding: utf-8 -*-
import subprocess
from StringIO import StringIO
out = StringIO()
sp = subprocess.Popen(["python", "test_output.py"],
stdout=subprocess.PIPE,