Beispiel #1
0
    def __init__(self,
                 logfile=None,
                 threshold=None,
                 frame_skip=None,
                 downscale_factor=None,
                 save_images=None,
                 isShow=False):
        """初始化
        
        Keyword Arguments:
            threshold {int} -- 阈值 (default: {30})
            frame_skip {int} -- 跳帧 (default: {0})
            downscale_factor {int} -- 压缩率 (default: {50})
            save_images {bool} -- 是否存储采样图片 (default: {True})
        """
        BasicPart.__init__(self, logfile=logfile, isShow=isShow)

        # 若有自定义参数,则进行覆盖
        if threshold != None:
            self.threshold = threshold

        if frame_skip != None:
            self.frame_skip = frame_skip

        if downscale_factor != None:
            self.downscale_factor = downscale_factor

        if save_images != None:
            self.save_images = save_images

        self.content_detector = detectors.ContentDetector(
            threshold=self.threshold)
Beispiel #2
0
 def __init__(self, videoinfo, logfile=None, isShow=False, savepic=False):
     """初始化
     
     Arguments:
         videoinfo {视频信息} -- {'name','datetime','descrption'}
     
     Keyword Arguments:
         logfile {string} -- 可选,log文件名 (default: {None})
         isShow {bool} -- 是否显示处理过程 (default: {False})
     """
     BasicPart.__init__(self, logfile, isShow)
     self.videoinfo = videoinfo
     self.__mkdirs()
     self.dbhandler = DBHandler()
     self.item_list = []
     # 人物识别
     self.pf = PersonFace(True)
     fi = FeatureIndex(True)
     fi.load_person_index(["Person"])
     self.pf.setFeatureIndex(fi)
     self.savepic = savepic
     # solr
     self.solrhandler = MainSolr(logfile, isShow)
     self.save_video()
     pass
Beispiel #3
0
 def __init__(self, logfile=None, isShow=False):
     """初始化
     """
     BasicPart.__init__(self, logfile=logfile, isShow=isShow)
     self.num_pixels = -1
     # 记录hsv历史数据,保留:{id, relate_id, hsv}
     self.hsv_history = []
     # 记录缩减的scene数目
     self.reduce_count = 0
     # 总item数
     self.sum_count = 0
     # 向前追溯最远距离
     self.maxdistance = 8
Beispiel #4
0
    def __init__(self, 
        max_len=1000, logfile=None, isShow=False):
        BasicPart.__init__(self, logfile, isShow)
        self.imagename     = ''
        self.facerecog     = FaceRecog(logfile=logfile, isShow=isShow)
        self.objectdetect  = ObjectDet(logfile, single_pic_process=True,isShow=isShow, picShow=False)
        self.dbhandler     = DBHandler()
        self.searchfeature = FeatureIndex(logfile=logfile, isShow=isShow)
        self.personface    = PersonFace(logfile=logfile, isShow=isShow)
        self.solrobj       = MainSolr(logfile=logfile, isShow=isShow)

        self.max_len = max_len
        # 默认阈值
        self.setThreshold(800, 1000)      
Beispiel #5
0
 def __init__(self,
              logfile=None,
              single_pic_process=False,
              isShow=False,
              picShow=False):
     '''
         useconfig:读取配置文件
         logfile:   日志文件路径
         isShow:    显示图片处理过程
         single_pic_process: 处理单张图片
     '''
     BasicPart.__init__(self, logfile=logfile, isShow=isShow)
     self.picShow = picShow
     self.__read_config()
     if single_pic_process:
         self.__kerasinit()
Beispiel #6
0
 def __init__(self,                     
     logfile=None, 
     isShowIndex=False,
     isShow=False):
     BasicPart.__init__(self, logfile, isShow)
     self.isfaceLoad    = False
     self.iscontLoad    = False
     self.ispersLoad    = False        
     self.isShowIndex = isShowIndex
     # 索引对象列表
     self.face_index_list     = []
     self.face_id_list_list   = []
     self.cont_index_list     = []
     self.cont_id_list_list   = []
     self.person_index_list   = []
     self.person_id_list_list = []
     pass
Beispiel #7
0
 def __init__(self, 
     threshold = None, 
     logfile   = None,
     picShow   = False,          
     isShow    = False): 
     '''
         threshold: 人脸大小阈值
         logfile:   日志文件路径
         isShow:    显示图片处理过程
         
     '''
     BasicPart.__init__(self, logfile=logfile, isShow=isShow)
     self.picShow  = picShow
     from DBHandler import DBHandler
     self.handler = DBHandler()        
     self.initFR()
     # 缓存
     self.dbcache = {}
Beispiel #8
0
 def __init__(self, 
     threshold = None, 
     logfile   = None,
     picShow   = False,          
     isShow    = False): 
     '''
         threshold: 人脸大小阈值
         logfile:   日志文件路径
         isShow:    显示图片处理过程
         
     '''
     BasicPart.__init__(self, logfile=logfile, isShow=isShow)
     self.picShow  = picShow
     self.detector = Detector()
     self.aligner = Aligner()
     self.identifier = Identifier()
     # self.thresh = self.config.getint('facerecog','threshold')
     if threshold != None:
         self.thresh = threshold
     
     self.detector.set_min_face_size(self.thresh)
Beispiel #9
0
 def __init__(self, logfile=None, isShow=False):
     BasicPart.__init__(self, logfile, isShow)
     self.handler = DBHandler()