Run this model with HF Jobs
Run thinking-friends/store-behavior-videomae on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/thinking-friends/store-behavior-videomae. Ask me which dataset to train on, then push the fine-tuned model to a new private model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/thinking-friends/store-behavior-videomae on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Instructions to use thinking-friends/store-behavior-videomae with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use thinking-friends/store-behavior-videomae with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("video-classification", model="thinking-friends/store-behavior-videomae")# pip install -U transformers accelerate # Load model directly from transformers import AutoImageProcessor, AutoModelForVideoClassification processor = AutoImageProcessor.from_pretrained("thinking-friends/store-behavior-videomae") model = AutoModelForVideoClassification.from_pretrained("thinking-friends/store-behavior-videomae", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Request access (research / non-commercial use only)
This repository is publicly accessible, but you have to accept the conditions to access its files and content.
This model is for research and non-commercial use only. Commercial use is not allowed (VideoMAE CC-BY-NC-4.0, MERL non-commercial). By requesting access you agree to the thinkingfriends-nc license in this repository. For commercial use, contact help@thinkingfriends.co.kr.
Log in or Sign Up to review the conditions and access this model content.
연구·비상업 목적 전용, 상업 이용 불가 (VideoMAE CC-BY-NC-4.0, MERL 비상업). 상업용 모델은 별도 출시 예정, 문의 help@thinkingfriends.co.kr
Research and non-commercial use only. No commercial use (VideoMAE CC-BY-NC-4.0, MERL non-commercial). A commercial model will be released separately. Contact: help@thinkingfriends.co.kr
TFVision Store Behaviour Classifier (store_behavior_v1, 19 classes, research / non-commercial)
A store and convenience-store video action classifier from Thinking Friends (띵킹프렌즈). It assigns a short clip to one of 19 action classes.
This is the research / non-commercial release. The training datasets are not released. A commercial model is planned as a separate artifact with its own terms. This repository does not include it.
License
thinkingfriends-nc (license: other). Use is limited to non-commercial and educational purposes. Commercial use is not allowed under this license.
A commercial model will be released separately. Contact: help@thinkingfriends.co.kr · https://thinkingfriends.co.kr · https://tftas.com
This license does not override upstream terms of the training data or the base model. The base checkpoint is CC-BY-NC-4.0, and the MERL Shopping Dataset is offered for research / non-commercial use. A commercial license from Thinking Friends, if any, would still require commercial permission from MERL and from the VideoMAE rightsholders. AI Hub’s official FAQ states that models, services, and other derivative works trained on AI Hub open data may be used, sold, or distributed for commercial or non-commercial purposes, with attribution. Limiting this public repository to non-commercial use reflects those stricter upstream terms and a choice by Thinking Friends. Redistribution of the original data is not allowed. See LICENSE for attribution and for the unresolved point about overseas hosting.
Model summary
| Item | Detail |
|---|---|
| Architecture | VideoMAE-Base (VideoMAEForVideoClassification) |
| Base weights | MCG-NJU/videomae-base-finetuned-kinetics (fine-tuned on Kinetics-400, CC-BY-NC-4.0) |
| Task | Clip-level 19-class action classification |
| Input | RGB video. 16 frames are sampled uniformly from the whole clip; the short side is resized to 224 px, then a 224×224 centre crop is taken |
| Weights | model.safetensors from run videomae_b_all19_a100, epoch 9 (best validation macro-F1) |
This card covers the 19-class single checkpoint. The product v1 confirmed on 2026-11-04 is a 14-class ensemble (E4 3 s, E4 6 s, E5, plus a return-logit shift). That system is a separate artifact and is not part of this release.
Quick start
Access is gated (auto-approve). Accept the license, then:
import numpy as np, torch, decord
from transformers import VideoMAEForVideoClassification, VideoMAEImageProcessor
repo = "thinking-friends/store-behavior-videomae"
model = VideoMAEForVideoClassification.from_pretrained(repo).eval()
processor = VideoMAEImageProcessor.from_pretrained(repo)
vr = decord.VideoReader("clip.mp4") # a short, pre-trimmed clip
idx = np.linspace(0, len(vr) - 1, 16).round().astype(int) # frame jump over the whole clip
frames = list(vr.get_batch(idx).asnumpy())
with torch.no_grad():
prob = model(**processor(frames, return_tensors="pt")).logits.softmax(-1)[0]
for i in prob.topk(3).indices.tolist():
print(model.config.id2label[i], round(float(prob[i]), 3))
python inference.py clip.mp4 does the same thing. The repository ships model.safetensors (weights only: no optimizer state, no data paths) and config.json with all 19 id2label entries and a frame_sampling block that records the rules below. A CPU is enough for a single clip.
| File | Detail |
|---|---|
model.safetensors |
344,989,628 bytes, float32, 186 tensors, state_dict only |
| SHA-256 | 788fe76aa45d8b44b49dcc77578e86f637f6c9f0a423c61bb10d17b1a764c230 |
| Load check | VideoMAEForVideoClassification strict load_state_dict: no missing or unexpected keys; the tensors equal the source checkpoint |
Example outputs
These are real outputs of this checkpoint on two clips from two public-domain U.S. government videos. They are not from the training data, which cannot be shown. Frame sources, licenses, and edits are listed in the examples dataset.
| # | Clip | Top-1 (softmax) | Reviewer's reading |
|---|---|---|---|
| 1 | Navy Exchange micro-market, people walking | store_move 68.0% |
matches |
| 2 | Commissary checkout counter | purchase 62.8% |
plausible |
How to read them: the yellow lines in each image mark the 224×224 centre crop that the model actually sees. The verdict is a person's reading of the clip, not a ground-truth label. These are selected examples. The classes were trained on fixed store-camera data (AI Hub CCTV-style footage and MERL overhead footage), while these clips are edited broadcast footage, so the domain differs from real CCTV. Expect weaker results on such footage than the test figures below suggest.
System logic: frame-jump (uniform temporal sampling)
The input is a pre-segmented short clip. There is no entrance model that splits close-up and mid-range views.
- Sixteen frames are taken from the first frame to the last, inclusive, at evenly spaced indices:
np.linspace(0, n_frames - 1, 16), rounded to integers. The frame jump (stride) is(n_frames - 1) / 15. - Each frame is resized so the short side is 224 px, centre-cropped to 224×224, and normalized with the ImageNet mean and standard deviation (0.485/0.456/0.406, 0.229/0.224/0.225).
- The 16-frame clip is passed through the VideoMAE-Base classifier. The predicted class is the argmax over the 19 logits.
Use the same sampling at inference as was used in training to match the figures in this card. Horizontal flipping is not used at inference.
The 19 classes
English identifiers follow the training label_map. Korean names follow the internal class map. “Source” is the originating dataset for that class definition.
| Id | English | Korean | Source |
|---|---|---|---|
| 0 | store_move |
매장이동 | AI Hub 71549 |
| 1 | select_product |
선택 | AI Hub 71549 |
| 2 | try_product |
시험 | AI Hub 71549 |
| 3 | purchase |
구매 | AI Hub 71549 |
| 4 | return_product |
반품 | AI Hub 71549 |
| 5 | compare_products |
비교 | AI Hub 71549 |
| 6 | fall_down |
전도 | AI Hub 71550 |
| 7 | vandalism |
파손 | AI Hub 71550 |
| 8 | arson |
방화 | AI Hub 71550 |
| 9 | smoking |
흡연 | AI Hub 71550 |
| 10 | abandonment |
유기 | AI Hub 71550 |
| 11 | theft |
절도 | AI Hub 71550 |
| 12 | assault |
폭행 | AI Hub 71550 |
| 13 | mobility_impaired |
이동약자 | AI Hub 71550 |
| 14 | reach_to_shelf |
선반에손뻗기 | MERL Shopping |
| 15 | retract_from_shelf |
선반에서손빼기 | MERL Shopping |
| 16 | hand_in_shelf |
선반안손유지 | MERL Shopping |
| 17 | inspect_product |
상품살펴보기 | MERL Shopping |
| 18 | inspect_shelf |
선반살펴보기 | MERL Shopping |
Training data scale
The dataset files will not be released. Only clip counts used to train the 19-class model are listed. The source is data_distribution.csv shared by videomae_b_all19_a100 and videomae_b_all19_a100_v2 (the train, validation, and test ID hashes match).
| Split | Clips | Composition |
|---|---|---|
| Train | 59,637 | AI Hub 71549 39,514 + AI Hub 71550 16,966 + MERL 3,157 |
| Validation | 8,151 | 71549 5,088 + 71550 2,189 + MERL 874 |
| Test | 8,559 | 71549 5,103 + 71550 2,110 + MERL 1,346 |
| Total | 76,347 |
Those counts are not the same as the official raw size of each public source dataset.
Fine-tuning scale
The procedure is omitted; only the scale of the recommended run is given.
- Base: VideoMAE-Base fine-tuned on Kinetics-400, with a 19-class head (768→19)
- Input: 16 frames per clip, 224×224, uniform temporal sampling
- Main run (
videomae_b_all19_a100): 10 epochs, 20,000 clips per epoch, effective batch size 16, seed 42, bf16, NVIDIA A100-SXM4-40GB - Class-balanced sampling with square-root frequency weights (
BALANCE=sqrt)
videomae_b_all19_a100_v2 is a later rerun on the same split (7 epochs, gradient checkpointing off, 8 workers). The recommended weights remain epoch 9 of the first run.
Compute
Figures are taken from logs and reports. Estimates are labelled as estimates.
| Run | GPU | Precision | Wall clock (Asia/Seoul) | Notes |
|---|---|---|---|---|
videomae_b_all19_a100 (recommended) |
NVIDIA A100-SXM4-40GB | bf16 | 2026-10-08 10:35:28–12:16:18, about 1 h 41 min | Times recorded in the comparison report. The span of leftover file mtimes on TF-100 is the same duration. Colab units about 9.3–9.6 CU are an estimate (no metered log) |
videomae_b_all19_a100_v2 |
NVIDIA A100-SXM4-40GB | bf16 | 2026-10-21, start about 11:02, epoch-7 validation 12:03:08, test 12:06:56, about 65 min for the main run | Start time from a user note plus file-mtime correction. About 5.7–6.4 CU is an estimate. Training resumed at step 3,501 after a disconnect |
Later 14-class experiments (E2–E7) also ran on Colab A100-SXM4-40GB with bf16. The 19-class weights in this card come from the two runs above.
Accuracy
The recommended weights are videomae_b_all19_a100 at the epoch with the best validation macro-F1 (epoch 9), evaluated on the test set. Test set: 8,559 clips.
| Metric | Value |
|---|---|
| Top-1 accuracy | 0.9780 |
| Macro-F1 (all 19 training classes) | 0.9594 |
| Top-5 accuracy | 0.9979 |
| Validation macro-F1 (epoch 9) | 0.9717 |
Test results by source:
| Source | Clips | Accuracy | Macro-F1 | Top-5 |
|---|---|---|---|---|
| AI Hub 71549 | 5,103 | 0.9886 | 0.9753 | 0.9986 |
| AI Hub 71550 | 2,110 | 0.9839 | 0.9800 | 1.0000 |
| MERL | 1,346 | 0.9287 | 0.9077 | 0.9918 |
Per-class test F1 (three decimal places; support is the test-clip count):
| Class | F1 | Precision | Recall | Support |
|---|---|---|---|---|
| store_move | 1.000 | 1.000 | 1.000 | 3,315 |
| select_product | 0.995 | 1.000 | 0.991 | 214 |
| try_product | 0.986 | 0.987 | 0.985 | 389 |
| purchase | 0.941 | 0.955 | 0.928 | 389 |
| return_product | 0.944 | 0.932 | 0.957 | 399 |
| compare_products | 0.985 | 0.982 | 0.987 | 397 |
| fall_down | 1.000 | 1.000 | 1.000 | 185 |
| vandalism | 0.957 | 0.982 | 0.932 | 236 |
| arson | 0.990 | 1.000 | 0.980 | 150 |
| smoking | 0.999 | 1.000 | 0.997 | 388 |
| abandonment | 0.942 | 0.927 | 0.957 | 187 |
| theft | 0.959 | 0.944 | 0.973 | 226 |
| assault | 0.992 | 0.984 | 1.000 | 249 |
| mobility_impaired | 1.000 | 1.000 | 1.000 | 489 |
| reach_to_shelf | 0.958 | 0.953 | 0.962 | 425 |
| retract_from_shelf | 0.964 | 0.963 | 0.965 | 405 |
| hand_in_shelf | 0.866 | 0.848 | 0.884 | 164 |
| inspect_product | 0.845 | 0.907 | 0.791 | 148 |
| inspect_shelf | 0.906 | 0.891 | 0.922 | 204 |
The same-split rerun videomae_b_all19_a100_v2 (epoch 7) scored test accuracy 0.9767, macro-F1 0.9587, and top-5 0.9981.
Limitations
- The test set is a random split from the same distribution as training. Later 14-class work showed that purchase/return confusion grows under a store-level hold-out (SYB). This card has no store-hold-out numbers for the 19-class model.
- The weakest classes are MERL
inspect_product(F1 0.845) andhand_in_shelf(F1 0.866). MERL is laboratory overhead footage, so there is a domain gap with Korean convenience-store CCTV. - Purchase and return are sometimes confused (purchase F1 0.941, return F1 0.944).
- The model classifies a pre-trimmed clip. It is not a temporal detector that finds start and end times in a long untrimmed video.
- The example images use public-domain footage, not training data: AI Hub footage is domestic-restricted and must not be redistributed, and MERL frames would risk redistributing that dataset. The examples are selected, and they are edited broadcast footage, so the domain differs from real CCTV.
- Research and non-commercial use only. Using the model in a commercial retail, security, or analytics service is not allowed.
Attribution
This model was trained using “실내(편의점, 매장) 구매행동 데이터” (AI Hub 71549) and “실내(편의점, 매장) 사람 이상행동 데이터” (AI Hub 71550), built with support from the Ministry of Science and ICT and the National Information Society Agency (NIA). The datasets may be requested from AI Hub (aihub.or.kr) under its usage policy. The original data are not included in this repository.
This work also used the MERL Shopping Dataset (Singh et al., CVPR 2016, doi:10.1109/CVPR.2016.216, MERL TR2016-080) and Tong et al., “VideoMAE: Masked Autoencoders are Data-Efficient Learners for Self-Supervised Video Pre-Training,” NeurIPS 2022, https://arxiv.org/abs/2203.12602 (MCG-NJU/videomae-base-finetuned-kinetics, CC-BY-NC-4.0).
Contact: help@thinkingfriends.co.kr · https://thinkingfriends.co.kr · https://tftas.com
Example clips: "Naval Support Activity Souda Bay celebrates the opening of the Navy Exchange Micro-Market" (U.S. Navy video by Seaman Apprentice Christina Reddy, DVIDS 1026757) and "Kadena Commissary Hosts Shopping Dash Event" (U.S. Marine Corps video by Cpl. Ernesto Lagunes, DVIDS 973326). Both are U.S. federal government works in the public domain, obtained through Wikimedia Commons. See the examples dataset for links.
- Downloads last month
- -
Model tree for thinking-friends/store-behavior-videomae
Base model
MCG-NJU/videomae-base-finetuned-kinetics