import{s as $t,o as _t}from"../chunks/scheduler.7bc62968.js";import{S as At,i as Lt,g as s,s as o,r as Y,A as Pt,h as l,f as i,c as n,j as kt,u as J,x as m,k as Ue,y as Vt,a,v as K,d as X,t as Z,w as ee,m as Ct,n as Mt}from"../chunks/index.2f8492b0.js";import{T as Tt}from"../chunks/Tip.016f38d9.js";import{H as ae}from"../chunks/Heading.14fb2476.js";function Et(te){let r;return{c(){r=Ct(`💡An amazing usecase of multimodal task is Multimodal Emotion Recognition (MER). The MER task involves recognition of emotion from two or more modalities like audio+text, text+vision, audio+vision or vision+text+audio As we discussed in the example, MER is more efficient than unimodal emotion recognition and gives clear insight into the 
emotion recognition task. Check out more on MER with this repository: https://github.com/EvelynFan/AWESOME-MER.`)},l(d){r=Mt(d,`💡An amazing usecase of multimodal task is Multimodal Emotion Recognition (MER). The MER task involves recognition of emotion from two or more modalities like audio+text, text+vision, audio+vision or vision+text+audio As we discussed in the example, MER is more efficient than unimodal emotion recognition and gives clear insight into the 
emotion recognition task. Check out more on MER with this repository: https://github.com/EvelynFan/AWESOME-MER.`)},m(d,u){a(d,r,u)},d(d){d&&i(r)}}}function Ht(te){let r;return{c(){r=Ct("💡Meta released first multimodal AI model to bind information from 6 different modalities:  images and videos, audio, text, depth, thermal, and inertial measurement units (IMUs). Check more here: https://imagebind.metademolab.com/")},l(d){r=Mt(d,"💡Meta released first multimodal AI model to bind information from 6 different modalities:  images and videos, audio, text, depth, thermal, and inertial measurement units (IMUs). Check more here: https://imagebind.metademolab.com/")},m(d,u){a(d,r,u)},d(d){d&&i(r)}}}function It(te){let r,d,u,oe,p,ne,g,Fe="Welcome to the chapter on Fusion of Text and Vision. This chapter builds the foundation for the later sections of the unit. We will explore:",se,v,Ge="<li>The notion of multimodality, and different sensory inputs humans use for efficient decision making.</li> <li>Why is it important for making innovative applications and services through which we can interact and make lives easier.</li> <li>Multimodality in context to Deep Learning, data, tasks, and models.</li> <li>Related applications like multimodal emotion recognition and multimodal search.</li>",le,w,Be="So let’s begin 🤗",me,x,re,y,Qe="A modality means a medium or a way in which something exists or is done. In our daily lives, we come across many scenarios where we have to make decisions and perform tasks. For this, we use our 5 sense organs (eyes to see, ears to hear, nose to smell, tongue to taste, and skin to touch). Based on the information from all sense organs, we assess our environment, perform tasks, and make decisions for our survival. Each of these 5 sense organs is a different modality through which information comes to us and thus the word multimodality or multimodal.",de,b,Ne="Think about this scenario for a moment, on a windy night you hear an eerie sound while you are on your bed 👻😨. You feel a bit scared, as you are unaware about the source of the sound. You try to gather some courage and check your environment but you are unable to figure this out 😱. Daringly, you turn on the lights and you find out that it was just your window which was half-opened through which the wind was blowing and making the sound in the first place 😒.",ue,k,Ye=`So what just happened here? Initially you had restricted understanding of the situation due to your limited knowledge of the environment. This limited knowledge was due to the fact because you were just relying on your ears (the eerie sound), to make sense. But as soon as you turned on the lights in the room and looked around through your eyes (added another sense organ), you had a better understanding about the whole situation. As we kept on adding modalities our understanding of the situation became better and clearer than before, for the same scenario, this suggests that adding more modalities to the same situation assist each other and improves the information content.
Even while taking this course and moving ahead, would you not like cool infographics, accompanied by video content explaining minute concepts instead of just plain textual content 😉
Here you go:`,he,T,Je='<img src="https://huggingface.co/datasets/hf-vision/course-assets/resolve/main/multimodal_fusion_text_vision/multimodal_elephant.png" alt="Multimodality Notion"/>',fe,C,Ke="<em>An infographic on multimodality and why it is important to capture the overall sense of data through different modalities. The infographic is multimodal as well (image + text).</em>",ce,M,Xe=`Many times communication between 2 people gets really awkward in textual mode, slightly improves when voices are involved but greatly improves when you are able to visualize body language and facial expressions as well. This has been studied in detail by the American Psychologist, Albert Mehrabian who stated this as the 7-38-55 rule of communication, the rule states:
“In communication, 7% of the overall meaning is conveyed through verbal mode (spoken words), 38% through voice and tone and 55% through body language and facial expressions.”`,pe,$,Ze='<img src="https://huggingface.co/datasets/hf-vision/course-assets/main/resolve/multimodal_fusion_text_vision/bigbang.jpg" alt="Funny Image + Text Meme example"/>',ge,_,et=`To be more general, in the context of AI, 7% of the meaning conveyed is through textual modality, 38% through audio modality and 55% through vision modality.
Within the context of deep learning, we would refer each modality as a way data arrives to a deep learning model for processing and predictions. The most commonly used modalities in deep learning are: vision, audio and text. Other modalities can also be considered for specific use cases like LIDAR, EEG Data, eye tracking data etc.`,ve,A,tt=`Unimodal models and datasets are purely based on a single modality, and have been studied for long with many tasks and benchmarks but are limited in their capabilities. Relying on a single modality might not give us the complete picture, and combining more modalities will increase the information content and reduce the possibility of missing cues that might be in them.
For the machines around us to be more intelligent, better at communicating with us and have enhanced interpretation and reasoning capabilities, it is important to build applications and services around models and datasets that are multimodal in nature. Because, multimodality can give us a clearer and more accurate representation of the world around us enabling us to develop applications that are closer to the real-world scenarios.`,we,L,it="<strong>Common combinations of modalities and real life examples:</strong>",xe,P,at="<li>Vision + Text : Infographics, Memes, Articles, Blogs.</li> <li>Vision + Audio: A Skype call with your friend, dyadic conversations.</li> <li>Vision + Audio + Text: Watching YouTube videos or movies with captions, social media content in general is multimodal.</li> <li>Audio + Text: Voice notes, music files with lyrics</li>",ye,V,be,E,ot="A dataset consisting of multiple modalities is a multimodal dataset. Out of the common modality combinations let us see some examples:",ke,H,nt='<li>Vision + Text: <a href="https://visionandlanguage.net/VIST/" rel="nofollow">Visual Storytelling Dataset</a>, <a href="https://visualqa.org/download.html" rel="nofollow">Visual Question Answering Dataset</a>, <a href="https://laion.ai/blog/laion-5b/" rel="nofollow">LAION-5B Dataset</a>.</li> <li>Vision + Audio: <a href="https://www.robots.ox.ac.uk/~vgg/data/vggsound/" rel="nofollow">VGG-Sound Dataset</a>, <a href="https://zenodo.org/records/1188976" rel="nofollow">RAVDESS Dataset</a>, <a href="https://www.avid.wiki/Main_Page" rel="nofollow">Audio-Visual Identity Database (AVID)</a>.</li> <li>Vision + Audio + Text: <a href="https://diuf.unifr.ch/main/diva/recola/" rel="nofollow">RECOLA Database</a>, <a href="https://sail.usc.edu/iemocap/" rel="nofollow">IEMOCAP Dataset</a>.</li>',Te,I,st=`Now let us see what kind of tasks can be performed using a multimodal dataset? There are many examples, but we will focus generally on tasks that contains the visual and textual
A multimodal dataset will require a model which is able to process data from multiple modalities, such a model is a multimodal model.`,Ce,S,Me,R,lt=`Each modality has different tasks related to it, for example: vision downstream tasks contain image classification, image segmentation, object detection etc. and we would be using
models specifically designed for these tasks. So tasks and models go hand in hand. If a task involves two or more modalities then it can be termed as a multimodal task. If we consider a task in terms of inputs and outputs, a multimodal task can generally be thought of as a single input/output arrangement with two different modalities at input and output ends respectively.`,$e,j,mt="Hugging Face supports a wide variety of multimodal tasks. Let us look into some of them.",_e,D,rt="<strong>Some multimodal tasks supported by 🤗 and their variants:</strong>",Ae,W,dt="<li>Vision + Text:</li>",Le,O,ut='<li><a href="https://huggingface.co/tasks/visual-question-answering" rel="nofollow">Visual Question Answering or VQA</a>: Aiding visually impaired persons, efficient image retrieval, video search, Video Question Answering, Document VQA.</li> <li><a href="https://huggingface.co/tasks/image-to-text" rel="nofollow">Image to Text</a>: Image Captioning, Optical Character Recognition (OCR), Pix2Struct.</li> <li><a href="https://huggingface.co/tasks/text-to-image" rel="nofollow">Text to Image</a>: Image Generation</li> <li><a href="https://huggingface.co/tasks/text-to-video" rel="nofollow">Text to Video</a>: Text-to-video editing, Text-to-video search, Video Translation, Text-driven Video Prediction.</li>',Pe,h,ht="<li>Audio + Text:</li>",Ve,q,ft='<li><a href="https://huggingface.co/tasks/automatic-speech-recognition" rel="nofollow">Automatic Speech Recognition</a> (or Speech to Text): Virtual Speech Assistants, Caption Generation.</li> <li><a href="https://huggingface.co/tasks/text-to-speech" rel="nofollow">Text to Speech</a>: Voice assistants, Announcement Systems.</li>',Ee,f,He,z,ct='<img src="https://huggingface.co/datasets/hf-vision/course-assets/resolve/main/multimodal_fusion_text_vision/Multimodal.jpg" alt="Multimodal model flow"/>',Ie,U,pt=`A multimodal model, is a model that can be used to perform multimodal tasks by processing data coming from multiple modalities at the same time. These models combine the uniqueness and strengths of different modalities to make a complete representation of data enhancing the performance on multiple tasks. Multimodal models are trained to integrate and process data from sources like images, videos, text, audio etc.
The process of combining these modalities begins with multiple unimodal models. The outputs of  these unimodal models (encoded data) are then fused using a strategy by the fusion module. The strategy of fusion can be early fusion, late fusion or hybrid fusion. The overall task of the fusion module is to make a combined representation of the encoded data from the unimodal models. Finally, a classification network takes up the fused representation to make predictions.`,Se,F,gt="A detailed section on multimodal tasks and models with a focus on Vision and Text, will be discussed in the next chapter.",Re,G,je,B,vt=`Internet search was the one key advantage Google had, but with the introduction of ChatGPT by OpenAI, Microsoft started out with
powering up their Bing search engine so that they can crush the competition. It was only restricted initially to LLMs, looking into large corpus of text data but the world around us, mainly social media content, web articles and all possible form of online content is largely multimodal. When we search about an image, the image pops up with a corresponding text to describe it. Won’t it be super cool to have another powerful multimodal model which involved both Vision and Text at the same time? This can revolutionize the search landscape hugely, and the core tech involved in this is multimodal learning. We know that many companies also have a large database which is multimodal and mostly unstructured in nature. Multimodal models might help companies with internal search, interactive documentation (chatbots), and many such use cases. This is another domain of Enterprise AI where we leverage AI for organizational intelligence.`,De,Q,wt="Vision Language Models (VLMs) are models that can understand and process both vision and text modalities. The joint understanding of both modalities lead VLMs to perform various tasks efficiently like Visual Question Answering, Text-to-image search etc. VLMs thus can serve as one of the best candidates for multimodal search. So overall, VLMs should find some way to map text and image pairs to a joint embedding space where each text-image pair is present as an embedding. We can perform various downstream tasks using these embeddings, which can also be used for search. The idea of such a joint space is that image and text embeddings that are similar in meaning will lie close together, enabling us to do searches for images based on text (text-to-image search) or vice-versa.",We,c,Oe,N,xt="After going through the fundamentals for multimodality, let’s now take a look into different multimodal tasks and models available in 🤗 and their applications via cool demos and Spaces.",qe,ie,ze;return p=new ae({props:{title:"Introduction",local:"introduction",headingTag:"h1"}}),x=new ae({props:{title:"What is multimodality? 📸📝🎵",local:"what-is-multimodality-",headingTag:"h2"}}),V=new ae({props:{title:"Multimodal Datasets",local:"multimodal-datasets",headingTag:"h2"}}),S=new ae({props:{title:"Multimodal Tasks and Models",local:"multimodal-tasks-and-models",headingTag:"h2"}}),f=new Tt({props:{$$slots:{default:[Et]},$$scope:{ctx:te}}}),G=new ae({props:{title:"An application of multimodality: Multimodal Search 🔎📲💻",local:"an-application-of-multimodality-multimodal-search-",headingTag:"h2"}}),c=new Tt({props:{$$slots:{default:[Ht]},$$scope:{ctx:te}}}),{c(){r=s("meta"),d=o(),u=s("p"),oe=o(),Y(p.$$.fragment),ne=o(),g=s("p"),g.textContent=Fe,se=o(),v=s("ul"),v.innerHTML=Ge,le=o(),w=s("p"),w.textContent=Be,me=o(),Y(x.$$.fragment),re=o(),y=s("p"),y.textContent=Qe,de=o(),b=s("p"),b.textContent=Ne,ue=o(),k=s("p"),k.textContent=Ye,he=o(),T=s("p"),T.innerHTML=Je,fe=o(),C=s("p"),C.innerHTML=Ke,ce=o(),M=s("p"),M.textContent=Xe,pe=o(),$=s("p"),$.innerHTML=Ze,ge=o(),_=s("p"),_.textContent=et,ve=o(),A=s("p"),A.textContent=tt,we=o(),L=s("p"),L.innerHTML=it,xe=o(),P=s("ul"),P.innerHTML=at,ye=o(),Y(V.$$.fragment),be=o(),E=s("p"),E.textContent=ot,ke=o(),H=s("ul"),H.innerHTML=nt,Te=o(),I=s("p"),I.textContent=st,Ce=o(),Y(S.$$.fragment),Me=o(),R=s("p"),R.textContent=lt,$e=o(),j=s("p"),j.textContent=mt,_e=o(),D=s("p"),D.innerHTML=rt,Ae=o(),W=s("ol"),W.innerHTML=dt,Le=o(),O=s("ul"),O.innerHTML=ut,Pe=o(),h=s("ol"),h.innerHTML=ht,Ve=o(),q=s("ul"),q.innerHTML=ft,Ee=o(),Y(f.$$.fragment),He=o(),z=s("p"),z.innerHTML=ct,Ie=o(),U=s("p"),U.textContent=pt,Se=o(),F=s("p"),F.textContent=gt,Re=o(),Y(G.$$.fragment),je=o(),B=s("p"),B.textContent=vt,De=o(),Q=s("p"),Q.textContent=wt,We=o(),Y(c.$$.fragment),Oe=o(),N=s("p"),N.textContent=xt,qe=o(),ie=s("p"),this.h()},l(e){const t=Pt("svelte-u9bgzb",document.head);r=l(t,"META",{name:!0,content:!0}),t.forEach(i),d=n(e),u=l(e,"P",{}),kt(u).forEach(i),oe=n(e),J(p.$$.fragment,e),ne=n(e),g=l(e,"P",{"data-svelte-h":!0}),m(g)!=="svelte-1iyniya"&&(g.textContent=Fe),se=n(e),v=l(e,"UL",{"data-svelte-h":!0}),m(v)!=="svelte-w6qdms"&&(v.innerHTML=Ge),le=n(e),w=l(e,"P",{"data-svelte-h":!0}),m(w)!=="svelte-gnkbgl"&&(w.textContent=Be),me=n(e),J(x.$$.fragment,e),re=n(e),y=l(e,"P",{"data-svelte-h":!0}),m(y)!=="svelte-1u991ft"&&(y.textContent=Qe),de=n(e),b=l(e,"P",{"data-svelte-h":!0}),m(b)!=="svelte-1pjtgza"&&(b.textContent=Ne),ue=n(e),k=l(e,"P",{"data-svelte-h":!0}),m(k)!=="svelte-p9vk4k"&&(k.textContent=Ye),he=n(e),T=l(e,"P",{"data-svelte-h":!0}),m(T)!=="svelte-1h3bmko"&&(T.innerHTML=Je),fe=n(e),C=l(e,"P",{"data-svelte-h":!0}),m(C)!=="svelte-1c2eqjh"&&(C.innerHTML=Ke),ce=n(e),M=l(e,"P",{"data-svelte-h":!0}),m(M)!=="svelte-16d6aha"&&(M.textContent=Xe),pe=n(e),$=l(e,"P",{"data-svelte-h":!0}),m($)!=="svelte-1nrybsm"&&($.innerHTML=Ze),ge=n(e),_=l(e,"P",{"data-svelte-h":!0}),m(_)!=="svelte-2y62d2"&&(_.textContent=et),ve=n(e),A=l(e,"P",{"data-svelte-h":!0}),m(A)!=="svelte-10jkjvr"&&(A.textContent=tt),we=n(e),L=l(e,"P",{"data-svelte-h":!0}),m(L)!=="svelte-1hvaac6"&&(L.innerHTML=it),xe=n(e),P=l(e,"UL",{"data-svelte-h":!0}),m(P)!=="svelte-w92k4b"&&(P.innerHTML=at),ye=n(e),J(V.$$.fragment,e),be=n(e),E=l(e,"P",{"data-svelte-h":!0}),m(E)!=="svelte-yev3hc"&&(E.textContent=ot),ke=n(e),H=l(e,"UL",{"data-svelte-h":!0}),m(H)!=="svelte-1qij1lr"&&(H.innerHTML=nt),Te=n(e),I=l(e,"P",{"data-svelte-h":!0}),m(I)!=="svelte-1y68ykp"&&(I.textContent=st),Ce=n(e),J(S.$$.fragment,e),Me=n(e),R=l(e,"P",{"data-svelte-h":!0}),m(R)!=="svelte-w1q3g9"&&(R.textContent=lt),$e=n(e),j=l(e,"P",{"data-svelte-h":!0}),m(j)!=="svelte-hfe0q2"&&(j.textContent=mt),_e=n(e),D=l(e,"P",{"data-svelte-h":!0}),m(D)!=="svelte-1gv11r6"&&(D.innerHTML=rt),Ae=n(e),W=l(e,"OL",{"data-svelte-h":!0}),m(W)!=="svelte-1qe4us9"&&(W.innerHTML=dt),Le=n(e),O=l(e,"UL",{"data-svelte-h":!0}),m(O)!=="svelte-1t47cw1"&&(O.innerHTML=ut),Pe=n(e),h=l(e,"OL",{start:!0,"data-svelte-h":!0}),m(h)!=="svelte-1k5rt4s"&&(h.innerHTML=ht),Ve=n(e),q=l(e,"UL",{"data-svelte-h":!0}),m(q)!=="svelte-12pwjv0"&&(q.innerHTML=ft),Ee=n(e),J(f.$$.fragment,e),He=n(e),z=l(e,"P",{"data-svelte-h":!0}),m(z)!=="svelte-s2acs8"&&(z.innerHTML=ct),Ie=n(e),U=l(e,"P",{"data-svelte-h":!0}),m(U)!=="svelte-1xx3ryf"&&(U.textContent=pt),Se=n(e),F=l(e,"P",{"data-svelte-h":!0}),m(F)!=="svelte-1m3suzu"&&(F.textContent=gt),Re=n(e),J(G.$$.fragment,e),je=n(e),B=l(e,"P",{"data-svelte-h":!0}),m(B)!=="svelte-msjj5c"&&(B.textContent=vt),De=n(e),Q=l(e,"P",{"data-svelte-h":!0}),m(Q)!=="svelte-1ujb0ci"&&(Q.textContent=wt),We=n(e),J(c.$$.fragment,e),Oe=n(e),N=l(e,"P",{"data-svelte-h":!0}),m(N)!=="svelte-1ezlpbr"&&(N.textContent=xt),qe=n(e),ie=l(e,"P",{}),kt(ie).forEach(i),this.h()},h(){Ue(r,"name","hf:doc:metadata"),Ue(r,"content",St),Ue(h,"start","2")},m(e,t){Vt(document.head,r),a(e,d,t),a(e,u,t),a(e,oe,t),K(p,e,t),a(e,ne,t),a(e,g,t),a(e,se,t),a(e,v,t),a(e,le,t),a(e,w,t),a(e,me,t),K(x,e,t),a(e,re,t),a(e,y,t),a(e,de,t),a(e,b,t),a(e,ue,t),a(e,k,t),a(e,he,t),a(e,T,t),a(e,fe,t),a(e,C,t),a(e,ce,t),a(e,M,t),a(e,pe,t),a(e,$,t),a(e,ge,t),a(e,_,t),a(e,ve,t),a(e,A,t),a(e,we,t),a(e,L,t),a(e,xe,t),a(e,P,t),a(e,ye,t),K(V,e,t),a(e,be,t),a(e,E,t),a(e,ke,t),a(e,H,t),a(e,Te,t),a(e,I,t),a(e,Ce,t),K(S,e,t),a(e,Me,t),a(e,R,t),a(e,$e,t),a(e,j,t),a(e,_e,t),a(e,D,t),a(e,Ae,t),a(e,W,t),a(e,Le,t),a(e,O,t),a(e,Pe,t),a(e,h,t),a(e,Ve,t),a(e,q,t),a(e,Ee,t),K(f,e,t),a(e,He,t),a(e,z,t),a(e,Ie,t),a(e,U,t),a(e,Se,t),a(e,F,t),a(e,Re,t),K(G,e,t),a(e,je,t),a(e,B,t),a(e,De,t),a(e,Q,t),a(e,We,t),K(c,e,t),a(e,Oe,t),a(e,N,t),a(e,qe,t),a(e,ie,t),ze=!0},p(e,[t]){const yt={};t&2&&(yt.$$scope={dirty:t,ctx:e}),f.$set(yt);const bt={};t&2&&(bt.$$scope={dirty:t,ctx:e}),c.$set(bt)},i(e){ze||(X(p.$$.fragment,e),X(x.$$.fragment,e),X(V.$$.fragment,e),X(S.$$.fragment,e),X(f.$$.fragment,e),X(G.$$.fragment,e),X(c.$$.fragment,e),ze=!0)},o(e){Z(p.$$.fragment,e),Z(x.$$.fragment,e),Z(V.$$.fragment,e),Z(S.$$.fragment,e),Z(f.$$.fragment,e),Z(G.$$.fragment,e),Z(c.$$.fragment,e),ze=!1},d(e){e&&(i(d),i(u),i(oe),i(ne),i(g),i(se),i(v),i(le),i(w),i(me),i(re),i(y),i(de),i(b),i(ue),i(k),i(he),i(T),i(fe),i(C),i(ce),i(M),i(pe),i($),i(ge),i(_),i(ve),i(A),i(we),i(L),i(xe),i(P),i(ye),i(be),i(E),i(ke),i(H),i(Te),i(I),i(Ce),i(Me),i(R),i($e),i(j),i(_e),i(D),i(Ae),i(W),i(Le),i(O),i(Pe),i(h),i(Ve),i(q),i(Ee),i(He),i(z),i(Ie),i(U),i(Se),i(F),i(Re),i(je),i(B),i(De),i(Q),i(We),i(Oe),i(N),i(qe),i(ie)),i(r),ee(p,e),ee(x,e),ee(V,e),ee(S,e),ee(f,e),ee(G,e),ee(c,e)}}}const St='{"title":"Introduction","local":"introduction","sections":[{"title":"What is multimodality? 📸📝🎵","local":"what-is-multimodality-","sections":[],"depth":2},{"title":"Multimodal Datasets","local":"multimodal-datasets","sections":[],"depth":2},{"title":"Multimodal Tasks and Models","local":"multimodal-tasks-and-models","sections":[],"depth":2},{"title":"An application of multimodality: Multimodal Search 🔎📲💻","local":"an-application-of-multimodality-multimodal-search-","sections":[],"depth":2}],"depth":1}';function Rt(te){return _t(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class qt extends At{constructor(r){super(),Lt(this,r,Rt,It,$t,{})}}export{qt as component};
