zoukankan      html  css  js  c++  java
  • dataset prepare

    dataset   prepare

    
    

    """
    Mask R-CNN
    Common utility functions and classes.

    
    

    Copyright (c) 2017 Matterport, Inc.
    Licensed under the MIT License (see LICENSE for details)
    Written by Waleed Abdulla
    """


    def
    prepare(self, class_map=None): """Prepares the Dataset class for use. TODO: class map is not supported yet. When done, it should handle mapping classes from different datasets to the same class ID. """ def clean_name(name): """Returns a shorter version of object names for cleaner display.""" return ",".join(name.split(",")[:1]) # Build (or rebuild) everything else from the info dicts. self.num_classes = len(self.class_info) self.class_ids = np.arange(self.num_classes) self.class_names = [clean_name(c["name"]) for c in self.class_info] self.num_images = len(self.image_info) self._image_ids = np.arange(self.num_images) # Mapping from source class and image IDs to internal IDs self.class_from_source_map = {"{}.{}".format(info['source'], info['id']): id for info, id in zip(self.class_info, self.class_ids)} self.image_from_source_map = {"{}.{}".format(info['source'], info['id']): id for info, id in zip(self.image_info, self.image_ids)} # Map sources to class_ids they support self.sources = list(set([i['source'] for i in self.class_info])) self.source_class_ids = {} # Loop over datasets for source in self.sources: self.source_class_ids[source] = [] # Find classes that belong to this dataset for i, info in enumerate(self.class_info): # Include BG class in all datasets if i == 0 or source == info['source']: self.source_class_ids[source].append(i)

    #################################

    QQ 3087438119
  • 相关阅读:
    杭电1029--Ignatius and the Princess IV(哈希)
    杭电1465--不容易系列之一
    杭电1021--Fibonacci Again
    杭电5018--Revenge of Fibonacci
    UVa10651(记忆化搜索)
    <Win32_5>深入浅出Win32的计时器
    偷个空,写个博客——各种沟通各种纠结
    Arbitrage HDU
    常用的字符串处理方法
    无法捕获的异常:MissingMethodException
  • 原文地址:https://www.cnblogs.com/herd/p/14693894.html
Copyright © 2011-2022 走看看