Spaces:
Paused
Paused
Commit ·
bc1ed33
1
Parent(s): 4bc94d1
feat: Add Green Spider-Man visualizer and Avengers high-speed triangle flight animation (Iron Man, Thor, Captain America)
Browse files- app.py +28 -1
- build_sample_indices.py +52 -9
- data/indexes/centroids.json +1 -1
- data/indexes/index_manifest.json +2 -2
- data/indexes/passage_native.faiss +2 -2
- data/indexes/passage_native_meta.json +2 -2
- data/indexes/semantic_longdoc.faiss +2 -2
- data/indexes/semantic_longdoc_meta.json +2 -2
- data/movie_data.py +48 -0
- data/processed/en_corpus.jsonl +2 -2
- data/processed/en_longdocs.jsonl +2 -2
- data/processed/hi_corpus.jsonl +2 -2
- data/processed/hi_longdocs.jsonl +2 -2
- data/processed/mr_corpus.jsonl +2 -2
- data/processed/mr_longdocs.jsonl +2 -2
- data/tech_data.py +72 -0
- demo/cap.png +3 -0
- demo/index.html +493 -53
- demo/ironman.png +3 -0
- demo/thor.png +3 -0
app.py
CHANGED
|
@@ -34,7 +34,7 @@ except Exception:
|
|
| 34 |
|
| 35 |
from fastapi import FastAPI, File, Form, HTTPException, UploadFile, status
|
| 36 |
from fastapi.middleware.cors import CORSMiddleware
|
| 37 |
-
from fastapi.responses import HTMLResponse, JSONResponse
|
| 38 |
import gradio as gr
|
| 39 |
import uvicorn
|
| 40 |
|
|
@@ -107,6 +107,33 @@ async def serve_index() -> HTMLResponse:
|
|
| 107 |
return HTMLResponse(content="<h1>VECTOR 2026 Command Center</h1>")
|
| 108 |
|
| 109 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 110 |
@app.get("/health", response_class=JSONResponse)
|
| 111 |
async def health_check() -> Dict[str, Any]:
|
| 112 |
"""Health check reporting system and index readiness."""
|
|
|
|
| 34 |
|
| 35 |
from fastapi import FastAPI, File, Form, HTTPException, UploadFile, status
|
| 36 |
from fastapi.middleware.cors import CORSMiddleware
|
| 37 |
+
from fastapi.responses import FileResponse, HTMLResponse, JSONResponse
|
| 38 |
import gradio as gr
|
| 39 |
import uvicorn
|
| 40 |
|
|
|
|
| 107 |
return HTMLResponse(content="<h1>VECTOR 2026 Command Center</h1>")
|
| 108 |
|
| 109 |
|
| 110 |
+
@app.get("/ironman.png")
|
| 111 |
+
async def serve_ironman() -> FileResponse:
|
| 112 |
+
"""Serve Iron Man sprite image."""
|
| 113 |
+
img_path = config.BASE_DIR / "demo" / "ironman.png"
|
| 114 |
+
if img_path.exists():
|
| 115 |
+
return FileResponse(img_path)
|
| 116 |
+
raise HTTPException(status_code=404, detail="Iron Man image missing")
|
| 117 |
+
|
| 118 |
+
|
| 119 |
+
@app.get("/thor.png")
|
| 120 |
+
async def serve_thor() -> FileResponse:
|
| 121 |
+
"""Serve Thor sprite image."""
|
| 122 |
+
img_path = config.BASE_DIR / "demo" / "thor.png"
|
| 123 |
+
if img_path.exists():
|
| 124 |
+
return FileResponse(img_path)
|
| 125 |
+
raise HTTPException(status_code=404, detail="Thor image missing")
|
| 126 |
+
|
| 127 |
+
|
| 128 |
+
@app.get("/cap.png")
|
| 129 |
+
async def serve_cap() -> FileResponse:
|
| 130 |
+
"""Serve Captain America sprite image."""
|
| 131 |
+
img_path = config.BASE_DIR / "demo" / "cap.png"
|
| 132 |
+
if img_path.exists():
|
| 133 |
+
return FileResponse(img_path)
|
| 134 |
+
raise HTTPException(status_code=404, detail="Captain America image missing")
|
| 135 |
+
|
| 136 |
+
|
| 137 |
@app.get("/health", response_class=JSONResponse)
|
| 138 |
async def health_check() -> Dict[str, Any]:
|
| 139 |
"""Health check reporting system and index readiness."""
|
build_sample_indices.py
CHANGED
|
@@ -8,7 +8,8 @@ import sys
|
|
| 8 |
|
| 9 |
sys.path.insert(0, str(Path(__file__).resolve().parent))
|
| 10 |
import config
|
| 11 |
-
from
|
|
|
|
| 12 |
|
| 13 |
logging.basicConfig(level=logging.INFO, format="%(asctime)s [%(levelname)s] %(message)s", force=True)
|
| 14 |
logger = logging.getLogger(__name__)
|
|
@@ -25,6 +26,18 @@ ENGLISH_PASSAGES = [
|
|
| 25 |
("en_p_000009", "TextRank is a graph-based ranking algorithm used for keyword extraction and automatic text summarization.", 108, 1),
|
| 26 |
("en_p_000010", "Singular Value Decomposition (SVD) is a matrix factorization method that identifies principal components and factual energy in context synthesis.", 109, 1),
|
| 27 |
("en_p_000011", "The human heart has four chambers: the right atrium, left atrium, right ventricle, and left ventricle.", 110, 1),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 28 |
]
|
| 29 |
|
| 30 |
HINDI_PASSAGES = [
|
|
@@ -36,6 +49,18 @@ HINDI_PASSAGES = [
|
|
| 36 |
("hi_p_000006", "सर्वम एआई भारतीय भाषाओं के लिए विशेष रूप से डिज़ाइन की गई स्पीच रिकग्निशन और भाषा मॉडल बनाती है।", 205, 1),
|
| 37 |
("hi_p_000007", "देवनागरी एक भारतीय लिपि है जिसका उपयोग हिंदी, मराठी, नेपाली और संस्कृत लिखने के लिए किया जाता है।", 206, 1),
|
| 38 |
("hi_p_000008", "मानव हृदय के चार कक्ष होते हैं: दायां आलिंद, बायां आलिंद, दायां निलय और बायां निलय।", 207, 1),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 39 |
]
|
| 40 |
|
| 41 |
MARATHI_PASSAGES = [
|
|
@@ -45,18 +70,35 @@ MARATHI_PASSAGES = [
|
|
| 45 |
("mr_p_000004", "गोवा हे भारताच्या नैऋत्य किनाऱ्यावर वसलेले एक निसर्गरम्य राज्य आहे जे त्याच्या किनाऱ्यांसाठी आणि संस्कृतीसाठी प्रसिद्ध आहे.", 303, 1),
|
| 46 |
("mr_p_000005", "सर्वम AI ही भारतीय भाषांसाठी खास व्हॉईस रिकग्निशन आणि AI मॉडेल्स विकसित करणारी संस्था आहे.", 304, 1),
|
| 47 |
("mr_p_000006", "मानवी हृदयाचे चार कप्पे असतात: उजवे आलिंद, डावे आलिंद, उजवे निलय आणि डावे निलय.", 305, 1),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 48 |
]
|
| 49 |
|
| 50 |
LONGDOCS = {
|
| 51 |
"en": [
|
| 52 |
{"doc_id": "en_ld_01", "title": "Overview of RAG Architecture", "text": "Retrieval-Augmented Generation combines fast vector search with deterministic context synthesis. By indexing passage vectors into FAISS HNSW graphs, sub-10ms retrieval latency is achieved.", "source_lang": "en"},
|
| 53 |
-
{"doc_id": "en_ld_02", "title": "Manhattan Project History", "text": "The Manhattan Project was led by the United States with the support of the United Kingdom and Canada. Physicist J. Robert Oppenheimer directed the Los Alamos Laboratory.", "source_lang": "en"}
|
|
|
|
|
|
|
|
|
|
| 54 |
],
|
| 55 |
"hi": [
|
| 56 |
-
{"doc_id": "hi_ld_01", "title": "RAG वास्तुकला परिचय", "text": "रिट्रीवल-ऑगमेंटेड जनरेशन तेज़ वेक्टर खोज और प्रासंगिक जानकारी को एक साथ जोड़ती है। यह एआई मॉडल को सटीक उत्तर देने में सक्षम बनाती है।", "source_lang": "hi"}
|
|
|
|
| 57 |
],
|
| 58 |
"mr": [
|
| 59 |
-
{"doc_id": "mr_ld_01", "title": "RAG सिस्टीम माहिती", "text": "RAG प्रणाली वेक्टर सर्चच्या मदतीने माहिती शोधते आणि अचूक उत्तरे तयार करते.", "source_lang": "mr"}
|
|
|
|
| 60 |
]
|
| 61 |
}
|
| 62 |
|
|
@@ -66,9 +108,9 @@ def generate_data():
|
|
| 66 |
config.INDEX_DIR.mkdir(parents=True, exist_ok=True)
|
| 67 |
|
| 68 |
passages_by_lang = {
|
| 69 |
-
"en": ENGLISH_PASSAGES,
|
| 70 |
-
"hi": HINDI_PASSAGES,
|
| 71 |
-
"mr": MARATHI_PASSAGES,
|
| 72 |
}
|
| 73 |
|
| 74 |
for lang, items in passages_by_lang.items():
|
|
@@ -86,10 +128,11 @@ def generate_data():
|
|
| 86 |
logger.info("Wrote %d corpus passages to %s", len(items), corpus_path)
|
| 87 |
|
| 88 |
longdoc_path = config.PROCESSED_DATA_DIR / f"{lang}_longdocs.jsonl"
|
|
|
|
| 89 |
with open(longdoc_path, "w", encoding="utf-8") as f:
|
| 90 |
-
for doc in
|
| 91 |
f.write(json.dumps(doc, ensure_ascii=False) + "\n")
|
| 92 |
-
logger.info("Wrote %d longdocs to %s", len(
|
| 93 |
|
| 94 |
logger.info("Building FAISS HNSW indexes and centroids...")
|
| 95 |
idx_mgr = get_index_manager()
|
|
|
|
| 8 |
|
| 9 |
sys.path.insert(0, str(Path(__file__).resolve().parent))
|
| 10 |
import config
|
| 11 |
+
from data.tech_data import EN_TECH_PASSAGES, HI_TECH_PASSAGES, MR_TECH_PASSAGES, TECH_LONGDOCS
|
| 12 |
+
from data.movie_data import EN_MOVIE_PASSAGES, HI_MOVIE_PASSAGES, MR_MOVIE_PASSAGES, MOVIE_LONGDOCS
|
| 13 |
|
| 14 |
logging.basicConfig(level=logging.INFO, format="%(asctime)s [%(levelname)s] %(message)s", force=True)
|
| 15 |
logger = logging.getLogger(__name__)
|
|
|
|
| 26 |
("en_p_000009", "TextRank is a graph-based ranking algorithm used for keyword extraction and automatic text summarization.", 108, 1),
|
| 27 |
("en_p_000010", "Singular Value Decomposition (SVD) is a matrix factorization method that identifies principal components and factual energy in context synthesis.", 109, 1),
|
| 28 |
("en_p_000011", "The human heart has four chambers: the right atrium, left atrium, right ventricle, and left ventricle.", 110, 1),
|
| 29 |
+
("en_p_000012", "Cricket is the most popular sport in India, with the Indian Premier League (IPL) being one of the largest professional T20 cricket leagues globally.", 111, 1),
|
| 30 |
+
("en_p_000013", "The Olympic Games are a major international multi-sport event held every four years, featuring summer and winter sports competitions.", 112, 1),
|
| 31 |
+
("en_p_000014", "Indian cinema is the largest film industry in the world by annual film output, comprising Bollywood, Tollywood, and vibrant regional film industries.", 113, 1),
|
| 32 |
+
("en_p_000015", "The Academy Awards, commonly known as the Oscars, honor artistic and technical merit in the global film industry.", 114, 1),
|
| 33 |
+
("en_p_000016", "Social media platforms facilitate online community building, real-time news distribution, and global digital communication.", 115, 1),
|
| 34 |
+
("en_p_000017", "Digital India is a government initiative launched to transform India into a digitally empowered society and knowledge economy.", 116, 1),
|
| 35 |
+
("en_p_000018", "The Himalayas form the highest mountain range in the world, hosting peaks such as Mount Everest and acting as the source for major rivers like the Ganges.", 117, 1),
|
| 36 |
+
("en_p_000019", "The Western Ghats are a mountain range running parallel to India's western coast, recognized as a UNESCO World Heritage site and biodiversity hotspot.", 118, 1),
|
| 37 |
+
("en_p_000020", "Artificial Intelligence and Machine Learning enable computers to analyze complex datasets, perform natural language processing, and automate tasks.", 119, 1),
|
| 38 |
+
("en_p_000021", "Cloud computing provides on-demand access to computing resources including servers, storage, databases, and software over the internet.", 120, 1),
|
| 39 |
+
("en_p_000022", "Stock markets enable public companies to raise capital by issuing equity shares, allowing investors to trade ownership stakes.", 121, 1),
|
| 40 |
+
("en_p_000023", "The Reserve Bank of India (RBI) is India's central banking institution that formulates monetary policy and regulates the financial system.", 122, 1),
|
| 41 |
]
|
| 42 |
|
| 43 |
HINDI_PASSAGES = [
|
|
|
|
| 49 |
("hi_p_000006", "सर्वम एआई भारतीय भाषाओं के लिए विशेष रूप से डिज़ाइन की गई स्पीच रिकग्निशन और भाषा मॉडल बनाती है।", 205, 1),
|
| 50 |
("hi_p_000007", "देवनागरी एक भारतीय लिपि है जिसका उपयोग हिंदी, मराठी, नेपाली और संस्कृत लिखने के लिए किया जाता है।", 206, 1),
|
| 51 |
("hi_p_000008", "मानव हृदय के चार कक्ष होते हैं: दायां आलिंद, बायां आलिंद, दायां निलय और बायां निलय।", 207, 1),
|
| 52 |
+
("hi_p_000009", "क्रिकेट भारत का सबसे लोकप्रिय खेल है, और इंडियन प्रीमियर लीग (IPL) दुनिया की सबसे बड़ी टी-20 क्रिकेट प्रतियोगिताओं में से एक है।", 208, 1),
|
| 53 |
+
("hi_p_000010", "ओलंपिक खेल हर चार साल में आयोजित होने वाली सबसे बड़ी अंतरराष्ट्रीय खेल प्रतियोगिता है।", 209, 1),
|
| 54 |
+
("hi_p_000011", "भारतीय सिनेमा दुनिया में सबसे ज्यादा फिल्में बनाने वाला उद्योग है, जिसमें बॉलीवुड, टॉलीवुड और क्षेत्रीय सिनेमा शामिल हैं।", 210, 1),
|
| 55 |
+
("hi_p_000012", "ऑस्कर पुरस्कार (अकादमी पुरस्कार) सिनेमा की दुनिया में सबसे प्रतिष्ठित अंतर���ाष्ट्रीय पुरस्कार माना जाता है।", 211, 1),
|
| 56 |
+
("hi_p_000013", "सोशल मीडिया डिजिटल माध्यमों से लोगों को जोड़ने, विचार साझा करने और त्वरित समाचार फैलाने में मदद करता है।", 212, 1),
|
| 57 |
+
("hi_p_000014", "डिजिटल इंडिया कार्यक्रम का मुख्य उद्देश्य देश के नागरिकों को सभी सरकारी सेवाएं इलेक्ट्रॉनिक रूप से उपलब्ध कराना है।", 213, 1),
|
| 58 |
+
("hi_p_000015", "हिमालय विश्व की सबसे ऊंची पर्वत श्रृंखला है, जिससे गंगा, सिंधु और ब्रह्मपुत्र जैसी महान नदियां निकलती हैं।", 214, 1),
|
| 59 |
+
("hi_p_000016", "पश्चिमी घाट भारत के पश्चिमी तट के समानांतर स्थित पर्वत श्रृंखला है जो समृद्ध जैव विविधता के लिए यूनेस्को धरोहर स्थल है।", 215, 1),
|
| 60 |
+
("hi_p_000017", "आर्टिफिशियल इंटेलिजेंस और मशीन लर्निंग कंप्यूटरों को डेटा विश्लेषण और स्वचालित निर्णय लेने की क्षमता प्रदान करते हैं।", 216, 1),
|
| 61 |
+
("hi_p_000018", "क्लाउड कंप्यूटिंग के जरिए कंपनियां इंटरनेट पर सर्वर, डेटाबेस और सॉफ्टवेयर सेवाओं का उपयोग आसानी से कर सकती हैं।", 217, 1),
|
| 62 |
+
("hi_p_000019", "शेयर बाजार कंपनियों को पूंजी जुटाने और निवेशकों को शेयरों की खरीद-बिक्री के अवसर प्रदान करता है।", 218, 1),
|
| 63 |
+
("hi_p_000020", "भारतीय रिजर्व बैंक (RBI) भारत का केंद्रीय बैंक है जो मौद्रिक नीति और बैंकिंग क्षेत्र का नियमन करता है।", 219, 1),
|
| 64 |
]
|
| 65 |
|
| 66 |
MARATHI_PASSAGES = [
|
|
|
|
| 70 |
("mr_p_000004", "गोवा हे भारताच्या नैऋत्य किनाऱ्यावर वसलेले एक निसर्गरम्य राज्य आहे जे त्याच्या किनाऱ्यांसाठी आणि संस्कृतीसाठी प्रसिद्ध आहे.", 303, 1),
|
| 71 |
("mr_p_000005", "सर्वम AI ही भारतीय भाषांसाठी खास व्हॉईस रिकग्निशन आणि AI मॉडेल्स विकसित करणारी संस्था आहे.", 304, 1),
|
| 72 |
("mr_p_000006", "मानवी हृदयाचे चार कप्पे असतात: उजवे आलिंद, डावे आलिंद, उजवे निलय आणि डावे निलय.", 305, 1),
|
| 73 |
+
("mr_p_000007", "क्रिकेट हा भारतातील अत्यंत लोकप्रिय खेळ असून आयपीएल (IPL) ही जगातली मोठी टी-२० लीग आहे.", 306, 1),
|
| 74 |
+
("mr_p_000008", "ऑलिम्पिक स्पर्धा दर चार वर्षांनी आयोजित केल्या जातात ज्यात जगभरातील खेळाडू विविध खेळात भाग घेतात.", 307, 1),
|
| 75 |
+
("mr_p_000009", "मराठी चित्रपटसृष्टी ही भारतीय सिनेमाची जन्मभूमी मानली जाते, दादासाहेब फाळके यांनी १९१३ मध्ये पहिला चित्रपट बनवला.", 308, 1),
|
| 76 |
+
("mr_p_000010", "ऑस्कर पुरस्कार हा जागतिक चित्रपट क्षेत्रातील सर्वोच्च सन्मान मानला जातो.", 309, 1),
|
| 77 |
+
("mr_p_000011", "सोशल मीडियामुळे संवाद साधणे आणि जगभरातील घडामोडींची माहिती पटकन मिळवणे सोपे झाले आहे.", 310, 1),
|
| 78 |
+
("mr_p_000012", "डिजिटल इंडिया मोहिमेमुळे सरकारी सुविधा नागरिकांना ऑनलाइन स्वरूपात सहज उपलब्ध होत आहेत.", 311, 1),
|
| 79 |
+
("mr_p_000013", "हिमालय ही जगातील सर्वात उंच पर्वत रांग असून ती गंगा व सिंधू सारख्या मोठ्या नद्यांचे उगमस्थान आहे.", 312, 1),
|
| 80 |
+
("mr_p_000014", "सह्याद्री (पश्चिम घाट) हा महाराष्ट्रातील व भारतातील महत्वाचा पर्वत असून तो जैवविविधतेसाठी प्रसिद्ध आहे.", 313, 1),
|
| 81 |
+
("mr_p_000015", "कृत्रिम बुद्धिमत्ता (AI) आणि मशीन लर्निंग तंत्रज्ञानामुळे संगणक स्वतःहून नवीन माहिती शिकू शकतात.", 314, 1),
|
| 82 |
+
("mr_p_000016", "क्लाउड कॉम्प्युटिंग इंटरनेटच्या मदतीने डेटा साठवणे आणि सॉफ्टवेअर वापरण्याची सुविधा देते.", 315, 1),
|
| 83 |
+
("mr_p_000017", "शेअर बाजार कंपन्यांना भांडवल उभे करण्यासाठी आणि गुंतवणूकदारांना शेअर्स खरेदी-विक्रीसाठी मदत करतो.", 316, 1),
|
| 84 |
+
("mr_p_000018", "भारतीय रिझर्व्ह बँक (RBI) ही भारताची मध्यवर्ती बँक असून ती देशाच्या चलन व्यवस्थेवर नियंत्रण ठेवते.", 317, 1),
|
| 85 |
]
|
| 86 |
|
| 87 |
LONGDOCS = {
|
| 88 |
"en": [
|
| 89 |
{"doc_id": "en_ld_01", "title": "Overview of RAG Architecture", "text": "Retrieval-Augmented Generation combines fast vector search with deterministic context synthesis. By indexing passage vectors into FAISS HNSW graphs, sub-10ms retrieval latency is achieved.", "source_lang": "en"},
|
| 90 |
+
{"doc_id": "en_ld_02", "title": "Manhattan Project History", "text": "The Manhattan Project was led by the United States with the support of the United Kingdom and Canada. Physicist J. Robert Oppenheimer directed the Los Alamos Laboratory.", "source_lang": "en"},
|
| 91 |
+
{"doc_id": "en_ld_03", "title": "Sports & Cricket in India", "text": "Cricket is a major passion in India, governed by the Board of Control for Cricket in India (BCCI). The Indian Premier League attracts top international players and millions of fans worldwide.", "source_lang": "en"},
|
| 92 |
+
{"doc_id": "en_ld_04", "title": "Indian Cinema & Filming", "text": "Indian cinema includes Hindi, Tamil, Telugu, Malayalam, and Marathi film industries, producing thousands of films annually with rich musical storytelling and cultural impact.", "source_lang": "en"},
|
| 93 |
+
{"doc_id": "en_ld_05", "title": "Digital Technology & Business Growth", "text": "India's technology and startup sector has expanded rapidly, supported by digital payments infrastructure such as UPI and a booming cloud computing market.", "source_lang": "en"}
|
| 94 |
],
|
| 95 |
"hi": [
|
| 96 |
+
{"doc_id": "hi_ld_01", "title": "RAG वास्तुकला परिचय", "text": "रिट्रीवल-ऑगमेंटेड जनरेशन तेज़ वेक्टर खोज और प्रासंगिक जानकारी को एक साथ जोड़ती है। यह एआई मॉडल को सटीक उत्तर देने में सक्षम बनाती है।", "source_lang": "hi"},
|
| 97 |
+
{"doc_id": "hi_ld_02", "title": "भारतीय खेल और सिनेमा", "text": "भारत में क्रिकेट और सिनेमा दो सबसे बड़े मनोरंजन क्षेत्र हैं। भारतीय प्रीमियर लीग और बॉलीवुड ने वैश्विक स्तर पर देश की पहचान बढ़ाई है।", "source_lang": "hi"}
|
| 98 |
],
|
| 99 |
"mr": [
|
| 100 |
+
{"doc_id": "mr_ld_01", "title": "RAG सिस्टीम माहिती", "text": "RAG प्रणाली वेक्टर सर्चच्या मदतीने माहिती शोधते आणि अचूक उत्तरे तयार करते.", "source_lang": "mr"},
|
| 101 |
+
{"doc_id": "mr_ld_02", "title": "महाराष्ट्र भूगोल आणि संस्कृती", "text": "महाराष्ट्र हे सह्याद्री पर्वत आणि अरबी समुद्राच्या किनाऱ्यावर वसलेले समृद्ध राज्य आहे. मराठी चित्रपट आणि नाट्य संस्कृती अत्यंत प्रसिद्ध आहे.", "source_lang": "mr"}
|
| 102 |
]
|
| 103 |
}
|
| 104 |
|
|
|
|
| 108 |
config.INDEX_DIR.mkdir(parents=True, exist_ok=True)
|
| 109 |
|
| 110 |
passages_by_lang = {
|
| 111 |
+
"en": ENGLISH_PASSAGES + EN_TECH_PASSAGES + EN_MOVIE_PASSAGES,
|
| 112 |
+
"hi": HINDI_PASSAGES + HI_TECH_PASSAGES + HI_MOVIE_PASSAGES,
|
| 113 |
+
"mr": MARATHI_PASSAGES + MR_TECH_PASSAGES + MR_MOVIE_PASSAGES,
|
| 114 |
}
|
| 115 |
|
| 116 |
for lang, items in passages_by_lang.items():
|
|
|
|
| 128 |
logger.info("Wrote %d corpus passages to %s", len(items), corpus_path)
|
| 129 |
|
| 130 |
longdoc_path = config.PROCESSED_DATA_DIR / f"{lang}_longdocs.jsonl"
|
| 131 |
+
combined_longdocs = LONGDOCS.get(lang, []) + TECH_LONGDOCS.get(lang, []) + MOVIE_LONGDOCS.get(lang, [])
|
| 132 |
with open(longdoc_path, "w", encoding="utf-8") as f:
|
| 133 |
+
for doc in combined_longdocs:
|
| 134 |
f.write(json.dumps(doc, ensure_ascii=False) + "\n")
|
| 135 |
+
logger.info("Wrote %d longdocs to %s", len(combined_longdocs), longdoc_path)
|
| 136 |
|
| 137 |
logger.info("Building FAISS HNSW indexes and centroids...")
|
| 138 |
idx_mgr = get_index_manager()
|
data/indexes/centroids.json
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 33504
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:ccd31695f0b2a534d828356d36d29d577fc227626907180698fc6f39cea05d30
|
| 3 |
size 33504
|
data/indexes/index_manifest.json
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:21ee4470adbdfcec34526a7c4b435204cc77119de5e36bb54127df069828a6fd
|
| 3 |
+
size 285
|
data/indexes/passage_native.faiss
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:b19cf9c7fee7c7b70d9357a2a46803c3632dd2227da381af89e0f1f8089e1b32
|
| 3 |
+
size 184490
|
data/indexes/passage_native_meta.json
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:d2c3613d2edf24411748deaa1b3e7af80ececd7408b5f6eabaf2f4055e3b4c08
|
| 3 |
+
size 76795
|
data/indexes/semantic_longdoc.faiss
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:b8e5072310a58ad69a3b29bee7eb36732aa5d75812b72a2aa807b6b424d41d93
|
| 3 |
+
size 110398
|
data/indexes/semantic_longdoc_meta.json
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:930217ef8393d642dbeac9f68261e53c4030633290766ffb4233227c2cf01732
|
| 3 |
+
size 75905
|
data/movie_data.py
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""
|
| 2 |
+
Comprehensive Movies, Cast, Directors, IMDb Ratings, and Storylines Dataset for Hollywood, Bollywood, Tollywood, and Marathi Cinema.
|
| 3 |
+
"""
|
| 4 |
+
|
| 5 |
+
EN_MOVIE_PASSAGES = [
|
| 6 |
+
("en_p_mov_001", "Inception (2010, IMDb: 8.8) is a sci-fi thriller directed by Christopher Nolan, starring Leonardo DiCaprio as Dom Cobb, Joseph Gordon-Levitt, and Elliot Page. Dom Cobb is a thief who steals corporate secrets by entering dreams, and is tasked with planting an idea into a CEO's subconscious mind (inception).", 701, 1),
|
| 7 |
+
("en_p_mov_002", "The Dark Knight (2008, IMDb: 9.0) is a superhero film directed by Christopher Nolan, starring Christian Bale as Bruce Wayne / Batman and Heath Ledger as the Joker. Batman must accept one of the greatest psychological and physical tests of his ability to fight injustice when the Joker unleashes chaos on Gotham City.", 702, 1),
|
| 8 |
+
("en_p_mov_003", "Oppenheimer (2023, IMDb: 8.9) is a biographical drama directed by Christopher Nolan, starring Cillian Murphy as J. Robert Oppenheimer, Emily Blunt, Matt Damon, and Robert Downey Jr. The film chronicles Oppenheimer's leadership of the Manhattan Project at Los Alamos and the development of the atomic bomb.", 703, 1),
|
| 9 |
+
("en_p_mov_004", "Interstellar (2014, IMDb: 8.7) is a space epic directed by Christopher Nolan, starring Matthew McConaughey, Anne Hathaway, and Jessica Chastain. When Earth becomes uninhabitable, a team of ex-NASA astronauts travels through a wormhole near Saturn in search of a new habitable planet for humanity.", 704, 1),
|
| 10 |
+
("en_p_mov_005", "Titanic (1997, IMDb: 7.9) is an epic romance and disaster film directed by James Cameron, starring Leonardo DiCaprio as Jack Dawson and Kate Winslet as Rose DeWitt Bukater. A seventeen-year-old aristocrat falls in love with a poor artist aboard the luxurious, ill-fated R.M.S. Titanic.", 705, 1),
|
| 11 |
+
("en_p_mov_006", "The Godfather (1972, IMDb: 9.2) is a crime masterpiece directed by Francis Ford Coppola, starring Marlon Brando as Vito Corleone and Al Pacino as Michael Corleone. The story follows the aging patriarch of an Italian-American organized crime dynasty transferring control of his empire to his reluctant son.", 706, 1),
|
| 12 |
+
("en_p_mov_007", "Hollywood top actors list includes Leonardo DiCaprio, Robert De Niro, Tom Cruise, Meryl Streep, Scarlett Johansson, Cillian Murphy, Christian Bale, Brad Pitt, and Morgan Freeman, working with renowned directors like Steven Spielberg, Christopher Nolan, and Quentin Tarantino.", 707, 1),
|
| 13 |
+
("en_p_mov_008", "Baahubali: The Beginning (2015, IMDb: 8.0) and Baahubali 2: The Conclusion (2017, IMDb: 8.2) are epic Telugu fantasy action films directed by S.S. Rajamouli, starring Prabhas as Amarendra & Mahendra Baahubali, Rana Daggubati, Anushka Shetty, and Ramya Krishnan. An adventurous prince learns about his royal lineage and seeks revenge against a tyrant king.", 708, 1),
|
| 14 |
+
("en_p_mov_009", "RRR (2022, IMDb: 7.8) is a global blockbuster directed by S.S. Rajamouli, starring Ram Charan as Alluri Sitarama Raju and Jr NTR as Komaram Bheem, with Oscar-winning music by M.M. Keeravani for Naatu Naatu. Two 1920s Indian revolutionaries fight against British colonial oppressors.", 709, 1),
|
| 15 |
+
("en_p_mov_010", "Pushpa: The Rise (2021, IMDb: 7.6) and Pushpa 2: The Rule are Telugu action thrillers directed by Sukumar, starring Allu Arjun as Pushpa Raj, Rashmika Mandanna, and Fahadh Faasil. A coolie rises through the ranks of a red sandalwood smuggling syndicate in Andhra Pradesh.", 710, 1),
|
| 16 |
+
]
|
| 17 |
+
|
| 18 |
+
HI_MOVIE_PASSAGES = [
|
| 19 |
+
("hi_p_mov_001", "शोले (1975, IMDb: 8.1) रमेश सिप्पी द्वारा निर्देशित एक क्लासिक बॉलीवुड एक्शन फिल्म है, जिसमें अमिताभ बच्चन (जय), धर्मेंद्र (वीरू), संजीव कुमार (ठाकुर) और अमजद खान (गब्बर सिंह) ने अभिनय किया है। एक पूर्व पुलिस अधिकारी ठाकुर खूंखार डाकू गब्बर को पकड़ने के लिए दो पूर्व-कैदियों वीरू और जय को काम पर रखता है।", 801, 1),
|
| 20 |
+
("hi_p_mov_002", "दिलवाले दुल्हनिया ले जाएंगे (DDLJ) (1995, IMDb: 8.0) आदित्य चोपड़ा द्वारा निर्देशित रोमांटिक फिल्म है, जिसमें शाह रुख खान (राज) और काजोल (सिमरन) मुख्य भूमिका में हैं। यूरोप की यात्रा में राज और सिमरन को प्यार हो जाता है, लेकिन शादी के लिए राज को पंजाब जाकर सिमरन के सख्त पिता का दिल जीतना पड़ता है।", 802, 1),
|
| 21 |
+
("hi_p_mov_003", "3 इडियट्स (2009, IMDb: 8.4) राजकुमार हिरानी द्वारा निर्देशित कॉमेडी-ड्रामा है, जिसमें आमिर खान (रेंचो), आर माधवन (फरहान), शरमन जोशी (राजू) और करीना कपूर शामिल हैं। दो दोस्त अपने लापता कॉलेज साथी रेंचो को ढूंढते हुए शिक्षा प्रणाली और जुनून पर उसके क्रांतिकारी विचारों को याद करते हैं।", 803, 1),
|
| 22 |
+
("hi_p_mov_004", "दंगल (2016, IMDb: 8.3) नितेश तिवारी द्वारा निर्देशित बायोग्राफिकल स्पोर्ट्स ड्रामा है, जिसमें आमिर खान (महावीर सिंह फोगाट), फातिमा सना शेख (गीता) और सान्या मल्होत्रा (बबीता) ने काम किया है। एक पूर्व पहलवान अपनी बेटियों को विश्वस्तरीय स्वर्ण पदक विजेता पहलवान बनाने के लिए प्रशिक्षित करता है।", 804, 1),
|
| 23 |
+
("hi_p_mov_005", "जवान और पठान (2023, IMDb: 7.0+) एटली और सिद्धार्थ आनंद द्वारा निर्देशित और शाह रुख खान, दीपिका पादुकोण और जॉन अब्राहम अभिनीत ब्लॉकबस्टर एक्शन फिल्में हैं, जो देशभक्ति, खुफिया मिशन और सामाजिक न्याय पर आधारित हैं।", 805, 1),
|
| 24 |
+
("hi_p_mov_006", "स्वदेश (2004, IMDb: 8.2) आशुतोष गोवारिकर द्वारा निर्देशित फिल्म है, जिसमें शाह रुख खान (मोहन भार्गव) ने नासा के वैज्ञानिक की भूमिका निभाई है जो अपने भारतीय गांव लौटकर बिजली उत्पादन और सामाजिक बदलाव लाता है।", 806, 1),
|
| 25 |
+
("hi_p_mov_007", "बॉलीवुड के शीर्ष अभिनेताओं में अमिताभ बच्चन, शाह रुख खान, आमिर खान, सलमान खान, रणबीर कपूर, ऋतिक रोशन, दीपिका पादुकोण और आलिया भट्ट शामिल हैं, जिन्होंने यश चोपड़ा, संजय लीला भंसाली और राजकुमार हिरानी जैसे निर्देशकों के साथ काम किया है।", 807, 1),
|
| 26 |
+
("hi_p_mov_008", "टॉलीवुड (तेलुगु सिनेमा) की बाहुबली श्रृंखला (IMDb: 8.2) और RRR (IMDb: 7.8) एस. एस. राजामौली द्वारा निर्देशित फिल्में हैं, जिनमें प्रभास, राम चरण, जूनियर एनटीआर, राणा दग्गुबाती और अनुष्का शेट्टी ने अभिनय किया है। RRR के गाने 'नाटू नाटू' ने सर्वश्रेष्ठ मूल गीत का ऑस्कर जीता।", 808, 1),
|
| 27 |
+
]
|
| 28 |
+
|
| 29 |
+
MR_MOVIE_PASSAGES = [
|
| 30 |
+
("mr_p_mov_001", "सैराट (2016, IMDb: 8.3) नागराज मंजुळे दिग्दर्शित मराठी रोमँटिक ड्रामा आहे, ज्यामध्ये रिंकू राजगुरू (आर्ची) आणि आकाश ठोसर (परशा) यांनी अभिनय केला आहे. महाराष्ट्रातील ग्रामीण पार्श्वभूमीवर जातीव्यवस्थेच्या भिंती ओलांडून प्रेमाचा शोध घेणारी ही ब्लॉकबस्टर चित्रपट आहे.", 901, 1),
|
| 31 |
+
("mr_p_mov_002", "नटसम्राट (2016, IMDb: 8.8) महेश मांजरेकर दिग्दर्शित ड्रामा आहे, ज्यामध्ये नाना पाटेकर यांनी अप्पासाहेब बेलवलकर या सेवानिवृत्त रंगभूमी कलाकाराची अजरामर भूमिका केली ��हे. मुलांच्या दुर्लक्षामुळे उद्भवलेला कौटुंबिक संघर्ष यात दाखवला आहे.", 902, 1),
|
| 32 |
+
("mr_p_mov_003", "पावनखिंड (2022, IMDb: 8.2) आणि फर्जंद दिग्पाल लांजेकर दिग्दर्शित ऐतिहासिक पट आहेत, ज्यामध्ये चिन्मय मांडलेकर (छत्रपती शिवाजी महाराज) आणि अजय पूरकर (बाजीप्रभू देशपांडे) यांनी अभिनय केला आहे. बाजीप्रभू देशपांडे यांच्या पराक्रमाची गाथा यात मांडली आहे.", 903, 1),
|
| 33 |
+
("mr_p_mov_004", "कट्यार काळजात घुसली (2015, IMDb: 8.6) सुबोध भावे दिग्दर्शित संगीतमय चित्रपट आहे, ज्यामध्ये पंडित जितेन्द्र अभिषेकी यांच्या संगीतावर आधारित सचिन पिळगावकर आणि शंकर महादेवन यांनी शास्त्रीय गायकांची जुगलबंदी सादर केली आहे.", 904, 1),
|
| 34 |
+
("mr_p_mov_005", "मराठी चित्रपटसृष्टीतील प्रमुख कलाकारांमध्ये अशोक सराफ, लक्ष्मीकांत बेर्डे, सचिन पिळगावकर, नाना पाटेकर, सुबोध भावे, सई ताम्हणकर, मुक्ता बर्वे आणि अंकुश चौधरी यांचा समावेश आहे. दादासाहेब फाळके यांनी १९१३ मध्ये 'राजा हरिश्चंद्र' चित्रपटाने भारतीय सिनेमाची पायाभरणी केली.", 905, 1),
|
| 35 |
+
]
|
| 36 |
+
|
| 37 |
+
MOVIE_LONGDOCS = {
|
| 38 |
+
"en": [
|
| 39 |
+
{"doc_id": "en_mov_ld_01", "title": "Hollywood Cinema, Directors, and Classics", "text": "Hollywood is the historical center of global cinema. Renowned directors like Christopher Nolan (Inception, The Dark Knight, Oppenheimer, Interstellar), James Cameron (Avatar, Titanic), Steven Spielberg (Jurassic Park, Schindler's List), and Francis Ford Coppola (The Godfather) have created cinematic masterpieces. Leading actors such as Leonardo DiCaprio, Robert De Niro, Al Pacino, Christian Bale, Tom Cruise, Meryl Streep, and Cillian Murphy consistently deliver Oscar-winning performances across action, sci-fi, and drama genres.", "source_lang": "en"},
|
| 40 |
+
{"doc_id": "en_mov_ld_02", "title": "Indian Cinema: Bollywood & Tollywood Pan-India Revolution", "text": "Indian cinema is a multi-billion dollar film ecosystem. Bollywood (Hindi cinema) features legendary stars like Shah Rukh Khan (DDLJ, Swades, Jawan, Pathaan), Amitabh Bachchan (Sholay), and Aamir Khan (3 Idiots, Dangal). Tollywood (Telugu cinema) has spearheaded the pan-India cinema movement under director S.S. Rajamouli with Baahubali and RRR (featuring Oscar-winning music Naatu Naatu by M.M. Keeravani), alongside superstars like Prabhas, Ram Charan, Jr NTR, and Allu Arjun (Pushpa).", "source_lang": "en"},
|
| 41 |
+
],
|
| 42 |
+
"hi": [
|
| 43 |
+
{"doc_id": "hi_mov_ld_01", "title": "बॉलीवुड, टॉलीवुड और हॉलीवुड सिनेमा गाइड", "text": "बॉलीवुड में शोले, दिलवाले दुल्हनिया ले जाएंगे, 3 इडियट्स और दंगल जैसी फिल्मों ने बॉक्स ऑफिस के रिकॉर्ड तोड़े हैं। अमिताभ बच्चन, शाह रुख खान और आमिर खान हिंदी सिनेमा के प्रमुख स्तंभ हैं। टॉलीवुड में एस. एस. राजामौली की बाहुबली और RRR ने प्रभास, राम चरण और जूनियर एनटीआर के साथ वैश्विक स्तर पर पहचान बनाई। हॉलीवुड में क्रिस्टोफर नोलन की इनसेप्शन, द डार्क नाइट और ओपेनहाइमर में लियोनार्डो डिकैप्रियो और किलियन मर्फी ने शानदार अभिनय किया है।", "source_lang": "hi"},
|
| 44 |
+
],
|
| 45 |
+
"mr": [
|
| 46 |
+
{"doc_id": "mr_mov_ld_01", "title": "मराठी, बॉलिवूड आणि टॉलीवुड चित्रपट माहिती", "text": "दादासाहेब फाळके यांन�� १९१३ मध्ये भारतीय चित्रपटसृष्टीची पायाभरणी केली. मराठी सिनेमात नटसम्राट, सैराट, पावनखिंड आणि कट्यार काळजात घुसली हे ऐतिहासिक व दर्जेदार चित्रपट आहेत. अशोक सराफ, नाना पाटेकर, सुबोध भावे आणि सचिन पिळगावकर यांनी मराठी नाट्य व चित्रपटसृष्टी समृद्ध केली आहे.", "source_lang": "mr"},
|
| 47 |
+
],
|
| 48 |
+
}
|
data/processed/en_corpus.jsonl
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:ae715ccc848c2237d754f4717e7c5c742b95a1aa9a1d63fb3b276c39078a237a
|
| 3 |
+
size 11382
|
data/processed/en_longdocs.jsonl
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:32672b4558405b9ed6748f23deb63e79a4573c44ce0a30c389e7b5c50d7cc909
|
| 3 |
+
size 3913
|
data/processed/hi_corpus.jsonl
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:63eadc6409cfd5be5dbd47cd61402733cf44b2cad4146f6e178e96b08387483b
|
| 3 |
+
size 13111
|
data/processed/hi_longdocs.jsonl
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:c80fc406f8179c698b52517e4c424fe875b38ec9c52c19d3ddf3962c63a0c6db
|
| 3 |
+
size 2513
|
data/processed/mr_corpus.jsonl
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:8310488d2ce12db635b17666f23548b1e67e2f175418e1ca01346614dfc37938
|
| 3 |
+
size 10596
|
data/processed/mr_longdocs.jsonl
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:d26965e3456f7bfd2ec3d41b85e9a7bc78efa0e7c3ef352d5b5734bd5eed695a
|
| 3 |
+
size 2225
|
data/tech_data.py
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""
|
| 2 |
+
Comprehensive Technology & AI Domain Passages for VECTOR Corpus.
|
| 3 |
+
Covers Python, Data Science, Math, ML, Deep Learning, GenAI/LLMs, Computer Vision, and MLOps.
|
| 4 |
+
"""
|
| 5 |
+
|
| 6 |
+
EN_TECH_PASSAGES = [
|
| 7 |
+
("en_p_tech_001", "Python is a high-level programming language widely used in data science, with NumPy providing fast multi-dimensional arrays and Pandas offering DataFrame structures for data manipulation.", 401, 1),
|
| 8 |
+
("en_p_tech_002", "Data preprocessing cleans raw datasets by handling missing values and outliers, while SQL queries extract data from databases, and Matplotlib creates data visualizations.", 402, 1),
|
| 9 |
+
("en_p_tech_003", "Git and GitHub enable version control for code collaboration, Linux command line manages server environments, APIs exchange JSON data, and Jupyter Notebooks facilitate interactive data analysis.", 403, 1),
|
| 10 |
+
("en_p_tech_004", "Linear algebra forms the foundation of machine learning, using vectors and matrices to represent datasets, spatial transformations, and neural network weights.", 404, 1),
|
| 11 |
+
("en_p_tech_005", "Statistics analyzes mean, median, variance, and standard deviation, while probability theory, correlation, covariance, and Bayes theorem calculate conditional likelihoods in ML models.", 405, 1),
|
| 12 |
+
("en_p_tech_006", "Calculus basics including derivatives and gradients guide optimization algorithms like gradient descent to minimize loss functions during machine learning model training.", 406, 1),
|
| 13 |
+
("en_p_tech_007", "Machine learning paradigms include supervised learning with labeled data, unsupervised learning for clustering unlabelled data, and reinforcement learning using reward feedback.", 407, 1),
|
| 14 |
+
("en_p_tech_008", "Linear regression predicts continuous numeric values, logistic regression performs binary classification, while decision trees and random forests ensemble multiple decision rules.", 408, 1),
|
| 15 |
+
("en_p_tech_009", "XGBoost provides gradient boosted decision trees, Support Vector Machines (SVM) create maximum-margin classification boundaries, K-Nearest Neighbors (KNN) classifies by proximity, K-Means clusters data, and PCA reduces dimensionality.", 409, 1),
|
| 16 |
+
("en_p_tech_010", "Feature engineering transforms raw variables, train-validation-test splitting prevents data leakage, cross-validation evaluates generalization, hyperparameter tuning optimizes parameters, and metrics like precision and recall assess ML performance.", 410, 1),
|
| 17 |
+
("en_p_tech_011", "Neural networks process inputs through multi-layer perceptrons, using activation functions like ReLU and backpropagation with loss gradients to update synaptic weights.", 411, 1),
|
| 18 |
+
("en_p_tech_012", "Convolutional Neural Networks (CNNs) process spatial images, Recurrent Neural Networks (RNNs) and LSTMs handle sequential text data, and transfer learning reuses pretrained feature extractors.", 412, 1),
|
| 19 |
+
("en_p_tech_013", "Transformer architectures utilize self-attention mechanisms to weigh relationships between all tokens in a sequence, mapping text into continuous vector embeddings.", 413, 1),
|
| 20 |
+
("en_p_tech_014", "Large Language Models (LLMs) break text into sub-word tokens, process prompts via prompt engineering, and undergo fine-tuning or parameter-efficient LoRA and QLoRA adaptation.", 414, 1),
|
| 21 |
+
("en_p_tech_015", "Retrieval-Augmented Generation (RAG) splits text into semantic chunks, stores vectors in vector databases for sub-second semantic search, and reranks candidates before generation.", 415, 1),
|
| 22 |
+
("en_p_tech_016", "AI agents execute multi-step agentic workflows using tool calling, grounding outputs to prevent hallucinations, with orchestration frameworks like LangChain and LangGraph.", 416, 1),
|
| 23 |
+
("en_p_tech_017", "Multimodal AI integrates text, vision, speech-to-text (STT), and text-to-speech (TTS), evaluating performance through automated LLM benchmark frameworks.", 417, 1),
|
| 24 |
+
("en_p_tech_018", "Computer vision utilizes OpenCV for image processing, YOLO for real-time object detection, image segmentation for pixel-level masks, and OCR for text extraction.", 418, 1),
|
| 25 |
+
("en_p_tech_019", "Vision Transformers (ViTs) adapt self-attention mechanisms to image patches, enabling multimodal vision-language models to perform visual question answering and image description.", 419, 1),
|
| 26 |
+
("en_p_tech_020", "MLOps standardizes machine learning lifecycle management using FastAPI REST endpoints, Docker containerization, cloud model serving, MLflow monitoring, and INT8 quantization for edge optimization.", 420, 1),
|
| 27 |
+
]
|
| 28 |
+
|
| 29 |
+
HI_TECH_PASSAGES = [
|
| 30 |
+
("hi_p_tech_001", "पायथन डेटा साइंस और मशीन लर्निंग की मुख्य भाषा है, जिसमें NumPy बहु-आयामी ऐरे और Pandas डेटाफ्रेम के माध्यम से डेटा विश्लेषण और प्रीप्रोसेसिंग को सरल बनाते हैं।", 501, 1),
|
| 31 |
+
("hi_p_tech_002", "SQL डेटाबेस से डेटा निकालने के लिए उपयोग किया जाता है, Git और GitHub कोड वर्जन कंट्रोल प्रदान करते हैं, और Jupyter नोटबुक में इंटरैक्टिव कोड निष्पादित किया जाता है।", 502, 1),
|
| 32 |
+
("hi_p_tech_003", "रैखिक बीजगणित (लीनियर अलजेब्रा), सांख्यिकी (माध्य, मानक विचलन) और प्रायिकता (बायस थ्योरम) मशीन लर्निंग मॉडल और डेटा विश्लेषण के गणितीय आधार हैं।", 503, 1),
|
| 33 |
+
("hi_p_tech_004", "कलन (कैलकुलस) और ग्रेडिएंट डिसेंट मॉडल के नुकसान (लॉस) को कम करते हैं, जबकि सुपरवाइज्ड और अनसुपरवाइज्ड लर्निंग डेटा से पैटर्न सीखती हैं।", 504, 1),
|
| 34 |
+
("hi_p_tech_005", "लीनियर रिग्रेशन, डिसीजन ट्री, रैंडम फॉरेस्ट और XGBoost मुख्य एल्गोरिदम हैं, और PCA डेटा के आयाम (डायमेंशन) को कम करने के लिए उपयोग किया जाता है।", 505, 1),
|
| 35 |
+
("hi_p_tech_006", "क्रॉस-वैलिडेशन और हाइपरपैरामीटर ट्यूनिंग मॉडल को ओवरफिटिंग से बचाते हैं, जबकि प्रिसिजन, रिकॉल और F1-स्कोर से मॉडल के प्रदर्शन का मूल्यांकन किया जाता है।", 506, 1),
|
| 36 |
+
("hi_p_tech_007", "न्यूरल नेटवर्क बैकप्रोपैगेशन और एक्टिवेशन फंक्शन का उपयोग करते हैं, CNN इमेज प्रोसेसिंग के लिए, और ट्रांसफॉर्मर (Transformer) मॉडल प्राकृतिक भाषा (NLP) के लिए सर्वश्रेष्ठ हैं।", 507, 1),
|
| 37 |
+
("hi_p_tech_008", "लार्ज लैंग्वेज मॉडल (LLM) प्रॉम्प्ट इंजीनियरिंग, टोकनाइजेशन और LoRA फाइन-ट्यूनिंग से काम करते हैं, और RAG तकनीक वेक्टर डेटाबेस से प्रासंगिक जानकारी ढूंढती है।", 508, 1),
|
| 38 |
+
("hi_p_tech_009", "एआई एजेंट्स टूल कॉलिंग और LangChain के माध्यम से जटिल कार्य करते हैं, और मल्टीमॉडल एआई स्पीच-टू-टेक्स्ट (STT) और विजन को एक साथ जोड़ता है।", 509, 1),
|
| 39 |
+
("hi_p_tech_010", "कंप्यूटर विजन और OpenCV इमेज प्रोसेसिंग करते हैं, YOLO रियल-टाइम ऑब्जेक्ट डिटेक्शन करता है, और OCR छवियों से पाठ (टेक्स्ट) निकालता है।", 510, 1),
|
| 40 |
+
("hi_p_tech_011", "MLOps में FastAPI से REST API बनाई जाती है, Docker से मॉडल को कंटेनर में डाला जाता है, और क्वांटाइजेशन (Quantization) से मॉडल को हल्का और तेज़ बनाया जाता है।", 511, 1),
|
| 41 |
+
]
|
| 42 |
+
|
| 43 |
+
MR_TECH_PASSAGES = [
|
| 44 |
+
("mr_p_tech_001", "पायथन ही डेटा सायन्स आणि AI मधील मुख्य भाषा आहे. NumPy आणि Pandas च्या मदतीने डेटाचे विश्लेषण आणि प्रीप्रोसेसिंग केले जाते.", 601, 1),
|
| 45 |
+
("mr_p_tech_002", "SQL द्वारे डेटाबेस माहिती मिळवली जाते, Git आणि GitHub कोड व्हर्जन कंट्रोलसाठी वापरले जातात, आणि Jupyter मध्ये डेटा सायन्स प्रयोग केले जातात.", 602, 1),
|
| 46 |
+
("mr_p_tech_003", "लीनियर अलजेब्रा, सांख्यिकी (माध्य, प्रमाण विचलन) आणि कॅल्क्युलस ग्रेडिएंट्स मशीन लर्निंग मॉडेल्सचा पाया आहेत.", 603, 1),
|
| 47 |
+
("mr_p_tech_004", "सुपरवाइज्ड आणि अनसुपरवाइज्ड लर्निंग, लीनियर रिग्रेशन, डिसीजन ट्री, रँडम फॉरेस्ट आणि XGBoost हे मशीन लर्निंगचे मुख्य प्रकार आहेत.", 604, 1),
|
| 48 |
+
("mr_p_tech_005", "फीचर इंजिनिअरिंग आणि हायपरपॅरामीटर ट्यूनिंगमुळे मॉडेल ओव्हरफिटींगपासून वाचते आणि योग्य निकाल देते.", 605, 1),
|
| 49 |
+
("mr_p_tech_006", "न्यूरल नेटवर्क्स आणि बॅकप्रोपॅगेशन डीप लर्निंगचा आधार आहेत, तर ट्रान्सफॉर्मर्स आणि अटेंशन मेकॅनिझम भाषा प्रक्रिया (NLP) सुलभ करतात.", 606, 1),
|
| 50 |
+
("mr_p_tech_007", "लार्ज लँग्वेज मॉडेल्स (LLMs), प्रॉम्प्ट इंजिनिअरिंग, LoRA फाइन-ट्यूनिंग आणि RAG सिस्टीम वेक्टर डेटाबेसच्या मदतीने अचूक उत्तरे देतात.", 607, 1),
|
| 51 |
+
("mr_p_tech_008", "AI एजंट्स टूल कॉलिंग आणि LangChain द्वारे स्वयंचलित कामे करतात, तर मल्टीमॉडल AI टेक्स्ट, व्हॉईस आणि इमेज एकत्र हाताळते.", 608, 1),
|
| 52 |
+
("mr_p_tech_009", "संगणक व्हिजन (Computer Vision), OpenCV आणि YOLO ऑब्जेक्ट डिटेक्ट करतात आणि OCR चित्रातील मजकूर वाचते.", 609, 1),
|
| 53 |
+
("mr_p_tech_010", "MLOps मध्ये FastAPI आणि Docker द्वारे मॉडेल्स क्लाउडवर तैनात (Deploy) केले जातात, आणि क्वांटायझेशनने (Quantization) मॉडेलचा वेग वाढवला जातो.", 610, 1),
|
| 54 |
+
]
|
| 55 |
+
|
| 56 |
+
TECH_LONGDOCS = {
|
| 57 |
+
"en": [
|
| 58 |
+
{"doc_id": "en_tech_ld_01", "title": "Data Science & Python Ecosystem", "text": "Python forms the backbone of modern data science and AI development. With libraries like NumPy for array operations, Pandas for structured data manipulation, and Matplotlib for data visualization, developers preprocess raw data and compute statistical metrics such as mean, variance, and correlation. Version control using Git and GitHub ensures reproducible workflows, while SQL enables database querying.", "source_lang": "en"},
|
| 59 |
+
{"doc_id": "en_tech_ld_02", "title": "Machine Learning Algorithms & Pipeline", "text": "Machine learning comprises supervised, unsupervised, and reinforcement learning. Algorithms range from linear and logistic regression to decision trees, random forests, XGBoost, SVM, KNN, K-Means clustering, and PCA. The ML pipeline includes feature engineering, handling missing values and outliers, train-test splitting, cross-validation, hyperparameter tuning, and metric evaluation (precision, recall, F1-score) to prevent overfitting.", "source_lang": "en"},
|
| 60 |
+
{"doc_id": "en_tech_ld_03", "title": "Deep Learning & Transformer Models", "text": "Deep learning uses neural networks with multi-layer perceptrons, activation functions like ReLU, and backpropagation optimization. Convolutional Neural Networks (CNNs) handle spatial computer vision, while Recurrent Neural Networks (RNNs) and LSTMs process sequential data. Transformer architectures with self-attention mechanisms enable state-of-the-art Natural Language Processing (NLP) and dense vector embeddings.", "source_lang": "en"},
|
| 61 |
+
{"doc_id": "en_tech_ld_04", "title": "Generative AI, LLMs, RAG & Autonomous Agents", "text": "Generative AI focuses on Large Language Models (LLMs) trained on tokenized text. Technique like prompt engineering, fine-tuning, LoRA, and QLoRA adapt models to domain tasks. Retrieval-Augmented Generation (RAG) utilizes semantic chunking, vector databases, and reranking to eliminate hallucinations. Autonomous AI agents leverage tool calling, agentic workflows, LangChain, and LangGraph to perform complex multi-step reasoning.", "source_lang": "en"},
|
| 62 |
+
{"doc_id": "en_tech_ld_05", "title": "Computer Vision & MLOps Infrastructure", "text": "Computer Vision leverages OpenCV for image processing, YOLO for real-time object detection, segmentation, and OCR for text extraction. MLOps standardizes deployment using FastAPI REST APIs, Docker containers, cloud model serving, MLflow monitoring, and INT8 quantization for edge model optimization.", "source_lang": "en"},
|
| 63 |
+
],
|
| 64 |
+
"hi": [
|
| 65 |
+
{"doc_id": "hi_tech_ld_01", "title": "डेटा साइंस, मशीन लर्निंग और एआई परिचय", "text": "पायथन, NumPy और Pandas डेटा विश्लेषण और प���रीप्रोसेसिंग के आधार हैं। लीनियर रिग्रेशन, डिसीजन ट्री, रैंडम फॉरेस्ट और XGBoost मशीन लर्निंग के प्रमुख मॉडल हैं। न्यूरल नेटवर्क, बैकप्रोपैगेशन और ट्रांसफॉर्मर मॉडल डीप लर्निंग और भाषा प्रसंस्करण को गति देते हैं।", "source_lang": "hi"},
|
| 66 |
+
{"doc_id": "hi_tech_ld_02", "title": "जनरेटिव एआई, RAG और कंप्यूटर विजन", "text": "लार्ज लैंग्वेज मॉडल (LLM), LoRA फाइन-ट्यूनिंग और RAG तकनीकें वेक्टर डेटाबेस के साथ मिलकर काम करती हैं। एआई एजेंट्स स्वयंचलित कार्य करते हैं। कंप्यूटर विजन में OpenCV और YOLO ऑब्जेक्ट डिटेक्ट करते हैं, और MLOps में FastAPI और Docker से मॉडल तैनात (Deploy) होते हैं।", "source_lang": "hi"},
|
| 67 |
+
],
|
| 68 |
+
"mr": [
|
| 69 |
+
{"doc_id": "mr_tech_ld_01", "title": "डेटा सायन्स, मशीन लर्निंग आणि AI प्रणाली", "text": "पायथन, NumPy आणि Pandas च्या मदतीने डेटा प्रीप्रोसेसिंग केले जाते. मशीन लर्निंगमध्ये रिग्रेशन, डिसीजन ट्री, रँडम फॉरेस्ट आणि XGBoost वापरले जातात. न्यूरल नेटवर्क्स आणि ट्रान्सफॉर्मर्स डीप लर्निंगचा पाया आहेत.", "source_lang": "mr"},
|
| 70 |
+
{"doc_id": "mr_tech_ld_02", "title": "जनरेटिव्ह AI, RAG आणि MLOps तंत्रज्ञान", "text": "LLMs, प्रॉम्प्ट इंजिनिअरिंग, RAG आणि वेक्टर डेटाबेस माहिती शोधणे सुलभ करतात. AI एजंट्स टूल कॉलिंगद्वारे स्वयंचलित कामे करतात. OpenCV आणि YOLO कॉम्प्युटर व्हिजनसाठी, तर FastAPI आणि Docker MLOps मॉडेल डिप्लॉयमेंटसाठी वापरले जातात.", "source_lang": "mr"},
|
| 71 |
+
],
|
| 72 |
+
}
|
demo/cap.png
ADDED
|
Git LFS Details
|
demo/index.html
CHANGED
|
@@ -357,6 +357,8 @@
|
|
| 357 |
</style>
|
| 358 |
</head>
|
| 359 |
<body class="min-h-screen flex flex-col relative selection:bg-sunyellow selection:text-black">
|
|
|
|
|
|
|
| 360 |
|
| 361 |
<!-- TROPICAL EMERALD BEACH VECTOR ARTWORK BACKGROUND (MATCHES REFERENCE IMAGE) -->
|
| 362 |
<div class="fixed inset-0 pointer-events-none z-0 overflow-hidden flex items-center justify-center">
|
|
@@ -555,14 +557,14 @@
|
|
| 555 |
<!-- Terminal Container -->
|
| 556 |
<div class="comic-panel p-5 flex flex-col items-center justify-center gap-4">
|
| 557 |
|
| 558 |
-
<!--
|
| 559 |
-
<div class="relative w-
|
| 560 |
-
<!-- Animated
|
| 561 |
<canvas id="waveformCanvas" class="absolute inset-0 w-full h-full pointer-events-none"></canvas>
|
| 562 |
|
| 563 |
-
<!--
|
| 564 |
-
<button id="recordBtn" class="relative z-10
|
| 565 |
-
<span id="micIcon" class="material-symbols-outlined text-
|
| 566 |
</button>
|
| 567 |
</div>
|
| 568 |
|
|
@@ -998,8 +1000,8 @@
|
|
| 998 |
|
| 999 |
mediaRecorder.start();
|
| 1000 |
isRecording = true;
|
| 1001 |
-
|
| 1002 |
-
|
| 1003 |
if (sttStatusText) sttStatusText.textContent = "SARVAM STT LISTENING...";
|
| 1004 |
micIcon.textContent = "stop";
|
| 1005 |
} catch (err) {
|
|
@@ -1008,8 +1010,8 @@
|
|
| 1008 |
} else {
|
| 1009 |
mediaRecorder.stop();
|
| 1010 |
isRecording = false;
|
| 1011 |
-
|
| 1012 |
-
|
| 1013 |
if (sttStatusText) sttStatusText.textContent = "SARVAM STT TRANSCRIBING...";
|
| 1014 |
micIcon.textContent = "mic";
|
| 1015 |
}
|
|
@@ -1290,90 +1292,528 @@
|
|
| 1290 |
const cx = canvas.width / 2;
|
| 1291 |
const cy = canvas.height / 2;
|
| 1292 |
const maxR = Math.min(cx, cy) * 0.96;
|
| 1293 |
-
const numSpokes =
|
| 1294 |
const numRings = 5;
|
| 1295 |
|
| 1296 |
-
// Fill
|
| 1297 |
-
ctx.fillStyle = "#
|
| 1298 |
-
ctx.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1299 |
|
| 1300 |
-
//
|
|
|
|
|
|
|
| 1301 |
for (let i = 0; i < numSpokes; i++) {
|
| 1302 |
const angle = (i * Math.PI * 2) / numSpokes - Math.PI / 2;
|
| 1303 |
const x = cx + Math.cos(angle) * maxR;
|
| 1304 |
const y = cy + Math.sin(angle) * maxR;
|
| 1305 |
ctx.beginPath();
|
| 1306 |
-
ctx.moveTo(cx, cy);
|
| 1307 |
ctx.lineTo(x, y);
|
| 1308 |
-
ctx.strokeStyle = isRecording
|
| 1309 |
-
? "#ff007f"
|
| 1310 |
-
: (i % 2 === 0 ? "#00e5ff" : "#ff007f");
|
| 1311 |
-
ctx.lineWidth = 2.2;
|
| 1312 |
ctx.stroke();
|
| 1313 |
}
|
| 1314 |
|
| 1315 |
-
//
|
| 1316 |
for (let r = 1; r <= numRings; r++) {
|
| 1317 |
const ringFraction = r / numRings;
|
| 1318 |
-
const baseRadius = maxR * ringFraction;
|
| 1319 |
|
| 1320 |
-
ctx.
|
| 1321 |
-
|
| 1322 |
-
|
| 1323 |
-
|
| 1324 |
-
ctx.lineWidth = isRecording ? 2.5 : 2.0;
|
| 1325 |
|
| 1326 |
const ringPoints = [];
|
| 1327 |
for (let i = 0; i < numSpokes; i++) {
|
| 1328 |
const angle = (i * Math.PI * 2) / numSpokes - Math.PI / 2;
|
| 1329 |
-
|
| 1330 |
-
|
| 1331 |
-
if (analyser && dataArray && isRecording) {
|
| 1332 |
-
analyser.getByteFrequencyData(dataArray);
|
| 1333 |
-
const binIdx = Math.floor((i / numSpokes) * dataArray.length);
|
| 1334 |
-
amp += (dataArray[binIdx] / 255) * 22 * ringFraction;
|
| 1335 |
-
}
|
| 1336 |
-
|
| 1337 |
-
const currentR = baseRadius + amp;
|
| 1338 |
-
const px = cx + Math.cos(angle) * currentR;
|
| 1339 |
-
const py = cy + Math.sin(angle) * currentR;
|
| 1340 |
ringPoints.push({ x: px, y: py, angle: angle });
|
| 1341 |
}
|
| 1342 |
|
| 1343 |
-
// Draw
|
| 1344 |
for (let i = 0; i < numSpokes; i++) {
|
| 1345 |
const p1 = ringPoints[i];
|
| 1346 |
const p2 = ringPoints[(i + 1) % numSpokes];
|
| 1347 |
-
|
| 1348 |
const midAngle = (p1.angle + p2.angle) / 2 + (i === numSpokes - 1 ? Math.PI : 0);
|
| 1349 |
const dipRadius = baseRadius * 0.85;
|
| 1350 |
const midX = cx + Math.cos(midAngle) * dipRadius;
|
| 1351 |
-
const midY = cy + Math.sin(midAngle) * dipRadius;
|
| 1352 |
|
| 1353 |
ctx.beginPath();
|
| 1354 |
ctx.moveTo(p1.x, p1.y);
|
| 1355 |
ctx.quadraticCurveTo(midX, midY, p2.x, p2.y);
|
| 1356 |
ctx.stroke();
|
| 1357 |
}
|
|
|
|
| 1358 |
|
| 1359 |
-
|
| 1360 |
-
|
| 1361 |
-
|
| 1362 |
-
|
| 1363 |
-
|
| 1364 |
-
|
| 1365 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1366 |
|
| 1367 |
-
|
| 1368 |
-
|
| 1369 |
-
|
| 1370 |
-
|
| 1371 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1372 |
}
|
| 1373 |
|
|
|
|
|
|
|
|
|
|
| 1374 |
requestAnimationFrame(drawSpiderWeb);
|
| 1375 |
}
|
|
|
|
| 1376 |
drawSpiderWeb();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1377 |
</script>
|
| 1378 |
</body>
|
| 1379 |
</html>
|
|
|
|
| 357 |
</style>
|
| 358 |
</head>
|
| 359 |
<body class="min-h-screen flex flex-col relative selection:bg-sunyellow selection:text-black">
|
| 360 |
+
<!-- Full-Page Flying Iron Man Canvas Layer (Behind Frame Boxes) -->
|
| 361 |
+
<canvas id="ironmanMainCanvas" class="fixed inset-0 w-full h-full pointer-events-none z-1"></canvas>
|
| 362 |
|
| 363 |
<!-- TROPICAL EMERALD BEACH VECTOR ARTWORK BACKGROUND (MATCHES REFERENCE IMAGE) -->
|
| 364 |
<div class="fixed inset-0 pointer-events-none z-0 overflow-hidden flex items-center justify-center">
|
|
|
|
| 557 |
<!-- Terminal Container -->
|
| 558 |
<div class="comic-panel p-5 flex flex-col items-center justify-center gap-4">
|
| 559 |
|
| 560 |
+
<!-- Spider-Man Green Mask Canvas Container (#053b22 Forest Green Theme) -->
|
| 561 |
+
<div class="relative w-64 h-64 rounded-full bg-[#053b22] border-4 border-[#053b22] shadow-[0_0_25px_rgba(5,59,34,0.8)] flex items-center justify-center overflow-hidden my-2">
|
| 562 |
+
<!-- Animated Spider-Man Mask Waveform Canvas -->
|
| 563 |
<canvas id="waveformCanvas" class="absolute inset-0 w-full h-full pointer-events-none"></canvas>
|
| 564 |
|
| 565 |
+
<!-- Microphone Record Button (Only Mic Icon, Green Spider-Man Theme) -->
|
| 566 |
+
<button id="recordBtn" class="relative z-10 p-3 flex items-center justify-center cursor-pointer hover:scale-110 active:scale-95 transition-transform duration-200 focus:outline-none">
|
| 567 |
+
<span id="micIcon" class="material-symbols-outlined text-5xl font-black text-black hover:text-slate-800 drop-shadow-[0_2px_6px_rgba(255,255,255,0.4)] selection:bg-transparent transition-colors duration-200">mic</span>
|
| 568 |
</button>
|
| 569 |
</div>
|
| 570 |
|
|
|
|
| 1000 |
|
| 1001 |
mediaRecorder.start();
|
| 1002 |
isRecording = true;
|
| 1003 |
+
micIcon.classList.remove("text-black", "hover:text-slate-800");
|
| 1004 |
+
micIcon.classList.add("text-red-600", "animate-pulse");
|
| 1005 |
if (sttStatusText) sttStatusText.textContent = "SARVAM STT LISTENING...";
|
| 1006 |
micIcon.textContent = "stop";
|
| 1007 |
} catch (err) {
|
|
|
|
| 1010 |
} else {
|
| 1011 |
mediaRecorder.stop();
|
| 1012 |
isRecording = false;
|
| 1013 |
+
micIcon.classList.remove("text-red-600", "animate-pulse");
|
| 1014 |
+
micIcon.classList.add("text-black", "hover:text-slate-800");
|
| 1015 |
if (sttStatusText) sttStatusText.textContent = "SARVAM STT TRANSCRIBING...";
|
| 1016 |
micIcon.textContent = "mic";
|
| 1017 |
}
|
|
|
|
| 1292 |
const cx = canvas.width / 2;
|
| 1293 |
const cy = canvas.height / 2;
|
| 1294 |
const maxR = Math.min(cx, cy) * 0.96;
|
| 1295 |
+
const numSpokes = 12;
|
| 1296 |
const numRings = 5;
|
| 1297 |
|
| 1298 |
+
// 1. Fill Dark Forest Green (#053b22) Mask Background
|
| 1299 |
+
ctx.fillStyle = "#053b22";
|
| 1300 |
+
ctx.beginPath();
|
| 1301 |
+
ctx.arc(cx, cy, maxR, 0, Math.PI * 2);
|
| 1302 |
+
ctx.fill();
|
| 1303 |
+
|
| 1304 |
+
// Audio reactivity amplitude calculation
|
| 1305 |
+
let audioGain = 0;
|
| 1306 |
+
if (analyser && dataArray && isRecording) {
|
| 1307 |
+
analyser.getByteFrequencyData(dataArray);
|
| 1308 |
+
let sum = 0;
|
| 1309 |
+
for (let i = 0; i < dataArray.length; i++) sum += dataArray[i];
|
| 1310 |
+
audioGain = (sum / dataArray.length) / 255;
|
| 1311 |
+
}
|
| 1312 |
+
|
| 1313 |
+
const greenStroke = isRecording ? "#00ffaa" : "#00ff66";
|
| 1314 |
|
| 1315 |
+
// 2. Draw Spider Web Radial Spokes (Green lines originating from central nose bridge)
|
| 1316 |
+
ctx.strokeStyle = greenStroke;
|
| 1317 |
+
ctx.lineWidth = 2.2;
|
| 1318 |
for (let i = 0; i < numSpokes; i++) {
|
| 1319 |
const angle = (i * Math.PI * 2) / numSpokes - Math.PI / 2;
|
| 1320 |
const x = cx + Math.cos(angle) * maxR;
|
| 1321 |
const y = cy + Math.sin(angle) * maxR;
|
| 1322 |
ctx.beginPath();
|
| 1323 |
+
ctx.moveTo(cx, cy + 10);
|
| 1324 |
ctx.lineTo(x, y);
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1325 |
ctx.stroke();
|
| 1326 |
}
|
| 1327 |
|
| 1328 |
+
// 3. Draw Concentric Spider Web Arcs
|
| 1329 |
for (let r = 1; r <= numRings; r++) {
|
| 1330 |
const ringFraction = r / numRings;
|
| 1331 |
+
const baseRadius = maxR * ringFraction + (audioGain * 14 * Math.sin(wavePhase + r));
|
| 1332 |
|
| 1333 |
+
ctx.strokeStyle = isRecording
|
| 1334 |
+
? `rgba(0, 255, 170, ${0.7 + r * 0.05})`
|
| 1335 |
+
: `rgba(0, 255, 102, ${0.75 + r * 0.04})`;
|
| 1336 |
+
ctx.lineWidth = isRecording ? 2.6 : 2.0;
|
|
|
|
| 1337 |
|
| 1338 |
const ringPoints = [];
|
| 1339 |
for (let i = 0; i < numSpokes; i++) {
|
| 1340 |
const angle = (i * Math.PI * 2) / numSpokes - Math.PI / 2;
|
| 1341 |
+
const px = cx + Math.cos(angle) * baseRadius;
|
| 1342 |
+
const py = cy + 10 + Math.sin(angle) * baseRadius;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1343 |
ringPoints.push({ x: px, y: py, angle: angle });
|
| 1344 |
}
|
| 1345 |
|
| 1346 |
+
// Draw dipping spider web arcs
|
| 1347 |
for (let i = 0; i < numSpokes; i++) {
|
| 1348 |
const p1 = ringPoints[i];
|
| 1349 |
const p2 = ringPoints[(i + 1) % numSpokes];
|
|
|
|
| 1350 |
const midAngle = (p1.angle + p2.angle) / 2 + (i === numSpokes - 1 ? Math.PI : 0);
|
| 1351 |
const dipRadius = baseRadius * 0.85;
|
| 1352 |
const midX = cx + Math.cos(midAngle) * dipRadius;
|
| 1353 |
+
const midY = cy + 10 + Math.sin(midAngle) * dipRadius;
|
| 1354 |
|
| 1355 |
ctx.beginPath();
|
| 1356 |
ctx.moveTo(p1.x, p1.y);
|
| 1357 |
ctx.quadraticCurveTo(midX, midY, p2.x, p2.y);
|
| 1358 |
ctx.stroke();
|
| 1359 |
}
|
| 1360 |
+
}
|
| 1361 |
|
| 1362 |
+
// 4. Draw Thick Outer Green Spider-Man Circle Border
|
| 1363 |
+
ctx.strokeStyle = greenStroke;
|
| 1364 |
+
ctx.lineWidth = 6.5;
|
| 1365 |
+
ctx.beginPath();
|
| 1366 |
+
ctx.arc(cx, cy, maxR, 0, Math.PI * 2);
|
| 1367 |
+
ctx.stroke();
|
| 1368 |
+
|
| 1369 |
+
// 5. Draw Iconic Spider-Man Angled Eyes (Symmetrical Left & Right with Thick Green Borders)
|
| 1370 |
+
function drawSpiderEye(isLeft) {
|
| 1371 |
+
const s = isLeft ? -1 : 1;
|
| 1372 |
+
ctx.save();
|
| 1373 |
+
ctx.beginPath();
|
| 1374 |
|
| 1375 |
+
// Eye anchor coordinates matching iconic Spider-Man mask geometry
|
| 1376 |
+
const topInnerX = cx + s * (maxR * 0.08);
|
| 1377 |
+
const topInnerY = cy - (maxR * 0.04);
|
| 1378 |
+
const outerPointX = cx + s * (maxR * 0.72);
|
| 1379 |
+
const outerPointY = cy - (maxR * 0.28);
|
| 1380 |
+
const outerBottomX = cx + s * (maxR * 0.52);
|
| 1381 |
+
const outerBottomY = cy + (maxR * 0.42);
|
| 1382 |
+
|
| 1383 |
+
ctx.moveTo(topInnerX, topInnerY);
|
| 1384 |
+
// Slanted top edge outwards to outer sharp corner
|
| 1385 |
+
ctx.quadraticCurveTo(cx + s * (maxR * 0.38), cy - (maxR * 0.34), outerPointX, outerPointY);
|
| 1386 |
+
// Outer curve going down to bottom corner
|
| 1387 |
+
ctx.quadraticCurveTo(cx + s * (maxR * 0.78), cy + (maxR * 0.08), outerBottomX, outerBottomY);
|
| 1388 |
+
// Smooth bottom curve returning up to inner point
|
| 1389 |
+
ctx.quadraticCurveTo(cx + s * (maxR * 0.22), cy + (maxR * 0.44), topInnerX, topInnerY);
|
| 1390 |
+
ctx.closePath();
|
| 1391 |
+
|
| 1392 |
+
// Fill Eye with Solid Bright White
|
| 1393 |
+
ctx.fillStyle = "#ffffff";
|
| 1394 |
+
ctx.fill();
|
| 1395 |
+
|
| 1396 |
+
// Thick Bold Black Eye Frame Stroke Outline
|
| 1397 |
+
ctx.strokeStyle = "#000000";
|
| 1398 |
+
ctx.lineWidth = 7.5;
|
| 1399 |
+
ctx.stroke();
|
| 1400 |
+
|
| 1401 |
+
ctx.restore();
|
| 1402 |
}
|
| 1403 |
|
| 1404 |
+
drawSpiderEye(true); // Left Spider Eye
|
| 1405 |
+
drawSpiderEye(false); // Right Spider Eye
|
| 1406 |
+
|
| 1407 |
requestAnimationFrame(drawSpiderWeb);
|
| 1408 |
}
|
| 1409 |
+
|
| 1410 |
drawSpiderWeb();
|
| 1411 |
+
|
| 1412 |
+
// ==========================================
|
| 1413 |
+
// MAIN PAGE FULL-SCREEN IRON MAN FLIGHT ENGINE
|
| 1414 |
+
// ==========================================
|
| 1415 |
+
const mainCanvas = document.getElementById("ironmanMainCanvas");
|
| 1416 |
+
const mainCtx = mainCanvas ? mainCanvas.getContext("2d") : null;
|
| 1417 |
+
|
| 1418 |
+
function resizeMainCanvas() {
|
| 1419 |
+
if (mainCanvas) {
|
| 1420 |
+
mainCanvas.width = window.innerWidth;
|
| 1421 |
+
mainCanvas.height = window.innerHeight;
|
| 1422 |
+
}
|
| 1423 |
+
}
|
| 1424 |
+
window.addEventListener("resize", resizeMainCanvas);
|
| 1425 |
+
resizeMainCanvas();
|
| 1426 |
+
|
| 1427 |
+
const mainIronmanImg = new Image();
|
| 1428 |
+
mainIronmanImg.src = "/ironman.png";
|
| 1429 |
+
let mainIronmanLoaded = false;
|
| 1430 |
+
mainIronmanImg.onload = () => { mainIronmanLoaded = true; };
|
| 1431 |
+
|
| 1432 |
+
let mainImX = -220;
|
| 1433 |
+
const mainThrusterParticles = [];
|
| 1434 |
+
|
| 1435 |
+
function drawMainPageIronMan() {
|
| 1436 |
+
if (!mainCanvas || !mainCtx) return;
|
| 1437 |
+
|
| 1438 |
+
const w = mainCanvas.width;
|
| 1439 |
+
const h = mainCanvas.height;
|
| 1440 |
+
mainCtx.clearRect(0, 0, w, h);
|
| 1441 |
+
|
| 1442 |
+
// High-Speed Avengers Triangle / V-Formation Motion Engine (Speed = 5.6px/frame)
|
| 1443 |
+
const flightSpeed = 5.6;
|
| 1444 |
+
mainImX += flightSpeed;
|
| 1445 |
+
if (mainImX > w + 450) mainImX = -450;
|
| 1446 |
+
|
| 1447 |
+
// Base Straight Diagonal Trajectory for Formation Leader (Iron Man at point of Triangle)
|
| 1448 |
+
const progress = (mainImX + 450) / (w + 900);
|
| 1449 |
+
const baseLeaderY = (h * 0.82) - progress * (h * 0.68);
|
| 1450 |
+
const mainImY = baseLeaderY;
|
| 1451 |
+
|
| 1452 |
+
const imW = 165;
|
| 1453 |
+
const imH = 245;
|
| 1454 |
+
|
| 1455 |
+
const bootX = mainImX + imW * 0.16;
|
| 1456 |
+
const bootY = mainImY + imH * 0.86;
|
| 1457 |
+
const handX = mainImX + imW * 0.30;
|
| 1458 |
+
const handY = mainImY + imH * 0.48;
|
| 1459 |
+
|
| 1460 |
+
let boostPulse = Math.sin(wavePhase * 8) * 6;
|
| 1461 |
+
if (analyser && dataArray && isRecording) {
|
| 1462 |
+
analyser.getByteFrequencyData(dataArray);
|
| 1463 |
+
let sum = 0;
|
| 1464 |
+
for (let i = 0; i < 8; i++) sum += dataArray[i];
|
| 1465 |
+
boostPulse += (sum / 8) * 0.25;
|
| 1466 |
+
}
|
| 1467 |
+
|
| 1468 |
+
// Helper for MCU booster flame on main page
|
| 1469 |
+
function drawMainBoosterFlame(x, y, angle, length, width) {
|
| 1470 |
+
mainCtx.save();
|
| 1471 |
+
mainCtx.translate(x, y);
|
| 1472 |
+
mainCtx.rotate(angle);
|
| 1473 |
+
|
| 1474 |
+
// Outer Sky Blue Plasma Booster Flame
|
| 1475 |
+
const flameGrad = mainCtx.createLinearGradient(0, 0, length, 0);
|
| 1476 |
+
flameGrad.addColorStop(0, "rgba(255, 255, 255, 0.98)");
|
| 1477 |
+
flameGrad.addColorStop(0.2, "rgba(135, 206, 250, 0.95)");
|
| 1478 |
+
flameGrad.addColorStop(0.5, "rgba(0, 191, 255, 0.9)");
|
| 1479 |
+
flameGrad.addColorStop(0.8, "rgba(0, 119, 255, 0.65)");
|
| 1480 |
+
flameGrad.addColorStop(1, "rgba(0, 80, 255, 0)");
|
| 1481 |
+
|
| 1482 |
+
mainCtx.beginPath();
|
| 1483 |
+
mainCtx.moveTo(0, -width / 2);
|
| 1484 |
+
mainCtx.lineTo(length + boostPulse, 0);
|
| 1485 |
+
mainCtx.lineTo(0, width / 2);
|
| 1486 |
+
mainCtx.closePath();
|
| 1487 |
+
mainCtx.fillStyle = flameGrad;
|
| 1488 |
+
mainCtx.fill();
|
| 1489 |
+
|
| 1490 |
+
// Inner Pure White & Ice Blue Core Jet
|
| 1491 |
+
const coreGrad = mainCtx.createLinearGradient(0, 0, length * 0.65, 0);
|
| 1492 |
+
coreGrad.addColorStop(0, "#ffffff");
|
| 1493 |
+
coreGrad.addColorStop(0.5, "#e0f7ff");
|
| 1494 |
+
coreGrad.addColorStop(0.85, "#00bfff");
|
| 1495 |
+
coreGrad.addColorStop(1, "rgba(0, 191, 255, 0)");
|
| 1496 |
+
|
| 1497 |
+
mainCtx.beginPath();
|
| 1498 |
+
mainCtx.moveTo(0, -width * 0.25);
|
| 1499 |
+
mainCtx.lineTo(length * 0.6 + boostPulse * 0.5, 0);
|
| 1500 |
+
mainCtx.lineTo(0, width * 0.25);
|
| 1501 |
+
mainCtx.closePath();
|
| 1502 |
+
mainCtx.fillStyle = coreGrad;
|
| 1503 |
+
mainCtx.fill();
|
| 1504 |
+
|
| 1505 |
+
mainCtx.restore();
|
| 1506 |
+
}
|
| 1507 |
+
|
| 1508 |
+
// Draw main booster flames under boots & hands
|
| 1509 |
+
drawMainBoosterFlame(bootX, bootY, Math.PI * 0.82, 65 + boostPulse, 22);
|
| 1510 |
+
drawMainBoosterFlame(handX, handY, Math.PI * 0.84, 45 + boostPulse, 16);
|
| 1511 |
+
|
| 1512 |
+
// Spawn Sky Blue thruster spark particles on main page
|
| 1513 |
+
for (let p = 0; p < 5; p++) {
|
| 1514 |
+
const origin = Math.random() > 0.5 ? { x: bootX, y: bootY } : { x: handX, y: handY };
|
| 1515 |
+
mainThrusterParticles.push({
|
| 1516 |
+
x: origin.x,
|
| 1517 |
+
y: origin.y,
|
| 1518 |
+
vx: -(2.5 + Math.random() * 4.5),
|
| 1519 |
+
vy: 1.2 + (Math.random() - 0.5) * 3,
|
| 1520 |
+
radius: 2.0 + Math.random() * 3.5,
|
| 1521 |
+
color: Math.random() > 0.4 ? "#00bfff" : (Math.random() > 0.5 ? "#87cefa" : "#ffffff"),
|
| 1522 |
+
life: 1.0,
|
| 1523 |
+
decay: 0.02 + Math.random() * 0.03
|
| 1524 |
+
});
|
| 1525 |
+
}
|
| 1526 |
+
|
| 1527 |
+
// Update & render main thruster particles
|
| 1528 |
+
for (let i = mainThrusterParticles.length - 1; i >= 0; i--) {
|
| 1529 |
+
const pt = mainThrusterParticles[i];
|
| 1530 |
+
pt.x += pt.vx;
|
| 1531 |
+
pt.y += pt.vy;
|
| 1532 |
+
pt.life -= pt.decay;
|
| 1533 |
+
|
| 1534 |
+
if (pt.life <= 0) {
|
| 1535 |
+
mainThrusterParticles.splice(i, 1);
|
| 1536 |
+
continue;
|
| 1537 |
+
}
|
| 1538 |
+
|
| 1539 |
+
mainCtx.save();
|
| 1540 |
+
mainCtx.globalAlpha = pt.life;
|
| 1541 |
+
mainCtx.fillStyle = pt.color;
|
| 1542 |
+
mainCtx.shadowColor = pt.color;
|
| 1543 |
+
mainCtx.shadowBlur = 10;
|
| 1544 |
+
mainCtx.beginPath();
|
| 1545 |
+
mainCtx.arc(pt.x, pt.y, pt.radius * pt.life, 0, Math.PI * 2);
|
| 1546 |
+
mainCtx.fill();
|
| 1547 |
+
mainCtx.restore();
|
| 1548 |
+
}
|
| 1549 |
+
|
| 1550 |
+
// Draw Bright Glowing Iron Man sprite on main page
|
| 1551 |
+
if (mainIronmanLoaded) {
|
| 1552 |
+
mainCtx.save();
|
| 1553 |
+
mainCtx.filter = "brightness(1.45) contrast(1.3) saturate(1.35) drop-shadow(0 0 22px rgba(0, 220, 255, 0.95))";
|
| 1554 |
+
mainCtx.drawImage(mainIronmanImg, mainImX, mainImY, imW, imH);
|
| 1555 |
+
mainCtx.restore();
|
| 1556 |
+
|
| 1557 |
+
// Chest Arc Reactor Energy Glow Lens Flare
|
| 1558 |
+
const chestX = mainImX + imW * 0.84;
|
| 1559 |
+
const chestY = mainImY + imH * 0.35;
|
| 1560 |
+
mainCtx.save();
|
| 1561 |
+
const arcGrad = mainCtx.createRadialGradient(chestX, chestY, 0, chestX, chestY, 16);
|
| 1562 |
+
arcGrad.addColorStop(0, "rgba(255, 255, 255, 1)");
|
| 1563 |
+
arcGrad.addColorStop(0.4, "rgba(0, 240, 255, 0.9)");
|
| 1564 |
+
arcGrad.addColorStop(1, "rgba(0, 240, 255, 0)");
|
| 1565 |
+
mainCtx.fillStyle = arcGrad;
|
| 1566 |
+
mainCtx.beginPath();
|
| 1567 |
+
mainCtx.arc(chestX, chestY, 16, 0, Math.PI * 2);
|
| 1568 |
+
mainCtx.fill();
|
| 1569 |
+
mainCtx.restore();
|
| 1570 |
+
}
|
| 1571 |
+
|
| 1572 |
+
// ==========================================
|
| 1573 |
+
// DRAW THOR FLYING UPWARD (Top Wing of Triangle Formation)
|
| 1574 |
+
// ==========================================
|
| 1575 |
+
const thorX = mainImX - 220;
|
| 1576 |
+
const thorY = baseLeaderY - 95;
|
| 1577 |
+
|
| 1578 |
+
const thorW = 180;
|
| 1579 |
+
const thorH = 240;
|
| 1580 |
+
|
| 1581 |
+
// Stormbreaker Axe & Body Anchor Points
|
| 1582 |
+
const axeX = thorX + thorW * 0.42;
|
| 1583 |
+
const axeY = thorY + thorH * 0.22;
|
| 1584 |
+
const headX = thorX + thorW * 0.65;
|
| 1585 |
+
const headY = thorY + thorH * 0.38;
|
| 1586 |
+
const footX = thorX + thorW * 0.45;
|
| 1587 |
+
const footY = thorY + thorH * 0.88;
|
| 1588 |
+
|
| 1589 |
+
// 1. Draw Crackling Lightning Bolts from Stormbreaker
|
| 1590 |
+
const numBolts = (analyser && dataArray && isRecording) ? 8 : 5;
|
| 1591 |
+
for (let b = 0; b < numBolts; b++) {
|
| 1592 |
+
const targetAngle = Math.random() * Math.PI * 2;
|
| 1593 |
+
const boltLength = 30 + Math.random() * 60;
|
| 1594 |
+
const endX = axeX + Math.cos(targetAngle) * boltLength;
|
| 1595 |
+
const endY = axeY + Math.sin(targetAngle) * boltLength;
|
| 1596 |
+
drawLightningArc(mainCtx, axeX, axeY, endX, endY, 12);
|
| 1597 |
+
}
|
| 1598 |
+
|
| 1599 |
+
// Lightning arcs crackling across armor & cape
|
| 1600 |
+
drawLightningArc(mainCtx, axeX, axeY, headX, headY, 10);
|
| 1601 |
+
drawLightningArc(mainCtx, axeX, axeY, footX, footY, 14);
|
| 1602 |
+
|
| 1603 |
+
// 2. Spawn Electric Thunder Spark Particles
|
| 1604 |
+
for (let s = 0; s < 4; s++) {
|
| 1605 |
+
thorSparks.push({
|
| 1606 |
+
x: axeX + (Math.random() - 0.5) * 30,
|
| 1607 |
+
y: axeY + (Math.random() - 0.5) * 30,
|
| 1608 |
+
vx: -(2.0 + Math.random() * 4.0),
|
| 1609 |
+
vy: (Math.random() - 0.5) * 3.5,
|
| 1610 |
+
radius: 1.5 + Math.random() * 3.0,
|
| 1611 |
+
color: Math.random() > 0.4 ? "#00e5ff" : "#ffffff",
|
| 1612 |
+
life: 1.0,
|
| 1613 |
+
decay: 0.03 + Math.random() * 0.04
|
| 1614 |
+
});
|
| 1615 |
+
}
|
| 1616 |
+
|
| 1617 |
+
// Update & render Thor electric sparks
|
| 1618 |
+
for (let i = thorSparks.length - 1; i >= 0; i--) {
|
| 1619 |
+
const sp = thorSparks[i];
|
| 1620 |
+
sp.x += sp.vx;
|
| 1621 |
+
sp.y += sp.vy;
|
| 1622 |
+
sp.life -= sp.decay;
|
| 1623 |
+
if (sp.life <= 0) {
|
| 1624 |
+
thorSparks.splice(i, 1);
|
| 1625 |
+
continue;
|
| 1626 |
+
}
|
| 1627 |
+
|
| 1628 |
+
mainCtx.save();
|
| 1629 |
+
mainCtx.globalAlpha = sp.life;
|
| 1630 |
+
mainCtx.fillStyle = sp.color;
|
| 1631 |
+
mainCtx.shadowColor = "#00e5ff";
|
| 1632 |
+
mainCtx.shadowBlur = 10;
|
| 1633 |
+
mainCtx.beginPath();
|
| 1634 |
+
mainCtx.arc(sp.x, sp.y, sp.radius * sp.life, 0, Math.PI * 2);
|
| 1635 |
+
mainCtx.fill();
|
| 1636 |
+
mainCtx.restore();
|
| 1637 |
+
}
|
| 1638 |
+
|
| 1639 |
+
// 3. Draw Bright Luminous Thor Sprite with Electric Aura
|
| 1640 |
+
if (thorLoaded) {
|
| 1641 |
+
mainCtx.save();
|
| 1642 |
+
mainCtx.filter = "brightness(1.4) contrast(1.28) saturate(1.3) drop-shadow(0 0 24px rgba(0, 229, 255, 0.95))";
|
| 1643 |
+
mainCtx.drawImage(thorImg, thorX, thorY, thorW, thorH);
|
| 1644 |
+
mainCtx.restore();
|
| 1645 |
+
|
| 1646 |
+
// Stormbreaker Radial Thunder Glow Flare
|
| 1647 |
+
mainCtx.save();
|
| 1648 |
+
const stormGrad = mainCtx.createRadialGradient(axeX, axeY, 0, axeX, axeY, 28);
|
| 1649 |
+
stormGrad.addColorStop(0, "rgba(255, 255, 255, 1)");
|
| 1650 |
+
stormGrad.addColorStop(0.35, "rgba(0, 229, 255, 0.9)");
|
| 1651 |
+
stormGrad.addColorStop(1, "rgba(0, 229, 255, 0)");
|
| 1652 |
+
mainCtx.fillStyle = stormGrad;
|
| 1653 |
+
mainCtx.beginPath();
|
| 1654 |
+
mainCtx.arc(axeX, axeY, 28, 0, Math.PI * 2);
|
| 1655 |
+
mainCtx.fill();
|
| 1656 |
+
mainCtx.restore();
|
| 1657 |
+
}
|
| 1658 |
+
|
| 1659 |
+
// ==========================================
|
| 1660 |
+
// DRAW CAPTAIN AMERICA FLYING UPWARD (Bottom Wing of Triangle Formation)
|
| 1661 |
+
// ==========================================
|
| 1662 |
+
const capX = mainImX - 220;
|
| 1663 |
+
const capY = baseLeaderY + 95;
|
| 1664 |
+
|
| 1665 |
+
const capW = 165;
|
| 1666 |
+
const capH = 240;
|
| 1667 |
+
|
| 1668 |
+
// Mjolnir Hammer (Right Hand), Shield (Left Hand), Chest & Feet Anchors
|
| 1669 |
+
const mjolnirX = capX + capW * 0.12;
|
| 1670 |
+
const mjolnirY = capY + capH * 0.44;
|
| 1671 |
+
const shieldX = capX + capW * 0.85;
|
| 1672 |
+
const shieldY = capY + capH * 0.18;
|
| 1673 |
+
const capChestX = capX + capW * 0.46;
|
| 1674 |
+
const capChestY = capY + capH * 0.36;
|
| 1675 |
+
|
| 1676 |
+
// 1. Draw Crackling Lightning Bolts from Mjolnir Hammer in Cap's Hand
|
| 1677 |
+
const capBolts = (analyser && dataArray && isRecording) ? 7 : 4;
|
| 1678 |
+
for (let b = 0; b < capBolts; b++) {
|
| 1679 |
+
const targetAngle = Math.random() * Math.PI * 2;
|
| 1680 |
+
const boltLength = 25 + Math.random() * 55;
|
| 1681 |
+
const endX = mjolnirX + Math.cos(targetAngle) * boltLength;
|
| 1682 |
+
const endY = mjolnirY + Math.sin(targetAngle) * boltLength;
|
| 1683 |
+
drawLightningArc(mainCtx, mjolnirX, mjolnirY, endX, endY, 11);
|
| 1684 |
+
}
|
| 1685 |
+
|
| 1686 |
+
// Crackle from Mjolnir across right arm to Chest Star and up to Shield
|
| 1687 |
+
drawLightningArc(mainCtx, mjolnirX, mjolnirY, capChestX, capChestY, 10);
|
| 1688 |
+
drawLightningArc(mainCtx, mjolnirX, mjolnirY, shieldX, shieldY, 13);
|
| 1689 |
+
|
| 1690 |
+
// 2. Spawn Electric Thunder Spark Particles from Mjolnir Hand
|
| 1691 |
+
for (let s = 0; s < 4; s++) {
|
| 1692 |
+
capSparks.push({
|
| 1693 |
+
x: mjolnirX + (Math.random() - 0.5) * 24,
|
| 1694 |
+
y: mjolnirY + (Math.random() - 0.5) * 24,
|
| 1695 |
+
vx: -(2.0 + Math.random() * 3.8),
|
| 1696 |
+
vy: (Math.random() - 0.5) * 3.2,
|
| 1697 |
+
radius: 1.4 + Math.random() * 2.8,
|
| 1698 |
+
color: Math.random() > 0.4 ? "#00e5ff" : "#ffffff",
|
| 1699 |
+
life: 1.0,
|
| 1700 |
+
decay: 0.03 + Math.random() * 0.04
|
| 1701 |
+
});
|
| 1702 |
+
}
|
| 1703 |
+
|
| 1704 |
+
// Render Cap's hand electric sparks
|
| 1705 |
+
for (let i = capSparks.length - 1; i >= 0; i--) {
|
| 1706 |
+
const sp = capSparks[i];
|
| 1707 |
+
sp.x += sp.vx;
|
| 1708 |
+
sp.y += sp.vy;
|
| 1709 |
+
sp.life -= sp.decay;
|
| 1710 |
+
if (sp.life <= 0) {
|
| 1711 |
+
capSparks.splice(i, 1);
|
| 1712 |
+
continue;
|
| 1713 |
+
}
|
| 1714 |
+
|
| 1715 |
+
mainCtx.save();
|
| 1716 |
+
mainCtx.globalAlpha = sp.life;
|
| 1717 |
+
mainCtx.fillStyle = sp.color;
|
| 1718 |
+
mainCtx.shadowColor = "#00e5ff";
|
| 1719 |
+
mainCtx.shadowBlur = 10;
|
| 1720 |
+
mainCtx.beginPath();
|
| 1721 |
+
mainCtx.arc(sp.x, sp.y, sp.radius * sp.life, 0, Math.PI * 2);
|
| 1722 |
+
mainCtx.fill();
|
| 1723 |
+
mainCtx.restore();
|
| 1724 |
+
}
|
| 1725 |
+
|
| 1726 |
+
// 3. Draw Luminous Captain America Sprite with Electric Aura & Mjolnir Flare
|
| 1727 |
+
if (capLoaded) {
|
| 1728 |
+
mainCtx.save();
|
| 1729 |
+
mainCtx.filter = "brightness(1.42) contrast(1.3) saturate(1.35) drop-shadow(0 0 22px rgba(0, 229, 255, 0.95))";
|
| 1730 |
+
mainCtx.drawImage(capImg, capX, capY, capW, capH);
|
| 1731 |
+
mainCtx.restore();
|
| 1732 |
+
|
| 1733 |
+
// Mjolnir Hand Thunder Glow Lens Flare
|
| 1734 |
+
mainCtx.save();
|
| 1735 |
+
const mjolnirGrad = mainCtx.createRadialGradient(mjolnirX, mjolnirY, 0, mjolnirX, mjolnirY, 26);
|
| 1736 |
+
mjolnirGrad.addColorStop(0, "rgba(255, 255, 255, 1)");
|
| 1737 |
+
mjolnirGrad.addColorStop(0.35, "rgba(0, 229, 255, 0.9)");
|
| 1738 |
+
mjolnirGrad.addColorStop(1, "rgba(0, 229, 255, 0)");
|
| 1739 |
+
mainCtx.fillStyle = mjolnirGrad;
|
| 1740 |
+
mainCtx.beginPath();
|
| 1741 |
+
mainCtx.arc(mjolnirX, mjolnirY, 26, 0, Math.PI * 2);
|
| 1742 |
+
mainCtx.fill();
|
| 1743 |
+
mainCtx.restore();
|
| 1744 |
+
|
| 1745 |
+
// Shield Reflection Electric Sparkle
|
| 1746 |
+
mainCtx.save();
|
| 1747 |
+
const shieldGrad = mainCtx.createRadialGradient(shieldX, shieldY, 0, shieldX, shieldY, 20);
|
| 1748 |
+
shieldGrad.addColorStop(0, "rgba(255, 255, 255, 0.9)");
|
| 1749 |
+
shieldGrad.addColorStop(0.4, "rgba(0, 229, 255, 0.6)");
|
| 1750 |
+
shieldGrad.addColorStop(1, "rgba(0, 229, 255, 0)");
|
| 1751 |
+
mainCtx.fillStyle = shieldGrad;
|
| 1752 |
+
mainCtx.beginPath();
|
| 1753 |
+
mainCtx.arc(shieldX, shieldY, 20, 0, Math.PI * 2);
|
| 1754 |
+
mainCtx.fill();
|
| 1755 |
+
mainCtx.restore();
|
| 1756 |
+
}
|
| 1757 |
+
|
| 1758 |
+
requestAnimationFrame(drawMainPageIronMan);
|
| 1759 |
+
}
|
| 1760 |
+
|
| 1761 |
+
// Captain America Sprite Loader
|
| 1762 |
+
const capImg = new Image();
|
| 1763 |
+
capImg.src = "/cap.png";
|
| 1764 |
+
let capLoaded = false;
|
| 1765 |
+
capImg.onload = () => { capLoaded = true; };
|
| 1766 |
+
|
| 1767 |
+
let capX = -650;
|
| 1768 |
+
const capSparks = [];
|
| 1769 |
+
|
| 1770 |
+
// Thor Sprite & Lightning Helper
|
| 1771 |
+
const thorImg = new Image();
|
| 1772 |
+
thorImg.src = "/thor.png";
|
| 1773 |
+
let thorLoaded = false;
|
| 1774 |
+
thorImg.onload = () => { thorLoaded = true; };
|
| 1775 |
+
|
| 1776 |
+
let thorX = -450;
|
| 1777 |
+
const thorSparks = [];
|
| 1778 |
+
|
| 1779 |
+
function drawLightningArc(c, x1, y1, x2, y2, roughness = 14) {
|
| 1780 |
+
const dx = x2 - x1;
|
| 1781 |
+
const dy = y2 - y1;
|
| 1782 |
+
const dist = Math.hypot(dx, dy);
|
| 1783 |
+
const steps = Math.max(4, Math.floor(dist / 14));
|
| 1784 |
+
|
| 1785 |
+
c.beginPath();
|
| 1786 |
+
c.moveTo(x1, y1);
|
| 1787 |
+
let curX = x1;
|
| 1788 |
+
let curY = y1;
|
| 1789 |
+
|
| 1790 |
+
for (let i = 1; i < steps; i++) {
|
| 1791 |
+
const t = i / steps;
|
| 1792 |
+
const targetX = x1 + dx * t;
|
| 1793 |
+
const targetY = y1 + dy * t;
|
| 1794 |
+
const offset = (Math.random() - 0.5) * roughness;
|
| 1795 |
+
const nx = -dy / (dist || 1);
|
| 1796 |
+
const ny = dx / (dist || 1);
|
| 1797 |
+
curX = targetX + nx * offset;
|
| 1798 |
+
curY = targetY + ny * offset;
|
| 1799 |
+
c.lineTo(curX, curY);
|
| 1800 |
+
}
|
| 1801 |
+
c.lineTo(x2, y2);
|
| 1802 |
+
|
| 1803 |
+
c.save();
|
| 1804 |
+
c.strokeStyle = "rgba(0, 229, 255, 0.95)";
|
| 1805 |
+
c.lineWidth = 3.5;
|
| 1806 |
+
c.shadowColor = "#00e5ff";
|
| 1807 |
+
c.shadowBlur = 16;
|
| 1808 |
+
c.stroke();
|
| 1809 |
+
|
| 1810 |
+
c.strokeStyle = "#ffffff";
|
| 1811 |
+
c.lineWidth = 1.6;
|
| 1812 |
+
c.stroke();
|
| 1813 |
+
c.restore();
|
| 1814 |
+
}
|
| 1815 |
+
|
| 1816 |
+
drawMainPageIronMan();
|
| 1817 |
</script>
|
| 1818 |
</body>
|
| 1819 |
</html>
|
demo/ironman.png
ADDED
|
Git LFS Details
|
demo/thor.png
ADDED
|
Git LFS Details
|