将生成图像送进inception, 得到1x1000的预测向量;
1. 如果生成的样本比较真实,那么Inception应该给出某个比较明确的类别, 向量中某个值比较高, 因此预测向量的信息熵越低越好;
2. 如果生成的样本多样性好,那么对于产生的一批样本,其对应的这批类别标签的分布应该比较均匀(各个类别都生成了一些), 因此类别标签的信息熵越高越好;
| import numpy as np | |
| import ros_numpy | |
| from sensor_msgs.msg import PointCloud2 | |
| """ | |
| pc: 2d numpy array of shape (N, 4) | |
| """ | |
| pc_array = np.zeros(len(pc), dtype=[ |
| def transform_pointcloud(T_X_2_pc, pc): | |
| """ | |
| transform pointcloud to frame X with transformation T_X_2_pc | |
| :param T_x_2_pc: a transform matrix of shape(4, 4) | |
| :param pc: a 2d array of shape (N, D) (the first 3 dim of D is x, y, z; the rest dim can be any extra data) | |
| :return: a 2d array of shape (N, D) | |
| """ | |
| pc[:, :3] = np.matmul( | |
| T_X_2_pc, | |
| np.column_stack([pc[:, :3], np.ones(len(pc)).reshape(-1, 1)]).T |
| import numpy as np | |
| def umeyama(X, Y): | |
| # From https://gist.github.com/CarloNicolini/7118015 | |
| # and https://github.com/ethz-asl/maplab/blob/master/test/end-to-end-common/python/end_to_end_common/umeyama.py | |
| assert X.shape[0] == 3 | |
| assert Y.shape[0] == 3 | |
| assert X.shape[1] > 0 | |
| assert Y.shape[1] > 0 |
| # !/usr/bin/env python3 | |
| # coding=utf-8 | |
| from __future__ import print_function, division, absolute_import | |
| import rospy | |
| from sensor_msgs.msg import PointCloud2 | |
| from nav_msgs.msg import Odometry | |
| import cv2 | |
| from cv_bridge import CvBridge, CvBridgeError |
| import functools | |
| import json | |
| import os | |
| import random | |
| import shutil | |
| from collections import defaultdict | |
| import matplotlib.pyplot as plt | |
| import pycocotools | |
| from pycocotools import mask |
| import array | |
| import cv2 | |
| import numpy as np | |
| import numpy.linalg as LA | |
| import open3d as o3d | |
| import matplotlib.pyplot as plt | |
| def load_calib(calib_file_path): | |
| """ |
| import numpy as np | |
| import cv2 | |
| def correction( | |
| img, | |
| shadow_amount_percent, shadow_tone_percent, shadow_radius, | |
| highlight_amount_percent, highlight_tone_percent, highlight_radius, | |
| color_percent | |
| ): | |
| """ |
| get_cmake_property(_variableNames VARIABLES) | |
| foreach (_variableName ${_variableNames}) | |
| message(STATUS "${_variableName}=${${_variableName}}") | |
| endforeach() |
Install oracle-java8-jdk:
sudo add-apt-repository -y ppa:webupd8team/java && sudo apt update && sudo apt -y install oracle-java8-installer