Skip to content

Instantly share code, notes, and snippets.

@stu6520
stu6520 / img_rescale.py
Created September 14, 2022 01:28
rescale multiple images at one time
import PIL
import os
import os.path
from PIL import Image
from PIL import ImageFile
ImageFile.LOAD_TRUNCATED_IMAGES = True
f = r'C:\Users\username\Desktop\example'
#folder path for rescaling
@stu6520
stu6520 / multi_test.py
Created September 14, 2022 01:19
multipal images detection for yolov3 or v4(no gpu)
#put this file in the same folder as darknet_no_gpu.exe
import os
import sys
import shutil
from pykeyboard import PyKeyboard
k = PyKeyboard()
index = 1
path = r"/Users/username/Desktop/example/"
@stu6520
stu6520 / img_converter.py
Created September 14, 2022 00:48
convert multiple images format at one time
from PIL import Image
from os import listdir
from os.path import splitext
target_directory = '.'
target = '.jpg'
for file in listdir(target_directory):
filename, extension = splitext(file)
try:
@stu6520
stu6520 / demo.cpp
Created September 14, 2022 00:39
camera realtime demo for Yolo-FastestV2
#include "yolo-fastestv2.h"
#include <chrono>
using namespace std::chrono;
int drawBoxes(cv::Mat srcImg, std::vector<TargetBox> boxes)
{
static const char* class_names[] = {
"person", "bicycle", "car", "motorcycle", "airplane", "bus", "train", "truck", "boat", "traffic light",
"fire hydrant", "stop sign", "parking meter", "bench", "bird", "cat", "dog", "horse", "sheep", "cow",
"elephant", "bear", "zebra", "giraffe", "backpack", "umbrella", "handbag", "tie", "suitcase", "frisbee",