Code Monkey home page Code Monkey logo

Comments (8)

xuanbinh-nguyen96 avatar xuanbinh-nguyen96 commented on September 22, 2024

Hi!
I regret not being able to provide feature extraction code because our proposal does not use any feature as input. We simply resized all the images to the suitable size (84x84 for maml and 128x128 for ae) and saved them as one file. If you want to work with your dataset, please resize them and use the pre-trained models we provided to extract the features you want.

from miccai21_mmq.

tangxiaochu123230 avatar tangxiaochu123230 commented on September 22, 2024

do not you subtract mean and divide std. I cannot preduce your result

from miccai21_mmq.

xuanbinh-nguyen96 avatar xuanbinh-nguyen96 commented on September 22, 2024

simply you open the image with the PIL library, resize and convert to the torch tensor, then divide them directly by 255.

from miccai21_mmq.

xuanbinh-nguyen96 avatar xuanbinh-nguyen96 commented on September 22, 2024
from PIL import Image
img_size = [128, 128]
transform = transforms.Compose([lambda x: Image.open(x).convert('L'),
                                         transforms.Resize(img_size),
                                         transforms.ToTensor(),
                                lambda x: x/255.])

from miccai21_mmq.

tangxiaochu123230 avatar tangxiaochu123230 commented on September 22, 2024

thanks you very much [code.]

微信图片_20220812165234
687189170287429743

on rad datset,we get very different feature

from miccai21_mmq.

tangxiaochu123230 avatar tangxiaochu123230 commented on September 22, 2024

if i do not use lambda x: x/255..it may be more closer

from miccai21_mmq.

xuanbinh-nguyen96 avatar xuanbinh-nguyen96 commented on September 22, 2024

I double checked and noticed there is a bit of a mistake here. Very sorry for this.
For our proposed dataset - PathVQA:

  • for maml (size 84x84), run:
    • Step 1 (resize all image by PIL with LANCZOS), run:
import os

from PIL import Image

path_to_images = 'pathVQA/images'

all_images = []

# Resize images
for r, d, f in os.walk(path_to_images):
    for file in f:
        if '.jpg' in file:
            all_images.append(os.path.join(r, file))

for i, image_file in enumerate(all_images):
    im = Image.open(image_file)
    im = im.resize((84, 84), resample=Image.LANCZOS)
    im.save(image_file)
    if i % 500 == 0:
        print(i)

Step 2, using the bellow "transform" on the images processed in step 1.

img_size = [84, 84]
transform = transforms.Compose([lambda x: Image.open(x).convert('RGB'),
                                         transforms.Resize(img_size),
                                         transforms.ToTensor(),
                                         transforms.Normalize((0.485, 0.456, 0.406), (0.229, 0.224, 0.225))
                                         ])
  • for ae (size 128x128), run:
    • Step 1 (resize all image by PIL with LANCZOS), run:
import os

from PIL import Image

path_to_images = 'pathVQA/images'

all_images = []

# Resize images
for r, d, f in os.walk(path_to_images):
    for file in f:
        if '.jpg' in file:
            all_images.append(os.path.join(r, file))

for i, image_file in enumerate(all_images):
    im = Image.open(image_file)
    im = im.resize((128, 128), resample=Image.LANCZOS)
    im.save(image_file)
    if i % 500 == 0:
        print(i)

Step 2, using the bellow "transform" on the images processed in step 1.

img_size = [128, 128]
transform = transforms.Compose([lambda x: Image.open(x).convert('L'),
                                         transforms.Resize(img_size),
                                         transforms.ToTensor(),
                                         transforms.Normalize((0.485, 0.456, 0.406), (0.229, 0.224, 0.225))
                                         ])

For RAD dataset, we use dataset from https://github.com/aioz-ai/MICCAI19-MedVQA

from miccai21_mmq.

tangxiaochu123230 avatar tangxiaochu123230 commented on September 22, 2024

great,thank you very much for you patience. I want to implemet vqa, if I can skip MMQ Progress and finetune VQA Progress based on model train on RAD dataset

from miccai21_mmq.

Related Issues (16)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.