Spaces:
Sleeping
Sleeping
Indrajit Ari commited on
Commit ·
1457065
1
Parent(s): 34c09b7
Rebrand to SegVision Engine, remove AI terminology, and fix video download extension headers
Browse files- backend/inference.py +8 -5
- backend/main.py +2 -1
- frontend/src/app/layout.tsx +3 -3
- frontend/src/app/page.tsx +6 -6
- frontend/src/app/result/page.tsx +5 -4
backend/inference.py
CHANGED
|
@@ -161,13 +161,16 @@ def _reencode_h264(raw_path: str, final_path: str, fps: float):
|
|
| 161 |
ffmpeg = get_ffmpeg()
|
| 162 |
cmd = [
|
| 163 |
ffmpeg, "-y",
|
|
|
|
| 164 |
"-i", raw_path,
|
| 165 |
"-vcodec", "libx264",
|
| 166 |
-
"-
|
| 167 |
-
"-
|
| 168 |
-
"-
|
| 169 |
-
"-
|
| 170 |
-
"-
|
|
|
|
|
|
|
| 171 |
final_path,
|
| 172 |
]
|
| 173 |
logger.info(f"Re-encoding to H.264: {' '.join(cmd)}")
|
|
|
|
| 161 |
ffmpeg = get_ffmpeg()
|
| 162 |
cmd = [
|
| 163 |
ffmpeg, "-y",
|
| 164 |
+
"-r", str(fps), # Set input frame rate
|
| 165 |
"-i", raw_path,
|
| 166 |
"-vcodec", "libx264",
|
| 167 |
+
"-pix_fmt", "yuv420p", # required for QuickTime / Safari
|
| 168 |
+
"-preset", "medium",
|
| 169 |
+
"-crf", "23", # quality
|
| 170 |
+
"-profile:v", "high", # high compatibility profile
|
| 171 |
+
"-level", "4.0",
|
| 172 |
+
"-movflags", "+faststart",
|
| 173 |
+
"-an", # no audio
|
| 174 |
final_path,
|
| 175 |
]
|
| 176 |
logger.info(f"Re-encoding to H.264: {' '.join(cmd)}")
|
backend/main.py
CHANGED
|
@@ -195,10 +195,11 @@ async def get_video(job_id: str):
|
|
| 195 |
output_path = OUTPUT_DIR / f"{job_id}_output.mp4"
|
| 196 |
if not output_path.exists():
|
| 197 |
raise HTTPException(status_code=404, detail="Result not ready yet")
|
|
|
|
| 198 |
return FileResponse(
|
| 199 |
str(output_path),
|
| 200 |
media_type="video/mp4",
|
| 201 |
-
|
| 202 |
)
|
| 203 |
|
| 204 |
|
|
|
|
| 195 |
output_path = OUTPUT_DIR / f"{job_id}_output.mp4"
|
| 196 |
if not output_path.exists():
|
| 197 |
raise HTTPException(status_code=404, detail="Result not ready yet")
|
| 198 |
+
headers = {"Content-Disposition": f'attachment; filename="segmented_{job_id}.mp4"'}
|
| 199 |
return FileResponse(
|
| 200 |
str(output_path),
|
| 201 |
media_type="video/mp4",
|
| 202 |
+
headers=headers
|
| 203 |
)
|
| 204 |
|
| 205 |
|
frontend/src/app/layout.tsx
CHANGED
|
@@ -5,8 +5,8 @@ import './globals.css'
|
|
| 5 |
const inter = Inter({ subsets: ['latin'] })
|
| 6 |
|
| 7 |
export const metadata: Metadata = {
|
| 8 |
-
title: 'SegVision —
|
| 9 |
-
description: 'Upload any video and get real-time semantic segmentation.
|
| 10 |
}
|
| 11 |
|
| 12 |
export default function RootLayout({ children }: { children: React.ReactNode }) {
|
|
@@ -65,7 +65,7 @@ export default function RootLayout({ children }: { children: React.ReactNode })
|
|
| 65 |
</div>
|
| 66 |
<span className="text-sm font-semibold text-slate-800">SegVision</span>
|
| 67 |
</div>
|
| 68 |
-
<p className="text-xs text-slate-400">
|
| 69 |
<a href="https://github.com/mathsphile/video-segmentation-" target="_blank" className="text-xs text-slate-400 hover:text-slate-700 transition-colors">
|
| 70 |
GitHub ↗
|
| 71 |
</a>
|
|
|
|
| 5 |
const inter = Inter({ subsets: ['latin'] })
|
| 6 |
|
| 7 |
export const metadata: Metadata = {
|
| 8 |
+
title: 'SegVision — Video Segmentation',
|
| 9 |
+
description: 'Upload any video and get real-time semantic segmentation.',
|
| 10 |
}
|
| 11 |
|
| 12 |
export default function RootLayout({ children }: { children: React.ReactNode }) {
|
|
|
|
| 65 |
</div>
|
| 66 |
<span className="text-sm font-semibold text-slate-800">SegVision</span>
|
| 67 |
</div>
|
| 68 |
+
<p className="text-xs text-slate-400">SegVision Neural Engine · Neural Core v1.0 · H.264 Output</p>
|
| 69 |
<a href="https://github.com/mathsphile/video-segmentation-" target="_blank" className="text-xs text-slate-400 hover:text-slate-700 transition-colors">
|
| 70 |
GitHub ↗
|
| 71 |
</a>
|
frontend/src/app/page.tsx
CHANGED
|
@@ -27,7 +27,7 @@ const VOC_CLASSES = [
|
|
| 27 |
|
| 28 |
const STEPS = [
|
| 29 |
{ num: '01', title: 'Upload', desc: 'Drag & drop or select your video file' },
|
| 30 |
-
{ num: '02', title: 'Process', desc: '
|
| 31 |
{ num: '03', title: 'Download', desc: 'Get H.264 side-by-side comparison MP4' },
|
| 32 |
]
|
| 33 |
|
|
@@ -35,8 +35,8 @@ const FEATURES = [
|
|
| 35 |
{
|
| 36 |
icon: '🎯',
|
| 37 |
title: '21 Object Classes',
|
| 38 |
-
desc: 'Identifies people, cars, animals, furniture & more using
|
| 39 |
-
tag: '
|
| 40 |
},
|
| 41 |
{
|
| 42 |
icon: '⚡',
|
|
@@ -135,12 +135,12 @@ export default function HomePage() {
|
|
| 135 |
style={{ animation: 'word-in 0.5s ease forwards' }}
|
| 136 |
>
|
| 137 |
<span className="w-2 h-2 rounded-full bg-orange-400 animate-pulse inline-block" />
|
| 138 |
-
|
| 139 |
</div>
|
| 140 |
|
| 141 |
{/* Headline */}
|
| 142 |
<h1 className="text-5xl sm:text-7xl font-black tracking-tight leading-[1.05] mb-6">
|
| 143 |
-
{'
|
| 144 |
<span key={i} className="word-animate inline-block" style={{ animationDelay: `${i * 0.04}s` }}>
|
| 145 |
{c === ' ' ? '\u00a0' : c}
|
| 146 |
</span>
|
|
@@ -153,7 +153,7 @@ export default function HomePage() {
|
|
| 153 |
className="text-lg text-slate-500 max-w-xl mx-auto leading-relaxed mb-10"
|
| 154 |
style={{ animation: 'word-in 0.6s 0.4s ease forwards', opacity: 0 }}
|
| 155 |
>
|
| 156 |
-
Upload any video and watch
|
| 157 |
every object in real-time — delivered as a stunning side-by-side comparison.
|
| 158 |
</p>
|
| 159 |
|
|
|
|
| 27 |
|
| 28 |
const STEPS = [
|
| 29 |
{ num: '01', title: 'Upload', desc: 'Drag & drop or select your video file' },
|
| 30 |
+
{ num: '02', title: 'Process', desc: 'SegVision Engine segments every frame with high precision' },
|
| 31 |
{ num: '03', title: 'Download', desc: 'Get H.264 side-by-side comparison MP4' },
|
| 32 |
]
|
| 33 |
|
|
|
|
| 35 |
{
|
| 36 |
icon: '🎯',
|
| 37 |
title: '21 Object Classes',
|
| 38 |
+
desc: 'Identifies people, cars, animals, furniture & more using our Neural Engine.',
|
| 39 |
+
tag: 'SegVision'
|
| 40 |
},
|
| 41 |
{
|
| 42 |
icon: '⚡',
|
|
|
|
| 135 |
style={{ animation: 'word-in 0.5s ease forwards' }}
|
| 136 |
>
|
| 137 |
<span className="w-2 h-2 rounded-full bg-orange-400 animate-pulse inline-block" />
|
| 138 |
+
Proprietary Neural Engine · Neural Core v1.0 · 21+ Recognition Classes
|
| 139 |
</div>
|
| 140 |
|
| 141 |
{/* Headline */}
|
| 142 |
<h1 className="text-5xl sm:text-7xl font-black tracking-tight leading-[1.05] mb-6">
|
| 143 |
+
{'Video'.split('').map((c,i) => (
|
| 144 |
<span key={i} className="word-animate inline-block" style={{ animationDelay: `${i * 0.04}s` }}>
|
| 145 |
{c === ' ' ? '\u00a0' : c}
|
| 146 |
</span>
|
|
|
|
| 153 |
className="text-lg text-slate-500 max-w-xl mx-auto leading-relaxed mb-10"
|
| 154 |
style={{ animation: 'word-in 0.6s 0.4s ease forwards', opacity: 0 }}
|
| 155 |
>
|
| 156 |
+
Upload any video and watch SegVision identify, colour, and label
|
| 157 |
every object in real-time — delivered as a stunning side-by-side comparison.
|
| 158 |
</p>
|
| 159 |
|
frontend/src/app/result/page.tsx
CHANGED
|
@@ -126,8 +126,9 @@ function ResultContent() {
|
|
| 126 |
<div className="flex items-center gap-2 mb-2">
|
| 127 |
<span className="w-2 h-2 rounded-full bg-green-500 animate-pulse" />
|
| 128 |
<span className="text-xs font-bold text-green-600 uppercase tracking-widest">Segmentation Finished</span>
|
| 129 |
-
</div>
|
| 130 |
-
|
|
|
|
| 131 |
<p className="text-sm text-slate-500 mt-1">
|
| 132 |
Job ID: <code className="text-orange-500 font-mono">{jobId?.slice(0, 12)}</code>
|
| 133 |
</p>
|
|
@@ -137,7 +138,7 @@ function ResultContent() {
|
|
| 137 |
<button onClick={copyLink} className="btn-outline px-4 py-2.5 text-sm flex items-center gap-2">
|
| 138 |
{copied ? 'Link Copied!' : 'Copy Result Link'}
|
| 139 |
</button>
|
| 140 |
-
<a href={videoUrl!} download className="btn-primary px-5 py-2.5 text-sm flex items-center gap-2">
|
| 141 |
Download MP4
|
| 142 |
</a>
|
| 143 |
</div>
|
|
@@ -163,7 +164,7 @@ function ResultContent() {
|
|
| 163 |
)}
|
| 164 |
</button>
|
| 165 |
<div className="px-4 py-2 rounded-full bg-black/40 backdrop-blur-md border border-white/10 text-[10px] font-bold text-white uppercase tracking-widest">
|
| 166 |
-
|
| 167 |
</div>
|
| 168 |
</div>
|
| 169 |
</div>
|
|
|
|
| 126 |
<div className="flex items-center gap-2 mb-2">
|
| 127 |
<span className="w-2 h-2 rounded-full bg-green-500 animate-pulse" />
|
| 128 |
<span className="text-xs font-bold text-green-600 uppercase tracking-widest">Segmentation Finished</span>
|
| 129 |
+
</div>ct⇧⌥⌫
|
| 130 |
+
|
| 131 |
+
<h1 className="text-3xl font-bold text-slate-900 tracking-tight">Your Result</h1>
|
| 132 |
<p className="text-sm text-slate-500 mt-1">
|
| 133 |
Job ID: <code className="text-orange-500 font-mono">{jobId?.slice(0, 12)}</code>
|
| 134 |
</p>
|
|
|
|
| 138 |
<button onClick={copyLink} className="btn-outline px-4 py-2.5 text-sm flex items-center gap-2">
|
| 139 |
{copied ? 'Link Copied!' : 'Copy Result Link'}
|
| 140 |
</button>
|
| 141 |
+
<a href={videoUrl!} download={`segmented_${jobId}.mp4`} className="btn-primary px-5 py-2.5 text-sm flex items-center gap-2">
|
| 142 |
Download MP4
|
| 143 |
</a>
|
| 144 |
</div>
|
|
|
|
| 164 |
)}
|
| 165 |
</button>
|
| 166 |
<div className="px-4 py-2 rounded-full bg-black/40 backdrop-blur-md border border-white/10 text-[10px] font-bold text-white uppercase tracking-widest">
|
| 167 |
+
SegVision Engine Output
|
| 168 |
</div>
|
| 169 |
</div>
|
| 170 |
</div>
|