{"id":31696361,"url":"https://github.com/filthyrake/telescope_cam_detection","last_synced_at":"2026-04-20T13:31:43.523Z","repository":{"id":318370394,"uuid":"1070399482","full_name":"filthyrake/telescope_cam_detection","owner":"filthyrake","description":"Real-time wildlife detection and telescope collision prevention system using RT-DETR + iNaturalist on NVIDIA A30","archived":false,"fork":false,"pushed_at":"2025-11-04T15:35:25.000Z","size":682,"stargazers_count":1,"open_issues_count":55,"forks_count":2,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-11-04T16:04:54.957Z","etag":null,"topics":["astronomy","computer-vision","deep-learning","fastapi","nvidia-gpu","object-detection","python","pytorch","real-time-detection","rt-detr","rtsp","telescope","websocket","wildlife-monitoring"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/filthyrake.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-10-05T20:59:52.000Z","updated_at":"2025-11-04T15:35:26.000Z","dependencies_parsed_at":"2025-10-15T02:40:39.852Z","dependency_job_id":null,"html_url":"https://github.com/filthyrake/telescope_cam_detection","commit_stats":null,"previous_names":["filthyrake/telescope_cam_detection"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/filthyrake/telescope_cam_detection","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/filthyrake%2Ftelescope_cam_detection","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/filthyrake%2Ftelescope_cam_detection/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/filthyrake%2Ftelescope_cam_detection/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/filthyrake%2Ftelescope_cam_detection/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/filthyrake","download_url":"https://codeload.github.com/filthyrake/telescope_cam_detection/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/filthyrake%2Ftelescope_cam_detection/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32048935,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-20T11:35:06.609Z","status":"ssl_error","status_checked_at":"2026-04-20T11:34:48.899Z","response_time":94,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["astronomy","computer-vision","deep-learning","fastapi","nvidia-gpu","object-detection","python","pytorch","real-time-detection","rt-detr","rtsp","telescope","websocket","wildlife-monitoring"],"created_at":"2025-10-08T17:01:52.646Z","updated_at":"2026-04-20T13:31:43.516Z","avatar_url":"https://github.com/filthyrake.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Telescope Detection System\n\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![Python 3.11+](https://img.shields.io/badge/python-3.11+-blue.svg)](https://www.python.org/downloads/)\n[![PyTorch](https://img.shields.io/badge/PyTorch-2.0+-ee4c2c.svg)](https://pytorch.org/)\n[![CUDA](https://img.shields.io/badge/CUDA-11.8+-76B900.svg)](https://developer.nvidia.com/cuda-toolkit)\n\nReal-time object detection system for monitoring astronomical telescopes and desert wildlife using Reolink cameras and NVIDIA GPUs.\n\n## Features\n\n- **Ultra-fast detection**: 11-21ms inference with YOLOX\n- **Object tracking**: Track animals across frames with unique IDs, dwell time, and movement analytics\n- **Multi-camera support**: Monitor multiple angles simultaneously with fault-tolerant startup\n- **GPU OOM graceful degradation**: Automatic memory management prevents crashes with progressive quality reduction\n- **Performance optimizations**: Empty frame filtering (30-50% throughput gain) + sparse detection (3x GPU load reduction)\n- **Clips directory authentication**: Optional Bearer token authentication for saved wildlife clips\n- **Motion filtering**: Background subtraction to eliminate false positives from static objects\n- **Time-of-day filtering**: Species activity patterns reduce false positives (e.g., birds at night → likely bugs/bats)\n- **Automatic reconnection**: Cameras reconnect automatically if connection is lost\n- **80 COCO classes**: Wildlife-relevant categories (person, bird, cat, dog, etc.)\n- **Per-class filtering**: Customizable confidence thresholds and size constraints per detection class\n- **Optional species classification**: iNaturalist Stage 2 (10,000 species) with geographic filtering + time-aware re-ranking\n- **Web interface**: Live video streams with real-time detection overlays and GPU memory monitoring\n- **Automatic snapshots**: Save interesting detections to disk with configurable cooldown\n- **MIT License**: Fully open source\n\n## Quick Start\n\n### 1. Install Dependencies\n\n```bash\nsource venv/bin/activate\npip install -r requirements.txt\n```\n\n### 2. Configure Cameras\n\nCopy the credentials template and add your camera passwords:\n\n```bash\ncp camera_credentials.example.yaml camera_credentials.yaml\nnano camera_credentials.yaml  # Add your passwords\n```\n\nEdit `config/config.yaml` to set camera IPs and detection preferences.\n\n### 3. Run the System\n\n```bash\npython main.py\n```\n\nAccess the web interface at **http://localhost:8000**\n\n### 4. Run as a Service (Recommended)\n\nFor production use with auto-start on boot:\n\n```bash\nsudo ./service.sh install\nsudo ./service.sh start\n./service.sh logs -f  # Watch logs\n```\n\nSee [SERVICE_SETUP.md](docs/setup/SERVICE_SETUP.md) for complete service documentation.\n\n## Documentation\n\n### Setup \u0026 Configuration\n- **[Configuration Reference](docs/setup/CONFIG_REFERENCE.md)** - All config options explained\n- **[Service Setup](docs/setup/SERVICE_SETUP.md)** - Running as systemd service\n- **[Camera Credentials](camera_credentials.example.yaml)** - Secure credential storage\n\n### Features \u0026 Usage\n- **[Snapshot Feature](docs/features/SNAPSHOT_FEATURE.md)** - Automatic image/video saving\n- **[Species Classification (Stage 2)](docs/features/STAGE2_SETUP.md)** - Fine-grained species ID\n- **[GPU OOM Graceful Degradation](docs/features/OOM_GRACEFUL_DEGRADATION.md)** - Memory management and crash prevention\n- **[API Reference](docs/api/API_REFERENCE.md)** - WebSocket and HTTP endpoints\n\n### Performance \u0026 Troubleshooting\n- **[Performance Guide](docs/PERFORMANCE.md)** - Benchmarks and optimization\n- **[Troubleshooting](docs/TROUBLESHOOTING.md)** - Common issues and solutions\n- **[Architecture](docs/architecture/ARCHITECTURE.md)** - System design and components\n\n### Training \u0026 Development\n- **[Training Guide](docs/training/TRAINING_GUIDE.md)** - Train custom models\n- **[Annotation Guide](docs/training/ANNOTATION_GUIDE.md)** - Label your own dataset\n\n## Testing\n\n```bash\n# Test camera connection\npython tests/test_camera_connection.py\n\n# Benchmark GPU inference\npython tests/test_inference.py\n\n# Measure end-to-end latency\npython tests/test_latency.py\n```\n\n## Project Structure\n\n```\ntelescope_cam_detection/\n├── config/                      # Configuration files\n├── src/                         # Core application modules\n├── web/                         # Web interface (HTML/JS)\n├── docs/                        # Complete documentation\n├── tests/                       # Test scripts\n├── models/                      # Model weights\n├── training/                    # Training infrastructure\n├── clips/                       # Saved detection snapshots\n└── main.py                      # Application entry point\n```\n\n## System Requirements\n\n- **OS**: Ubuntu 22.04+ (or similar Linux)\n- **GPU**: NVIDIA GPU with CUDA support (A30 recommended)\n- **Python**: 3.11+\n- **RAM**: 8GB+ recommended\n- **Network**: Local network access to Reolink cameras\n\n## Performance\n\nWith NVIDIA A30:\n- **Inference**: 11-21ms per frame\n- **FPS**: 25-30 sustained\n- **Latency**: 25-35ms end-to-end\n- **Memory**: ~2GB VRAM per camera\n\nSee [Performance Guide](docs/PERFORMANCE.md) for optimization strategies and benchmarks.\n\n## Development Roadmap\n\n- ✅ **Phase 1**: Core detection system (complete)\n- ✅ **Phase 2**: Species classification (complete)\n- 🔨 **Phase 3**: Custom telescope training (in progress)\n- 📋 **Phase 4**: Collision detection and alerts (planned)\n\n## Troubleshooting\n\nHaving issues? Check the [Troubleshooting Guide](docs/TROUBLESHOOTING.md) for common problems and solutions.\n\nQuick fixes:\n- **Camera not connecting?** Run `python tests/test_camera_connection.py`\n- **GPU not working?** Check with `nvidia-smi` and verify CUDA is available\n- **High latency?** See [Performance Guide](docs/PERFORMANCE.md) for optimization tips\n\n## API\n\n### WebSocket\nConnect to `ws://localhost:8000/ws/detections` for real-time detection events.\n\n### HTTP\n- `GET /` - Web interface\n- `GET /health` - Health check\n- `GET /stats` - Performance metrics\n- `GET /video/feed` - MJPEG video stream\n\nSee [API Reference](docs/api/API_REFERENCE.md) for complete documentation.\n\n## Credits\n\nBuilt with these excellent open-source projects:\n\n- **[YOLOX](https://github.com/Megvii-BaseDetection/YOLOX)** (Apache 2.0) - Object detection\n- **[iNaturalist/EVA02](https://github.com/huggingface/pytorch-image-models)** (Apache 2.0) - Species classification\n- **[PyTorch](https://pytorch.org/)** (BSD-3) - Deep learning framework\n- **[OpenCV](https://opencv.org/)** (Apache 2.0) - Computer vision\n- **[FastAPI](https://fastapi.tiangolo.com/)** (MIT) - Web framework\n\n## License\n\nMIT License - see [LICENSE](LICENSE) for details. All dependencies use permissive licenses (Apache 2.0, BSD, MIT).\n\n## Support\n\n- 📖 **Documentation**: See `docs/` directory\n- 🐛 **Issues**: [GitHub Issues](https://github.com/filthyrake/telescope_cam_detection/issues)\n- 📊 **Logs**: `./service.sh logs` or check `logs/` directory\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffilthyrake%2Ftelescope_cam_detection","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffilthyrake%2Ftelescope_cam_detection","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffilthyrake%2Ftelescope_cam_detection/lists"}