Skip to content

MUSIQ metric needs to be added with a PyTorch module #13

@ethanweber

Description

@ethanweber

I used a TensorFlow model for the MUSIQ metric which is difficult to install. We should find a better one with PyTorch and update this part of the code to work properly.

# scores = []
# for i in range(bs):
# image = preds[i].permute(1, 2, 0)
# img = Image.fromarray((image.detach().cpu().numpy() * 255).astype("uint8"))
# image_bytes = io.BytesIO()
# img.save(image_bytes, format="PNG")
# image_bytes = image_bytes.getvalue()
# x = tf.constant(image_bytes)
# assert x.device.endswith("GPU:0")
# aesthetic_score = self.predict_fn(x)
# score = float(tf.squeeze(aesthetic_score["output_0"]).numpy())
# scores.append(score)
# scores = torch.tensor(scores)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions