zoukankan      html  css  js  c++  java
  • 查看生成的数据维度

    from mpl_toolkits.mplot3d import Axes3D
    import matplotlib.pyplot as plt
    import numpy as np
    %matplotlib inline

    from __future__ import print_function
    import numpy as np

    def valid_imshow_data(data):
        data = np.asarray(data)
        if data.ndim == 2:
            return True
        elif data.ndim == 3:
            if 3 <= data.shape[2] <= 4:
                return True
            else:
                print('The "data" has 3 dimensions but the last dimension '
                      'must have a length of 3 (RGB) or 4 (RGBA), not "{}".'
                      ''.format(data.shape[2]))
                return False
        else:
            print('To visualize an image the data must be 2 dimensional or '
                  '3 dimensional, not "{}".'
                  ''.format(data.ndim))
            return False

    data = np.load('/home/nkh/nkh/DSB2017-master/training/detector/results/res18/bbox/0a0c32c9e08cc2ea76a71649de56be6d_lbb.npy')

    valid_imshow_data(data)/data.shape

    clean.npy四维

    label.npy二维

    pbb.npy二维

    lbb.npy一维

  • 相关阅读:
    this指向
    call方法
    js浮点数的比较
    最近写h5 后台可配置大图轮播 发现pc上面正常,手机端无法显示
    记录好用的网站
    s-table组件设定
    iview TimePicker实现选择时间段
    symbol的使用
    JS笔记
    linux网络基础管理
  • 原文地址:https://www.cnblogs.com/nkh222/p/7687240.html
Copyright © 2011-2022 走看看