Download templates/quickstart.html from Atomio/facerecog: direct link, hf CLI and curl.
- Browser
- Download file 2.73 kB
-
https://huggingface.co/spaces/Atomio/facerecog/resolve/main/templates/quickstart.html
- Command line
-
hf download hf://spaces/Atomio/facerecog/templates/quickstart.html
-
curl -L -o quickstart.html https://huggingface.co/spaces/Atomio/facerecog/resolve/main/templates/quickstart.html
2.73 kB
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>Quick Start Guide</title> | |
| <link rel="stylesheet" href="/static/css/style.css"> | |
| </head> | |
| <body> | |
| <div class="container"> | |
| <div class="sidebar"> | |
| <h1>Face Recognition API</h1> | |
| <ul> | |
| <li><a href="/">Home</a></li> | |
| <li><a href="/docs">API Docs</a></li> | |
| <li><a href="/quickstart">Quick Start</a></li> | |
| </ul> | |
| </div> | |
| <div class="main-content"> | |
| <h1>Quick Start Guide</h1> | |
| <p>This guide will walk you through the basics of using the Face Recognition API.</p> | |
| <h2>Authentication</h2> | |
| <p>The API uses JWT for authentication. You'll need to include your JWT in the `Authorization` header of your requests.</p> | |
| <pre><code>Authorization: Bearer YOUR_JWT</code></pre> | |
| <h2>Endpoints</h2> | |
| <p>The API has the following main endpoints:</p> | |
| <ul> | |
| <li><code>/api/v1/faces/register</code>: Register a new face.</li> | |
| <li><code>/api/v1/faces/recognize</code>: Recognize a face in an image.</li> | |
| <li><code>/api/v1/faces/recognize-video</code>: Recognize faces in a video.</li> | |
| </ul> | |
| <h2>Examples</h2> | |
| <p>Here are some examples of how to use the API in different languages.</p> | |
| <h3>Python</h3> | |
| <pre><code>import requests | |
| image_path = 'path/to/your/image.jpg' | |
| url = 'http://localhost:8000/api/v1/faces/recognize' | |
| headers = {'Authorization': 'Bearer YOUR_JWT'} | |
| with open(image_path, 'rb') as f: | |
| files = {'image': f} | |
| response = requests.post(url, headers=headers, files=files) | |
| print(response.json())</code></pre> | |
| <h3>JavaScript (Node.js)</h3> | |
| <pre><code>const axios = require('axios'); | |
| const fs = require('fs'); | |
| const FormData = require('form-data'); | |
| const imagePath = 'path/to/your/image.jpg'; | |
| const url = 'http://localhost:8000/api/v1/faces/recognize'; | |
| const token = 'YOUR_JWT'; | |
| const form = new FormData(); | |
| form.append('image', fs.createReadStream(imagePath)); | |
| axios.post(url, form, { | |
| headers: { | |
| ...form.getHeaders(), | |
| 'Authorization': `Bearer ${token}` | |
| } | |
| }) | |
| .then(response => { | |
| console.log(response.data); | |
| }) | |
| .catch(error => { | |
| console.error(error); | |
| });</code></pre> | |
| <h3>cURL</h3> | |
| <pre><code>curl -X POST \ | |
| http://localhost:8000/api/v1/faces/recognize \ | |
| -H 'Authorization: Bearer YOUR_JWT' \ | |
| -F 'image=@/path/to/your/image.jpg'</code></pre> | |
| </div> | |
| </div> | |
| </body> | |
| </html> |