This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import argparse | |
import os | |
import PIL | |
import cv2 | |
import numpy as np | |
import torch | |
from densepose import add_densepose_config | |
from densepose.vis.densepose_results import ( | |
DensePoseResultsFineSegmentationVisualizer as Visualizer, | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
Sends a slack message to #general if there are any lambdalabs instances available | |
If there are, it will also send a message to #general with the name and price of the instance | |
If there are GPU instances available, it will also request one | |
''' | |
from slack_utils import send_slack_message | |
import requests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
HEIGHT=768 | |
WIDTH=1024 | |
OVERLAP = 256 | |
PROMPT = "360 degree equirectangular panorama photograph, alps, mountains, landscape,\ | |
trending on artstation, cinematic composition, beautiful lighting, hyper detailed, 8 k, photo, photography" | |
INPAINT_FIRST = False # use inpainting to fill in the first frame (force blue, green etc) | |
USE_OPEN_JOURNEY = False # open journey is nice, but inpainting works with vanilla SD - sometimes the difference is too big. | |
#Also open journey does not work with all resolution sizes | |
# First image - no overlap here. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# %% | |
import replicate | |
model = replicate.models.get("prompthero/openjourney") | |
version = model.versions.get("9936c2001faa2194a261c01381f90e65261879985476014a0a37a334593a05eb") | |
PROMPT = "mdjrny-v4 style 360 degree equirectangular panorama photograph, Alps, giant mountains, meadows, rivers, rolling hills, trending on artstation, cinematic composition, beautiful lighting, hyper detailed, 8 k, photo, photography" | |
output = version.predict(prompt=PROMPT, width=1024, height=512) | |
# %% | |
# download the iamge from the url at output[0] | |
import requests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
box = pv.Box() | |
box.triangulate() | |
faces = box.faces.reshape((-1,5)) #first dim is nr of points | |
faces = faces[:,1:] | |
t = trimesh.creation.Trimesh(vertices=np.array(box.points), | |
faces = faces, | |
face_normals = t2.face_normals) | |