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 | |
""" | |
Cansei de apanhar no termo https://term.ooo/. | |
➜ python termo.py -x e r t i p a l c n -f 2u 5o -c s | |
musgo | |
""" | |
from string import ascii_lowercase, digits | |
import argparse |
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
filename | imagemagick quality | size(KB) | picamera quality | |
---|---|---|---|---|
pic_001.jpg | 1 | 60 | 1 | |
pic_002.jpg | 4 | 60 | 2 | |
pic_003.jpg | 92 | 60 | 3 | |
pic_004.jpg | 92 | 64 | 4 | |
pic_005.jpg | 25 | 68 | 5 | |
pic_006.jpg | 92 | 80 | 6 | |
pic_007.jpg | 49 | 104 | 7 | |
pic_008.jpg | 61 | 132 | 8 | |
pic_009.jpg | 70 | 160 | 9 |
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
echo 'file_name\tquality\tsize (KB)' && for i in $(ls); do echo $i'\t'$(identify -format "%Q" "$i")'\t'$(ls -ls "$i" | cut -d " " -f1); done | |
# file_name quality size (KB) | |
# q_001_0001.jpg 1 152 | |
# q_010_0001.jpg 75 852 | |
# q_020_0001.jpg 94 2000 | |
# q_030_0001.jpg 98 3144 | |
# q_040_0001.jpg 99 3700 | |
# q_050_0001.jpg 99 4260 | |
# q_060_0001.jpg 100 4940 |
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 sys | |
import math | |
MAXIMUM_SIZE = math.ceil(math.log(sys.maxsize, 2)) | |
def int2bin(integer, length=MAXIMUM_SIZE): | |
""" | |
Returns the `integer` as an unsigned binary string with a fixed `length` in bits. | |
Truncates to the `length` in bits to prevent overflow. |
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
Survived | Name | Age | Class | Fare | Embarked | Boat | Body | |
---|---|---|---|---|---|---|---|---|
1 | Allen, Miss. Elisabeth Walton | 29.0 | 1 | 211.3375 | Southampton | 2 | ||
1 | Allison, Master. Hudson Trevor | 0.92 | 1 | 151.55 | Southampton | 11 | ||
0 | Allison, Miss. Helen Loraine | 2.0 | 1 | 151.55 | Southampton | |||
0 | Allison, Mr. Hudson Joshua Creighton | 30.0 | 1 | 151.55 | Southampton | 135.0 | ||
0 | Allison, Mrs. Hudson J C (Bessie Waldo Daniels) | 25.0 | 1 | 151.55 | Southampton | |||
1 | Anderson, Mr. Harry | 48.0 | 1 | 26.55 | Southampton | 3 | ||
1 | Andrews, Miss. Kornelia Theodosia | 63.0 | 1 | 77.9583 | Southampton | 10 | ||
0 | Andrews, Mr. Thomas Jr | 39.0 | 1 | 0.0 | Southampton | |||
1 | Appleton, Mrs. Edward Dale (Charlotte Lamson) | 53.0 | 1 | 51.4792 | Southampton | D |
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 | |
"""Start with a bang!""" | |
import argparse | |
from os import path | |
import cv2 | |
import numpy as np | |
def main(args): |
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
v4l2-ctl -d /dev/video0 --list-formats-ext | grep Size | sed 's/.*[^0-9]\([0-9]\+x[0-9]\+\)[^0-9]\?.*/\1/' | sort | uniq |python3 -c "import fileinput;res = [line.split('x') for line in fileinput.input()];res = [(int(r[0]), int(r[1]), int(r[0])*int(r[1])) for r in res];res=sorted(res, key=lambda x: -x[2]);print(res[0][0:2])" |
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
pessoa | |
bicicleta | |
carro | |
motocicleta | |
avião | |
ônibus | |
trem | |
caminhão | |
barco | |
semáforo |
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 | |
import sys | |
import numpy as np | |
def main(input, output, categories): | |
with np.load(input) as npz: | |
data = dict(npz) | |
print("Chopping last layer") | |
data['maskrcnn/conv/W:0'] = data['maskrcnn/conv/W:0'][:,:,:,:categories] |
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
$ dvc push -v > dvc.log 2>&1 | |
DEBUG: PRAGMA user_version; | |
DEBUG: fetched: [(3,)] | |
DEBUG: CREATE TABLE IF NOT EXISTS state (inode INTEGER PRIMARY KEY, mtime TEXT NOT NULL, size TEXT NOT NULL, md5 TEXT NOT NULL, timestamp TEXT NOT NULL) | |
DEBUG: CREATE TABLE IF NOT EXISTS state_info (count INTEGER) | |
DEBUG: CREATE TABLE IF NOT EXISTS link_state (path TEXT PRIMARY KEY, inode INTEGER NOT NULL, mtime TEXT NOT NULL) | |
DEBUG: INSERT OR IGNORE INTO state_info (count) SELECT 0 WHERE NOT EXISTS (SELECT * FROM state_info) | |
DEBUG: PRAGMA user_version = 3; | |
DEBUG: Path /home/john/imagem-mariposas/.dvc/cache/3e/4a6b6668be13477f2b5c285ac9fbb5.dir inode 2097211 | |
DEBUG: SELECT mtime, size, md5, timestamp from state WHERE inode=2097211 |
NewerOlder