module add anaconda
module add gcc/4.9.1
module add cuda/9.2
module save
This file contains 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
a = 0 # global | |
def change1(): | |
a = 1 # nonlocal | |
def change2(): | |
nonlocal a | |
a = 3 | |
def change3(): | |
global a | |
print('change3', a) | |
a = 4 |
This file contains 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
#!/usr/bin/env python | |
#-*- coding: UTF-8 -*- | |
import sys, os, re, time, pkgutil, logging, click, subprocess, zipfile | |
from jinja2 import Template, Environment, PackageLoader | |
from datetime import datetime | |
__version__ = "1.1" | |
RE_CHAPTER_AND_SECTIONS=[ |
This file contains 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,sys,shutil | |
import cv2 | |
import numpy as np | |
USAGE = "python %s video [outPath]"%sys.argv[0] | |
USAGE += "\n example: python %s video.mp4 ./output"%sys.argv[0] | |
if len(sys.argv) < 2 or '-h' in sys.argv or '--help' in sys.argv: | |
print(USAGE) |
This file contains 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
# -*- coding: utf-8 -*- | |
""" | |
Created on Sat Oct 10 15:29:24 2020 | |
@author: qzane | |
The SMPLX models can be find at: https://smpl-x.is.tue.mpg.de/ | |
""" | |
import numpy as np | |
import scipy | |
from scipy.ndimage.measurements import label |
This file contains 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
def solve_RT1_RT2(A, B): | |
''' solve for B = x1.dot(A).dot(x2) | |
A = [[[R1,T1],[0,1]]...] # shape: (n,4,4) | |
B = [[[R2,T2],[0,1]]...] # shape: (n,4,4) | |
minimize{np.einsum('jk,ikp,pq->ijq', x1, A, x2)-B} | |
return: x1,x2: shape(4,4) | |
''' | |
def func(x,a,b): | |
x1 = x[:16].reshape(4,4) | |
x2 = x[16:].reshape(4,4) |
This file contains 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
#!/usr/bin/env python3 | |
# -*- coding: utf-8 -*- | |
""" | |
Created on Wed Mar 28 14:34:17 2018 | |
@author: qzane | |
""" | |
import os,sys | |
import numpy as np |
This file contains 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
# dataset maker for https://github.com/Engineering-Course/CIHP_PGN | |
# author: qzane@live.com | |
import os,sys,shutil | |
from PIL import Image | |
import numpy as np | |
DATA_TYPE = ['png','PNG','jpg','JPG'] | |
def main(): | |
USAGE = "python %s /path_to_images name_of_dataset" % sys.argv[0] |
This file contains 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
""" | |
Created on May 14 2018 | |
@author: qzane | |
""" | |
import os,sys | |
import requests | |
from lxml import etree | |
MOVIE0 = r'https://www.youtube.com/watch?v=lIES3ii-IOg' |
This file contains 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
#include<Mouse.h> | |
//sleep 5;sudo ./arduino --board arduino:avr:leonardo --upload ~/arduino/touch/touch.ino --port /dev/ttyACM7 | |
void setup(){ | |
delay(5000); | |
Mouse.begin(); | |
} | |
void tap(unsigned long x,unsigned long y){ | |
int tmpX, tmpY; | |
x = x / 3; //I dont know why, x, y is in pixel |
NewerOlder