🤖 AI/ML

Computer Vision

Computer Vision

The field of AI in which computers understand images and video. Used in object recognition, segmentation, and autonomous driving.

📖 Detailed Explanation

Computer Vision is a field of artificial intelligence in which computers analyze and understand digital images and video to extract meaningful information. Mimicking the human visual system, it automates tasks such as object recognition, scene understanding, and pattern detection. As of 2024-2025, foundation models such as Vision Transformer (ViT), CLIP, and SAM (Segment Anything Model) are transforming the paradigm of computer vision.

The history of computer vision began with MIT's Summer Vision Project in the 1960s, and after AlexNet won the ImageNet competition in 2012, deep learning-based approaches became mainstream. CNN architectures such as ResNet and EfficientNet then advanced, and with the introduction of the Transformer architecture after 2020, multimodal learning and zero-shot recognition became possible. In particular, since Meta's release of SAM in 2023, the generalization ability of segmentation tasks has improved greatly.

Core tasks include image classification, object detection, semantic segmentation, instance segmentation, pose estimation, and depth estimation. Recent models such as YOLOv8, DINO, and Grounding DINO support real-time processing and open-vocabulary recognition, so they can be applied immediately across many domains.

In practice, computer vision is used in nearly every industry, including autonomous vehicles, medical image diagnosis, manufacturing quality inspection, security surveillance, AR/VR, and agricultural drones. As of 2025, combined with Edge AI chipsets (NVIDIA Jetson Orin, Apple Neural Engine), on-device inference is becoming commonplace, and real-time vision applications linked with 5G/6G networks are spreading.

💻 Code Example

An example of object detection with YOLOv8 and image processing with OpenCV.

# YOLOv8을 사용한 객체 탐지 예제
# pip install ultralytics opencv-python

from ultralytics import YOLO
import cv2

# YOLOv8 모델 로드 (nano, small, medium, large, xlarge 선택 가능)
model = YOLO('yolov8n.pt')  # 가장 빠른 nano 모델

# 이미지 파일로 객체 탐지
image_path = 'sample.jpg'
results = model(image_path)

# 결과 시각화 및 저장
for result in results:
    # 바운딩 박스 정보
    boxes = result.boxes
    for box in boxes:
        cls = int(box.cls[0])  # 클래스 인덱스
        conf = float(box.conf[0])  # 신뢰도
        label = model.names[cls]  # 클래스 이름
        print(f"탐지: {label} (신뢰도: {conf:.2f})")

    # 결과 이미지 저장
    result.save(filename='result.jpg')

# 실시간 웹캠 객체 탐지
cap = cv2.VideoCapture(0)
while cap.isOpened():
    ret, frame = cap.read()
    if not ret:
        break

    # 추론 수행
    results = model(frame, verbose=False)
    annotated_frame = results[0].plot()  # 결과 시각화

    cv2.imshow('YOLOv8 Detection', annotated_frame)
    if cv2.waitKey(1) & 0xFF == ord('q'):
        break

cap.release()
cv2.destroyAllWindows()

An example of image classification using the Transformers library.

# Vision Transformer를 사용한 이미지 분류
# pip install transformers torch pillow

from transformers import ViTImageProcessor, ViTForImageClassification
from PIL import Image
import torch

# ViT 모델과 프로세서 로드
processor = ViTImageProcessor.from_pretrained('google/vit-base-patch16-224')
model = ViTForImageClassification.from_pretrained('google/vit-base-patch16-224')

# 이미지 로드 및 전처리
image = Image.open('cat.jpg')
inputs = processor(images=image, return_tensors="pt")

# 추론 수행
with torch.no_grad():
    outputs = model(**inputs)
    logits = outputs.logits

# Top-5 예측 결과
probs = torch.softmax(logits, dim=-1)
top5_probs, top5_indices = torch.topk(probs, 5)

print("Top-5 예측 결과:")
for prob, idx in zip(top5_probs[0], top5_indices[0]):
    label = model.config.id2label[idx.item()]
    print(f"  {label}: {prob.item():.4f}")

📊 Performance & Cost

A comparison of major computer vision models as of January 2025.

Model COCO mAP Speed (FPS) Parameter Use case
YOLOv8-nano 37.3% ~600 FPS 3.2M Edge/Mobile
YOLOv8-large 52.9% ~100 FPS 43.7M Server inference
DINO (ViT-L) 63.0% ~15 FPS 304M High-precision analysis
SAM (ViT-H) - ~10 FPS 641M Segmentation

Cloud vision API price comparison (as of January 2025):

Services Price per 1,000 Free tier Key features
Google Cloud Vision $1.50 1,000/month OCR, labeling, faces
AWS Rekognition $1.00 5,000/month (12 months) Objects, text, faces
Azure Computer Vision $1.00 5,000/month Analysis, OCR, thumbnails

🗣️ Say It Like This in Practice

💬 In a Meeting
"When we applied YOLOv8 to defect detection on a manufacturing line, inspection time dropped from 2 seconds to 0.1 seconds, and the defect detection rate rose from 95% to 99.2%. Real-time processing is possible on an Edge GPU, so there's no additional infrastructure cost either."
💬 In an Interview
"In an autonomous driving project, I implemented BEV (Bird's Eye View) transformation and multi-camera fusion. By integrating the inputs from 6 cameras into 3D space, we improved object tracking accuracy by 40%, and optimizing with TensorRT achieved real-time processing at 30 FPS."
💬 In a Technical Discussion
"With the arrival of foundation models like SAM, domain-specific data labeling costs have dropped significantly. With prompt-based segmentation, it can be applied right away even to medical imaging without pre-training, and fine-tuning gives expert-level accuracy."

Take a mock interview on this topic → WIA SOOM AI Interview · Start for free

⚠️ Common Mistakes & Cautions

❌

Ignoring the gap between training data and the real environment

Applying a model trained on COCO or ImageNet directly to an industrial setting significantly degrades performance. Fine-tuning on real-environment data with different lighting, angles, and backgrounds is essential.

❌

Mismatch between model size and inference environment

Attempts to deploy large server-class models to Edge devices often fail. Check the target hardware's memory and compute capacity first, and choose an appropriate model size.

✅

The right approach

Run benchmarks in the target environment early in the project and clearly define the trade-off between accuracy and speed. Use inference optimization tools such as ONNX, TensorRT, and CoreML to convert the model for the deployment environment.

🔗 Related Terms

📚 Learn More