segment.py 文件源码

python
阅读 33 收藏 0 点赞 0 评论 0

项目:antares 作者: CONABIO 项目源码 文件源码
def handle(self, **options):
        '''
        In this example command, the values that come from the user input are
        added up and the result is printed in the screen.
        '''
        stack = options['path'][0]
        output_vector_file = '/Users/agutierrez/%s.gpkg' % get_basename(stack)


        segmentation = bis.Model()


        shapes, transform, meta = segmentation.predict(stack)

        # Vectorize
        #shapes = features.shapes(segments.astype(np.uint16), transform=transform)


        start_time = time.time()
        print 'about to start query' 
        query = persist_database(shapes, meta)
        print 'done'
        print time.time() - start_time
        start_time = time.time()
        with connection.cursor() as cursor:
            cursor.execute(query)
        transaction.commit()  
        print time.time() - start_time

        #persist_file(shapes, output_vector_file, meta)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号