最近在做安全帽的识别,训练集标注好后需要进行归一化,简单写了个算法凑合用 import xml.etree.ElementTree as ET import os import numpy as np VOC_CLASSES = ( # always index 0 'blue', 'red', 'yellow', 'white','no') #读取xml并进行归一化 def parse_rec(filename): """ Parse a PASCAL VOC xml file """ tree = ET.parse(filename) objects = [] jects = [] for obj in tree.findall('object'): objc = {} difficult = int(obj.find('difficult').text) if difficult == 1: # print(filename) continue objc['name'] = obj.find('name').text bbox = obj.find('bndbox') objc['bbox'] = [int(float(bbox.find('xmin').text)), int(float(bbox.find('ymin').text)), int(float(bbox.find('xmax').text)), int(flo
MIN-MAX归一化
最新推荐文章于 2025-04-02 10:54:15 发布