핵심 요약
1인칭 시점(Egocentric) 비전을 활용하여 일반 디스플레이를 비접촉 인터페이스로 변환하는 시스템을 구축한다. Roboflow의 InferencePipeline으로 비디오 스트림을 관리하고, RF-DETR Nano로 화면 위치를, MediaPipe로 21개의 손 키포인트를 실시간 감지한다. 엄지와 검지 사이의 거리를 계산해 핀치 제스처를 인식하고 이를 OS의 줌 이벤트로 변환하여 물리적 터치 없이 화면을 제어한다. 이 방식은 스마트 글래스 등 웨어러블 기기에서 활용 가능한 효율적인 상호작용 아키텍처를 제시한다.
배경
Python 프로그래밍, OpenCV 기초 지식, 컴퓨터 비전 파이프라인에 대한 이해
대상 독자
실시간 컴퓨터 비전 애플리케이션 개발자 및 HCI 연구자
의미 / 영향
고가의 하드웨어 없이도 웹캠과 오픈소스 모델만으로 정교한 비접촉 인터페이스를 구현할 수 있음을 보여주며, 향후 스마트 글래스 생태계의 핵심 입력 방식이 될 가능성을 제시한다.
섹션별 상세
from inference import InferencePipeline
pipeline = InferencePipeline.init_with_custom_logic(
video_reference=settings.camera,
on_video_frame=processor.infer,
on_prediction=processor.on_prediction,
)Roboflow InferencePipeline을 사용하여 비디오 스트림과 추론 콜백을 설정하는 코드
options = HandLandmarkerOptions(
base_options=BaseOptions(model_asset_path=model_path),
running_mode=VisionRunningMode.LIVE_STREAM,
num_hands=1,
result_callback=result_callback,
)
landmarker = HandLandmarker.create_from_options(options)MediaPipe Hand Landmarker를 실시간 스트림 모드로 설정하는 코드


model = RFDETRSegNano()
model.optimize_for_inference(dtype=torch.float16)
model.predict(frame.image, threshold=threshold)RF-DETR Nano 모델을 로드하고 추론을 실행하는 코드
def on_prediction(self, predictions: Any, video_frame: VideoFrame) -> None:
hand_result = predictions[0]
laptop_detections = predictions[1]
corner = self._laptop_detector.get_corner(laptop_detections)
if hand_result is not None and hand_result.hand_landmarks:
for hand_landmarks in hand_result.hand_landmarks:
self._gesture_manager.detect_and_execute(hand_landmarks, corner)추론 결과를 받아 손 랜드마크와 화면 위치를 기반으로 제스처를 실행하는 콜백 함수
실무 Takeaway
- InferencePipeline을 활용하면 복잡한 멀티스레딩 코드 없이도 여러 모델을 결합한 실시간 컴퓨터 비전 파이프라인을 구축할 수 있다.
- 단순한 손 위치 추출을 넘어 RF-DETR로 상호작용 표면을 먼저 감지하고 기준점을 잡아야 실제 애플리케이션 제어에 필요한 상대 좌표를 얻을 수 있다.
- MediaPipe의 비동기 라이브 스트림 모드를 적용하여 프레임 드랍 없이 부드러운 제스처 인식을 구현하는 것이 실시간 인터페이스의 핵심이다.
언급된 리소스
AI 요약 · 북마크 · 개인 피드 설정 — 무료