Skip to content

Instantly share code, notes, and snippets.

import torch
from torch.utils.data import Dataset, DataLoader
from torchvision import transforms
import time
from sklearn import datasets
import numpy
from PIL import Image
class ImageDataSet(Dataset):
"""Image dataset."""
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.nn.parameter import Parameter
from torch.autograd import Function
import numpy as np
def one_hot(index, classes):
size = index.size() + (classes,)
import numpy as np
import cv2 as cv
# Most of the code come from https://docs.opencv.org/master/d4/dee/tutorial_optical_flow.html
# But, The algorithm is changed to TVL-1
cap = cv.VideoCapture(cv.samples.findFile("vtest.avi"))
ret, frame1 = cap.read()
prvs = cv.cvtColor(frame1, cv.COLOR_BGR2GRAY)
hsv = np.zeros_like(frame1)
from skimage import io, filters, draw, color
import numpy as np
# A Fast algorithm for active contours and curvature estimation
# https://www.cs.princeton.edu/courses/archive/spr02/cs496/williams_shah.pdf
def main():
# ループの終了条件
max_iter = 10000
thresh_finish = 10.0
import torch
import torchvision
import numpy as np
import time
def main():
# wget 'https://ultralytics.com/images/zidane.jpg' in advance.
model = torch.hub.load('ultralytics/yolov5', 'yolov5s', pretrained=True)
model = model.to('cuda')
<!DOCTYPE html>
<html lang="en">
<head>
<title>Lens distortion WebGL sample using three.js. Giliam de Carpentier, 2015. BSD licensed. See
www.decarpentier.nl/lens-distortion for more details</title>
<meta charset="utf-8">
<style>
body {
margin: 0px;
@yudai09
yudai09 / errors_come_from_camera_orientaton.ipynb
Created March 6, 2023 14:41
errors_come_from_camera_orientaton.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
import numpy as np
import laspy as lp
import open3d as o3d
import time
def main():
pcd = o3d.geometry.PointCloud()
points, colors = load_las_file()