Row 14281
Content Data
This page contains data entry 14281 from the Axioma AXP content repository. The structured data below represents the complete record for this entry.
I think we might be misunderstanding each other. I didn't say that upsampling was a *requirement* of this process... I meant that since you are doing it during training you also have to do it during inference.
Here's a simplified version of what my inference code looks like:
def upscale_image(model, image_path, output_path): model.eval() image = Image.open(image_path).convert('YCbCr') y, cb, cr = image.split() transform = transforms.ToTensor() input_tensor = transform(y).unsqueeze(0).unsqueeze(0).float() with torch.no_grad(): output_tensor = model(input_tensor) output_image_y = output_tensor.squeeze().numpy() output_image_y = np.clip(output_image_y, 0, 1) output_image_y = (output_image_y * 255.0).astype(np.uint8) output_image = Image.merge('YCbCr', [ Image.fromarray(output_image_y), cb.resize(output_image_y.shape, Image.BICUBIC), cr.resize(output_image_y.shape, Image.BICUBIC) ]).convert('RGB') output_image.save(output_path) # Usage upscale_image(model, 'data/low_res/some_image.png', 'data/upscaled_image.png')
| Field | Value |
|---|---|
| text | I think we might be misunderstanding each other. I didn't say that upsampling was a *requirement* of this process... I meant that since you are doing it during training you also have to do it during inference. Here's a simplified version of what my inference code looks like: def upscale_image(model, image_path, output_path): model.eval() image = Image.open(image_path).convert('YCbCr') y, cb, cr = image.split() transform = transforms.ToTensor() i… |
| label | r/deeplearning |
| dataType | comment |
| communityName | r/deeplearning |
| datetime | 2024-05-20 |
| username_encoded | Z0FBQUFBQm5Lakw4b1hGZzdpZmtDREExWUNrd1VUdjM1dW1iZWE0UXhKaUo2eXJJTFZtV2FEZkxsQjdXbkFhMHNaLWMtRmV6d1ZLTXVDQTQ5LTBuakthTlo3QklrOEJZcWc9PQ== |
| url_encoded | Z0FBQUFBQm5Lak9MdVVDREdIQTdrNjFiY3h3UTNnN19HcnhqS3hqNlMxNEFFSi1DZmdCWFBzVW1IRC14U3A5RDdkWmZCM05HWjdydzEtS0RYa0N1Z0oxMVhXOXpxbDFnMEhfQWhEX2hFZ3M0VkJGdGZkTFh1YXpEY0dEQ2FXSTY4ZnBhbzNiaXBoeWVPMHdHNlA5WV92RnBYdUFSR2dOYndNT1g4MnY0M0lJVzhxa1dJTnMtOEZjNXNpNG5UVk5SdXNZbjVadGpKckNz |
Raw Record
{
"text": "I think we might be misunderstanding each other. I didn't say that upsampling was a *requirement* of this process... I meant that since you are doing it during training you also have to do it during inference.\n\nHere's a simplified version of what my inference code looks like:\n\n def upscale_image(model, image_path, output_path):\n model.eval()\n image = Image.open(image_path).convert('YCbCr')\n y, cb, cr = image.split()\n \n transform = transforms.ToTensor()\n input_tensor = transform(y).unsqueeze(0).unsqueeze(0).float()\n \n with torch.no_grad():\n output_tensor = model(input_tensor)\n \n output_image_y = output_tensor.squeeze().numpy()\n output_image_y = np.clip(output_image_y, 0, 1)\n output_image_y = (output_image_y * 255.0).astype(np.uint8)\n \n output_image = Image.merge('YCbCr', [\n Image.fromarray(output_image_y),\n cb.resize(output_image_y.shape, Image.BICUBIC),\n cr.resize(output_image_y.shape, Image.BICUBIC)\n ]).convert('RGB')\n \n output_image.save(output_path)\n \n # Usage\n upscale_image(model, 'data/low_res/some_image.png', 'data/upscaled_image.png')",
"label": "r/deeplearning",
"dataType": "comment",
"communityName": "r/deeplearning",
"datetime": "2024-05-20",
"username_encoded": "Z0FBQUFBQm5Lakw4b1hGZzdpZmtDREExWUNrd1VUdjM1dW1iZWE0UXhKaUo2eXJJTFZtV2FEZkxsQjdXbkFhMHNaLWMtRmV6d1ZLTXVDQTQ5LTBuakthTlo3QklrOEJZcWc9PQ==",
"url_encoded": "Z0FBQUFBQm5Lak9MdVVDREdIQTdrNjFiY3h3UTNnN19HcnhqS3hqNlMxNEFFSi1DZmdCWFBzVW1IRC14U3A5RDdkWmZCM05HWjdydzEtS0RYa0N1Z0oxMVhXOXpxbDFnMEhfQWhEX2hFZ3M0VkJGdGZkTFh1YXpEY0dEQ2FXSTY4ZnBhbzNiaXBoeWVPMHdHNlA5WV92RnBYdUFSR2dOYndNT1g4MnY0M0lJVzhxa1dJTnMtOEZjNXNpNG5UVk5SdXNZbjVadGpKckNz"
}
Entry Information
- Entry ID: 14281
- Repository: Axioma AXP
- Dataset: arrmlet/reddit_dataset_36
- Total Entries: 100,000