# AI를 사용해 뉴욕 시민들에게 창문 밖으로 모자를 떨어뜨리는 기술

> Clean Markdown view of GeekNews topic #15483. Use the original source for factual precision when an external source URL is present.

## Metadata

- GeekNews HTML: [https://news.hada.io/topic?id=15483](https://news.hada.io/topic?id=15483)
- GeekNews Markdown: [https://news.hada.io/topic/15483.md](https://news.hada.io/topic/15483.md)
- Type: GN+
- Author: [neo](https://news.hada.io/@neo)
- Published: 2024-06-24T09:45:01+09:00
- Updated: 2024-06-24T09:45:01+09:00
- Original source: [dropofahat.zone](https://dropofahat.zone/)
- Points: 1
- Comments: 1

## Topic Body

### 창문 쇼핑을 멈추고 창문 쇼핑을 시작하자!

#### AI를 이용한 드롭핑 방법

- **목표**: AI를 이용해 창문 밖으로 모자를 떨어뜨려 뉴욕 시민들에게 제공하는 서비스 운영.
- **필요한 것들**: Raspberry Pi, Adafruit 스테퍼 모터, 실, Roboflow AI, 가벼운 제품(예: 프로펠러 모자).

#### 창문 열기

- **문제**: 창문이 약 4인치밖에 열리지 않음.
- **해결**: 구글링을 통해 창문에 맞는 키를 찾아 해결.

#### 모자 선택

- **조건**: 떨어질 때 다치지 않고, 교통에 방해되지 않는 모자.
- **선택**: 미래를 상징하고 아름답게 떨어지는 프로펠러 모자.

#### 드롭핑 메커니즘

- **구성**: Raspberry Pi와 스테퍼 모터 사용.
- **방법**: 실을 스테퍼 모터에 감아 조금씩 움직이게 함.
- **코드**: Python 파일로 작성된 드롭핑 코드.

```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 파일로 작성된 감지 및 드롭핑 코드.

```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 모델의 정확도와 실시간 처리 성능이 중요함.
- **유사 프로젝트**: 드론 배송 서비스와 유사한 개념으로 확장 가능성 있음.
- **사회적 영향**: 도시 생활의 편리함을 증대시키는 동시에 새로운 형태의 상거래를 창출할 수 있음.

## Comments



### Comment 26524

- Author: neo
- Created: 2024-06-24T09:45:02+09:00
- Points: 1

###### [Hacker News 의견](https://news.ycombinator.com/item?id=40767459) 
- **유용한 AI**: 오랜만에 인터넷에서 본 가장 유용한 것임. 훌륭한 작업에 감사함.
- **모자 낙하**: 프로펠러와 바람에도 불구하고 모자가 직선으로 떨어지는 것이 이해되지 않음.
- **프로젝트 사랑**: 이런 종류의 프로젝트를 좋아함. 여러 주에서 AI 생성 콘텐츠에 워터마크를 요구하는 법안을 추진 중임.
- **잘못된 사용**: 모자 대신 다른 것을 사용하면 치명적일 수 있음.
- **예상치 못한 멋진 게시물**: 처음엔 평범할 줄 알았으나 매우 흥미로웠음. 저자가 많은 도전을 극복하고 이를 쉽게 해결한 것처럼 보임.
- **비디오 객체 감지**: Roboflow SaaS를 사용하는 이유가 궁금함. Pi가 Frigate나 DOODS 같은 온디바이스 솔루션을 실행하기에 성능이 부족한 것 같음.
- **웹캠 아이디어**: 뉴올리언스의 Bourbon St 발코니에서 파티에 구슬을 던지는 웹캠 아이디어가 멋짐. 관심 있는 사람은 연락처를 남기길 바람.
- **투자 기회**: 이 투자 기회에 참여하고 싶었으나 너무 늦은 것 같음.
- **이웃 가게 찾기**: 가끔 길에서 껌을 원함. 요약하자면, 가벼운 제품, Raspberry Pi, Adafruit 스테퍼 모터, 실, Roboflow를 사용함.
- **가짜 비디오**: 모자가 떨어질 때 사라졌다가 다시 나타나는 비디오 클립이 있음.
