Skip to content

Instantly share code, notes, and snippets.

View chunibyo-wly's full-sized avatar
🏠
Working from home

Longyong Wu chunibyo-wly

🏠
Working from home
View GitHub Profile
@chunibyo-wly
chunibyo-wly / image_patch_split.py
Last active November 13, 2024 01:27
手动切分图片和标注以及转换 COCO 格式到 DOTA 格式
import cv2
from pycocotools.coco import COCO
from tqdm import tqdm
import numpy as np
import os
import os.path as osp
import shapely
from copy import deepcopy
import json
import shutil
@chunibyo-wly
chunibyo-wly / highlight.js
Created May 19, 2024 16:15
Google Sheet App Script 自动高亮单元格关键词
function getAllIndexes(string, texts) {
const results = [];
texts.forEach(text => {
const regex = new RegExp(text, 'gi');
let match;
while ((match = regex.exec(string)) !== null) {
const startIndex = match.index;
const endIndex = match.index + text.length - 1;
@chunibyo-wly
chunibyo-wly / blender_fastapi.py
Created June 17, 2024 13:42
blender 启动 webserver
import bpy
import threading
import uvicorn
from fastapi import FastAPI
# Define the FastAPI application
app = FastAPI()
@app.get("/")
def read_root():
@chunibyo-wly
chunibyo-wly / .tmux_startup.sh
Created September 7, 2024 09:25
Prevent WSLg suspend when terminal closed
#!/bin/bash
FLAG_FILE="/tmp/startup_script_executed"
if [ ! -f "$FLAG_FILE" ]; then
# Your commands here
echo "Running startup commands..."
# Example: Start a new tmux session with specific windows
tmux new-session -d -s my_session