Que fait scan-studio ?
Pipeline: frames (ffmpeg, blur score, even spread) -> people check (OpenCV face detectors; refuse) -> structure from motion (pycolmap, CPU) -> dense (OpenCV semi-global stereo per frame pair, left-right and multi-view checks, Open3D TSDF fusion) -> clean (ground plane, far-from-features fins, largest piece, optional box) -> orient (up from camera axes and the ground) -> scale -> simplify + texture (quadric decimation, xatlas, colour from the frames) -> GLB -> report.html (+ optional USDZ via ar-models).
Skill folder (written $S below): this folder. Every command is $S/scan-studio <command>. $S/scan-studio run --help lists all options.
Before you start
- Objects only. Never scan a person, a face or anyone's body, with or without consent. If the user asks for a person, say no and explain that this tool is for objects. The run stops by itself (exit code 4) when faces are detected in at least max(2, 5 % of the frames checked), and deletes the extracted frames. The check misses small (under about 6 % of the frame width), tilted, turned and background faces, so it does not replace looking at the video.
--confirm-objectexists only for faces that belong to an object (a statue, a doll, a printed picture) with no person in the frames. Ask the user before using it and never use it for a real person. - Rights. The model is a copy of the object's shape and surface. Ask whose object it is if that matters (artwork, products of other brands).
- Size. Structure from motion has no units. For AR, ask the user for one real measurement: the height, the longest side, or the distance between two points they can measure with a ruler. Never guess it.
- No GPU here. Everything runs on the CPU. The demo (89 frames of 720p video) took 68 to 150 seconds on 16 to 2 threads; larger frames, more frames and photo sets take longer. Say so before starting a long run.
How to film (tell the user)
Walk slowly all the way round the object, phone upright, at two heights if you can (one ring at table level, one looking down). Keep the whole object in frame and filling about half of it. Diffuse light, no flash. Put it on a textured surface (a newspaper, a wooden table), not on a plain white sheet. Shiny, glass, black or plain white objects reconstruct badly. 30 to 90 seconds of video is plenty.
Workflow
$S/scan-studio check(runscheck_env.sh). Fix any MISS line (Python 3.12 venv withrequirements.txt).- Run:
A folder of photos works the same ($S/scan-studio run path/to/video.mp4 --height 0.19 [--out DIR] [--name NAME] [--usdz]run path/to/photos/). Output goes to<name>-out/next to the input:<name>.glb,report.html,report.json,work/(frames, COLMAP database and sparse model in text form). With--usdz:ar/<name>.glbandar/<name>.usdz. - Look at the result: render the report and Read the PNGs:
Check: is the object complete, upright, standing on the floor, free of table pieces and fins, and is the texture right?$S/scan-studio render <out>/report.html --png /tmp/after.png $S/scan-studio render <out>/report.html --png /tmp/before.png --mode before - Fix what you see:
- table left under the object -> it was not found as a plane; use
--box xmin,ymin,zmin,xmax,ymax,zmax(metres, y up, numbers from the report's Measure tool of a run with the same size option; the size option is then applied to what the box keeps) or film with more of the table visible. - parts of the object missing ->
--keep-groundif a flat base was cut off; otherwise film more slowly with more overlap and more light. - lying on its side -> the camera was held sideways for most of the video; film again upright.
- few cameras placed -> plain or shiny surface; add texture around the object (newspaper), or use photos.
- table left under the object -> it was not found as a plane; use
- Real size after the fact (no new reconstruction): open the report, click Measure, click two points the user can also measure on the real object, then
or$S/scan-studio scale <out> --points "x,y,z" "x,y,z" --length 0.123 [--usdz]scale <out> --height 0.19. - Deliver: the GLB path and size in MB, the real size in centimetres, the triangle count, the run time, and the report path. Say plainly that AR was not tested on a phone here.
Options worth knowing
--frames N (default 90, 12 to 200), --triangles N (default 80000), --texture 2048 (power of two, 0 for vertex colours), --dense stereo|sparse|auto, --threads N, --keep-ground, --box. scan-studio frames <video> and scan-studio faces <video|folder|image> run one stage alone. scan-studio evaluate <out> --truth mesh.ply --cameras cams.json measures a test capture against its ground truth. scan-studio report <out> rewrites the page.
Exit codes: 0 done, 1 the capture could not become a model (or fewer than 30 % of cameras placed, or the USDZ failed after the GLB and report were written), 2 usage mistake, 3 over a size limit, 4 faces detected, 5 internal error. If the process is killed (out of memory), the launcher says "killed by signal N"; retry with --threads 4 or fewer --frames.
A face WARNING on the terminal (faces in too few frames to refuse) means: look at the frames in work/images/ before delivering.
Safety
- Inputs: only local files (no URLs; ffmpeg runs with
-protocol_whitelist file,pipe). Budgets cap the total work: input bytes, photos, pixels per photo, decoded candidate frames and their total pixels, kept frames, triangles, texture size, report size. - Outputs are written through temporary files and renamed; symlinked output files or folders are refused.
- The report makes no network requests: its content security policy allows only its own inline script and style by hash. Every name from the input is escaped.
- The launcher runs Python isolated (
-I): nothing is imported from the current folder orPYTHONPATH.
Limits (say these)
- CPU only by design: COLMAP's PatchMatch stereo needs CUDA, so dense depth comes from two-view semi-global matching instead. Detail is lower than a GPU photogrammetry tool; fine engraving and thin parts (wires, handles thinner than about 1 % of the object) may be lost or thickened.
- No Gaussian splats: no splat trainer runs in reasonable time on a CPU.
work/sparse/holds the cameras and points in COLMAP text format, which GPU splat tools can read. - The face check uses Haar detectors: they miss faces turned away, small or in the dark, and can fire on face-like patterns. It is a guard against mistakes, not a guarantee.
- The underside that sat on the table is not seen and stays open or flat.
Troubleshooting
structure from motion placed only N cameras: too little texture or too much blur; film slower, add texture, more light.only N usable stereo pairs: it falls back to a coarser Poisson surface on the sparse points (dense.methodin the report says which).--usdz needs the ar-models skill: install it in~/.claude/skills/ar-modelsor setSCAN_STUDIO_AR_MODELS.rendersays Playwright not found:npm i -g playwright-core; no browser: install Chrome ornpx playwright-core install chromium.