Code Monkey home page Code Monkey logo

video-text-retrieval's Introduction

HCM AI CHALLENGE 2022
Event Retrieval from Visual Data


To do task


Setup

pip install git+https://github.com/openai/CLIP.git
pip install -r requirements.txt

Download requirement files

Download requirement files for SBRET

Format Keyframes_id.json

Chứa thông tin của tất cả keyframe trong database

{"0": {
    "image_path": "Database/KeyFramesC00_V00/C00_V0000/000000.jpg",
    "list_shot_id": ["000000","000039","000079","000096","000118","000158"],

    "list_shot_path": [
      {"shot_id": "000000", "shot_path": "Database/KeyFramesC00_V00/C00_V0000/000000.jpg"},
      {"shot_id": "000039", "shot_path": "Database/KeyFramesC00_V00/C00_V0000/000039.jpg"},
      {"shot_id": "000079", "shot_path": "Database/KeyFramesC00_V00/C00_V0000/000079.jpg"},
      {"shot_id": "000096", "shot_path": "Database/KeyFramesC00_V00/C00_V0000/000096.jpg"},
      {"shot_id": "000118", "shot_path": "Database/KeyFramesC00_V00/C00_V0000/000118.jpg"},
      {"shot_id": "000158", "shot_path": "Database/KeyFramesC00_V00/C00_V0000/000158.jpg"}
    ]
  }
}

Format dict_support_model.json

{"0": {
    "image_path": 'Database/KeyFramesC00_V00/C00_V0000/000096.jpg',
    "list_shot_id": ['000000','000039','000079','000096','000118','000158']
  }
}

Format dict_img2id_path.json

Thông tin chi tiết của từng frame trong mỗi video, frame và số thứ tự của frame trong video

{
"C00_V00": {
        "C00_V0000": {
                "00000.jpg": 0, # image path của ảnh 1
                "00001.jpg" 1, # image path của ảnh 2 
                ......,
                "n.jph": n, # image path của ảnh n
                "total_image": # tổng số lượng ảnh của C00_V0000
            }
        ....
    }
....
}

Format dict_id2img_path.json

Thông tin chi tiết của từng frame trong mỗi video, frame và số thứ tự của frame trong video

{
"C00_V00": {
        "C00_V0000": {
                0: "00000.jpg", # image path của ảnh 1
                1: "00001.jpg", # image path của ảnh 2 
                ......,
                n: "n.jph", # image path của ảnh n
                "total_image": # tổng số lượng ảnh của C00_V0000
            }
        ....
    }
....
}

Hướng dẫn cách sử dụng web

python3 app.py

Sau khi chạy dòng lệnh trên thì trên URL gõ đường link sau:

Linux: http://0.0.0.0:5001/thumbnailimg?index=0

Window: http://127.0.0.1:5001/thumbnailimg?index=0

Lúc này trang web sẽ được hiển thị lên màn hình như sau:

ảnh UI

Ở mỗi tấm ảnh có 2 nút knn ở bên trái và select ở bên phải. Khi chúng ta ấn vào nút knn thì sẽ thực hiện chức năng truy vấn ảnh (tìm kiếm ảnh tương đương trong database). Lúc này sẽ xuất hiện thêm 1 tab khác show ra kết quả của truy vấn ảnh.

KNN

Nút sellect sẽ là lựa chọn ảnh đó cùng với shot ảnh của nó để ghi vào file submit

Ở phần phía trên, nút Search dùng để truy vấn text, khi ta nhập câu text query và ấn nút search thì màn hình sẽ trả ra kết quả của những hình ảnh tương đương theo câu truy vấn.

Sau khi chúng ta đã xác định xong việc lựa chọn kết quả thì bấm nút Download để thực hiện tải file submit về để submit kết quả lên hệ thống.

Cuối cùng là nhấn nút Clear để reset lại file submit dưới hệ thống và tiếp tục thực hiện cho những kết quả tiếp theo.

video-text-retrieval's People

Contributors

dotrannhattuong avatar ngoctuan1 avatar anminhhung avatar akemi0301 avatar thangquocdang avatar

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.