Ultralytics YOLO27: Join the waitlist.
License YOLO
Back to Ultralytics Glossary

Action Recognition

Action recognition, or human activity recognition (HAR), labels what people do in video by modeling motion over time. Methods, datasets, and code.

Action recognition is a computer vision task that classifies what a person, or sometimes an animal or robot, is doing in a video: walking, waving, falling, swinging a golf club, or doing a push-up. It extends image classification along time, because many actions cannot be told apart in a single frame. A still image of someone halfway down may show sitting or standing up, while a short clip shows which one is happening. The term is often used interchangeably with human activity recognition (HAR), although HAR also covers recognition from wearable sensors such as accelerometers.

How Action Recognition Works#

Models take a clip, typically 8 to 64 frames sampled from a few seconds of video, and learn two kinds of information: spatial features describing what the people and objects look like, and temporal features describing how they move. Early two-stream networks processed RGB frames and optical flow in separate branches and fused their predictions. 3D convolutional neural networks convolve across height, width, and time at once; I3D built them by inflating 2D image filters pretrained on ImageNet into 3D, and SlowFast pairs a low-frame-rate pathway for appearance with a high-frame-rate pathway for motion. Video transformers apply self-attention across space-time patches, and VideoMAE pretrains them by reconstructing heavily masked video.

A 3D CNN from the TorchVision video models classifies a clip in a few lines:

import cv2
import numpy as np
import torch
from torchvision.models.video import R3D_18_Weights, r3d_18

# Load a 3D CNN pretrained on the 400 action classes of Kinetics-400
weights = R3D_18_Weights.KINETICS400_V1
model = r3d_18(weights=weights).eval()

# Read 16 consecutive frames from a short exercise video
cap = cv2.VideoCapture("https://github.com/ultralytics/assets/releases/download/v0.0.0/solution_ci_pose_demo.mp4")
frames = [cv2.cvtColor(cap.read()[1], cv2.COLOR_BGR2RGB) for _ in range(16)]

# Stack the frames into one clip shaped (time, channels, height, width) and classify it
clip = torch.from_numpy(np.stack(frames)).permute(0, 3, 1, 2)
batch = weights.transforms()(clip).unsqueeze(0)
with torch.no_grad():
    probs = model(batch).softmax(dim=1)[0]

top = probs.argmax().item()
print(f"{weights.meta['categories'][top]}: {probs[top]:.2f}")

The model prints push up: 0.99: it labels the whole half-second clip with one action from its 400 classes.

Skeleton-based methods take a different route. A pose estimation model first finds body keypoints in every frame, and a temporal model such as the graph network ST-GCN classifies the resulting joint trajectories. Skeletons ignore clothing, lighting, and background, and they are small enough to process in real time on edge devices. Ultralytics YOLO26 pose models supply the 17 body keypoints per person for this route, and the workouts monitoring solution turns the angle between three of those keypoints into repetition counts for exercises such as push-ups and squats.

  • Pose estimation and object tracking: Pose estimation locates joints and tracking keeps each person's identity across frames. Both are often inputs to action recognition, which interprets the movement they describe; in a crowd, each tracked person gets their own clip and label.
  • Temporal action localization: Finds when each action starts and ends in a long, untrimmed video. Spatio-temporal action detection goes further and boxes each actor in each frame, as in the AVA dataset.
  • Video understanding: The broader field that also covers captioning, question answering, and reasoning about events and causes in video.

Real-World Applications#

  • Healthcare and elder care: Fall detection systems recognize a fall from camera or wearable data and alert staff, and rehabilitation apps check that patients perform exercises correctly.
  • Fitness and sports: Apps count repetitions and score form, and sports analytics classify shots, passes, and strokes in broadcast footage.
  • Safety and security: Monitoring systems flag fights in public spaces and falls or unsafe lifting on factory floors.
  • Human-robot interaction: Robots and smart devices respond to gestures such as waving or pointing.

Datasets and Challenges#

Labeling video takes far more effort than labeling images, so progress has followed large datasets. Kinetics-400 contains at least 400 YouTube clips of about 10 seconds for each of its 400 human action classes, and UCF101 has 13,320 clips in 101 classes. Something-Something V2 targets scene bias, the tendency of models to recognize swimming from the pool instead of the strokes: its roughly 220,000 clips show hands interacting with everyday objects in 174 classes that differ only in motion, such as "pushing something from left to right" and "pushing something from right to left".

Explore solutions

Computer vision in sports

Computer vision in sports

Discover how Ultralytics YOLO powers sports vision with player and ball tracking, performance analytics, coaching insights, and athlete rehabilitation.
Learn more
Computer vision for aerial imagery

Computer vision for aerial imagery

Turn drone and aerial imagery into real-time insights for agriculture, aquaculture, conservation, and geospatial analysis with Ultralytics YOLO.
Learn more
Computer vision in aerospace

Computer vision in aerospace

Apply computer vision in aerospace with Ultralytics YOLO for aircraft inspection, runway FOD detection, airport ground operations, and composite defect detection.
Learn more
Computer vision in security

Computer vision in security

Protect every site with Ultralytics YOLO models. Vision AI powers perimeter monitoring, threat detection, license-plate recognition, and workplace safety.
Learn more
Computer vision in robotics

Computer vision in robotics

Power smarter machines with Ultralytics YOLO models. Vision AI in robotics drives autonomous navigation, perception, object tracking, and real-time control.
Learn more
Computer vision in logistics

Computer vision in logistics

Streamline logistics with Ultralytics YOLO models. Vision AI enables package inspection, sorting, vehicle tracking, and real-time warehouse safety monitoring.
Learn more
Computer vision in retail

Computer vision in retail

Reimagine retail with Ultralytics YOLO models. Vision AI powers inventory tracking, shelf monitoring, queue management, and smarter customer insights.
Learn more
Computer vision in healthcare

Computer vision in healthcare

Build healthcare solutions with Ultralytics YOLO models. Vision AI in healthcare powers faster medical imaging, smarter diagnostics, and patient monitoring.
Learn more
Computer vision in manufacturing

Computer vision in manufacturing

Optimize manufacturing with Ultralytics YOLO models. Vision AI drives quality control, defect detection, PPE compliance, and assembly line automation.
Learn more
Computer vision in automotive

Computer vision in automotive

Apply computer vision in automotive with Ultralytics YOLO models. Vision AI elevates road safety, driver assistance, and vehicle automation for smarter roads.
Learn more
Computer vision in agriculture

Computer vision in agriculture

Bring vision AI to smart agriculture with Ultralytics YOLO models. Power crop monitoring, livestock tracking, and precision farming for higher, smarter yields.
Learn more

Let's build the future of AI together!

Begin your journey with the future of machine learning