분류 전체보기 643

YOLO 기초, 영상 인식, 영상에서 사물인식하기 yolo11x, yolo11n

YOLO 기초, 영상 인식, 영상에서 사물인식하기 yolo11x, yolo11n 1. requirements.txtpip install -r requirements.txt 2. 모듈 만들기utils 폴더를 보면 init파일이 있다. video_utils.py에 이 모듈의 메서드가 있다. main()함수가 잘 작동되는지 테스트 해보자.import cv2from ultralytics import YOLOfrom utils import (read_video)def main(): print("hello")if __name__ == "__main__": main()  3. save videovideo_utils.pyimport cv2def read_video(video_path): cap = cv..

depth pro, YOLO11, 거리재기

depth pro는 사진 또는 영상을 보고 카메라로부터 해당 대상까지 거리를 잴 수 있는 기능이다. 색깔 또는 수치상으로 나타낼 수 있다. https://github.com/apple/ml-depth-pro GitHub - apple/ml-depth-pro: Depth Pro: Sharp Monocular Metric Depth in Less Than a Second.Depth Pro: Sharp Monocular Metric Depth in Less Than a Second. - apple/ml-depth-progithub.com 위 문제를 푸는 동안 import module 오류가 계속 일어났는데, 결국 패스경로를 잘못 입력해서 나타나는 현상이었다. ModuleNotFoundError Tracebac..

openCV 중급 손가락으로 그리기

손가락으로 글씨를 쓰고, 해당 수식을 gemini 모델로 계산하여 답을 나오게 하는 코드이다.  handTrackingModule.py#Importing All the Required Librariesimport cv2import mediapipe as mpclass handDetector(): def __init__(self, mode = False, max_hands = 1, model_complexity = 1, min_det_conf = 0.7, min_tracking_confidence = 0.7): self.mode = mode self.max_hands = max_hands self.model_complexity = model_complexity ..

머신러닝/openCV 2025.03.05

openCV 기초, mediapipe 설치 에러 해결하기, dll문제

1. 발생한 에러ImportError: DLL load failed while importing _framework_bindings: DLL 초기화 루틴을 실행할 수 없습니다. mediapipe 를 임포트 하려고 하는 중에 발생한 에러였다.  이를 해결하기 위한 방법으로 챗이 제안한 것은 다양했다. 다른 방법으로는 해결되지 않았다. 마지막 방법이었던 파이썬 3.9를 설치하니 바로 해결! 결국 파이썬 버전이 맞지 않아서 되지 않았던 것이다.  찾아보니, 나와 같은 mediapipe 설치 에러 문제가 많이 발생하는데 설치한 패키지와 파이썬 버전의 호환 때문이 대다수다.  파이썬을 설치하는 방법은 아래의 공식홈페이지에서 3.9 버전 중 하나를 설치하는 것https://www.python.org/download..

머신러닝/openCV 2025.03.04

pycharm 새로운 가상환경 만들기

문제 상황(.venv) PS C:\Users\samsung\PycharmProjects\Section_01> pip install -r requirements.txt Fatal error in launcher: Unable to create process using '"C:\Users\samsung\PycharmProjects\PythonProject18\.venv\Scripts\python.exe" "C:\Users\samsung\PycharmProjects\Section_01\.venv\Scripts\pip.exe" install -r requirements.txt': ??? ??? ?? ? ????.  1. 기존 가상환경 삭제Remove-Item -Recurse -Force .venv  2. 새 가..