File size: 3,597 Bytes
7a87926
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
122
123
124
125
126
127
128
129
# Scripts Directory

This directory contains scripts for testing, experimentation, and tooling.

## Structure

```
scripts/
β”œβ”€β”€ bin/                    # Shell scripts and executables
β”‚   β”œβ”€β”€ run_ba_validation.sh
β”‚   β”œβ”€β”€ run_finetuning.sh
β”‚   └── setup_ba_pipeline.sh
β”œβ”€β”€ experiments/             # Experimental and testing scripts
β”‚   β”œβ”€β”€ test_api_with_profiling.py  # API testing with profiling
β”‚   β”œβ”€β”€ run_arkit_ba_validation.py   # ARKit BA validation
β”‚   β”œβ”€β”€ run_arkit_ba_validation_gui.py  # ARKit validation with GUI
β”‚   └── run_ba_validation_video.py  # Video-based BA validation
β”œβ”€β”€ tests/                   # Unit and integration tests
β”‚   β”œβ”€β”€ smoke_test.py
β”‚   β”œβ”€β”€ smoke_test_basic.py
β”‚   β”œβ”€β”€ test_gui_simple.py
β”‚   └── test_smart_pairing.py
β”œβ”€β”€ tools/                   # Utility tools
β”‚   └── visualize_ba_results.py  # BA validation result visualization
└── test_api.py             # Comprehensive API endpoint testing
```

## Usage

### API Testing

Test API endpoints:

```bash
# Comprehensive API testing (recommended)
python scripts/test_api.py --base-url http://localhost:8000

# Test with specific data directories
python scripts/test_api.py \
    --base-url http://localhost:8000 \
    --sequence-dir data/sequences/seq001 \
    --arkit-dir assets/examples/ARKit \
    --sequences-dir data/raw/sequences \
    --training-data-dir data/training

# Test without optimization parameters
python scripts/test_api.py --skip-optimizations

# Test without job polling (faster)
python scripts/test_api.py --skip-polling

# API testing with profiling
python scripts/experiments/test_api_with_profiling.py --base-url http://localhost:8000
```

### BA Validation Experiments

Run BA validation experiments:

```bash
# ARKit validation
python scripts/experiments/run_arkit_ba_validation.py \
    --arkit-dir assets/examples/ARKit \
    --output-dir data/arkit_ba_validation

# ARKit validation with GUI
python scripts/experiments/run_arkit_ba_validation_gui.py \
    --arkit-dir assets/examples/ARKit \
    --output-dir data/arkit_ba_validation

# Video-based validation
python scripts/experiments/run_ba_validation_video.py \
    --video path/to/video.mp4 \
    --output-dir data/ba_validation
```

### Shell Scripts

Run setup and pipeline scripts:

```bash
# Setup BA pipeline
bash scripts/bin/setup_ba_pipeline.sh

# Run BA validation
bash scripts/bin/run_ba_validation.sh

# Run fine-tuning
bash scripts/bin/run_finetuning.sh
```

### Tools

Visualize BA validation results:

```bash
python scripts/tools/visualize_ba_results.py \
    --results-dir data/arkit_ba_validation \
    --output-dir data/arkit_ba_validation/visualizations
```

### Tests

Run unit and integration tests:

```bash
# Run all tests
python -m pytest scripts/tests/

# Run specific test
python scripts/tests/smoke_test.py
```

## Organization Principles

1. **Core Application Code**: All application logic lives in `ylff/`
2. **Experiments**: Testing and experimental scripts in `scripts/experiments/`
3. **Tools**: Utility scripts for visualization, analysis, etc. in `scripts/tools/`
4. **Tests**: Unit and integration tests in `scripts/tests/`
5. **Binaries**: Shell scripts and executables in `scripts/bin/`

## Adding New Scripts

- **API/Endpoint Testing**: Add to `scripts/experiments/`
- **Data Processing Tools**: Add to `scripts/tools/`
- **New Experiments**: Add to `scripts/experiments/`
- **Unit Tests**: Add to `scripts/tests/`
- **Shell Scripts**: Add to `scripts/bin/`