-
Notifications
You must be signed in to change notification settings - Fork 4
Home
Tattle Khoj supports searching via images: https://services.tattle.co.in/khoj/ The search surfaces stories from Fact checking sites if they contain images similar to the one being searched for.
'Duplicate-video' is a sub project to implement Tattle video search on Khoj. This project will surface fact checking sites if they contain a video which is an exact match to the one searched for.
- Python and Flask for Backend
- React for Frontend
- SQL or Mongo for persistence
- Redis for caching needs
For now this is a headless backend without any UI. When we integrate it as the search engine for khoj, the UI will talk to the archive-server (which handles authentication and routing to correct services), and archive-server will request this server to get results.
The server will be given a URL to a video file and not the file itself. The server might need to download the file if it needs to operate on the file.
- Upload Endpoint (/api/upload) - This endpoint will be used to add video to our server.
Sample Code to upload a video to the server (via url)
import requests
url = "SERVER_URL/upload"
payload = {
"url": IMAGE_URL,
"type" : "video"
"doc_id": DOCUMENT_ID
}
response = requests.request("POST", url, data = payload)
print(response.text.encode('utf8'))
- Search Endpoint (/api/search) - Sample Code to search for a duplicate video (via url)
This will return matching doc ids of the duplicates
import requests
url = "SERVER_URL/search"
payload = {
"url": IMAGE_URL,
"type" : "video"
}
response = requests.request("POST", url, data = payload)
print(response.text.encode('utf8'))