从mxnet的rec数据中还原图片

 

From:  python程序,可以从mxnet的rec数据文件中,将图片还原出来

 

# -*- coding: UTF-8 -*-
import mxnet as mx
import argparse
import PIL.Image
import io
import numpy as np
#import cv2
#import tensorflow as tf
import os
import imageio
from mxnet import ndarray as nd
import matplotlib.pyplot 

def parse_args():
    parser = argparse.ArgumentParser(
        formatter_class=argparse.ArgumentDefaultsHelpFormatter,
        description='data path information'
    )
    parser.add_argument('--bin_path', default='/work/faces_ms1m_112x112/train.rec', type=str,
                        help='path to the binary image file')
    parser.add_argument('--idx_path', default='/work/faces_ms1m_112x112/train.idx', type=str,
                        help='path to the image index path')
    parser.add_argument('--tfrecords_file_path', default='/work/faces_ms1m_112x112/img_data', type=str,
  

你可能感兴趣的:(MXNet)