Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
vision
Commits
683baf8e
Unverified
Commit
683baf8e
authored
May 03, 2023
by
Adam J. Stewart
Committed by
GitHub
May 03, 2023
Browse files
Check sha256 of weights (#7219)
Co-authored-by:
Nicolas Hug
<
nh.nicolas.hug@gmail.com
>
parent
8811c915
Changes
41
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
23 additions
and
23 deletions
+23
-23
torchvision/models/quantization/inception.py
torchvision/models/quantization/inception.py
+1
-1
torchvision/models/quantization/mobilenetv2.py
torchvision/models/quantization/mobilenetv2.py
+1
-1
torchvision/models/quantization/mobilenetv3.py
torchvision/models/quantization/mobilenetv3.py
+1
-1
torchvision/models/quantization/resnet.py
torchvision/models/quantization/resnet.py
+1
-1
torchvision/models/quantization/shufflenetv2.py
torchvision/models/quantization/shufflenetv2.py
+1
-1
torchvision/models/regnet.py
torchvision/models/regnet.py
+1
-1
torchvision/models/resnet.py
torchvision/models/resnet.py
+1
-1
torchvision/models/segmentation/deeplabv3.py
torchvision/models/segmentation/deeplabv3.py
+3
-3
torchvision/models/segmentation/fcn.py
torchvision/models/segmentation/fcn.py
+2
-2
torchvision/models/segmentation/lraspp.py
torchvision/models/segmentation/lraspp.py
+1
-1
torchvision/models/shufflenetv2.py
torchvision/models/shufflenetv2.py
+1
-1
torchvision/models/squeezenet.py
torchvision/models/squeezenet.py
+1
-1
torchvision/models/swin_transformer.py
torchvision/models/swin_transformer.py
+1
-1
torchvision/models/vgg.py
torchvision/models/vgg.py
+1
-1
torchvision/models/video/mvit.py
torchvision/models/video/mvit.py
+1
-1
torchvision/models/video/resnet.py
torchvision/models/video/resnet.py
+1
-1
torchvision/models/video/s3d.py
torchvision/models/video/s3d.py
+1
-1
torchvision/models/video/swin_transformer.py
torchvision/models/video/swin_transformer.py
+1
-1
torchvision/models/vision_transformer.py
torchvision/models/vision_transformer.py
+1
-1
torchvision/prototype/models/depth/stereo/crestereo.py
torchvision/prototype/models/depth/stereo/crestereo.py
+1
-1
No files found.
torchvision/models/quantization/inception.py
View file @
683baf8e
...
...
@@ -265,7 +265,7 @@ def inception_v3(
if
quantize
and
not
original_aux_logits
:
model
.
aux_logits
=
False
model
.
AuxLogits
=
None
model
.
load_state_dict
(
weights
.
get_state_dict
(
progress
=
progress
))
model
.
load_state_dict
(
weights
.
get_state_dict
(
progress
=
progress
,
check_hash
=
True
))
if
not
quantize
and
not
original_aux_logits
:
model
.
aux_logits
=
False
model
.
AuxLogits
=
None
...
...
torchvision/models/quantization/mobilenetv2.py
View file @
683baf8e
...
...
@@ -149,6 +149,6 @@ def mobilenet_v2(
quantize_model
(
model
,
backend
)
if
weights
is
not
None
:
model
.
load_state_dict
(
weights
.
get_state_dict
(
progress
=
progress
))
model
.
load_state_dict
(
weights
.
get_state_dict
(
progress
=
progress
,
check_hash
=
True
))
return
model
torchvision/models/quantization/mobilenetv3.py
View file @
683baf8e
...
...
@@ -149,7 +149,7 @@ def _mobilenet_v3_model(
torch
.
ao
.
quantization
.
prepare_qat
(
model
,
inplace
=
True
)
if
weights
is
not
None
:
model
.
load_state_dict
(
weights
.
get_state_dict
(
progress
=
progress
))
model
.
load_state_dict
(
weights
.
get_state_dict
(
progress
=
progress
,
check_hash
=
True
))
if
quantize
:
torch
.
ao
.
quantization
.
convert
(
model
,
inplace
=
True
)
...
...
torchvision/models/quantization/resnet.py
View file @
683baf8e
...
...
@@ -144,7 +144,7 @@ def _resnet(
quantize_model
(
model
,
backend
)
if
weights
is
not
None
:
model
.
load_state_dict
(
weights
.
get_state_dict
(
progress
=
progress
))
model
.
load_state_dict
(
weights
.
get_state_dict
(
progress
=
progress
,
check_hash
=
True
))
return
model
...
...
torchvision/models/quantization/shufflenetv2.py
View file @
683baf8e
...
...
@@ -108,7 +108,7 @@ def _shufflenetv2(
quantize_model
(
model
,
backend
)
if
weights
is
not
None
:
model
.
load_state_dict
(
weights
.
get_state_dict
(
progress
=
progress
))
model
.
load_state_dict
(
weights
.
get_state_dict
(
progress
=
progress
,
check_hash
=
True
))
return
model
...
...
torchvision/models/regnet.py
View file @
683baf8e
...
...
@@ -397,7 +397,7 @@ def _regnet(
model
=
RegNet
(
block_params
,
norm_layer
=
norm_layer
,
**
kwargs
)
if
weights
is
not
None
:
model
.
load_state_dict
(
weights
.
get_state_dict
(
progress
=
progress
))
model
.
load_state_dict
(
weights
.
get_state_dict
(
progress
=
progress
,
check_hash
=
True
))
return
model
...
...
torchvision/models/resnet.py
View file @
683baf8e
...
...
@@ -298,7 +298,7 @@ def _resnet(
model
=
ResNet
(
block
,
layers
,
**
kwargs
)
if
weights
is
not
None
:
model
.
load_state_dict
(
weights
.
get_state_dict
(
progress
=
progress
))
model
.
load_state_dict
(
weights
.
get_state_dict
(
progress
=
progress
,
check_hash
=
True
))
return
model
...
...
torchvision/models/segmentation/deeplabv3.py
View file @
683baf8e
...
...
@@ -275,7 +275,7 @@ def deeplabv3_resnet50(
model
=
_deeplabv3_resnet
(
backbone
,
num_classes
,
aux_loss
)
if
weights
is
not
None
:
model
.
load_state_dict
(
weights
.
get_state_dict
(
progress
=
progress
))
model
.
load_state_dict
(
weights
.
get_state_dict
(
progress
=
progress
,
check_hash
=
True
))
return
model
...
...
@@ -331,7 +331,7 @@ def deeplabv3_resnet101(
model
=
_deeplabv3_resnet
(
backbone
,
num_classes
,
aux_loss
)
if
weights
is
not
None
:
model
.
load_state_dict
(
weights
.
get_state_dict
(
progress
=
progress
))
model
.
load_state_dict
(
weights
.
get_state_dict
(
progress
=
progress
,
check_hash
=
True
))
return
model
...
...
@@ -385,6 +385,6 @@ def deeplabv3_mobilenet_v3_large(
model
=
_deeplabv3_mobilenetv3
(
backbone
,
num_classes
,
aux_loss
)
if
weights
is
not
None
:
model
.
load_state_dict
(
weights
.
get_state_dict
(
progress
=
progress
))
model
.
load_state_dict
(
weights
.
get_state_dict
(
progress
=
progress
,
check_hash
=
True
))
return
model
torchvision/models/segmentation/fcn.py
View file @
683baf8e
...
...
@@ -168,7 +168,7 @@ def fcn_resnet50(
model
=
_fcn_resnet
(
backbone
,
num_classes
,
aux_loss
)
if
weights
is
not
None
:
model
.
load_state_dict
(
weights
.
get_state_dict
(
progress
=
progress
))
model
.
load_state_dict
(
weights
.
get_state_dict
(
progress
=
progress
,
check_hash
=
True
))
return
model
...
...
@@ -227,6 +227,6 @@ def fcn_resnet101(
model
=
_fcn_resnet
(
backbone
,
num_classes
,
aux_loss
)
if
weights
is
not
None
:
model
.
load_state_dict
(
weights
.
get_state_dict
(
progress
=
progress
))
model
.
load_state_dict
(
weights
.
get_state_dict
(
progress
=
progress
,
check_hash
=
True
))
return
model
torchvision/models/segmentation/lraspp.py
View file @
683baf8e
...
...
@@ -173,6 +173,6 @@ def lraspp_mobilenet_v3_large(
model
=
_lraspp_mobilenetv3
(
backbone
,
num_classes
)
if
weights
is
not
None
:
model
.
load_state_dict
(
weights
.
get_state_dict
(
progress
=
progress
))
model
.
load_state_dict
(
weights
.
get_state_dict
(
progress
=
progress
,
check_hash
=
True
))
return
model
torchvision/models/shufflenetv2.py
View file @
683baf8e
...
...
@@ -178,7 +178,7 @@ def _shufflenetv2(
model
=
ShuffleNetV2
(
*
args
,
**
kwargs
)
if
weights
is
not
None
:
model
.
load_state_dict
(
weights
.
get_state_dict
(
progress
=
progress
))
model
.
load_state_dict
(
weights
.
get_state_dict
(
progress
=
progress
,
check_hash
=
True
))
return
model
...
...
torchvision/models/squeezenet.py
View file @
683baf8e
...
...
@@ -109,7 +109,7 @@ def _squeezenet(
model
=
SqueezeNet
(
version
,
**
kwargs
)
if
weights
is
not
None
:
model
.
load_state_dict
(
weights
.
get_state_dict
(
progress
=
progress
))
model
.
load_state_dict
(
weights
.
get_state_dict
(
progress
=
progress
,
check_hash
=
True
))
return
model
...
...
torchvision/models/swin_transformer.py
View file @
683baf8e
...
...
@@ -639,7 +639,7 @@ def _swin_transformer(
)
if
weights
is
not
None
:
model
.
load_state_dict
(
weights
.
get_state_dict
(
progress
=
progress
))
model
.
load_state_dict
(
weights
.
get_state_dict
(
progress
=
progress
,
check_hash
=
True
))
return
model
...
...
torchvision/models/vgg.py
View file @
683baf8e
...
...
@@ -102,7 +102,7 @@ def _vgg(cfg: str, batch_norm: bool, weights: Optional[WeightsEnum], progress: b
_ovewrite_named_param
(
kwargs
,
"num_classes"
,
len
(
weights
.
meta
[
"categories"
]))
model
=
VGG
(
make_layers
(
cfgs
[
cfg
],
batch_norm
=
batch_norm
),
**
kwargs
)
if
weights
is
not
None
:
model
.
load_state_dict
(
weights
.
get_state_dict
(
progress
=
progress
))
model
.
load_state_dict
(
weights
.
get_state_dict
(
progress
=
progress
,
check_hash
=
True
))
return
model
...
...
torchvision/models/video/mvit.py
View file @
683baf8e
...
...
@@ -593,7 +593,7 @@ def _mvit(
)
if
weights
is
not
None
:
model
.
load_state_dict
(
weights
.
get_state_dict
(
progress
=
progress
))
model
.
load_state_dict
(
weights
.
get_state_dict
(
progress
=
progress
,
check_hash
=
True
))
return
model
...
...
torchvision/models/video/resnet.py
View file @
683baf8e
...
...
@@ -303,7 +303,7 @@ def _video_resnet(
model
=
VideoResNet
(
block
,
conv_makers
,
layers
,
stem
,
**
kwargs
)
if
weights
is
not
None
:
model
.
load_state_dict
(
weights
.
get_state_dict
(
progress
=
progress
))
model
.
load_state_dict
(
weights
.
get_state_dict
(
progress
=
progress
,
check_hash
=
True
))
return
model
...
...
torchvision/models/video/s3d.py
View file @
683baf8e
...
...
@@ -214,6 +214,6 @@ def s3d(*, weights: Optional[S3D_Weights] = None, progress: bool = True, **kwarg
model
=
S3D
(
**
kwargs
)
if
weights
is
not
None
:
model
.
load_state_dict
(
weights
.
get_state_dict
(
progress
=
progress
))
model
.
load_state_dict
(
weights
.
get_state_dict
(
progress
=
progress
,
check_hash
=
True
))
return
model
torchvision/models/video/swin_transformer.py
View file @
683baf8e
...
...
@@ -497,7 +497,7 @@ def _swin_transformer3d(
)
if
weights
is
not
None
:
model
.
load_state_dict
(
weights
.
get_state_dict
(
progress
=
progress
))
model
.
load_state_dict
(
weights
.
get_state_dict
(
progress
=
progress
,
check_hash
=
True
))
return
model
...
...
torchvision/models/vision_transformer.py
View file @
683baf8e
...
...
@@ -332,7 +332,7 @@ def _vision_transformer(
)
if
weights
:
model
.
load_state_dict
(
weights
.
get_state_dict
(
progress
=
progress
))
model
.
load_state_dict
(
weights
.
get_state_dict
(
progress
=
progress
,
check_hash
=
True
))
return
model
...
...
torchvision/prototype/models/depth/stereo/crestereo.py
View file @
683baf8e
...
...
@@ -1052,7 +1052,7 @@ def _crestereo(
)
if
weights
is
not
None
:
model
.
load_state_dict
(
weights
.
get_state_dict
(
progress
=
progress
))
model
.
load_state_dict
(
weights
.
get_state_dict
(
progress
=
progress
,
check_hash
=
True
))
return
model
...
...
Prev
1
2
3
Next
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment