Giter Site home page Giter Site logo

inspirai / characterize-anything Goto Github PK

View Code? Open in Web Editor NEW
11.0 4.0 4.0 23.27 MB

Characterize Anything: A Wondrous Chemical Reaction between vision models and AI Characters

License: Apache License 2.0

Shell 0.08% Python 99.92%
characters chatgpt multimodal segment-anything video-object-segmentation video-object-tracking characterize-anything large-language-models nlp vision

characterize-anything's Introduction

Characterize Anything

Imagine a world where every object around you springs to life. Meet your favorite mug of coffee, chat with your fridge, befriend your sofa.๐Ÿคฉ

Characterize Anything is an interactive tool that can bring any inanimate object in a video or image to life. This is made possible through the combined use of advanced video object tracking and segmentation technologies as well as large vision language models. With this tool, users can easily specify which object(s) they want to talk to by simple mouse clicks. Overall, Characterize Anything is an exciting and inspirational tool that offers endless possibilities for enhancing human-object interactions.

(This project is still under active development to make it into an amazing product.๐Ÿ’ช)

1) Background

There are already various Awesome-Anything projects in the community, and "characterize anything" would like to join the family.

๐Ÿ’ก How does this idea come out?

TLDR: A wondrous chemical reaction between vision language models and AI Characters

We'd like to inspire
  • We've long been fascinated by the idea of AI-driven characters / avatars (both UGC and PGC ones). Character.ai is one of the best places where you could get an interesting experience.
  • Foundation vision models (e.g., Segment Anything) are amazing
  • Foundation language models (e.g., ChatGPT) are amazing.
  • There are awesome preliminary open-source projects that we could base on (e.g., Track-Anything).
  • Inspirai inspires people.

๐ŸŒŸ What are potential applications?

TLDR: Education, Entertainment, Attraction

ChatGPT has a lot to say!
Well, we ask ChatGPT to help us with the answer (Basically we ask it to write advertisement for the concept).
  • ToC: For kids

ChatGPT: Are your kids curious little explorers, always eager to learn about new things? Well, have no fear, because "characterize anything" is here! Your kiddos can now chat it up with any object they want to learn about, ask all their burning questions, and maybe even make some new pals along the way. Imagination and curiosity will reach an all-time high with this awesome concept. So who knows? Maybe your child will even become besties with the living room lamp or have a heart-to-heart with the kitchen sink. The possibilities are endless!

  • ToC: For Adults

Checkout some videos for fun: Youtube | If Objects Could Talk!? | Brent Rivera

ChatGPT: Grown-ups, are you tired of the same old boring conversations with inanimate objects? Do you dread talking to your houseplants because they never seem to talk back? Well, fear not! The amazing concept of "characterize anything" is not just for kids anymore. Yes, you can now have meaningful conversations with your favorite household items or even your car. Did you ever think you'd bond with your fridge over your mutual love of cheese? Or have a heated debate with your computer about which is better, Apple or Windows? The possibilities are endless, and with "characterize anything," you'll never feel alone in a room again. So go ahead, channel your inner child and start talking to your lamp. You might just learn something new about each other.

  • ToB

ChatGPT: Attention! Are you tired of the same old boring sales and marketing pitches? Do you want to revolutionize the way you connect with your customers? Look no further than "characterize anything"! With this unique concept, you can bring your products and services to life in a whole new way. Imagine your customers being able to engage in conversations with your products, asking questions, and getting to know them on a deeper level. Your products will no longer be just inanimate objects, but characters with personalities and stories to share. Plus, this innovative approach to customer engagement is sure to set your business apart from the competition. So why not give "characterize anything" a try and let your customers get to know your products like never before? They'll be hooked in no time!

2) Demo

We currently offer two types of demos based on Gradio:

  1. Interactive Static Demo

    • You can input an image and select the object you want to converse with. Once you've made your selection, you can start the conversation.
    • If you wish to converse with another object, simply click on it and the conversation will restart.
  2. Self-Chat Video Demo

    • You can input a video and select at least two objects that you would like to bring to life (at the first frame). ChatGPT will then imagine a conversation between the selected objects in a creative way.
    • The output would be the original video with dialogue lines added and stick to objects

2.1) Interactive Static Demo

English Chinese

2.2) Self-Chat Video Demo

English Demo Chinese Demo
sample2_en.mp4
sample2_zh.mp4

3) System Architecture

The self-chat demo pipeline is illustrated as follows:

The self-chat video pipeline comprises several steps including:

  • Input: A video that contains the desired objects.
  • Visual Control: Users clicking on objects that will participate in character conversations.
  • Caption Anything: Generating different levels of image captions for the first video frame.
  • ChatGPT: Generating a creative conversation between characters based on the generated captions.
  • Track Anything: Conducting video tracking and segmentation based on the SAM and XMem models.
  • Output: The original video, but with dialogue lines added and attached to the relevant objects.

3.1) Limitations

Below are some major limitations that we would like to highlight:

  • Pipeline complexity

    Our current pipeline comprises multiple projects and models, and is already quite complex. It may not be entirely end-to-end.

  • Absence of shot change handling

    Our system only supports simple scenarios where objects remain largely unchanged in a video. However, it is quite common in real-life scenarios to have multiple shot changes in a video. In such cases, shot change detection and image caption regeneration may be required.

  • Need for manual controls

    At present, certain aspects of the system still require manual controls. For example, the duration of each conversation turn is manually set (i.e., based on the number of frames involved), rather than being automatically determined. Additionally, the location of dialogue contents (e.g., text appearing above objects) is manually set.

4) ๐ŸŽ“ Tutorials

4.1) Get Started

git clone [email protected]:inspirai/Characterize-Anything.git
cd Characterize-Anything

# Install dependencies: 
conda env create -f environment.yml

# Run the Characterize-Anything gradio demo.
python characterize_anything_app.py --device cuda:0 --port xx  # (video: self chat mode)
python characterize_anything_image_app.py --device cuda:0 --port xx  # (image: interactive chat mode)

# --sam_model_type vit_b 
    # for lower memory usage
# --checkpoints_dir local_dir 
    # for local checkpoints directory which contains the following ckpts:
        # - sam_vit_h_4b8939.pth (https://dl.fbaipublicfiles.com/segment_anything/sam_vit_h_4b8939.pth)
        # - XMem-s012.pth (https://github.com/hkchengrex/XMem/releases/download/v1.0/XMem-s012.pth)
        # - E2FGVI-HQ-CVPR22.pth (https://drive.google.com/uc?id=10wGdKSUOie0XmCr8SQ2A2FeDe-mfn5w3)

4.2) Recipes

We'd like to share some experiences that are more or less related to our project.

5) Acknowledgement

We appreciate the open source of the following preliminary projects:

  • Segment Anything is a strong segmentation foundation model that supports diverse prompts.

  • Track Anything combines SAM with XMem for high-performance object tracking and segmentation in videos.

  • Caption Anything combines SAM with vision language models in order to caption any object.

Also, we used Midjourney for creating our Pixar-style logo image ๐Ÿค— We thank Pixar for their incredible animation movies!

characterize-anything's People

Contributors

findmyway avatar loofahcus avatar mrzjy avatar yguo33 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  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.