コード例 #1
0
ファイル: training.py プロジェクト: MichaelBBTiger/linemod
    options = parser.parse_args()

    return options


if __name__ == '__main__':
    options = parse_args()

    plasm = ecto.Plasm()

    #setup the input source, grayscale conversion
    trainer = Trainer(path='/wg/stor2a/vrabaud/workspace/recognition_kitchen_groovy/build/buildspace/lib/object_recognition_reconstruction')
    model_filler = ModelFiller()

    #connect up the pose_est
    plasm.connect(trainer['detector'] >>  model_filler['detector'])

    object_id = 'whoolite'
    writer = ModelWriter(session_ids=list_to_cpp_json_str([]),
                        object_id=object_id, db_params=ObjectDbParameters({'type': 'CouchDB',
                                                                              'root': 'http://bwl.willowgarage.com:5984',
                                                                              'collection': 'object_recognition'}),
                        method=LinemodDetectionPipeline.type_name(),
                        json_submethod=dict_to_cpp_json_str({}),
                        json_params=dict_to_cpp_json_str({}))

    plasm.connect(model_filler["db_document"] >> writer["db_document"])

    options.niter = 1
    run_plasm(options, plasm, locals=vars())
コード例 #2
0
ファイル: detection.py プロジェクト: hris2003/linemod
    db_params = ObjectDbParameters({
        'type': 'CouchDB',
        'root': 'http://bwl.willowgarage.com:5984',
        'collection': 'object_recognition'
    })
    object_db = ObjectDb(db_params)

    #setup the input source, grayscale conversion
    from ecto_openni import VGA_RES, FPS_30
    source = create_source('image_pipeline',
                           'OpenNISource',
                           image_mode=VGA_RES,
                           image_fps=FPS_30)

    print LinemodDetectionPipeline.type_name()
    object_ids = ['whoolite', 'tilex']
    model_documents = Models(object_db, object_ids,
                             LinemodDetectionPipeline.type_name(),
                             json_helper.dict_to_cpp_json_str({}))
    print len(model_documents)
    detector = Detector(model_documents=model_documents,
                        db=object_db,
                        threshold=90)

    #connect up the pose_est
    plasm.connect(source['image'] >> detector['image'],
                  source['depth'] >> detector['depth'])
    plasm.connect(source['image'] >> imshow(name='source')[:])

    if 0:
コード例 #3
0
ファイル: detection.py プロジェクト: abdullah38rcc/linemod

if __name__ == '__main__':
    options = parse_args()

    plasm = ecto.Plasm()

    db_params = ObjectDbParameters({'type': 'CouchDB', 'root': 'http://bwl.willowgarage.com:5984',
                                        'collection': 'object_recognition'})
    object_db = ObjectDb(db_params)

    #setup the input source, grayscale conversion
    from ecto_openni import VGA_RES, FPS_30
    source = create_source('image_pipeline','OpenNISource',image_mode=VGA_RES,image_fps=FPS_30)

    print LinemodDetectionPipeline.type_name()
    object_ids = ['whoolite', 'tilex']
    model_documents = Models(object_db, object_ids, LinemodDetectionPipeline.type_name(), json_helper.dict_to_cpp_json_str({}))
    print len(model_documents)
    detector = Detector(model_documents=model_documents, db=object_db, threshold=90)

    #connect up the pose_est
    plasm.connect(source['image'] >> detector['image'],
                  source['depth'] >> detector['depth']
                  )
    plasm.connect(source['image'] >> imshow(name='source')[:])

    if 0:
        import ecto_ros
        import ecto_ros.ecto_sensor_msgs
        import sys
コード例 #4
0
    #setup the input source, grayscale conversion
    trainer = Trainer(
        path=
        '/wg/stor2a/vrabaud/workspace/recognition_kitchen_groovy/build/buildspace/lib/object_recognition_reconstruction'
    )
    model_filler = ModelFiller()

    #connect up the pose_est
    plasm.connect(trainer['detector'] >> model_filler['detector'])

    object_id = 'whoolite'
    writer = ModelWriter(session_ids=list_to_cpp_json_str([]),
                         object_id=object_id,
                         db_params=ObjectDbParameters({
                             'type':
                             'CouchDB',
                             'root':
                             'http://bwl.willowgarage.com:5984',
                             'collection':
                             'object_recognition'
                         }),
                         method=LinemodDetectionPipeline.type_name(),
                         json_submethod=dict_to_cpp_json_str({}),
                         json_params=dict_to_cpp_json_str({}))

    plasm.connect(model_filler["db_document"] >> writer["db_document"])

    options.niter = 1
    run_plasm(options, plasm, locals=vars())