File size: 2,089 Bytes
ed03434
8455fce
2027de6
dc95bd9
8455fce
2027de6
e8f61e2
8455fce
2027de6
 
8455fce
 
 
 
 
 
2027de6
 
8455fce
 
53e6c51
8455fce
 
 
 
 
 
a897be7
8455fce
 
 
dc95bd9
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import gradio
import torch
from transformers import pipeline


def summarize(doc):
    summarizer_pipeline = pipeline("summarization", model="UNIST-Eunchan/Research-Paper-Summarization-Pegasus-x-ArXiv")

    doc = r"{doc}".replace('\n', ' ')
    result = summarizer_pipeline(doc)
    return s.replace("<n>", " ")

# s = 'Given two images of different anime roles, anime style recognition (ASR) aims to learn abstract painting style to determine whether the two images are from the same work, which is an interesting but challenging problem. Unlike biometric recognition, such as face recognition, iris recognition, and person re-identification, ASR suffers from a much larger semantic gap but receives less attention. In this paper, we propose a challenging ASR benchmark. Firstly, we collect a large-scale ASR dataset (LSASRD), which contains 20,937 images of 190 anime works and each work at least has ten different roles. In addition to the large-scale, LSASRD contains a list of challenging factors, such as complex illuminations, various poses, theatrical colors and exaggerated compositions. Secondly, we design a cross-role protocol to evaluate ASR performance, in which query and gallery images must come from different roles to validate an ASR model is to learn abstract painting style rather than learn discriminative features of roles. Finally, we apply two powerful person re-identification methods, namely, AGW and TransReID, to construct the baseline performance on LSASRD. Surprisingly, the recent transformer model (i.e., TransReID) only acquires a 42.24% mAP on LSASRD. Therefore, we believe that the ASR task of a huge semantic gap deserves deep and long-term research.'

# print(' '.join(summarize(s).split()))



app = gradio.Interface(
    fn = summarize,
    inputs = gradio.Textbox(placeholder = 'Paste Here', label = 'Paper'),
    outputs = gradio.Textbox(label = 'Summary'),
    title = 'Paper Abstract Summarizer',
    description = 'A text summarizer to summarize paper abstract'
)

def main():
    app.launch(share=True)

if __name__ == '__main__':
    main()