Skip to main content
  • Home
  • Development
  • Documentation
  • Donate
  • Operational login
  • Browse the archive

swh logo
SoftwareHeritage
Software
Heritage
Archive
Features
  • Search

  • Downloads

  • Save code now

  • Add forge now

  • Help

https://github.com/jhuangBU/gsdeformer-code
21 May 2026, 06:31:33 UTC
  • Code
  • Branches (1)
  • Releases (0)
  • Visits
    • Branches
    • Releases
    • HEAD
    • refs/heads/main
    No releases to show
  • 707fda0
  • /
  • infer_gsdeformer_exp_quant.sh
Raw File Download Save again
Take a new snapshot of a software origin

If the archived software origin currently browsed is not synchronized with its upstream version (for instance when new commits have been issued), you can explicitly request Software Heritage to take a new snapshot of it.

Use the form below to proceed. Once a request has been submitted and accepted, it will be processed as soon as possible. You can then check its processing state by visiting this dedicated page.
swh spinner

Processing "take a new snapshot" request ...

To reference or cite the objects present in the Software Heritage archive, permalinks based on SoftWare Hash IDentifiers (SWHIDs) must be used.
Select below a type of object currently browsed in order to display its associated SWHID and permalink.

  • content
  • directory
  • revision
  • snapshot
origin badgecontent badge
swh:1:cnt:08b39034bda809ca2c969620e53754a4ec637d78
origin badgedirectory badge
swh:1:dir:707fda0a4042745751136cd51ca2c0bc48da42ca
origin badgerevision badge
swh:1:rev:2eb7f6d3bf60cacd4f3969a9d68949cb3a34da95
origin badgesnapshot badge
swh:1:snp:fd22f80b54ad40aa01ea8be83f3828c1228d614f

This interface enables to generate software citations, provided that the root directory of browsed objects contains a citation.cff or codemeta.json file.
Select below a type of object currently browsed in order to generate citations for them.

  • content
  • directory
  • revision
  • snapshot
(requires biblatex-software package)
Generating citation ...
(requires biblatex-software package)
Generating citation ...
(requires biblatex-software package)
Generating citation ...
(requires biblatex-software package)
Generating citation ...
Tip revision: 2eb7f6d3bf60cacd4f3969a9d68949cb3a34da95 authored by jhuangBU on 10 May 2026, 11:43:06 UTC
doc: revise README
Tip revision: 2eb7f6d
infer_gsdeformer_exp_quant.sh
#!/bin/bash

set -e

export LIBGL_ALWAYS_SOFTWARE=1

# Usage: ./infer_gsdeformer_exp_quant_v2.sh <scene_name>
# Example: ./infer_gsdeformer_exp_quant_v2.sh mic

if [ $# -lt 1 ]; then
    echo "Usage: $0 <scene_name>"
    exit 1
fi

SCENE=$1
BASE=data/quantitative/$SCENE
MODEL_PATH=gs3d/output/$SCENE
EVAL_PATH=gs3d/output/eval_$SCENE

# Validate paths
[ ! -d "$BASE" ] && { echo "Error: Base directory not found: $BASE"; exit 1; }
[ ! -d "$BASE/$SCENE" ] && { echo "Error: Dataset not found"; exit 1; }
[ ! -d "$BASE/${SCENE}_deformed" ] && { echo "Error: Deformed dataset not found"; exit 1; }
[ ! -d "$MODEL_PATH" ] && { echo "Error: Model directory not found"; exit 1; }
[ ! -f "$BASE/${SCENE}_proxy.ply" ] && { echo "Error: Source cage not found"; exit 1; }
[ ! -f "$BASE/${SCENE}_proxy_deformed.ply" ] && { echo "Error: Target cage not found"; exit 1; }

# Find latest iteration
LATEST_ITER=$(ls -v $MODEL_PATH/point_cloud/ | grep "^iteration_" | tail -1 | sed 's/iteration_//')
[ -z "$LATEST_ITER" ] && { echo "Error: No iteration found"; exit 1; }

echo "Scene: $SCENE"
echo "Latest iteration: $LATEST_ITER"
echo "==========================================="

# Step 1: Deform and render all test images using cli.py
echo "[1/4] Deforming and rendering test images..."
rm -rf $EVAL_PATH
mkdir -p $EVAL_PATH/renders_raw

python -m gsdeformer.editorv2.cli \
    source_path=$BASE/${SCENE}_deformed \
    model_path=$MODEL_PATH \
    cage_path=$BASE/${SCENE}_proxy.ply \
    dst_cage_path=$BASE/${SCENE}_proxy_deformed.ply \
    cam_idx=-1 \
    algorithm=all \
    expname=quant_${SCENE} \
    output_path=$EVAL_PATH/renders_raw \
    save_model=false \
    iteration=$LATEST_ITER \
    use_camera_resolution=true \
    white_bg=true

# Step 2: Create folder structure for metrics.py
echo "[2/4] Setting up folder structure..."
mkdir -p $EVAL_PATH/test/ours_30000/renders
mkdir -p $EVAL_PATH/test/ours_30000/gt

# Step 3: Copy rendered images (strip _deformed suffix)
echo "[3/4] Organizing rendered images..."
for f in $EVAL_PATH/renders_raw/*_deformed.png; do
    if [ -f "$f" ]; then
        filename=$(basename "$f")
        # Strip _deformed.png and add .png back
        newname="${filename%_deformed.png}.png"
        cp "$f" "$EVAL_PATH/test/ours_30000/renders/$newname"
    fi
done

# Copy ground truth images
echo "Copying ground truth images..."
cp $BASE/${SCENE}_deformed/train/*.png $EVAL_PATH/test/ours_30000/gt/

# Step 4: Compute metrics (with masks if available)
echo "[4/4] Computing metrics..."
cd gs3d
MASK_DIR="../$BASE/${SCENE}_deformed/masks"
MASK_ARG=""
[ -d "$MASK_DIR" ] && MASK_ARG="--masks $MASK_DIR"
python metrics.py -m output/eval_$SCENE --background white $MASK_ARG
cd ..

# Export to CSV
python -c "
import json, csv
with open('$EVAL_PATH/results.json') as f:
    data = json.load(f)
method = list(data.keys())[0]
m = data[method]
with open('$EVAL_PATH/results.csv', 'w', newline='') as f:
    w = csv.writer(f)
    w.writerow(['scene', 'SSIM', 'PSNR', 'LPIPS'])
    w.writerow(['$SCENE', f\"{m['SSIM']:.6f}\", f\"{m['PSNR']:.6f}\", f\"{m['LPIPS']:.6f}\"])
print(f\"Results: SSIM={m['SSIM']:.6f}, PSNR={m['PSNR']:.6f}, LPIPS={m['LPIPS']:.6f}\")
"

echo "==========================================="
echo "✓ Complete! Results saved to: $EVAL_PATH/results.csv"

back to top

Software Heritage — Copyright (C) 2015–2026, The Software Heritage developers. License: GNU AGPLv3+.
The source code of Software Heritage itself is available on our development forge.
The source code files archived by Software Heritage are available under their own copyright and licenses.
Terms of use: Archive access, API— Content policy— Contact— JavaScript license information— Web API