# -*- encoding:utf-8 -*-
# @Time    : 2021/1/3 15:15
# @Author  : gfjiang
import os.path as osp
import mmcv
import numpy as np
import cvtools
import matplotlib.pyplot as plt
import cv2.cv2 as cv
from functools import partial
import torch
import math
from cvtools.utils.path import add_prefix_filename_suffix

from mmdet.ops import nms
from mmdet.apis import init_detector, inference_detector


def draw_features(module, input, output, work_dir='./'):
    x = output.cpu().numpy()
    out_channels = list(output.shape)[1]
    height = int(math.sqrt(out_channels))
    width = height
    if list(output.shape)[2] < 128:
        return
    fig = plt.figure(figsize=(32, 32))
    fig.subplots_adjust(left=0.05, right=0.95, bottom=0.05, top=0.95, wspace=0.05, hspace=0.05)
    for i in range(height * width):
        plt.subplot(height, width, i + 1)
        plt.axis('off')
        img = x[0, i, :, :]
        pmin = np.min(img)
        pmax = 
np.max(img)