fix typos in lincense
This commit is contained in:
parent
6dac92aedf
commit
82c5486714
|
@ -6,7 +6,7 @@
|
|||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# less required by applicable law or agreed to in writing, software
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
|
@ -37,7 +37,7 @@ def read_annotation(ann_file):
|
|||
|
||||
return ann
|
||||
|
||||
def read_IC13_annotation(ann_file):
|
||||
def read_ic13_annotation(ann_file):
|
||||
file = open(ann_file)
|
||||
|
||||
ann = {}
|
||||
|
@ -60,14 +60,17 @@ def read_svt_annotation(ann_file):
|
|||
return ann
|
||||
|
||||
def get_eval_result(result_path, ann_file):
|
||||
"""
|
||||
Calculate accuracy according to the annotation file and result file.
|
||||
"""
|
||||
metrics = CRNNAccuracy(config)
|
||||
|
||||
if args.dataset == "ic03" or args.dataset == "iiit5k":
|
||||
ann = read_annotation(args.ann_file)
|
||||
ann = read_annotation(ann_file)
|
||||
elif args.dataset == "ic13":
|
||||
ann = read_IC13_annotation(args.ann_file)
|
||||
ann = read_ic13_annotation(ann_file)
|
||||
elif args.dataset == "svt":
|
||||
ann = read_svt_annotation(args.ann_file)
|
||||
ann = read_svt_annotation(ann_file)
|
||||
|
||||
for img_name, label in ann.items():
|
||||
result_file = os.path.join(result_path, img_name[:-4] + "_0.bin")
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# less required by applicable law or agreed to in writing, software
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# less required by applicable law or agreed to in writing, software
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# less required by applicable law or agreed to in writing, software
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
|
@ -43,7 +43,7 @@ args_opt = parser.parse_args()
|
|||
context.set_context(mode=context.GRAPH_MODE, device_target="Ascend", device_id=args_opt.device_id)
|
||||
|
||||
|
||||
def Deeptext_eval_test(dataset_path='', ckpt_path=''):
|
||||
def deeptext_eval_test(dataset_path='', ckpt_path=''):
|
||||
"""Deeptext evaluation."""
|
||||
ds = create_deeptext_dataset(dataset_path, batch_size=config.test_batch_size,
|
||||
repeat_num=1, is_training=False)
|
||||
|
@ -114,9 +114,9 @@ def Deeptext_eval_test(dataset_path='', ckpt_path=''):
|
|||
print("\n========================================\n")
|
||||
for i in range(config.num_classes - 1):
|
||||
j = i + 1
|
||||
F1 = (2 * precisions[j] * recalls[j]) / (precisions[j] + recalls[j] + 1e-6)
|
||||
f1 = (2 * precisions[j] * recalls[j]) / (precisions[j] + recalls[j] + 1e-6)
|
||||
print("class {} precision is {:.2f}%, recall is {:.2f}%,"
|
||||
"F1 is {:.2f}%".format(j, precisions[j] * 100, recalls[j] * 100, F1 * 100))
|
||||
"F1 is {:.2f}%".format(j, precisions[j] * 100, recalls[j] * 100, f1 * 100))
|
||||
if config.use_ambigous_sample:
|
||||
break
|
||||
|
||||
|
@ -137,4 +137,4 @@ if __name__ == '__main__':
|
|||
|
||||
print("CHECKING MINDRECORD FILES DONE!")
|
||||
print("Start Eval!")
|
||||
Deeptext_eval_test(mindrecord_file, args_opt.checkpoint_path)
|
||||
deeptext_eval_test(mindrecord_file, args_opt.checkpoint_path)
|
||||
|
|
|
@ -6,19 +6,19 @@
|
|||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# less required by applicable law or agreed to in writing, software
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
# ============================================================================
|
||||
|
||||
"""VGG16 for deeptext"""
|
||||
|
||||
import mindspore.common.dtype as mstype
|
||||
import mindspore.nn as nn
|
||||
from mindspore.ops import operations as P
|
||||
|
||||
# """VGG16 for deeptext"""
|
||||
|
||||
|
||||
def _conv(in_channels, out_channels, kernel_size=3, stride=1, padding=0, pad_mode='pad'):
|
||||
"""Conv2D wrapper."""
|
||||
# shape = (out_channels, in_channels, kernel_size, kernel_size)
|
||||
|
@ -60,6 +60,7 @@ class VGG16FeatureExtraction(nn.Cell):
|
|||
self.cast = P.Cast()
|
||||
|
||||
def construct(self, x):
|
||||
""" Construction of VGG """
|
||||
x = self.cast(x, mstype.float32)
|
||||
x = self.conv1_1(x)
|
||||
x = self.relu(x)
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# less required by applicable law or agreed to in writing, software
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# less required by applicable law or agreed to in writing, software
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
|
@ -41,7 +41,7 @@ args_opt = parser.parse_args()
|
|||
|
||||
context.set_context(mode=context.GRAPH_MODE, device_target=args_opt.device_target, device_id=args_opt.device_id)
|
||||
|
||||
def FasterRcnn_eval(dataset_path, ckpt_path, ann_file):
|
||||
def fasterrcnn_eval(dataset_path, ckpt_path, ann_file):
|
||||
"""FasterRcnn evaluation."""
|
||||
ds = create_fasterrcnn_dataset(dataset_path, batch_size=config.test_batch_size, is_training=False)
|
||||
net = Faster_Rcnn_Resnet50(config)
|
||||
|
@ -132,4 +132,4 @@ if __name__ == '__main__':
|
|||
|
||||
print("CHECKING MINDRECORD FILES DONE!")
|
||||
print("Start Eval!")
|
||||
FasterRcnn_eval(mindrecord_file, args_opt.checkpoint_path, args_opt.ann_file)
|
||||
fasterrcnn_eval(mindrecord_file, args_opt.checkpoint_path, args_opt.ann_file)
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# less required by applicable law or agreed to in writing, software
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
|
@ -28,7 +28,8 @@ parser.add_argument("--ann_file", type=str, required=True, help="ann file.")
|
|||
parser.add_argument("--img_path", type=str, required=True, help="image file path.")
|
||||
args = parser.parse_args()
|
||||
|
||||
def get_eval_result(ann_file, img_path):
|
||||
def get_eval_result(ann_file):
|
||||
""" get evaluation result of faster rcnn"""
|
||||
max_num = 128
|
||||
result_path = "./result_Files/"
|
||||
|
||||
|
@ -69,4 +70,4 @@ def get_eval_result(ann_file, img_path):
|
|||
coco_eval(result_files, eval_types, dataset_coco, single_result=False)
|
||||
|
||||
if __name__ == '__main__':
|
||||
get_eval_result(args.ann_file, args.img_path)
|
||||
get_eval_result(args.ann_file)
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# less required by applicable law or agreed to in writing, software
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# less required by applicable law or agreed to in writing, software
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
|
@ -39,7 +39,7 @@ args_opt = parser.parse_args()
|
|||
|
||||
context.set_context(mode=context.GRAPH_MODE, device_target="Ascend", device_id=args_opt.device_id)
|
||||
|
||||
def MaskRcnn_eval(dataset_path, ckpt_path, ann_file):
|
||||
def maskrcnn_eval(dataset_path, ckpt_path, ann_file):
|
||||
"""MaskRcnn evaluation."""
|
||||
ds = create_maskrcnn_dataset(dataset_path, batch_size=config.test_batch_size, is_training=False)
|
||||
|
||||
|
@ -129,4 +129,4 @@ if __name__ == '__main__':
|
|||
print("IMAGE_DIR or ANNO_PATH not exits.")
|
||||
|
||||
print("Start Eval!")
|
||||
MaskRcnn_eval(mindrecord_file, args_opt.checkpoint_path, args_opt.ann_file)
|
||||
maskrcnn_eval(mindrecord_file, args_opt.checkpoint_path, args_opt.ann_file)
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# less required by applicable law or agreed to in writing, software
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
|
@ -29,11 +29,11 @@ parser.add_argument("--ann_file", type=str, required=True, help="ann file.")
|
|||
parser.add_argument("--img_path", type=str, required=True, help="image file path.")
|
||||
args = parser.parse_args()
|
||||
|
||||
def get_imgSize(file_name):
|
||||
def get_img_size(file_name):
|
||||
img = Image.open(file_name)
|
||||
return img.size
|
||||
|
||||
def get_resizeRatio(img_size):
|
||||
def get_resize_ratio(img_size):
|
||||
org_width, org_height = img_size
|
||||
resize_ratio = dst_width / org_width
|
||||
if resize_ratio > dst_height / org_height:
|
||||
|
@ -42,6 +42,7 @@ def get_resizeRatio(img_size):
|
|||
return resize_ratio
|
||||
|
||||
def get_eval_result(ann_file, img_path):
|
||||
""" Get metrics result according to the annotation file and result file"""
|
||||
max_num = 128
|
||||
result_path = "./result_Files/"
|
||||
outputs = []
|
||||
|
@ -52,8 +53,8 @@ def get_eval_result(ann_file, img_path):
|
|||
for img_id in img_ids:
|
||||
file_id = str(img_id).zfill(12)
|
||||
file = img_path + "/" + file_id + ".jpg"
|
||||
img_size = get_imgSize(file)
|
||||
resize_ratio = get_resizeRatio(img_size)
|
||||
img_size = get_img_size(file)
|
||||
resize_ratio = get_resize_ratio(img_size)
|
||||
|
||||
img_metas = np.array([img_size[1], img_size[0]] + [resize_ratio, resize_ratio])
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# less required by applicable law or agreed to in writing, software
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# less required by applicable law or agreed to in writing, software
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
|
@ -39,7 +39,7 @@ args_opt = parser.parse_args()
|
|||
|
||||
context.set_context(mode=context.GRAPH_MODE, device_target="Ascend", device_id=args_opt.device_id)
|
||||
|
||||
def MaskRcnn_eval(dataset_path, ckpt_path, ann_file):
|
||||
def maskrcnn_eval(dataset_path, ckpt_path, ann_file):
|
||||
"""MaskRcnn evaluation."""
|
||||
ds = create_maskrcnn_dataset(dataset_path, batch_size=config.test_batch_size, is_training=False)
|
||||
|
||||
|
@ -131,4 +131,4 @@ if __name__ == '__main__':
|
|||
print("IMAGE_DIR or ANNO_PATH not exits.")
|
||||
|
||||
print("Start Eval!")
|
||||
MaskRcnn_eval(mindrecord_file, args_opt.checkpoint_path, args_opt.ann_file)
|
||||
maskrcnn_eval(mindrecord_file, args_opt.checkpoint_path, args_opt.ann_file)
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# less required by applicable law or agreed to in writing, software
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# less required by applicable law or agreed to in writing, software
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
|
@ -95,8 +95,8 @@ class DetectionEngine:
|
|||
intersect_area = intersect_w * intersect_h
|
||||
ovr = intersect_area / (areas[i] + areas[order[1:]] - intersect_area)
|
||||
|
||||
indexs = np.where(ovr <= threshold)[0]
|
||||
order = order[indexs + 1]
|
||||
indices = np.where(ovr <= threshold)[0]
|
||||
order = order[indices + 1]
|
||||
|
||||
return reserved_boxes
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# less required by applicable law or agreed to in writing, software
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# less required by applicable law or agreed to in writing, software
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# less required by applicable law or agreed to in writing, software
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
|
@ -170,7 +170,7 @@ def get_interp_method(interp, sizes=()):
|
|||
Neighbors method. (used by default).
|
||||
4: Lanczos interpolation over 8x8 pixel neighborhood.
|
||||
9: Cubic for enlarge, area for shrink, bilinear for others
|
||||
10: Random select from interpolation method metioned above.
|
||||
10: Random select from interpolation method mentioned above.
|
||||
Note:
|
||||
When shrinking an image, it will generally look best with AREA-based
|
||||
interpolation, whereas, when enlarging an image, it will generally look best
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# less required by applicable law or agreed to in writing, software
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# less required by applicable law or agreed to in writing, software
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# less required by applicable law or agreed to in writing, software
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# less required by applicable law or agreed to in writing, software
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# less required by applicable law or agreed to in writing, software
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# less required by applicable law or agreed to in writing, software
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# less required by applicable law or agreed to in writing, software
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# less required by applicable law or agreed to in writing, software
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# less required by applicable law or agreed to in writing, software
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# less required by applicable law or agreed to in writing, software
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# less required by applicable law or agreed to in writing, software
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# less required by applicable law or agreed to in writing, software
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# less required by applicable law or agreed to in writing, software
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# less required by applicable law or agreed to in writing, software
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# less required by applicable law or agreed to in writing, software
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# less required by applicable law or agreed to in writing, software
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# less required by applicable law or agreed to in writing, software
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# less required by applicable law or agreed to in writing, software
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# less required by applicable law or agreed to in writing, software
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# less required by applicable law or agreed to in writing, software
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# less required by applicable law or agreed to in writing, software
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# less required by applicable law or agreed to in writing, software
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# less required by applicable law or agreed to in writing, software
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# less required by applicable law or agreed to in writing, software
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# less required by applicable law or agreed to in writing, software
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# less required by applicable law or agreed to in writing, software
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# less required by applicable law or agreed to in writing, software
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# less required by applicable law or agreed to in writing, software
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# less required by applicable law or agreed to in writing, software
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# less required by applicable law or agreed to in writing, software
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# less required by applicable law or agreed to in writing, software
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# less required by applicable law or agreed to in writing, software
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
|
@ -32,7 +32,10 @@ from src.lr_schedule import get_lr
|
|||
from src.init_params import init_net_param, filter_checkpoint_parameter
|
||||
|
||||
|
||||
def main():
|
||||
def get_args():
|
||||
"""
|
||||
Parse arguments
|
||||
"""
|
||||
parser = argparse.ArgumentParser(description="SSD training")
|
||||
parser.add_argument("--only_create_dataset", type=ast.literal_eval, default=False,
|
||||
help="If set it true, only create Mindrecord, default is False.")
|
||||
|
@ -47,7 +50,7 @@ def main():
|
|||
parser.add_argument("--mode", type=str, default="sink",
|
||||
help="Run sink mode or not, default is sink.")
|
||||
parser.add_argument("--dataset", type=str, default="coco",
|
||||
help="Dataset, defalut is coco.")
|
||||
help="Dataset, default is coco.")
|
||||
parser.add_argument("--epoch_size", type=int, default=500,
|
||||
help="Epoch size, default is 500.")
|
||||
parser.add_argument("--batch_size", type=int, default=32,
|
||||
|
@ -63,7 +66,10 @@ def main():
|
|||
parser.add_argument("--filter_weight", type=ast.literal_eval, default=False,
|
||||
help="Filter weight parameters, default is False.")
|
||||
args_opt = parser.parse_args()
|
||||
return args_opt
|
||||
|
||||
def main():
|
||||
args_opt = get_args()
|
||||
context.set_context(mode=context.GRAPH_MODE,
|
||||
device_target="Ascend", device_id=args_opt.device_id)
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# less required by applicable law or agreed to in writing, software
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# less required by applicable law or agreed to in writing, software
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
|
|
Loading…
Reference in New Issue