batch_manager.py 文件源码

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

项目:SSD-Keras_Tensorflow 作者: jedol 项目源码 文件源码
def binary_encoder(data):
    ## Input
    ##  data: dict
    ##      'id': sample ID(usually name of image file)
    ##      'image': path to image file
    ##      'objects': dict
    ##          'bbox': bounding box coordinate of object
    ##          'label': label of object
    ## Output
    ##  string: encoded list
    ##      [id, encoded_image, labels, nbboxes]

    ## encode image
    image = cv2.imread(data['image'])
    _, encoded_image = cv2.imencode('.jpg', image)
    data['image'] = encoded_image

    return pickle.dumps(data, pickle.HIGHEST_PROTOCOL)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号