Research-only access agreement

Access requires acceptance of the research-only, non-commercial license. Requests are reviewed manually.

I agree to use this model only for non-commercial research or education, preserve attribution, and obtain permission before publishing results derived from it.

Log in or Sign Up to review the conditions and access this model content.

Image-to-Embroidery Public Model Package

Public model package for the image-to-embroidery research prototype. This refreshed package contains the latest available neural checkpoint and the current M2.91 professional-candidate research configuration.

This repository contains both:

  1. a Transformers-compatible custom PyTorch model that can be loaded with AutoModel.from_pretrained(..., trust_remote_code=True);
  2. the original project checkpoint and planner policy artifacts used by the full DST/PES export pipeline.

Version and status

  • Latest trained neural checkpoint: checkpoints/model14B_gentle_continue_geometry_final.pt
  • Direct Transformers weights: model.safetensors (converted from the model14B checkpoint)
  • Promoted geometry baseline: checkpoints/best_model13_multiformat_all_vector_continuity.pt
  • Latest planner research stage: M2.91 professional candidate generation
  • Public Hub repository: LLYszs070206/image-to-embroidery-private

Important: M2.91 is a planner/candidate-generation strategy, not a new .pt neural checkpoint. It is included under research/ so the newest research direction travels with the latest callable model.

Use and attribution

This is a public, research-only release. Read MODEL_LICENSE.md before downloading or using it. The release claimant is LLYszs070206; cite CITATION.cff and preserve AUTHOR_DECLARATION.md and SHA256SUMS.txt when redistributing permitted reports.

Files

config.json
preprocessor_config.json
model.safetensors
configuration_embroidery.py
modeling_embroidery.py
image_processing_embroidery.py
checkpoints/model14B_gentle_continue_geometry_final.pt
checkpoints/best_model13_multiformat_all_vector_continuity.pt
checkpoints/m2_edge_policy.json
checkpoints/m2_edge_policy_m2_1_globalrepair20.json
configs/relation_planner.yaml
model_index.json
research/configs/m2_89_hard_failure_aware_selector.json
research/configs/m2_90_professional_texture_objective.json
research/configs/m2_91_professional_candidate_generation.json
research/docs/m2_89_hard_failure_aware_selector.md
research/docs/m2_90_professional_texture_objective.md
research/docs/m2_91_professional_candidate_generation.md
research/evidence/*

Direct Transformers Usage

from PIL import Image
from transformers import AutoImageProcessor, AutoModel

repo_id = "LLYszs070206/image-to-embroidery-private"

processor = AutoImageProcessor.from_pretrained(repo_id, trust_remote_code=True)
model = AutoModel.from_pretrained(repo_id, trust_remote_code=True)
model.eval()

image = Image.open("your_image.png").convert("RGB")
inputs = processor(image, return_tensors="pt")
outputs = model(**inputs)

print(outputs.logits.shape)  # [1, 20, 256, 256]
maps = model.post_process(outputs.logits)
mask = maps["mask"]
density = maps["density"]
path_order = maps["path_order"]

The 20 output channels are:

mask, density, axis_x, axis_y, axis_confidence, boundary, centerline,
stitch_type_no_stitch, stitch_type_running, stitch_type_satin, stitch_type_fill,
entry_endpoint_heatmap, exit_endpoint_heatmap, path_order,
segment_mask, segment_boundary, segment_order,
stitch_trace, near_connect, jump_endpoint

Recommended Local Download

hf download <your-namespace>/image-to-embroidery-private `
  --include "checkpoints/*" "configs/*" "model_index.json" `
  --local-dir hf_downloads/image-to-embroidery-private

The model repository is public and does not require authentication to download.

Distribution note: this repository publishes the model and runtime code. Any third-party images, DST/PES files, or source datasets used during research are not automatically relicensed by this repository; redistribute them only when their original license permits it.

One-command image to DST/PES

The repository also includes the local runtime needed by the exporter:

runtime/infer_model3_portrait_hybrid.py
runtime/planner/graph_tsp.py
runtime/planner/geometry_priors.py
runtime/planner/relation_cost.py
checkpoints/m2_edge_policy_m2_1_globalrepair20.json

Install the runtime dependencies, then run from the downloaded repository root:

python -m pip install -r requirements.txt
python run_image_to_dst.py inputs/your_image.png `
  --output-dir outputs/your_image_m2_1

The command enables the model14B checkpoint, Graph-TSP ordering, M2 hard-safe edge filtering, mask-safe connectors, continuity maps, and safe-connect repair. It writes .dst, .pes, preview PNGs, and summary.json into the output directory. Use --cpu if CUDA is unavailable.

M2.91 research files are included under research/. M2.91 is currently a candidate-generation/selection experiment; the one-command conservative runtime uses the validated M2.1 decode policy until M2.91's higher execution cost is reduced.

Recommended Inference Flags

Use these artifacts with the local project repository:

python infer_model3_portrait_hybrid.py inputs/your_image.png `
  --checkpoint hf_downloads/image-to-embroidery-private/checkpoints/best_model13_multiformat_all_vector_continuity.pt `
  --output-dir outputs/your_image_m2_1 `
  --planner-config hf_downloads/image-to-embroidery-private/configs/relation_planner.yaml `
  --geometry-planner `
  --model-path-order `
  --use-continuity-planner `
  --serpentine-fill `
  --graph-tsp-planner `
  --mask-safe-connectors `
  --m2-edge-policy hf_downloads/image-to-embroidery-private/checkpoints/m2_edge_policy.json `
  --m2-edge-policy-top-k 4 `
  --m2-hard-safe-filter `
  --m2-safe-min-inside-fraction 0.96 `
  --m2-jump-aware-weight 0.25 `
  --m2-offmask-weight 0.5 `
  --m2-visible-weight 1.0 `
  --m2-trim-weight 0.25 `
  --safe-connect-repair `
  --safe-connect-repair-max-mm 20.0 `
  --safe-connect-repair-min-inside-fraction 0.90 `
  --safe-connect-repair-global-mask

Current Status

  • Main uploaded image model: the latest available model14B gentle-continue geometry checkpoint, published as model.safetensors for direct Transformers loading.
  • Previous promoted model13 vector-continuity checkpoint is retained under checkpoints/ for traceability.
  • Current promoted M2 decode setting: M2.1 global safe-connect repair20.
  • M2.89 remains the conservative hard-safety deployment baseline.
  • M2.90 is the safer professional-texture selector.
  • M2.91 is the latest professional candidate-generation experiment. It improves professional-preview and texture signals, but its execution cost is higher, so it is not the conservative default yet.

The direct Transformers model returns dense geometry/planning maps. Full DST/PES export still uses the local project pipeline because DST writing depends on the graph planner, M2 policy, and pyembroidery exporter.

This package does not include training datasets.

Downloads last month
-
Safetensors
Model size
1.97M params
Tensor type
F32
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support