pip install simpletransformers pip uninstall torch, then run latest install script from pytorch.org
environment variables:
$ PORCH_N=100_000 PORCH_CUDA=True python bmark_distil.py
pip install simpletransformers pip uninstall torch, then run latest install script from pytorch.org
environment variables:
$ PORCH_N=100_000 PORCH_CUDA=True python bmark_distil.py
# Creating chloropleth with colors scaled to a dataframe is super easy, | |
# but if you want to add the exact values as a tooltip, | |
# Have to do it by editing the json that defines the boundaries of the states ! | |
# Quite complicated / annoying if unfamiliar with GeoJSON format. | |
state_abbr = simplejson.load(open('us_state_capitals.json')) | |
state_abbr = pd.DataFrame(state_abbr).transpose().reset_index().rename( | |
columns={'index':'abbr'} | |
) |
# Other possibilities | |
# e.g. Used for RG2 gripper | |
def olmia(): | |
#force0 = 5 | |
#width0 = 0 | |
#force1 = 5 | |
#width1 = 1100 | |
#force2 = 40 | |
#width2 = 0 |
''' | |
Date: 24 April 2020 | |
Author: nouyang | |
Example for reading (multiple) aruco tag. | |
The code outputs pose estimate to the shell (or to the file). | |
Motivation: The openCV documentation is oriented at C++, so it may be difficult to | |
translate to Python. This is a simple example that reads multiple tags, converts | |
rotation to Euler, and prints to the commandline. I also explain how to obtain camera |
""" | |
Convert YouTube subtitles(vtt) to human readable text. | |
Download only subtitles from YouTube with youtube-dl: | |
youtube-dl --skip-download --convert-subs vtt <video_url> | |
Note that default subtitle format provided by YouTube is ass, which is hard | |
to process with simple regex. Luckily youtube-dl can convert ass to vtt, which | |
is easier to process. |
# script to create timer in terminal | |
# Jason Atwood | |
# 2013/6/22 | |
# Nouyang -- added large font, send-notify popup, gnome-terminal resize, and play wav file | |
# 2019 | |
#!/bin/sh | |
# start up | |
#echo "starting timer script ..." |
Arucotag time, tag1 xyz, tag2 xyz, tag1 rollpitchyaw (xyz), tag2 -- xyz zerod averaged; 1.4325604438781738; -0.04961893824233008; -0.05359939423137295; -0.04982387644324944; -0.05038360130221645; -0.04640478914072482; -0.050179964932310084; 2.8118697239913235; -8.772199918827821; -9.82776223299835; 2.7892837261660275; 9.890234153377573; -14.972194520722148; -0.05000126977227327; -0.05000209168604888; -0.05000192068777976; 2.8005767250786757; 0.5590171172748759; -12.399978376860249 | |
Arucotag time, tag1 xyz, tag2 xyz, tag1 rollpitchyaw (xyz), tag2 -- xyz zerod averaged; 1.4791462421417236; -0.04959811047099668; -0.053596665003502485; -0.04976573979042518; -0.05038360130221645; -0.04640478914072482; -0.050179964932310084; 4.738171612374154; -15.070717763088878; -22.51421969502433; 4.756004713612519; 15.445164648243166; -30.858389788111364; -0.04999085588660657; -0.05000072707211366; -0.04997285236136763; 4.747088162993337; 0.18722344257714418; -26.686304741567845 | |
Arucotag time, tag1 xyz, tag2 xyz, tag1 rollpitchy |
# https://askubuntu.com/questions/37824/what-is-the-best-way-to-configure-a-thinkpads-trackpoint | |
echo 200 | sudo tee /sys/devices/platform/i8042/serio1/serio2/sensitivity | |
echo 200 | sudo tee /sys/devices/platform/i8042/serio1/serio2/speed |
#! /usr/bin/python | |
import os | |
import pdfrw | |
INVOICE_TEMPLATE_PATH = 'delay.pdf' | |
INVOICE_OUTPUT_PATH = 'delay_pdfrw2.pdf' | |
* Brightness keys don't work. Instead | |
rui@chaiX1YG2:~$ xrandr --output eDP-1 --brightness 0.8 | |
As a temp solutions, I created keyboard shortcuts for 0.8 (super-f6) and 0.3 (supers-f5) settings, using | |
gnome-terminal -e "sh \home\rui\brightdown.sh" (may require chmod +x) | |
Via the settings GUI -> add a custom shortcut | |
* Suspend doesn't seem to work | |
systemctl suspend -i |