👀 Image recognition
What is an Iamge
💾 Formats
- JPG: To speed up jpeg image I/O from the disk one should not use PIL, skimage and even OpenCV but look for
libjpeg-turbo
orPyVips
. - PNG:
- DICOM (Medical Image)
🐇 (Fast) Dataloaders
ffcv
is a dataloader that dramatically increases data throughput in model training
Realted work: DeepSpeed
🔨 Image preprocessing
Normalization
- Mean subtraction: Center the data to zero.
x = x - x.mean()
- Standardize: Put the data on the same scale.
x = x / x.std()
PCA and Whitening
- Mean subtraction: Center the data in zero.
x = x - x.mean()
- Decorrelation or PCA: Rotate the data until there is no correlation anymore.
- Whitening: Put the data on the same scale.
whitened = decorrelated / np.sqrt(eigVals + 1e-5)
ZCA Whitening with Zero component analysis (ZCA) is a very similar process.
Subtract Local Mean
CLAHE: Contrast Limited Adaptive Histogram Equalization
Data Augmentation
5 Libraries Options:
- Fastai
- TIMM
- Torchvision
- Albumentation
- Kornia
TIMM
https://medium.com/towards-data-science/getting-started-with-pytorch-image-models-timm-a-practitioners-guide-4e77b4bf9055
OpenCV basics
Write text
# Put text
cv2.putText(img = frame,
text = resolution_str,
org = (50, 100) ,
fontFace = cv2.FONT_HERSHEY_SIMPLEX,
fontScale = 1,
color = (255, 255, 255),
thickness = 2)
Reference
- Cheatsheet CNN
- Google tutorial image classification
- Paper:
- ML training video: Bag of Tricks (2020)
- awesome-data-augmentation
- http://szeliski.org/Book
- A year in computer vision
- Others
- Inceptionism
- Capsule net
- pyimagesearch: Start here
- Pretrained models in pytorch
- Ranking,
- comparison paper
- Little tricks paper
- GPipe