This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Turn this | |
location name Jan-2010 Feb-2010 March-2010 | |
A "test" 12 20 30 | |
B "foo" 18 20 25 | |
into this | |
location name Date Value |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Post the data | |
var fd = new FormData(); | |
fd.append("name", "some_filename.jpg"); | |
fd.append("image", dataurl); | |
fd.append("info", "lah_de_dah"); | |
$.ajax({ | |
url: '/ajax_photo', | |
data: fd, | |
cache: false, | |
contentType: false, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<img src="" id="image"> | |
<input id="input" type="file" onchange="handleFiles()"> | |
<script> | |
function handleFiles() | |
{ | |
var dataurl = null; | |
var filesToUpload = document.getElementById('input').files; | |
var file = filesToUpload[0]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
var MAX_WIDTH = 300; | |
var MAX_HEIGHT = 400; | |
var dataurl_user = null; | |
var dataurl_celebrity = null; | |
function handleFiles(inputid, imageid_to_show, mode) | |
{ | |
var filesToUpload = document.getElementById(inputid).files; |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import torch | |
import argparse | |
from maskrcnn_benchmark.config import cfg | |
from maskrcnn_benchmark.utils.c2_model_loading import load_c2_format | |
def removekey(d, listofkeys): | |
r = dict(d) | |
for key in listofkeys: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
brief: face alignment with FFHQ method (https://github.com/NVlabs/ffhq-dataset) | |
author: lzhbrian (https://lzhbrian.me) | |
date: 2020.1.5 | |
note: code is heavily borrowed from | |
https://github.com/NVlabs/ffhq-dataset | |
http://dlib.net/face_landmark_detection.py.html | |
requirements: | |
apt install cmake |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Author: lzhbrian (https://lzhbrian.me) | |
Date: 2020.1.20 | |
Note: mainly modified from: https://github.com/tkarras/progressive_growing_of_gans/blob/master/util_scripts.py#L50 | |
""" | |
import numpy as np | |
from PIL import Image | |
import os | |
import scipy |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# this is from | |
# https://github.com/ox-vgg/vgg_face2/issues/2#issuecomment-461684945 | |
import requests | |
import getpass | |
import sys | |
LOGIN_URL = "http://zeus.robots.ox.ac.uk/vgg_face2/login/" | |
FILE_URL = "http://zeus.robots.ox.ac.uk/vgg_face2/get_file?fname=vggface2_test.tar.gz" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for i in $@ | |
do | |
# create user | |
useradd --gid groupname --home-dir /nvme/$i --create-home --no-user-group --shell /bin/bash $i | |
echo $i:$i | chpasswd | |
# make folder a data path | |
mkdir /data1/$i | |
chown $i:groupname /data1/$i | |
done |
OlderNewer