Skip to content

[New Sample] Add 'squim_subjective' Model Computational Graph#83

Merged
JewelRoam merged 4 commits intoPaddlePaddle:developfrom
ooooo-create:squim_subjective
Aug 5, 2025
Merged

[New Sample] Add 'squim_subjective' Model Computational Graph#83
JewelRoam merged 4 commits intoPaddlePaddle:developfrom
ooooo-create:squim_subjective

Conversation

@ooooo-create
Copy link
Contributor

@ooooo-create ooooo-create commented Aug 5, 2025

PR Category

New Sample

Description

Model: squim_subjective
Framework: Pytorch
Dependency: torchaudio
Content: 要把 graph_net.torch.extract 中 dynamic 设置为 False 才可以验证通

复现脚本,dynamic=False

import json
import torch
import torchaudio
import graph_net

if __name__ == "__main__":
    bundle = torchaudio.pipelines.SQUIM_SUBJECTIVE
    model = bundle.get_model()
    model.eval()

    batch_size = 1
    sample_rate = bundle.sample_rate
    num_seconds = 5
    num_samples = sample_rate * num_seconds
    dummy_waveform = torch.randn(batch_size, num_samples)
    dummy_reference = torch.randn(batch_size, num_samples)

    device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
    model.to(device)
    dummy_waveform = dummy_waveform.to(device)
    dummy_reference = dummy_reference.to(device)
    print(f"Using device: {device}")

    model = graph_net.torch.extract(name="squim_subjective", dynamic=False)(model)

    print("Running inference...")
    print("Input waveform shape:", dummy_waveform.shape)
    print("Input reference shape:", dummy_reference.shape)

    score = model(dummy_waveform, dummy_reference)
    
    print("Inference finished.")

@paddle-bot
Copy link

paddle-bot bot commented Aug 5, 2025

Thanks for your contribution!

@ooooo-create ooooo-create changed the title [Now Test][New Sample] Add 'squim_subjective' Model Computational Graph [New Sample] Add 'squim_subjective' Model Computational Graph Aug 5, 2025
@JewelRoam JewelRoam merged commit c6f0e21 into PaddlePaddle:develop Aug 5, 2025
3 checks passed
@ooooo-create ooooo-create deleted the squim_subjective branch September 29, 2025 09:48
JewelRoam pushed a commit to JewelRoam/GraphNet that referenced this pull request Oct 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

contributor External developers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants