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 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.""" |
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 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,) |
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 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 |
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 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) |
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 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') |
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
<!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; |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 laspy as lp | |
import open3d as o3d | |
import time | |
def main(): | |
pcd = o3d.geometry.PointCloud() | |
points, colors = load_las_file() |
OlderNewer