This file contains hidden or 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
| docker run --rm -it --network=host --privileged bluenviron/mavp2p serial:/dev/ttyACM1:57600 udps:0.0.0.0:5700 |
This file contains hidden or 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 | |
| from scipy.spatial.transform import Rotation as R | |
| if __name__ == '__main__': | |
| # Generating a random point cloud within specified spatial limits | |
| num_points = 100 # Reduced number of points for clarity | |
| points_3d = np.random.rand(num_points, 3) # Random points in 3D | |
| # Scale and shift points to fit within the specified range | |
| points_3d[:, 0] = points_3d[:, 0] * 1000 - 500 # X: -500 to 500 mm |
This file contains hidden or 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 argparse | |
| import dataclasses | |
| import json | |
| import math | |
| import threading | |
| import time | |
| from typing import List | |
| import matplotlib | |
| import matplotlib.animation as animation |
This file contains hidden or 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
| void setup() { | |
| Serial.begin(230400,SERIAL_8N1); | |
| Serial1.begin(230400, SERIAL_8N1, 21, 22); | |
| } | |
| int n; | |
| void loop() { | |
| n = Serial1.available(); | |
| if (n != 0) | |
| { |
This file contains hidden or 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 json | |
| from argparse import ArgumentParser | |
| def convert(input_file, output_file): | |
| with open(input_file, 'r') as fin: | |
| data2 = json.load(fin) | |
| features = data2['features'] | |
| with open(output_file, 'w') as fout: |
This file contains hidden or 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 torch | |
| import torchvision | |
| from torch.utils.data import DataLoader | |
| from torchvision.transforms import ToTensor | |
| train_dataset = torchvision.datasets.MNIST('data', train=True, transform=ToTensor(), download=True) | |
| test_dataset = torchvision.datasets.MNIST('data', train=False, transform=ToTensor(), download=True) | |
| batch_size = 16 |
This file contains hidden or 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 | |
| w = torch.tensor([5.], requires_grad=True) | |
| lr = 0.6 | |
| w_mom_grad = 0 | |
| momentum_coef = 0.9 | |
| weight_decay = 0.001 | |
| for i in range(10): |
This file contains hidden or 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 | |
| x = torch.tensor([1.5,2.8,15.,19.5]) | |
| y = torch.tensor([0.,0.,1.,1.]) | |
| w = torch.tensor([-.3], requires_grad=True) | |
| b = torch.tensor([0.1232154], requires_grad=True) | |
| def model(x): |
This file contains hidden or 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 time | |
| import av | |
| import tqdm | |
| from av.video import VideoStream | |
| desired_fps = 2 | |
| timestamp = int(time.time()) |
This file contains hidden or 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
| client | |
| # put the line below to disable tunneling outcoming trafic | |
| route-nopull | |
| .... |
NewerOlder