本文整理汇总了Python中features.Features方法的典型用法代码示例。如果您正苦于以下问题:Python features.Features方法的具体用法?Python features.Features怎么用?Python features.Features使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类features
的用法示例。
在下文中一共展示了features.Features方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: import features [as 别名]
# 或者: from features import Features [as 别名]
def __init__(self):
# initialise config
self.config_provider = ConfigProvider()
# initialise robots
self.rocky_robot = RockyRobot()
self.sporty_robot = SportyRobot()
# initialise webcam
self.webcam = Webcam()
# initialise markers
self.markers = Markers()
self.markers_cache = None
# initialise features
self.features = Features(self.config_provider)
# initialise texture
self.texture_background = None
示例2: __init__
# 需要导入模块: import features [as 别名]
# 或者: from features import Features [as 别名]
def __init__(self, exchanges, logger, db_prices, db_other, db_client):
self.exchanges = exchanges
self.logger = logger
self.db_prices = db_prices
self.db_other = db_other
self.db_client = db_client
self.db_collections_price = {
i.get_name(): db_prices[i.get_name()] for i in self.exchanges}
# Save-later queue.
self.signals_save_to_db = queue.Queue(0)
# DataFrame container: data[exchange][symbol][timeframe].
self.data = {}
self.init_dataframes(empty=True)
# Strategy models.
self.models = self.load_models(self.logger)
# Signal container: signals[exchange][symbol][timeframe].
self.signals = {}
# persistent reference to features library.
self.feature_ref = Features()
示例3: hierarchical_segmentation
# 需要导入模块: import features [as 别名]
# 或者: from features import Features [as 别名]
def hierarchical_segmentation(I, k = 100, feature_mask = features.SimilarityMask(1, 1, 1, 1)):
F0, n_region = segment.segment_label(I, 0.8, k, 100)
adj_mat, A0 = _calc_adjacency_matrix(F0, n_region)
feature_extractor = features.Features(I, F0, n_region)
# stores list of regions sorted by their similarity
S = _build_initial_similarity_set(A0, feature_extractor)
# stores region label and its parent (empty if initial).
R = {i : () for i in range(n_region)}
A = [A0] # stores adjacency relation for each step
F = [F0] # stores label image for each step
# greedy hierarchical grouping loop
while len(S):
(s, (i, j)) = S.pop()
t = feature_extractor.merge(i, j)
# record merged region (larger region should come first)
R[t] = (i, j) if feature_extractor.size[j] < feature_extractor.size[i] else (j, i)
Ak = _new_adjacency_dict(A[-1], i, j, t)
A.append(Ak)
S = _merge_similarity_set(feature_extractor, Ak, S, i, j, t)
F.append(_new_label_image(F[-1], i, j, t))
# bounding boxes for each hierarchy
L = feature_extractor.bbox
return (R, F, L)
示例4: setup_method
# 需要导入模块: import features [as 别名]
# 或者: from features import Features [as 别名]
def setup_method(self, method = None, w = 10, h = 10):
self.h, self.w = h, w
image = numpy.zeros((self.h, self.w, 3), dtype=numpy.uint8)
label = numpy.zeros((self.h, self.w), dtype=int)
self.f = features.Features(image, label, 1)