Downloads · 30 days
0
Diami/12444
12444 is a machine learning model from Diami. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
from PIL import Image, ImageFilter, ImageOps
Downloads · 30 days
0
Access
Public
Updated Feb 25, 2023
Repo size
—
Likes
0
Public
Click a slice to open those files.
Other1.5 KB · 66%
From the Hugging Face model README
from PIL import Image, ImageFilter, ImageOps
img_url = "https://svs.gsfc.nasa.gov/vis/a000000/a004700/a004720/lroc_color_poles_1k.jpg" img = Image.open(requests.get(img_url, stream=True).raw)
gray_img = ImageOps.grayscale(img)
filtered_img = gray_img.filter(ImageFilter.FIND_EDGES)
inverted_img = ImageOps.invert(filtered_img)
color_map = [(0, 0, 0), (255, 255, 255), (142, 35, 35), (255, 192, 203)] arcane_img = inverted_img.convert('P', palette=Image.ADAPTIVE, colors=4) arcane_img.putpalette(color_map)
arcane_img.show()