forked from Geekgineer/motcpp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprepare_release_data.sh
More file actions
executable file
·121 lines (108 loc) · 4 KB
/
prepare_release_data.sh
File metadata and controls
executable file
·121 lines (108 loc) · 4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
#!/bin/bash
# SPDX-License-Identifier: AGPL-3.0-or-later
# Copyright (c) 2026 motcpp contributors
#
# Prepare benchmark data for GitHub Release
# Run this to create archives that can be uploaded to releases
set -e
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
PROJECT_ROOT="$(dirname "$SCRIPT_DIR")"
OUTPUT_DIR="${PROJECT_ROOT}/release_assets"
ASSETS_DIR="${PROJECT_ROOT}/assets"
# Colors
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
NC='\033[0m'
echo "=== Preparing Benchmark Data for Release ==="
echo ""
# Check if assets directory exists
if [ ! -d "$ASSETS_DIR" ]; then
echo -e "${YELLOW}Warning: assets/ directory not found${NC}"
echo ""
echo "To prepare benchmark data, you need to:"
echo ""
echo "1. Download MOT17 dataset (mini version for testing):"
echo " mkdir -p assets/MOT17-mini/train"
echo " # Copy sequences: MOT17-02-FRCNN, MOT17-04-FRCNN, etc."
echo ""
echo "2. Generate or copy YOLOX detections:"
echo " mkdir -p assets/yolox_x_ablation/dets"
echo " # Format: frame,id,x,y,w,h,conf,-1,-1,-1"
echo ""
echo "3. (Optional) Generate ReID embeddings:"
echo " mkdir -p assets/reid_embs"
echo ""
echo "Or copy from boxmot-cpp assets if available:"
echo " cp -r ../boxmot-cpp/assets/* assets/"
echo ""
exit 1
fi
mkdir -p "$OUTPUT_DIR"
cd "$PROJECT_ROOT"
CREATED_FILES=0
# 1. Package MOT17-mini (sample sequences)
if [ -d "assets/MOT17-mini" ]; then
echo "Packaging MOT17-mini..."
tar -czf "${OUTPUT_DIR}/MOT17-mini.tar.gz" -C assets MOT17-mini
echo -e " ${GREEN}✓${NC} Created: MOT17-mini.tar.gz ($(du -h "${OUTPUT_DIR}/MOT17-mini.tar.gz" | cut -f1))"
CREATED_FILES=$((CREATED_FILES + 1))
else
echo -e " ${YELLOW}⚠${NC} Skipped: MOT17-mini (not found)"
fi
# 2. Package detection files
if [ -d "assets/yolox_x_ablation" ]; then
echo "Packaging YOLOX detections..."
tar -czf "${OUTPUT_DIR}/yolox_dets.tar.gz" -C assets yolox_x_ablation
echo -e " ${GREEN}✓${NC} Created: yolox_dets.tar.gz ($(du -h "${OUTPUT_DIR}/yolox_dets.tar.gz" | cut -f1))"
CREATED_FILES=$((CREATED_FILES + 1))
else
echo -e " ${YELLOW}⚠${NC} Skipped: yolox_dets (not found)"
fi
# 3. Package ReID embeddings (if available)
# Check both standalone reid_embs and yolox_x_ablation/embs
if [ -d "assets/reid_embs" ]; then
echo "Packaging ReID embeddings (standalone)..."
tar -czf "${OUTPUT_DIR}/reid_embs.tar.gz" -C assets reid_embs
echo -e " ${GREEN}✓${NC} Created: reid_embs.tar.gz ($(du -h "${OUTPUT_DIR}/reid_embs.tar.gz" | cut -f1))"
CREATED_FILES=$((CREATED_FILES + 1))
elif [ -d "assets/yolox_x_ablation/embs" ]; then
echo "Packaging ReID embeddings (from yolox_x_ablation/embs)..."
tar -czf "${OUTPUT_DIR}/reid_embs.tar.gz" -C assets/yolox_x_ablation embs
echo -e " ${GREEN}✓${NC} Created: reid_embs.tar.gz ($(du -h "${OUTPUT_DIR}/reid_embs.tar.gz" | cut -f1))"
CREATED_FILES=$((CREATED_FILES + 1))
else
echo -e " ${YELLOW}⚠${NC} Skipped: reid_embs (not found)"
fi
# Check if any files were created
if [ $CREATED_FILES -eq 0 ]; then
echo ""
echo -e "${RED}Error: No data files found to package!${NC}"
echo ""
echo "Please ensure you have benchmark data in the assets/ directory."
echo "See above for required directory structure."
exit 1
fi
# 4. Create checksums
echo ""
echo "Creating checksums..."
cd "$OUTPUT_DIR"
if ls *.tar.gz 1> /dev/null 2>&1; then
sha256sum *.tar.gz > SHA256SUMS.txt
cat SHA256SUMS.txt
else
echo -e "${RED}No tar.gz files found to create checksums${NC}"
exit 1
fi
echo ""
echo -e "${GREEN}=== Release Assets Ready ===${NC}"
echo "Location: $OUTPUT_DIR"
echo ""
echo "Created $CREATED_FILES archive(s):"
ls -la "$OUTPUT_DIR"/*.tar.gz 2>/dev/null || true
echo ""
echo "GitHub Release Instructions:"
echo "1. Go to https://github.com/Geekgineer/motcpp/releases"
echo "2. Create new release with tag 'benchmark-data-v1.0'"
echo "3. Upload all files from $OUTPUT_DIR"
echo "4. Users can then run: ./scripts/auto_benchmark.sh --all"