SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2007.13145 · 2020

Deep Photometric Stereo for Non-Lambertian Surfaces

arXiv · PDF · Open in the Atlas

Code that ran

9 of 12 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 9 have no contract verdict; 0 failures of our instrument; 3 no recorded run), measured 2026-11-22; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2007.13145.json · badge: /api/ran/2007.13145.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
guanyingc/PS-FCN canonical (classifier label)
classifier basis: census
9 ran · 3 no recorded run
FunctionStatusWhere it lives
arrayToTensor Ran
ran on a synthesized input
guanyingc/PS-FCN/datasets/pms_transforms.py
code served (permissive licence) · get_code("b53c08665873abc9")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Tensor, ndim 3, dtype family float, shape (2, 4, 3) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np

torch.manual_seed(0)

# Create a small test array with shape (height, width, channels)
# Using distinct dimensions: 4 (height) x 3 (width) x 2 (channels)
array = np.random.randn(4, 3, 2).astype(np.float32)

ARGS = {
    "array": array
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 3, dtype family float, shape (2, 4, 3) — shape (2, 4, 3) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
benchmarkLoader Ran
ran on a synthesized input
guanyingc/PS-FCN/datasets/custom_data_loader.py
code served (permissive licence) · get_code("3bc2e432daccb33d")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned DataLoader. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.utils.data
from unittest.mock import Mock, MagicMock

torch.manual_seed(0)

# Create a minimal stand-in dataset class that mimics DiLiGenT_main
class MockDiLiGenT(torch.utils.data.Dataset):
    def __init__(self, args, split):
        self.args = args
        self.split = split
        self.length = 2
    
    def __len__(self):
        return self.length
    
    def __getitem__(self, idx):
        # Return a simple tuple of tensors
        return (torch.randn(3, 4), torch.randn(3, 4))

# Patch the import so DiLiGenT_main returns our mock
import sys
from types import ModuleType

mock_datasets = ModuleType('datasets')
mock_diligent_main = ModuleType('datasets.DiLiGenT_main')
mock_diligent_main.DiLiGenT_main = MockDiLiGenT
sys.modules['datasets'] = mock_datasets
sys.modules['datasets.DiLiGenT_main'] = mock_diligent_main

# Create args object with all required attributes
class ArgsNamespace:
    def __init__(self):
        self.benchmark = 'DiLiGenT_main'
        self.test_batch = 2
        self.workers = 0
        self.cuda = False

args = ArgsNamespace()

ARGS = {
    'args': args
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
datasets, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type DataLoader — a DataLoader output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a DataLoader output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
customDataloader Ran
ran on a synthesized input
guanyingc/PS-FCN/datasets/custom_data_loader.py
code served (permissive licence) · get_code("d9bafcf88fcf69a9")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.utils.data
from unittest.mock import Mock, MagicMock

torch.manual_seed(0)

# Create a minimal stand-in for PS_Synth_Dataset
class MockPS_Synth_Dataset(torch.utils.data.Dataset):
    def __init__(self, args, data_dir, split):
        self.args = args
        self.data_dir = data_dir
        self.split = split
        self.length = 10  # arbitrary small length
    
    def __len__(self):
        return self.length
    
    def __getitem__(self, idx):
        # Return a simple (image, label) tuple
        return (torch.randn(3, 4, 4), torch.randn(3))

# Patch the import so it returns our mock dataset
import sys
from unittest.mock import patch

mock_module = Mock()
mock_module.PS_Synth_Dataset = MockPS_Synth_Dataset
sys.modules['datasets'] = Mock()
sys.modules['datasets.PS_Synth_Dataset'] = mock_module

# Create arguments object as a simple namespace
class Args:
    def __init__(self):
        self.data_dir = '/tmp/data1'
        self.data_dir2 = '/tmp/data2'
        self.dataset = 'PS_Synth_Dataset'
        self.concat_data = False
        self.batch = 2
        self.val_batch = 2
        self.workers = 0
        self.cuda = False

ARGS = {
    'args': Args()
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
datasets, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 1, dtype family float — a tuple output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
getInput Ran
ran on a synthesized input
guanyingc/PS-FCN/models/model_utils.py
code served (permissive licence) · get_code("da7de87d5de4c51d")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned list. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
torch.manual_seed(0)

class Args:
    def __init__(self, in_light=False):
        self.in_light = in_light

args = Args(in_light=True)

data = {
    'input': torch.randn(2, 4),
    'l': torch.randn(2, 3)
}

ARGS = {
    'args': args,
    'data': data
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list — a list output has no array shape of its own; none is stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
getInputChanel Ran
ran on a synthesized input
guanyingc/PS-FCN/models/model_utils.py
code served (permissive licence) · get_code("56d225ef46427960")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned int, ndim 0, dtype family int, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn

class Args:
    def __init__(self):
        self.in_light = False

ARGS = {'args': Args()}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type int, ndim 0, dtype family int, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
getOptimizer Ran
ran on a synthesized input
guanyingc/PS-FCN/models/solver_utils.py
code served (permissive licence) · get_code("29662f28c6c5c73d")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Adam. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn

torch.manual_seed(0)

# Create a small model with parameters
model = nn.Sequential(
    nn.Linear(4, 3),
    nn.ReLU(),
    nn.Linear(3, 2)
)

params = model.parameters()

# Create args object with all required attributes
class Args:
    def __init__(self):
        self.solver = 'adam'
        self.init_lr = 0.001
        self.beta_1 = 0.9
        self.beta_2 = 0.999
        self.momentum = 0.9

args = Args()

ARGS = {
    'args': args,
    'params': params
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Adam — a Adam output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Adam output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
normalToMask Ran
ran on a synthesized input
guanyingc/PS-FCN/datasets/pms_transforms.py
code served (permissive licence) · get_code("46fd95ecbea5f94a")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned ndarray, ndim 3, dtype family float, shape (2, 2, 1) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np

# Construct a small normal map array
# Shape should be (height, width, 3) where the last dimension is the normal vector
# The function computes np.square(normal).sum(2, keepdims=True) > thres
# So we need at least 3 channels in the last dimension
normal = np.array([
    [[0.5, 0.3, 0.2], [0.1, 0.2, 0.3]],
    [[-0.003927, -0.003927, -0.003927], [0.8, 0.6, 0.4]]
], dtype=np.float32)

ARGS = {
    "normal": normal,
    "thres": 0.01
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 3, dtype family float, shape (2, 2, 1) — shape (2, 2, 1) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
parseData Ran
ran on a synthesized input
guanyingc/PS-FCN/models/model_utils.py
code served (permissive licence) · get_code("9527241a3b9c5fab")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned dict. The image it ran in was not recorded. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

torch.manual_seed(0)

class MockTimer:
    def updateTime(self, label):
        pass

class MockArgs:
    def __init__(self, cuda=False, in_light=False):
        self.cuda = cuda
        self.in_light = in_light

# Create sample data
sample = {
    'img': torch.randn(2, 3, 4, 4),  # batch=2, channels=3, height=4, width=4
    'N': torch.randn(2, 5),  # batch=2, target_dim=5
    'mask': torch.ones(2, 1, 4, 4),  # batch=2, channels=1, height=4, width=4
    'light': torch.randn(1, 3, 1, 1),  # for expansion to match input shape
}

args = MockArgs(cuda=False, in_light=False)
timer = MockTimer()

ARGS = {
    'args': args,
    'sample': sample,
    'timer': timer,
    'split': 'train'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
rgbToGray Ran
ran on a synthesized input
guanyingc/PS-FCN/datasets/pms_transforms.py
code served (permissive licence) · get_code("4ca36c7a90516c3a")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Tensor, ndim 3, dtype family float, shape (4, 3, 1) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np

torch.manual_seed(0)

# Create a small RGB image tensor with shape (height, width, channels)
# Using distinct dimensions: 4x3x3 for (h, w, c)
img = torch.rand(4, 3, 3, dtype=torch.float32)

ARGS = {
    "img": img
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 3, dtype family float, shape (4, 3, 1) — shape (4, 3, 1) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
buildModel Not yet run
unverified (harvested, no recorded run)
guanyingc/PS-FCN/models/custom_model.py
code served (permissive licence) · get_code("a90a8a6931789779")
How it ran

no invocation recorded.

getLrScheduler Not yet run
unverified (harvested, no recorded run)
guanyingc/PS-FCN/models/solver_utils.py
code served (permissive licence) · get_code("b58a3089fbaa19c5")
How it ran

no invocation recorded.

loadRecords Not yet run
unverified (harvested, no recorded run)
guanyingc/PS-FCN/models/solver_utils.py
code served (permissive licence) · get_code("7b29b4cbb0e9a17b")
How it ran

no invocation recorded.

Also present in other papers' code

Of 12 samples lifted from this paper's linked repositories, 12 carry a function identity and 0 do not. Of the 12 distinct functions with an identity, 2 are also present in other papers whose code we hold (2 with at least one paper dated earlier, 0 the same month, 0 later) and 10 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

FunctionAlso present inEarliest-datedOthers named
getLrScheduler 1 other paper
1 dated earlier
1903.07366 (2019-03)
Self-calibrating Deep Photometric Stereo Networks
loadRecords 1 other paper
1 dated earlier
1903.07366 (2019-03)
Self-calibrating Deep Photometric Stereo Networks

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-22.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

This paper addresses the problem of photometric stereo, in both calibrated and uncalibrated scenarios, for non-Lambertian surfaces based on deep learning. We first introduce a fully convolutional deep network for calibrated photometric stereo, which we call PS-FCN. Unlike traditional approaches that adopt simplified reflectance models to make the problem tractable, our method directly learns the mapping from reflectance observations to surface normal, and is able to handle surfaces with general and unknown isotropic reflectance. At test time, PS-FCN takes an arbitrary number of images and their associated light directions as input and predicts a surface normal map of the scene in a fast feed-forward pass. To deal with the uncalibrated scenario where light directions are unknown, we introduce a new convolutional network, named LCNet, to estimate light directions from input images. The estimated light directions and the input images are then fed to PS-FCN to determine the surface normals. Our method does not require a pre-defined set of light directions and can handle multiple images in an order-agnostic manner. Thorough evaluation of our approach on both synthetic and real datasets shows that it outperforms state-of-the-art methods in both calibrated and uncalibrated scenarios.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2007.13145")
get_code_for_paper("2007.13145")
have("2007.13145")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2007.13145.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2007.13145.svg)](https://syntology.ai/paper/2007.13145)

Connect an agent — have() is free.