无题
presentation-25-5-18-毕业答辩
/*!
* reveal.js 4.5.0
* https://revealjs.com
* MIT licensed
*
* Copyright (C) 2011-2023 Hakim El Hattab, https://hakim.se
*/
.reveal .r-stretch,.reveal .stretch{max-width:none;max-height:none}.reveal pre.r-stretch code,.reveal pre.stretch code{height:100%;max-height:100%;box-sizing:border-box}.reveal .r-fit-text{display:inline-block;white-space:nowrap}.reveal .r-stack{display:grid}.reveal .r-stack>*{grid-area:1/1;margin:auto}.rev ...
无题
reveal.js - Slide Notes
body {
font-family: Helvetica;
font-size: 18px;
}
#current-slide,
#upcoming-slide,
#speaker-controls {
padding: 6px;
box-sizing: border-box;
-moz-box-sizing: border-box;
}
#current-slide iframe,
#upcoming-slide iframe {
width: 100%;
height: 100%;
border: 1px solid #ddd;
}
#current-slide .label,
#upcoming-slide .label {
position: absolute;
top: 10px;
left: 10px;
z-index: 2;
...
无题
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).RevealNotes=e()}(this,(function(){"use strict";function t(){return{baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:nul ...
Vaihingen Dataset
ISPRS-Vaihingen
The Vaihingen dataset is for urban semantic segmentation used in the 2D Semantic Labeling Contest - Vaihingen.
The dataset can be requested at the challenge homepage. You need to get a package file named Vaihingen.zip (size: 14.9 GB), and unzip this package to get a folder named Vaihingen which contains 14 files as follows:
123456789101112131415Vaihingen├── 3DLabeling├── ALS├── DSM├── Images├── Ortho├── Reference_3d_reconstruction├── Reference_object_detection├── dsm_09cm_matchin ...
函数和类的签名
函数的签名(Function Signature)指的是函数的参数列表,包括参数的名称、默认值、类型注解,以及参数的调用方式(位置参数、关键字参数等)。它决定了如何调用该函数。在 Python 中,可以使用 inspect.signature() 来获取函数的签名。
类的签名(Class Signature)指的是类的构造函数(__init__ 方法)的参数列表,包括参数的名称、默认值、类型注解等信息。它决定了如何实例化该类。在 Python 中,可以使用 inspect.signature() 来获取类的签名,即 __init__ 方法的参数信息。
1234567891011121314151617181920import inspectclass obj: def __init__(self, a, b, c): pass def func(a, b, c): passprint(func.__code__.co_varnames)# ('a', 'b', 'c')print(obj.__i ...
IntermediateLayerGetter 获取中间结果
获取中间结果
利用 IntermediateLayerGetter 方法可以非常方便的获取中间结果,例如获取 resnet 的中间结果——features,这一点很有用,因为很多模型都会使用 resnet 作为 backbone 来提取 features。
123456789101112131415161718192021import torchfrom torchvision.models import resnet18from torchvision.models._utils import IntermediateLayerGetterinput = torch.rand(size=(1, 3, 224, 224))model = resnet18()output = model(input)print(output.shape)# torch.Size([1, 1000])'''extract layer1, layer2, layer3 and layer4, giving as names feat1, feat2, feat3 and fea ...
Python 包裹传递和解包传递
简介
在 Python 中,参数传递方式有两种主要形式:位置参数和关键字参数。通过使用包裹传递(packing)和解包传递(unpacking),可以灵活地处理任意数量的参数。
单星号 *
单星号 * 用于处理位置参数的打包和解包。
单星号打包
单星号 * 打包会将多个位置参数打包成一个 tuple 对象
123456def sum_all(*args): print(f"{args = }, {type(args) = }") return sum(args)result = sum_all(1, 2, 3, 4)# args = (1, 2, 3, 4), type(args) = <class 'tuple'>
单星号解包
单星号 * 解包用于将一个可迭代对象解包为位置参数
123456def add(a, b, c): return a + b + cdata = [1, 2, 3]print(*data) # 1 2 3result = add(*data) # add(1, 2 ...
Panoptic Feature Pyramid Networks
Panoptic FPN 整体结构图
参考实现
FPN 部分
这一部分的代码是参考 FPN-Semantic-segmentation | github 这个仓库
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143'''Panoptic FPN in PyTorch.See the paper "Panoptic Feature Pyramid Network ...
Pytorch 对 ResNet 的实现
参考
pytorch vision resnet
resnet.py | pytorch github
借助 torch hub
可以直接借助 torch hub pytorch vision resnet 来加载预训练的 resnet。
12345678import torchmodel = torch.hub.load('pytorch/vision:v0.10.0', 'resnet18', pretrained=True)'''or any of these variants'''# model = torch.hub.load('pytorch/vision:v0.10.0', 'resnet34', pretrained=True)# model = torch.hub.load('pytorch/vision:v0.10.0', 'resnet50', pretrained=True)# mod ...
Pytorch 对 SwinTransformer 的实现
参考
SwinTransformer | pytorch docs
swin_transformer.py | pytorch github
借助 torch hub
可以直接借助 torch hub pytorch vision resnet 来加载预训练的 resnet。
1234567891011import torchfrom torchvision.models import swin_t, Swin_T_Weightsfrom torchvision.models._utils import IntermediateLayerGetterinput = torch.rand(size=(1, 3, 224, 224))model = swin_t(weights=Swin_T_Weights.IMAGENET1K_V1)# for name, child in model.named_children():# print(name)output = model(input)print(output.shape)# torch.Size([1, 1000])
swin_ ...