A collection of two Python-based projects demonstrating practical applications of FastAPI, computer vision, web scraping, and data processing.
This repository contains:
- Project 1: Face Authentication API (FastAPI + FaceNet)
- Project 2: Amazon Laptop Scraper (Requests + BeautifulSoup + Selenium optional)
requirements.txtfor all dependencies- Simple front-end HTML page for testing the API
- Easy-to-follow instructions for running both projects
This project provides an API to compare two face images and determine whether they belong to the same person. It uses:
- MTCNN for face detection
- keras-facenet (FaceNet) for embedding extraction
- Cosine similarity to compare faces
- Detects faces from uploaded images
- Extracts normalized FaceNet embeddings
- Returns:
- Similarity score
- Whether images belong to the same person
- Bounding boxes + detection probabilities
-
Install dependencies:
pip install -r requirements.txt
-
Run the FastAPI server:
uvicorn main:app --reload
-
Open Swagger Docs:
http://localhost:8000/docs -
Test using the included
index.html:- Located in
frontend/folder - Open in browser and upload two images
- Located in
{
"verification_result": "Same person",
"similarity_score": 0.9947601556777954,
"image1": {
"num_faces": 1,
"bounding_boxes": [
[
357,
318,
574,
626
]
],
"detection_probs": [
0.9838451147079468
]
},
"image2": {
"num_faces": 2,
"bounding_boxes": [
[
1255,
1138,
2022,
2255
],
[
1663,
3329,
1732,
3412
]
],
"detection_probs": [
0.9985344409942627,
0.8942990303039551
]
},
"threshold_used": 0.7,
"model": "FaceNet (keras-facenet) + MTCNN"
}A Python script that scrapes Amazon.in search results for laptop listings, extracting:
- ASIN
- Product name
- Price
- Rating
- Image URL
- Product URL
- Whether result is Sponsored or Organic
requestsbeautifulsoup4lxmlpandastqdm- Optional:
selenium+webdriver-manager
Basic use:
python scrape.pyScrape a specific number of pages:
python scrape.py --pages 5Force Selenium mode:
python scrape.py --seleniumChoose custom output directory:
python scrape.py --out scraped_datapython scrape.py
Fetching pages: 100%|██████████████████████████████████████████████████| 20/20 [00:42<00:00, 2.14s/it]

Output CSV stored automatically with a timestamp.
All required dependencies for both projects are listed in requirements.txt.

