Files
synthetic-defect-factory/docs/PROJECT_BRIEF.md
T

2.2 KiB

PROJECT: Synthetic Defect Factory, a virtual production line for AI visual inspection.

GOAL: Procedurally generate USDA scenes of a metal bracket (80x40x6 mm, 4 holes, 2 screws) on a conveyor with defect variants. Render with Blender (headless), auto-generate YOLO labels, train YOLOv8, and run inference on a simulated conveyor video.

CLASSES: 0 scratch, 1 dent, 2 missing_part, 3 misplaced_part (good parts get an empty label file).

ENVIRONMENT (already set up, do not reinstall):

  • Windows, PowerShell. Project root: C:\Ai India Innovations\synthetic-defect-factory
  • Python 3.11.9 virtual env in .venv (already active in my terminal). Installed: usd-core, numpy, pillow, opencv-python, pyyaml, ultralytics 8.4.183, PyTorch 2.11.0+cu128.
  • Blender 5.2 at: C:\Program Files\Blender Foundation\Blender 5.2\blender.exe
  • Hardware: NVIDIA RTX 3050 6GB Laptop GPU, 15.7 GB RAM. Training: YOLOv8n, imgsz 640, batch 8 (fall back to 4 on out-of-memory), workers 2 (0 if Windows dataloader errors). Never run rendering and training at the same time.

RULES:

  • Blender 5.2 is newer than your training data. Before writing any bpy code, check the installed version's API: list valid render engine identifiers, check the signature of the USD import operator (bpy.ops.wm.usd_import) and the Cycles device options by running small headless test scripts. Do not assume names from older versions.
  • All paths, seeds, counts and the Blender executable path live in config/project_config.yaml. No hardcoded paths.
  • USD: ASCII .usda, upAxis Z, metersPerUnit 1.0, materials as UsdPreviewSurface only, no Omniverse-only schemas. Named prims: /World/Product/Body, /World/Product/Screw_1, Screw_2, /World/Conveyor, /World/Camera, /World/Lights/*.
  • Every scene writes a manifest JSON: scene id, seed, and for each defect: class_id, class_name, target prim, center in product-local coordinates (meters), radius (meters).
  • Blender runs headless: blender --background --python script.py -- .
  • Everything is seeded and reproducible.
  • After each task: run the code, list the output files, run a verification, and summarize. Do not continue past a failed check.
  • Stay inside the project folder. Ask before installing anything new.