GithubHelp home page GithubHelp logo

sbu caption dataset format about lavis HOT 6 OPEN

salesforce avatar salesforce commented on June 4, 2024
sbu caption dataset format

from lavis.

Comments (6)

dxli94 avatar dxli94 commented on June 4, 2024 5

Hi, @1024er,

Thanks for raising this. This definitely needs fixing. I'll work on this this week.

Thanks.

from lavis.

1024er avatar 1024er commented on June 4, 2024

Hi, @1024er,

Thanks for raising this. This definitely needs fixing. I'll work on this this week.

Thanks.

Has it been fixed ? thank you ~

from lavis.

dxli94 avatar dxli94 commented on June 4, 2024

Hi @1024er ,

It seems the annotations of SBU captions are not properly addressing the image directory structure in the zip.

I have now updated the downloading script to directly fetch images from urls. Though I wouldn't be surprised if some urls deprecate as they will.

Let me know how it works.

Thanks.

from lavis.

xinbowu2 avatar xinbowu2 commented on June 4, 2024

Hi, I tried the new annotation file, but I still found a lot of images were missing. I am wondering if there is a script to generate an annotations file based on available images.

from lavis.

slyviacassell avatar slyviacassell commented on June 4, 2024

Hi, I tried the new annotation file, but I still found a lot of images were missing. I am wondering if there is a script to generate an annotations file based on available images.

I've encountered the same issue. Would you mind providing the processed images via google drive? @dxli94

from lavis.

slyviacassell avatar slyviacassell commented on June 4, 2024

Hi, I tried the new annotation file, but I still found a lot of images were missing. I am wondering if there is a script to generate an annotations file based on available images.

I've encountered the same issue. Would you mind providing the processed images via google drive? @dxli94

I'll give a processing script for masking the non-valid records of sbu captions.

import tqdm
import os
nonvalid_records=[]
valid_records=[]
with open('sbu_captions/annotations/sbu.json', "r") as f:
    dset=json.load(f)
    def check_file_exists(filename,path):
        exist=os.path.exists(os.path.join(path,filename))
        return exist
    
    for ann in tqdm.tqdm(dset):
        exist=check_file_exists(ann['image'],'sbu_captions/images')
        
        if exist:
            valid_records.append(ann)
        else:
            nonvalid_records.append(ann)
    print('not valid records',len(nonvalid_records),'valid records',len(valid_records))

print("saving valid")
with open('sbu_captions/annotations/sbu_valid.json', "w") as f:
    dset=json.dump(valid_records,f)

print("saving nonvalid")
with open('sbu_captions/annotations/sbu_nonvalid.json', "w") as f:
    dset=json.dump(nonvalid_records,f)

from lavis.

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.