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
""" | |
data.txt | |
0,0,0 | |
1,1,0 | |
0,1,1 | |
1,0,1 | |
""" | |
import torch |
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 typing import List | |
from ..component import Component | |
from ...state import AllState, VehicleState, EntityRelation, EntityRelationEnum, Path, Trajectory, Route, ObjectFrameEnum | |
from ...utils import serialization | |
from ...mathutils.transforms import vector_madd, vector_dist | |
import math | |
import numpy as np | |
# Two helper functions to get plaaning time | |
# Should be moved to mathutils? |
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
img_path = 'image/G2/6.jpg'# Detect and remove unrelevant regions (batch). | |
import cv2 | |
import numpy as np | |
import pandas as pd | |
# Parameters. | |
group_lst = ['G1', 'G2', 'G3', 'G4'] | |
group_dct = {'G1': 19, 'G2': 13, 'G3': 15, 'G4': 16} | |
kernel = np.ones((5,5), np.uint8) | |
img_path = 'image/G2/6.jpg' |
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
# Copyright 2017 The TensorFlow Authors. All Rights Reserved. | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 | |
# | |
# Unless required by applicable law or agreed to in writing, software | |
# distributed under the License is distributed on an "AS IS" BASIS, |
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
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 | |
# | |
# Unless required by applicable law or agreed to in writing, software | |
# distributed under the License is distributed on an "AS IS" BASIS, |
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 requests | |
headers = {'X-AIO-KEY':'08e1fcfcb7554b348679ca0633241e42'} | |
res = requests.post('https://io.adafruit.com/api/v2/jackyyeh/feeds/light/data', {"value":900}, headers=headers) | |
print(res.json()) |
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 sys | |
import Adafruit_DHT | |
import requests | |
import time | |
headers = {'X-AIO-KEY':'b89e5148eebe4f7b9eb366de79deabba'} | |
sensor = Adafruit_DHT.DHT11 | |
pin = 4 # GPIO4 (Raspberry Pi 3 pin 7) |