Skip to content
Open
Show file tree
Hide file tree
Changes from 11 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
114 changes: 114 additions & 0 deletions e --abort
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
bc38c962 (HEAD -> dev) Fix PerceptualLoss enum references and docstrings
be2869df Fix network_type docstring formatting in PerceptualLoss
ccea8930 (origin/dev, origin/HEAD) DCO Remediation Commit for Mohammad Amanour Rahman <[email protected]>
0c667a99 DCO Remediation Commit for Mohammad Amanour Rahman <[email protected]>
ea64afaf DCO Remediation Commit for Mohammad Amanour Rahman <[email protected]>
3e92d74e Fix PerceptualLoss enum references and docstrings
84e7d704 DCO Remediation Commit for Mohammad Amanour Rahman <[email protected]>
eeef1729 DCO Remediation Commit for Mohammad Amanour Rahman <[email protected]>
cc0c951f Fix PerceptualLoss enum references and docstrings
96ea131f DCO Remediation Commit for Mohammad Amanour Rahman <[email protected]>
e2d0a027 DCO Remediation Commit for Mohammad Amanour Rahman <[email protected]>
7ce29a1e Fix network_type docstring formatting in PerceptualLoss
15fd428c Bump actions/checkout from 4 to 6 (#8649)
e5417c86 Bump al-cheb/configure-pagefile-action from 1.4 to 1.5 (#8648)
c1d02cf1 Bump peter-evans/slash-command-dispatch from 4.0.0 to 5.0.0 (#8650)
e2677053 Added an optional_import check for onnxruntime and applied the @unitt… (#8641)
04a89ee9 Generate heatmap transforms (#8579)
f493ecdd 8620 modulenotfounderror no module named onnxscript in test py3x 311 pipeline (#8638)
9a456274 Fix #8350: Clarify LocalNormalizedCrossCorrelationLoss docstring (#8639)
865b0e70 Update documentation links (#8637)
c968907c Fix #8599: Add track_meta and weights_only arguments to PersistentDataset for MetaTensor support. (#8628)
806c0e84 Fix index using tuple for image cropping operation (#8633)
23c271ea feat: add activation checkpointing to unet (#8554)
16e469c8 Correct H&E stain ordering heuristic in ExtractHEStains (#8551)
a8a7e575 timestep scheduling with np.linspace (#8623)
f315bcb0 8620 ModuleNotFoundError: No module named \'onnxscript\' in test-py3x (3.11) pipeline (#8621)
e72145ce Fix box_iou returning 0 for floating-point results less than 1. #8369 (#8553)
579cec52 added ReduceTrait and FlattenSequence (#8531)
d260b785 Bump github/codeql-action from 3 to 4 (#8616)
b10410ce Bump actions/upload-artifact from 4 to 5 (#8615)
69444c13 Bump actions/download-artifact from 5 to 6 (#8614)
d9cfa3e6 Bump peter-evans/create-or-update-comment from 4 to 5 (#8612)
09ace633 Include more-itertools in build env (#8611)
42a99477 8564 fourier positional encoding (#8570)
69f3dd26 Bump actions/setup-python from 5 to 6 (#8589)
c4a1acc8 Bump actions/checkout from 4 to 5 (#8588)
8a2efcb0 Bump actions/download-artifact from 4 to 5 (#8590)
53382d83 Update citation for 1.5.1 (#8582)
9c6d819f Release 1.5.1 Updates (#8575)
9122739e Removing instantiation in forward (#8580)
cf5790db Fix gdown fails (#8576)
cf5505a5 Diffusion Model Encoder has an output layer set in forward method and this leads to problems (#8578)
6327a861 Transformers version (#8574)
946cfdff Path traversal issue security fix (#8568)
948fbb70 Torch and Pickle Safe Load Fixes (#8566)
401ea4a0 Fix hardcoded input dim in DiffusionModelEncoder (#8514)
fd13c1b5 Create SECURITY.md (#8546)
725c8dea Torchvision pretrain fix (#8563)
b5bc69d0 Classifier free guidance unconditioned value (#8562)
0968da20 Improve Orientation transform to use the "space" (LPS vs RAS) of a metatensor by default (#8473)
d4ba52e3 Fix build failure by pinning pyamg to versions below 5.3.0 (#8548)
cb200af0 Tests Cleanup (#8535)
1e6c6615 8525 improve documentation on the datalist format (#8539)
cf869814 fix: HistogramNormalized doc (#8543)
cafc1feb Pytorch 2.8 Support (#8530)
b92b2ce8 Add support for optional conditioning in PatchInferer, SliceInferer, and SlidingWindowInferer (#8400)
2a12c4b4 Add input validation to ImageStats class (#8501)
ede6ace8 Throw exception on invalid images in retinanet detector (#8515)
1dc0e68c 8185 test refactor 2 (#8405)
503b4ede fix bug in maisi vae (#8517)
8ee3f89b Updates for Pytorch 2.7 (#8429)
def42221 Adding .coderabbit.yaml File (#8513)
e0be5d27 Update README badges to add research paper citations number (#8494)
e499362b add kwargs in array and functional file (#8508)
4b69748a ci: add custom timeout to ci job in order to save resources (#8504)
d388d1c6 Update citation (#8484)
3d6021a6 Fix: ZarrAvgMerger ValueError with zarr_format 3 (#8477)
d38c93f9 Removed or Replaced Broken URLs (#8483)
e5c512ff Fix integration test in 24.10 (#8480)
423ea748 Fixing URLs in README.md (#8481)
dfe6fc77 Changelog For 1.5 (#8474)
c3a317d2 Adding CODEOWNERS (#8457)
c3a3397d Remove unused test cases in bundle load (#8463)
2d416557 Classifier free guidance (#8460)
f85135b0 Remove deprecated `net_name` in test file (#8461)
d4b4bff9 Adding Support Policy + Doc Updates (#8458)
222d5094 Migrate to modern Python Logger API (#8449)
bf6bc1fd Enable code coverage comments on PRs in codecov configuration (#8402)
707b2305 Remove deprecated `return_state_dict ` in bundle `load` (#8454)
03a0d851 Fix AutoencoderKL docstrings. (#8445)
daf9f054 Update default overlap value in occlusion_sensitivity to 0.6 (#8446)
f97a0e9b Remove deprecated functionality for v1.5 (#8430)
4305bb81 :bug: fix cosine noise scheduler (#8427)
0d19a72f Temporarily Restrict setuptools Version to 79.0.1 (#8441)
b58e883c selfattention block: Remove the fc linear layer if it is not used (#8325)
f27517b8 Inverse Threading Fix (#8418)
8f3d8e87 Update get latest bundle version function (#8420)
eadffd24 Fix OptionalImportError: required package `openslide` is not installed (#8419)
9586071c Add Skip test in TestTranschex (#8416)
6c8de354 8394 Update bundle download API (#8403)
83dcd35c Fix: correctly apply fftshift to real-valued data inputs (#8407)
90ead4bf 8328 nnunet bundle integration (#8329)
4986d7ff Auto3DSeg algo_template hash update (#8406)
bfcb318b Restormer Implementation (#8312)
8aef9a98 Update Dice Metric Docs (#8388)
5c5ca232 Auto3DSeg algo_template hash update (#8397)
0f5da113 Auto3DSeg algo_template hash update (#8393)
41d6c9c2 8201 Fix DataFrame subsets indexing in CSVDataset() (#8351)
34f37973 add prediction type for rflow scheduler (#8386)
90de55b1 Add rectified flow noise scheduler for accelerated diffusion model (#8374)
7c26e5af Enable Pytorch 2.6 (#8309)
1983f277 Auto3DSeg algo_template hash update (#8378)
2e391c82 Bump torch minimum to mitigate CVE-2024-31580 & CVE-2024-31583 and enable numpy 2 compatibility (#8368)
a09c1f08 Update monaihosting download method (#8364)
ab075234 Modify ControlNet inferer so that it takes in context when the diffus… (#8360)
a7905909 8354 fix path at test onnx trt export (#8361)
d98f3481 Solves path problem in test_bundle_trt_export.py (#8357)
af54a17b Add Average Precision to metrics (#8089)
b0ed2534 Fix CommonKeys docstring (#8342)
fb8c5bf7 Removed outdated `torch` version checks from transform functions (#8359)
960c59b4 Fix `packaging` imports in version comparison logic (#8347)
0a85eed2 Inferer modification - save_intermediates clashes with latent shape adjustment in latent diffusion inferers (#8343)
44add8d1 Bump min torch to 1.13.1 to mitigate CVE-2022-45907 unsafe usage of eval (#8296)
e538f7fd Recursive Item Mapping for Nested Lists in Compose (#8187)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

Wrong file provided - cannot review git log output.

The file appears to be a git log dump rather than source code. The filename "e --abort" suggests a malformed command. The PR objectives indicate changes to monai/losses/perceptual.py (enum rename from PercetualNetworkType to PerceptualNetworkType), but that file was not provided for review.

Please provide the actual source file with code changes.

🤖 Prompt for AI Agents
In e --abort around lines 1-114 the uploaded file is a git log dump (wrong file)
instead of the intended source; replace this with the actual modified source
file monai/losses/perceptual.py containing the PR changes, rename the misspelled
enum PercetualNetworkType to PerceptualNetworkType (update the enum definition,
all references, imports, and type hints), fix related docstrings and any
occurrences of the old name, run unit tests and linters, and amend the commit/PR
to include the corrected file so reviewers can verify the change.

20 changes: 13 additions & 7 deletions monai/losses/perceptual.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
torchvision, _ = optional_import("torchvision")


class PercetualNetworkType(StrEnum):
class PerceptualNetworkType(StrEnum):
alex = "alex"
vgg = "vgg"
squeeze = "squeeze"
Expand All @@ -49,9 +49,15 @@ class PerceptualLoss(nn.Module):

Args:
spatial_dims: number of spatial dimensions.
network_type: {``"alex"``, ``"vgg"``, ``"squeeze"``, ``"radimagenet_resnet50"``,
``"medicalnet_resnet10_23datasets"``, ``"medicalnet_resnet50_23datasets"``, ``"resnet50"``}
Specifies the network architecture to use. Defaults to ``"alex"``.
network_type: str | PercetualNetworkType = PercetualNetworkType.alex,
One of:
- "alex"
- "vgg"
- "squeeze"
- "radimagenet_resnet50"
- "medicalnet_resnet10_23datasets"
- "medicalnet_resnet50_23datasets"
- "resnet50"
is_fake_3d: if True use 2.5D approach for a 3D perceptual loss.
fake_3d_ratio: ratio of how many slices per axis are used in the 2.5D approach.
cache_dir: path to cache directory to save the pretrained network weights.
Expand All @@ -70,7 +76,7 @@ class PerceptualLoss(nn.Module):
def __init__(
self,
spatial_dims: int,
network_type: str = PercetualNetworkType.alex,
network_type: str = PerceptualNetworkType.alex,
is_fake_3d: bool = True,
fake_3d_ratio: float = 0.5,
cache_dir: str | None = None,
Expand All @@ -93,10 +99,10 @@ def __init__(
if channel_wise and "medicalnet_" not in network_type:
raise ValueError("Channel-wise loss is only compatible with MedicalNet networks.")

if network_type.lower() not in list(PercetualNetworkType):
if network_type.lower() not in list(PerceptualNetworkType):
raise ValueError(
"Unrecognised criterion entered for Adversarial Loss. Must be one in: %s"
% ", ".join(PercetualNetworkType)
% ", ".join(PerceptualNetworkType)
)

if cache_dir:
Expand Down
Loading