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
""" | |
Adapted from | |
https://github.com/bmwoodruff/numpy-ideas/blob/main/find_numpy_functions_missing_examples.ipynb | |
Which adapted from | |
https://gist.github.com/WarrenWeckesser/c33d0236279cc5d73843f0497e14ed0e | |
Gotta giv'em credits 😉 | |
Find numpy functions whose docstrings do not contain "Examples". | |
""" |
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] |
NewerOlder