File size: 5,024 Bytes
02f88ee
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
# Face Swap Video API - Collections Index

**Base URL:** `https://logicgoinfotechspaces-face-swap-video.hf.space`

---

## πŸ“Š **MongoDB Collections**

### **1. source_images**
**Collection Name:** `source_images`  
**Database:** `face_swap_video`

**Schema:**
```json
{
  "_id": "ObjectId",
  "filename": "string",
  "file_path": "string",
  "uploaded_at": "datetime",
  "status": "string",
  "content_type": "string",
  "file_size": "number"
}
```

**API Endpoints:**
- **Upload:** `POST https://logicgoinfotechspaces-face-swap-video.hf.space/api/source-image`
- **List All:** `GET https://logicgoinfotechspaces-face-swap-video.hf.space/api/source-images`
- **Get One:** Use `_id` from list response

---

### **2. target_videos**
**Collection Name:** `target_videos`  
**Database:** `face_swap_video`

**Schema:**
```json
{
  "_id": "ObjectId",
  "filename": "string",
  "file_path": "string",
  "uploaded_at": "datetime",
  "status": "string",
  "content_type": "string",
  "file_size": "number"
}
```

**API Endpoints:**
- **Upload:** `POST https://logicgoinfotechspaces-face-swap-video.hf.space/api/target-video`
- **List All:** `GET https://logicgoinfotechspaces-face-swap-video.hf.space/api/target-videos`
- **Get One:** Use `_id` from list response

---

### **3. result_videos**
**Collection Name:** `result_videos`  
**Database:** `face_swap_video`

**Schema:**
```json
{
  "_id": "ObjectId",
  "source_image_path": "string",
  "target_video_path": "string",
  "result_file_path": "string",
  "created_at": "datetime",
  "status": "string",
  "job_id": "string",
  "processing_time": "number (optional)"
}
```

**API Endpoints:**
- **Download:** `GET https://logicgoinfotechspaces-face-swap-video.hf.space/api/result-video/{result_video_id}`
- **List All:** `GET https://logicgoinfotechspaces-face-swap-video.hf.space/api/result-videos`
- **Get Download URL:** Use `result_video_url` from job status when `status = "completed"`

---

### **4. processing_jobs**
**Collection Name:** `processing_jobs`  
**Database:** `face_swap_video`

**Schema:**
```json
{
  "_id": "ObjectId",
  "job_id": "string (UUID)",
  "source_image_id": "string",
  "target_video_id": "string",
  "status": "string (queued|processing|completed|failed)",
  "created_at": "datetime",
  "progress": "number (0-100)",
  "result_video_id": "string (optional)",
  "result_video_url": "string (optional)",
  "error": "string (optional)"
}
```

**API Endpoints:**
- **Create Job:** `POST https://logicgoinfotechspaces-face-swap-video.hf.space/api/face-swap`
- **Get Status:** `GET https://logicgoinfotechspaces-face-swap-video.hf.space/api/job/{job_id}`

---

## πŸ”— **Complete API Endpoints Index**

### **Upload Endpoints**
```
POST https://logicgoinfotechspaces-face-swap-video.hf.space/api/source-image
POST https://logicgoinfotechspaces-face-swap-video.hf.space/api/target-video
```

### **Processing Endpoints**
```
POST https://logicgoinfotechspaces-face-swap-video.hf.space/api/face-swap
GET  https://logicgoinfotechspaces-face-swap-video.hf.space/api/job/{job_id}
```

### **Download Endpoints**
```
GET https://logicgoinfotechspaces-face-swap-video.hf.space/api/result-video/{result_video_id}
```

### **List Endpoints**
```
GET https://logicgoinfotechspaces-face-swap-video.hf.space/api/source-images
GET https://logicgoinfotechspaces-face-swap-video.hf.space/api/target-videos
GET https://logicgoinfotechspaces-face-swap-video.hf.space/api/result-videos
```

### **Utility Endpoints**
```
GET https://logicgoinfotechspaces-face-swap-video.hf.space/api/health
GET https://logicgoinfotechspaces-face-swap-video.hf.space/docs
GET https://logicgoinfotechspaces-face-swap-video.hf.space/
```

---

## πŸ“ **MongoDB Connection String**

```
mongodb+srv://itishalogicgo_db_user:HR837xi0B9yh2vZK@cluster0.jeeytpz.mongodb.net/?retryWrites=true&w=majority&appName=Cluster0
```

**Database:** `face_swap_video`

**Collections:**
1. `source_images`
2. `target_videos`
3. `result_videos`
4. `processing_jobs`

---

## πŸ”„ **Workflow Example**

1. **Upload Source Image** β†’ Get `source_image_id`
2. **Upload Target Video** β†’ Get `target_video_id`
3. **Start Face Swap** β†’ Get `job_id`
4. **Poll Job Status** β†’ Get `result_video_url` when `status = "completed"`
5. **Download Result** β†’ Use `result_video_url` directly

---

## πŸ“‹ **Quick Reference**

| Collection | Insert Endpoint | List Endpoint | Get One |
|------------|----------------|---------------|---------|
| `source_images` | `POST /api/source-image` | `GET /api/source-images` | Use `_id` |
| `target_videos` | `POST /api/target-video` | `GET /api/target-videos` | Use `_id` |
| `result_videos` | Auto via job completion | `GET /api/result-videos` | `GET /api/result-video/{id}` |
| `processing_jobs` | `POST /api/face-swap` | N/A | `GET /api/job/{job_id}` |

---

## 🌐 **MongoDB Atlas Dashboard**

Access your collections at:
```
https://cloud.mongodb.com/
```

**Cluster:** `Cluster0`  
**Database:** `face_swap_video`  
**Collections:** 4 collections listed above