This file contains hidden or 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
| #!/usr/bin/env python3 | |
| import os | |
| import sys | |
| import argparse | |
| import subprocess | |
| import glob | |
| from pathlib import Path | |
| import natsort |
This file contains hidden or 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
| #!/usr/bin/env python3 | |
| """ | |
| File Name Checker | |
| This script checks if all file names from the first directory exist somewhere | |
| in the second directory, including subdirectories recursively. | |
| """ | |
| import os | |
| import sys |
This file contains hidden or 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
| #!/usr/bin/env python3 | |
| import os | |
| import shutil | |
| import argparse | |
| from pathlib import Path | |
| def copy_source_files(source_dir, dest_dir, extensions=('.h', '.cpp', '.pde')): | |
| """ | |
| Recursively find files with specified extensions and copy them to destination |
This file contains hidden or 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 os | |
| import time | |
| import matplotlib.pyplot as plt | |
| from datetime import datetime | |
| def format_time(epoch_time): | |
| return time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(epoch_time)) | |
| # Global figure and axis for single window | |
| fig, ax = None, None |
This file contains hidden or 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
| #!/usr/bin/env bash | |
| # List all projects | |
| projects=$(gcloud projects list --format="value(projectId)") | |
| # Function to check if Compute Engine API is enabled | |
| is_compute_api_enabled() { | |
| local project=$1 | |
| gcloud services list --enabled --project="$project" --format="value(config.name)" | grep -q "compute.googleapis.com" | |
| } |
This file contains hidden or 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 os | |
| import socket | |
| import time | |
| import struct | |
| from multiprocessing import Process | |
| socket_path = "/tmp/ipc_benchmark_socket" | |
| def run_server(): | |
| if os.path.exists(socket_path): |
This file contains hidden or 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
| #pragma once | |
| #include <vector> | |
| #include "ofImage.h" | |
| class FixedVideoDelay { | |
| private: | |
| int delayAmount; | |
| int totalFrames; | |
| int readPosition; |
This file contains hidden or 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 zmq | |
| context = zmq.Context() | |
| socket = context.socket(zmq.PULL) | |
| socket.bind("tcp://*:5558") | |
| print("Collector started... collecting results.") | |
| while True: | |
| result = socket.recv_json() | |
| print(f"Collected: {result}") |
This file contains hidden or 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 threading | |
| import queue | |
| class ThreadedWorker(): | |
| def __init__(self): | |
| self.input_queue = queue.Queue() | |
| self.output_queue = queue.Queue() | |
| self.should_exit = False | |
| self.thread = threading.Thread(target=self.run) | |
This file contains hidden or 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 types | |
| import PIL | |
| import torch | |
| from diffusers.pipelines.stable_diffusion_xl.pipeline_stable_diffusion_xl_img2img import retrieve_latents | |
| from diffusers.utils.torch_utils import randn_tensor | |
| def prepare_latents( | |
| self, image, timestep, batch_size, num_images_per_prompt, dtype, device, generator=None, add_noise=True, fixed_noise=True | |
| ): | |
| if not isinstance(image, (torch.Tensor, PIL.Image.Image, list)): |
NewerOlder