numpy 中的 axis 和 pytorch 中的 dim
关于 numpy 中的 axis 和 pytorch 中的 dim
123456789101112131415import numpy as nparray = np.random.randint(low=0, high=6, size=(3, 4))print(array.shape, array)# (3, 4) [[5 3 0 4]# [4 3 1 0]# [2 0 3 2]]array0 = array.sum(axis=0, keepdims=True)print(array0.shape, array0)# (1, 4) [[11 6 4 6]]array1 = array.sum(axis=1, keepdims=True)print(array1.shape, array1)# (3, 1) [[12]# [ 8]# [ 7]]
123456789101112131415import torchtensor = torch.randint(low=0, high=6, size=(3, 4))prin ...
COCO format
Reference
Transforms v2: End-to-end object detection/segmentation example
Transforms v2: End-to-end object detection/segmentation example
Youtube video introducing COCO
COCO Dataset Format - Complete Walkthrough
Blog that introduces COCO format
COCO format , what and how
Waht is COCO format
Introduction
The COCO (Common Objects in Context) format is a standard format for storing and sharing annotations for images and videos. It was developed for the COCO image and video recognition cha ...
Gaussian Error Linear Unit (GELU)
Gaussian Error Linear Unit (GELU)
Arxiv link to the paper of GELU
Gaussian Error Linear Unit (GELU)
Definition of GELU
GELU(x)=xP(X≤x)=xΦ(x)=x⋅12[1+erf(x/2)]{\rm GELU}(x) = xP(X \leq x) = x\Phi(x) = x\cdot \frac{1}{2}
\left[ 1+ {\rm erf}(x/\sqrt2) \right]
GELU(x)=xP(X≤x)=xΦ(x)=x⋅21[1+erf(x/2)]
Where Φ(⋅)\Phi(\cdot)Φ(⋅) denotes cumulative distribution function (CDF) for normal distribution and erf(⋅){\rm erf}(\cdot)erf(⋅) is error function.
Derivative of GELU
ddxGELU(x)=ddx[x⋅Φ(x)]=Φ(x)+x ...
Google Scholar
How to use Google Scholars
谷歌学术检索论文如何指定多个来源
Google Scholar 谷歌学术文献检索技巧总结
TGRS
1Segmentation (source: "Transactions on Geoscience and Remote Sensing")
ICCV
1Segmentation (source: "International Conference on Computer Vision")
CVPR
1Segmentation (source: "Computer Vision and Pattern Recognition")
NeurIPS
1Segmentation (source: "Advances in Neural Information Processing Systems")
AAAI
1Segmentation (source: "Proceedings of the AAAI Conference on Artificia ...
Secure Shell
SSH, Secure Shell
查看已有公钥
12cd ~/.ssh # 进入目录cat id_rsa.pub # 显示公钥
1cat ~/.ssh/id_rsa.pub # 显示公钥
生成新的密钥
12345678910111213ssh-keygen -t rsa -b 4096 -f ~/.ssh/newsshkey# 参数说明:# -t rsa 指定加密方式为RSA# -b 4096 密钥长度(bit)# -f 指定密钥文件名, 默认为 id_rsa# 各个参数都可以不填, 使用默认参数ssh-keygen# 建议加上这些参数ssh-keygen -t rsa -C xxx@xxx.com# 这里的 xxx@xxx.com 只是用于生成的 sshkey 的名称, 并不要求具体命名为某个邮箱
将公钥上传至服务器
SSH配置密钥登录以及简单的安全设置
123ssh-copy-id -i ~/.ssh/newsshkey.pub -p port User@HostName# -i ~/.ssh/newsshkey.pub 指定密钥文件公钥, 注意后缀为.pub, 这是 ...
Datasets
ISPRS-Potsdam
Prepare Dataset: ISPRS-Potsdam | mmsegmentation
The Potsdam dataset is for urban semantic segmentation used in the 2D Semantic Labeling Contest - Potsdam.
The dataset can be requested at the challenge homepage. You will get a file named utf-8' 'Potsdam.zip, and unzip this file to get a folder named Potsdam which contains 10 files:
1234567891011Potsdam├── 1_DSM.rar├── 1_DSM_normalisation.zip├── 2_Ortho_RGB.zip <--├── 3_Ortho_IRRG.zip├── 4_Ortho_RGBIR.zip├── 5_Labels_all.zip├── 5_ ...
Commonly used Modules in deep learning
ExifTool
ExifTool Command-Line Examples
Pillow
Pillow documentation
PIL.Image.open
PIL.Image.save
PIL.Image.convert
12conda install pillowimport PIL
open images in a folder
12345678910111213141516171819202122232425262728import osimport globfrom PIL import Imageimport matplotlib.pyplot as pltpath2image = r"path/to/images"path2mask = r"path/to/masks"image_paths = glob.glob(os.path.join(path2image, '*.png'))image_names = [os.path.basename(result_path) for result_path i ...
Markdown Syntax
TOC
You can also create TOC (Table Of Contents) by inserting [TOC] to your markdown file. For example:
[TOC]
Hyperlink
With {target="_blank"} added, the hyperlink will be opened in a new Tab
Markdown Preview Enhanced{target="_blank"}
Otherwise, it will be opened in current Tab
Markdown Preview Enhanced{target="_blank"}
You can right click and Open in Browser to try the two hyperlinks above.
Emoji & Font-Awesome
:smile:, :fa-car:
Front-matter
123456789 ...
Pytorch Lightning
Learning material
Youtube video tutorials
PyTorch Lightning Tutorials | Aladdin Persson{target="_blank"}
The official document
lightning ai docs{target="_blank"}
The official document > Level Up
Level Up: Basic skills{target="_blank"}
Level Up: Intermediate skills{target="_blank"}
Level Up: Advanced skills{target="_blank"}
Level Up: Expert skills{target="_blank"}
LightningModule
Lightning Module{target="_blank"}
Log ...
openmmlab
Run Swin Transformer for Semantic Segmentation on Colab
Swin-Transformer-Semantic-Segmentation | GitHub
mmsegmentation | GitHub
mmsegmentation/…/get_started.md#install-on-google-colab | GitHub
get_started/installation | mmcv
Swin Transformer算法环境配置(语义分割)| ZhiHu
MMSegmentation_Tutorial.ipynb | Colab
install mmcv and mmsegmentation
12!pip install openmim!mim install mmcv
Use mmcv, not mmcv-full, to install the full version, because it took me so long that I canceled the installation.
MMCV contains ...