File size: 2,644 Bytes
e365924
 
 
 
 
 
 
ca1863b
e365924
 
 
 
 
f1bc870
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
---
title: Primate Batch Detection
emoji: 💻
colorFrom: purple
colorTo: gray
sdk: gradio
sdk_version: 5.24.0
app_file: app_batch.py
pinned: false
license: apache-2.0
---

Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference


# Primate Batch Detection: Installation & Troubleshooting Guide

## Installation Guide

### 1. Set Up WSL (Windows Users Only)

If you're using Windows, you'll need to install the **Windows Subsystem for Linux (WSL)**:

[WSL Installation Guide (Microsoft)](https://learn.microsoft.com/en-us/windows/wsl/install)

We recommend using **Ubuntu 22.04** as your Linux distribution.

**Important:** Run all following commands in the **WSL terminal**, **not PowerShell**.

---

### 2. Install Docker

Follow these guides to install Docker in your WSL Ubuntu environment:

- [Install Docker Desktop (Linux)](https://docs.docker.com/desktop/setup/install/linux/ubuntu/)
- [Install Docker Engine (Ubuntu)](https://docs.docker.com/engine/install/ubuntu/)

---

### 3. Install the NVIDIA Container Toolkit

This is necessary for GPU support inside Docker containers:

[NVIDIA Container Toolkit Installation Guide](https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/install-guide.html)

---

### 4. Run the Docker Container

Use the pre-configured Docker image provided by the Hugging Face Space:

[Run Docker Container](https://huggingface.co/spaces/caltech-animal-tracking/Primate_Batch_Detection?docker=true)

---

## Troubleshooting Guide

### 🚫 Error:

```docker: Error response from daemon: could not select device driver "" with capabilities: [[gpu]]```

### 🛠️ Fix:  
This typically means that the **NVIDIA Container Toolkit** was not installed or configured correctly. Double-check your installation by revisiting the [NVIDIA Container Toolkit Guide](https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/install-guide.html).

### 🚫 Error:
```
docker: permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock:
Head "http://%2Fvar%2Frun%2Fdocker.sock/_ping": dial unix /var/run/docker.sock: connect: permission denied
```

### 🛠️ Fix:
This error occurs when your user does not have permission to access the Docker socket.

You have two options:

**Option 1: Add your user to the Docker group**
```
sudo usermod -aG docker $USER
sudo systemctl restart docker  # May not be needed or available in WSL
```
Then restart your terminal or log out and back in for the group change to take effect.

**Option 2: Use sudo for all your docker commands**
```
sudo docker $your_command
```