forked from mindspore-Ecosystem/mindspore
!19583 fix some network problem
Merge pull request !19583 from jiangzhenguang/fix_someme_problem
This commit is contained in:
commit
24df7fc466
|
@ -23,7 +23,7 @@ class CRNNAccuracy(nn.Metric):
|
|||
"""
|
||||
|
||||
def __init__(self, config, print_flag=True):
|
||||
super(CRNNAccuracy).__init__()
|
||||
super(CRNNAccuracy, self).__init__()
|
||||
self.config = config
|
||||
self._correct_num = 0
|
||||
self._total_num = 0
|
||||
|
|
|
@ -16,10 +16,10 @@
|
|||
import random
|
||||
import threading
|
||||
import copy
|
||||
|
||||
import numpy as np
|
||||
from PIL import Image
|
||||
import cv2
|
||||
from model_utils.config import config
|
||||
|
||||
def _rand(a=0., b=1.):
|
||||
return np.random.rand() * (b - a) + a
|
||||
|
@ -550,13 +550,13 @@ class MultiScaleTrans:
|
|||
|
||||
if self.size_dict.get(seed_key, None) is None:
|
||||
random.seed(seed_key)
|
||||
new_size = random.choice(self.config.multi_scale)
|
||||
new_size = random.choice(config.multi_scale)
|
||||
self.size_dict[seed_key] = new_size
|
||||
seed = seed_key
|
||||
|
||||
input_size = self.size_dict[seed]
|
||||
for img, anno in zip(imgs, annos):
|
||||
img, anno = preprocess_fn(img, anno, self.config, input_size, self.device_num, self.each_multiscale)
|
||||
img, anno = preprocess_fn(img, anno, config, input_size, self.device_num, self.each_multiscale)
|
||||
ret_imgs.append(img.transpose(2, 0, 1).copy())
|
||||
bbox_true_1, bbox_true_2, bbox_true_3, gt_box1, gt_box2, gt_box3 = \
|
||||
_preprocess_true_boxes(true_boxes=anno, anchors=self.anchor_scales, in_shape=img.shape[0:2],
|
||||
|
|
Loading…
Reference in New Issue