raft_small¶
- torchvision.models.optical_flow.raft_small(\, weights: Optional[Raft_Small_Weights] = None, progress=True, \**kwargs) RAFT[原始碼]¶
RAFT “small” 模型,出自 RAFT: Recurrent All Pairs Field Transforms for Optical Flow。
請參閱下面的示例,瞭解如何使用此模型的教程。
- 引數:
weights (
Raft_Small_Weights, 可選) – 要使用的預訓練權重。有關更多詳細資訊和可能值,請參閱下面的Raft_Small_Weights。預設情況下,不使用預訓練權重。progress (bool) – 如果為 True,則在 stderr 上顯示下載進度條。預設為 True。
\*\*kwargs – 傳遞給
torchvision.models.optical_flow.RAFT基類的引數。有關此類的更多詳細資訊,請參閱 原始碼。
- class torchvision.models.optical_flow.Raft_Small_Weights(value)[原始碼]¶
上面的模型構建器接受以下值作為
weights引數。Raft_Small_Weights.DEFAULT等同於Raft_Small_Weights.C_T_V2。您也可以使用字串,例如weights='DEFAULT'或weights='C_T_V1'。這裡報告的指標如下。
epe是“端點誤差”,表示預測流與其真實值相差多少(以畫素為單位)。對所有影像的所有畫素取平均值。per_image_epe類似,但平均方式不同:首先對每張影像分別計算 epe,然後對所有影像取平均值。這對應於原始論文中的“Fl-epe”(有時寫為“F1-epe”),並且僅用於 Kitti。fl-all也是 Kitti 特有的指標,由該資料集的作者定義,並用於 Kitti 排行榜。它表示 epe 小於 3px 或流的 2-範數小於 5% 的畫素的平均值。Raft_Small_Weights.C_T_V1:
這些權重是從原始論文移植過來的。它們在
FlyingChairs+FlyingThings3D上訓練的。epe(在 Sintel-Train-Cleanpass 上)
2.1231
epe(在 Sintel-Train-Finalpass 上)
3.279
per_image_epe(在 Kitti-Train 上)
7.6557
fl_all(在 Kitti-Train 上)
25.2801
min_size
height=128, width=128
引數數量
990162
方案
GFLOPS
47.66
檔案大小
3.8 MB
推理轉換可在
Raft_Small_Weights.C_T_V1.transforms獲得,並執行以下預處理操作:接受PIL.Image、批次處理的(B, C, H, W)和單個(C, H, W)影像torch.Tensor物件。影像被縮放到[-1.0, 1.0]。Raft_Small_Weights.C_T_V2:
這些權重是在
FlyingChairs+FlyingThings3D上從頭開始訓練的。也可用作Raft_Small_Weights.DEFAULT。epe(在 Sintel-Train-Cleanpass 上)
1.9901
epe(在 Sintel-Train-Finalpass 上)
3.2831
per_image_epe(在 Kitti-Train 上)
7.5978
fl_all(在 Kitti-Train 上)
25.2369
min_size
height=128, width=128
引數數量
990162
方案
GFLOPS
47.66
檔案大小
3.8 MB
推理轉換可在
Raft_Small_Weights.C_T_V2.transforms獲得,並執行以下預處理操作:接受PIL.Image、批次處理的(B, C, H, W)和單個(C, H, W)影像torch.Tensor物件。影像被縮放到[-1.0, 1.0]。
使用
raft_small的示例