ウィンドウショッピングをやめて、ウィンドウショッピングを始めよう!
AIを使ったドロッピング方法
- 目標: AIを使って窓の外から帽子を落とし、ニューヨーク市民に提供するサービスを運営すること。
- 必要なもの: Raspberry Pi、Adafruit ステッパーモーター、糸、Roboflow AI、軽い製品(例: プロペラ帽)。
窓を開ける
- 問題: 窓が約4インチしか開かない。
- 解決: Google検索で窓に合う鍵を見つけて解決。
帽子の選定
- 条件: 落ちるときにけがをさせず、交通の妨げにならない帽子。
- 選択: 未来を象徴し、美しく落ちるプロペラ帽。
ドロッピング機構
- 構成: Raspberry Pi とステッパーモーターを使用。
- 方法: 糸をステッパーモーターに巻き付けて少しずつ動かす。
- コード: Pythonファイルで書かれたドロッピングコード。
import time
import board
import digitalio
enable_pin = digitalio.DigitalInOut(board.D18)
coil_A_1_pin = digitalio.DigitalInOut(board.D4)
coil_A_2_pin = digitalio.DigitalInOut(board.D17)
coil_B_1_pin = digitalio.DigitalInOut(board.D23)
coil_B_2_pin = digitalio.DigitalInOut(board.D24)
enable_pin.direction = digitalio.Direction.OUTPUT
coil_A_1_pin.direction = digitalio.Direction.OUTPUT
coil_A_2_pin.direction = digitalio.Direction.OUTPUT
coil_B_1_pin.direction = digitalio.Direction.OUTPUT
coil_B_2_pin.direction = digitalio.Direction.OUTPUT
enable_pin.value = True
def forward(delay, steps):
i = 0
while i in range(0, steps):
setStep(1, 0, 1, 0)
time.sleep(delay)
setStep(0, 1, 1, 0)
time.sleep(delay)
setStep(0, 1, 0, 1)
time.sleep(delay)
setStep(1, 0, 0, 1)
time.sleep(delay)
i += 1
def setStep(w1, w2, w3, w4):
coil_A_1_pin.value = w1
coil_A_2_pin.value = w2
coil_B_1_pin.value = w3
coil_B_2_pin.value = w4
forward(5, int(512))
AI
- 目標: 窓の下に人がいるかどうかをリアルタイムで検知すること。
- 方法: ウェブカメラを通じて映像をリアルタイム分析し、特定の位置に人がいるか確認する。
- モデル: Roboflowを使って物体検出モデルを作成。
- コード: Pythonファイルで書かれた検知およびドロッピングコード。
import cv2
import time
import paramiko
from inference_sdk import InferenceHTTPClient
CLIENT = InferenceHTTPClient(api_url="https://detect.roboflow.com", api_key="API_KEY")
def ssh_execute(host, port, username, password, command):
client = paramiko.SSHClient()
client.load_system_host_keys()
client.set_missing_host_key_policy(paramiko.WarningPolicy)
try:
client.connect(host, port=port, username=username, password=password)
stdin, stdout, stderr = client.exec_command(command)
print(stdout.read().decode().strip())
if stderr.read().decode().strip():
print('Error:', stderr)
finally:
client.close()
video = cv2.VideoCapture(0)
consec_detections = 0
while True:
ret, frame = video.read()
result = CLIENT.infer(frame, model_id="drop-of-a-a-hat/2")
if 'predictions' in result and len(result['predictions']) > 0:
consec_detections += 1
else:
consec_detections = 0
if consec_detections >= 3:
ssh_execute('raspberry.local', 22, 'pi', 'raspberry', 'python3 dropHat.py')
consec_detections = 0
time.sleep(1)
壮大なビジョン
- ビジョン: ニューヨーク市内を歩き回りながら、必要なあらゆるものが窓から落ちてくる世界。
- 目標: "Window Shopping" の最初の事例として定着すること。
GN⁺の見解
- 興味深い点: AIとIoTを組み合わせ、創造的なビジネスモデルを提示している。
- 導入時の検討事項: 窓の構造と安全面の問題を事前に十分検討する必要がある。
- 技術的課題: AIモデルの精度とリアルタイム処理性能が重要。
- 類似プロジェクト: ドローン配送サービスに似た概念として拡張の可能性がある。
- 社会的影響: 都市生活の利便性を高めると同時に、新しい形の商取引を生み出す可能性がある。
1件のコメント
Hacker Newsの意見