섹션별 상세
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)추론 결과를 받아 손 랜드마크와 화면 위치를 기반으로 제스처를 실행하는 콜백 함수
용어 해설
- 1인칭 시점 비전(Egocentric Vision)
- — 사용자의 몸이나 머리에 장착된 카메라를 통해 사용자가 보는 것과 동일한 시각적 데이터를 처리하는 컴퓨터 비전 분야이다. 기기가 아닌 사용자 자체가 참조점이 되어 주변 환경과 상호작용하는 방식을 연구하며, 스마트 글래스나 웨어러블 기기의 핵심 기술이다.
- 손 키포인트(Hand Landmarks)
- — 손가락 마디, 끝점, 손목 등 손의 기하학적 구조를 나타내는 특정 지점들의 좌표 집합이다. 일반적으로 21개의 포인트를 추출하여 손의 모양, 방향, 제스처를 실시간으로 파악하는 데 사용되며 제스처 기반 인터페이스 구현의 기초가 된다.
- 추론 파이프라인(Inference Pipeline)
- — 입력 데이터 수집부터 전처리, 모델 실행, 결과 후처리 및 출력까지의 전 과정을 자동화한 소프트웨어 구조이다. 실시간 영상 처리에서 프레임 드랍을 방지하고 멀티스레딩을 효율적으로 관리하여 추론 성능을 최적화하는 역할을 한다.
- 핀치 제스처(Pinch Gesture)
- — 엄지와 검지 손가락을 모으거나 벌리는 동작이다. 컴퓨터 비전에서는 두 손가락 끝점 사이의 유클리드 거리를 계산하여 상태를 감지하며, 주로 화면의 확대(Zoom-in) 및 축소(Zoom-out) 명령을 수행하는 인터페이스로 활용된다.
- 투영 변환(Projective Transform)
- — 한 평면의 점들을 다른 평면으로 투영할 때 발생하는 기하학적 왜곡을 보정하는 수학적 기법이다. 카메라 각도가 비스듬할 때 감지된 화면 좌표를 실제 디스플레이 좌표계로 정확하게 매핑하기 위해 사용되는 호모그래피 계산을 포함한다.
기술
- Roboflow Inference
- MediaPipe
- RF-DETR
- Python
- PyTorch
- pynput
활용 사례
- 비접촉 화면 제어
- 스마트 글래스 인터페이스
- 가상 터치패드
언급된 리소스
AI 요약 · 북마크 · 개인 피드 설정 — 무료
출처 · 인용 안내
인용 시 "요약 출처: AI Trends (aitrends.kr)"를 표기하고, 사실 확인은 원문 보기 기준으로 진행해 주세요. 자세한 기준은 운영 정책을 참고해 주세요.