You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
import numpy as np
|
|
|
|
from matplotlib.colors import rgb_to_hsv
|
|
|
|
|
|
|
|
from check import plot_preds
|
|
|
|
from utils import extract_colors
|
|
|
|
|
|
|
|
if __name__ == "__main__":
|
|
|
|
rgb_tensor, _ = extract_colors()
|
|
|
|
xkcd_rgb = rgb_tensor.numpy()
|
|
|
|
# xkcd_rgb = np.random.rand(1000, 3)
|
|
|
|
xkcd_hsv = rgb_to_hsv(xkcd_rgb)
|
|
|
|
plot_preds(
|
|
|
|
xkcd_hsv[:, 0], xkcd_rgb, fname="hsv", roll=False, dpi=300, figsize=(6, 6)
|
|
|
|
)
|
|
|
|
rgb = np.vstack([np.eye(3), np.eye(3) + np.eye(3)[:, [1, 2, 0]]])
|
|
|
|
print("Pure RGB in Hue-Space:")
|
|
|
|
print(rgb)
|
|
|
|
print(rgb_to_hsv(rgb)[:, 0])
|