deeplabcut.pose_estimation_tensorflow.backbones.mobilenet_v2
Implementation of Mobilenet V2.
Architecture: https://arxiv.org/abs/1801.04381
The base model gives 72.2% accuracy on ImageNet, with 300MMadds, 3.4 M parameters.
Functions:
| Name | Description |
|---|---|
mobilenet |
Creates mobilenet V2 network. |
mobilenet_base |
Creates base of the mobilenet (no pooling and no logits) . |
training_scope |
Defines MobilenetV2 training scope. |
mobilenet
mobilenet(
input_tensor,
num_classes=1001,
depth_multiplier=1.0,
scope="MobilenetV2",
conv_defs=None,
finegrain_classification_mode=False,
min_depth=None,
divisible_by=None,
activation_fn=None,
**kwargs
)
Creates mobilenet V2 network.
Inference mode is created by default. To create training use training_scope below.
with tf.contrib.slim.arg_scope(mobilenet_v2.training_scope()): logits, endpoints = mobilenet_v2.mobilenet(input_tensor)
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
The input tensor |
required | |
|
number of classes |
1001
|
|
|
The multiplier applied to scale number of |
1.0
|
|
|
Scope of the operator |
'MobilenetV2'
|
|
|
Allows to override default conv def. |
None
|
|
|
When set to True, the model |
False
|
|
|
//arxiv.org/abs/1801.04381 |
required | |
|
If provided, will ensure that all layers will have that |
None
|
|
|
If provided will ensure that all layers # channels |
None
|
|
|
Activation function to use, defaults to tf.nn.relu6 if not specified. |
None
|
|
|
passed directly to mobilenet.mobilenet: prediction_fn- what prediction function to use. reuse-: whether to reuse variables (if reuse set to true, scope must be given). |
{}
|
Returns: logits/endpoints pair
Raises:
| Type | Description |
|---|---|
ValueError
|
On invalid arguments |
Source code in deeplabcut/pose_estimation_tensorflow/backbones/mobilenet_v2.py
90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 | |
mobilenet_base
Creates base of the mobilenet (no pooling and no logits) .
Source code in deeplabcut/pose_estimation_tensorflow/backbones/mobilenet_v2.py
training_scope
Defines MobilenetV2 training scope.
Usage
with tf.contrib.slim.arg_scope(mobilenet_v2.training_scope()): logits, endpoints = mobilenet_v2.mobilenet(input_tensor)
with slim.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
Passed to mobilenet.training_scope. The following parameters |
{}
|
|
|
weight_decay- The weight decay to use for regularizing the model. stddev- Standard deviation for initialization, if negative uses xavier. dropout_keep_prob- dropout keep probability bn_decay- decay for the batch norm moving averages. |
required |
Returns:
| Type | Description |
|---|---|
|
An |