프로젝트

일반

사용자정보

개정판 69c8fbf0

ID69c8fbf0c8874c295a3824906d2c21e9ded2e9d2
상위 02bc2a5f
하위 b2027eec, 3bbfbe44

함의성이(가) 4년 이상 전에 추가함

issue #1366: fix label load

Change-Id: I11bd31b4d61fbd7cab892f404606d177be518433

차이점 보기:

DTI_PID/WebServer/symbol_training/src/doftech_dataset.py
25 25
        self.img_path_list = sorted([item for sublist in [glob.glob(self.img_path + ext) for ext in ["*.jpg", "*.png"]] for item in sublist])#sorted(glob.glob(os.path.join(self.img_path, '*.jpg')))
26 26

  
27 27
        self.img_list = []
28
        for img_path in self.img_path_list:
29
            self.img_list.append(cv2.imread(img_path))
28
        #for img_path in self.img_path_list:
29
        #    self.img_list.append(cv2.imread(img_path))
30 30

  
31 31
        self.img_list_new = []
32 32
        self.anno_list_new = []
......
34 34
        self.anno_path_list = sorted([item for sublist in [glob.glob(self.xml_path + ext) for ext in ["*.xml"]] for item in sublist])#sorted(glob.glob(os.path.join(self.xml_path, '*.xml')))
35 35
        self.anno_list = []
36 36

  
37
        for anno_path in self.anno_path_list:
37
        #for anno_path in self.anno_path_list:
38
        for index in range(self.anno_path_list):
39
            anno_path = self.anno_path_list[index]
38 40
            annot = ET.parse(anno_path)
39 41
            objects = []
40 42
            for obj in annot.findall('object'):
......
44 46
                    #label = self.classes.index(obj.find('name').text.lower().strip())
45 47
                    label = self.classes.index(obj.find('name').text)
46 48
                    objects.append([xmin, ymin, xmax, ymax, label])
47
            self.anno_list.append(objects)
49
            if objects:
50
                self.anno_list.append(objects)
51
                img_path = self.img_path_list[index]
52
                self.img_list.append(cv2.imread(img_path))
48 53

  
49 54
        if self.is_training==True:
50 55
            if self.use_rescale == True:

내보내기 Unified diff

클립보드 이미지 추가 (최대 크기: 500 MB)