Browse Source

try anchoring secondary colors

new-sep-loss
Michael Pilosov 10 months ago
parent
commit
0366b5d0f1
  1. BIN
      hsv.png
  2. 3
      hsv.py
  3. 6
      utils.py

BIN
hsv.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 MiB

After

Width:  |  Height:  |  Size: 2.7 MiB

3
hsv.py

@ -12,6 +12,7 @@ if __name__ == "__main__":
plot_preds( plot_preds(
xkcd_hsv[:, 0], xkcd_rgb, fname="hsv", roll=False, dpi=300, figsize=(6, 6) xkcd_hsv[:, 0], xkcd_rgb, fname="hsv", roll=False, dpi=300, figsize=(6, 6)
) )
rgb = np.eye(3) rgb = np.vstack([np.eye(3), np.eye(3) + np.eye(3)[:, [1, 2, 0]]])
print("Pure RGB in Hue-Space:") print("Pure RGB in Hue-Space:")
print(rgb)
print(rgb_to_hsv(rgb)[:, 0]) print(rgb_to_hsv(rgb)[:, 0])

6
utils.py

@ -34,7 +34,7 @@ def extract_colors():
return rgb_tensor, xkcd_color_names return rgb_tensor, xkcd_color_names
PURE_RGB = preprocess_data( PURE_RGB = preprocess_data(torch.eye(3) + torch.eye(3)[:, [1, 2, 0]])
torch.tensor([[1, 0, 0], [0, 1, 0], [0, 0, 1]], dtype=torch.float32) PURE_HSV = torch.tensor(
[[0], [1 / 3], [2 / 3], [5 / 6], [1 / 6], [0.5]], dtype=torch.float32
) )
PURE_HSV = torch.tensor([[0], [1 / 3], [2 / 3]], dtype=torch.float32)

Loading…
Cancel
Save