Coder Social home page Coder Social logo

Comments (3)

xinyu1205 avatar xinyu1205 commented on July 17, 2024

Hi, for recognize open-set of tags, you can refer to "RAM Inference on Unseen Categories (Open-Set)" in README.md.
And thank you for providing such a concise and amazing code reference, and we will consider implementing this in the feature.
Best regards!

from recognize-anything.

majinyu666 avatar majinyu666 commented on July 17, 2024

Hi there,

Firstly, fantastic work and thank you for sharing!

Second, do you mind providing a small code example to recognize an open-set of tags?

Eg.

from ram import get_transform, inference_ram, inference_tag2text
from ram.models import ram, tag2text_caption

ram_model = ram(pretrained=ram_checkpoint, image_size=image_size, vit='swin_l').eval().to(device)

# Setup image
image = ... 

# Custom tags
tags = ["house", "car", "pig"] 

# Perform inference
result = inference_ram(model, image, custom_tags)

Hi, with PR #63 now you can set up custom dataset, whether for open-set or not. Please refer to the "Batch Inference and Evaluation" section of readme, and set up dataset following datasets/openimages-rare-200.

Here are main steps of setting up datasets:

  1. mkdir datasets/my_dataset/.

  2. ln -s /path/to/image_folder datasets/my_dataset/imgs.

  3. Create tag list datasets/my_dataset/my_dataset_ram_taglist.txt. This is where you put any custom tags. (But for closed-set, these tags should be subset of the label system, i.e., subset of ram/data/tam_tag_list.txt.)

    my_tag_1
    my_tag_2
    my_tag_3
    
  4. Create image list datasets/my_dataset/my_dataset_ram_annots.txt. Ignore annots if you don't care about metrics.

    subfolder1/subfolder2/aaa.jpg
    subfolder1/subfolder2/bbb.jpg,my_tag_2,my_tag_3
    

from recognize-anything.

SeeknnDestroy avatar SeeknnDestroy commented on July 17, 2024

hi @majinyu666, @xinyu1205,

I want to create my custom dataset for tag2text batch inference. But I saw that it has different format, tagidlist.txt and idannots.txt. Can you please show an example for each, what they refer to?

from recognize-anything.

Related Issues (20)

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.