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
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
# All Vagrant configuration is done below. The "2" in Vagrant.configure | |
# configures the configuration version (we support older styles for | |
# backwards compatibility). Please don't change it unless you know what | |
# you're doing. | |
$rootScript = <<SCRIPT | |
cd /home/vagrant |
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 numpy as np | |
import cv2 | |
# Get bounding boxes from the model | |
results = model(input_img) | |
boxes = results[0].boxes | |
# Iterate over all boxes and crop image segments | |
cropped_images = [] | |
for box in boxes: |
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
from PIL import Image | |
def add_white_background(image_path): | |
# Open the image | |
image = Image.open(image_path) | |
# Check if the image has a transparent background | |
if image.mode == 'RGBA': | |
# Add a white background |
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 cv2 as cv | |
import numpy as np | |
# Load image | |
img = cv.imread('input_image_name.jpg', 0) | |
# Apply median filter to remove noise | |
img = cv.medianBlur(img, 5) | |
# Apply adaptive thresholding |
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 Foundation | |
class Person { | |
var clothes: String | |
var shoes: String | |
init(clothes: String, shoes: String) { | |
self.clothes = clothes | |
self.shoes = shoes | |
} |
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
#include "FastLED.h" | |
#define NUM_LEDS 300 // Number of LEDs in strip | |
CRGB leds[NUM_LEDS]; | |
#define PIN 5 // Arduino pin connected to the LED strip | |
byte selectedEffect=-1; // start with "-1" since the "loop" will right away increase it by 1 | |
void setup() | |
{ | |
FastLED.addLeds<WS2811, PIN, GRB>(leds, NUM_LEDS).setCorrection( TypicalLEDStrip ); | |
} |