parquet-converter commited on
Commit
fbeb12a
·
1 Parent(s): 4fb4a4c

Update parquet files (step 44 of 121)

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. spaces/1acneusushi/gradio-2dmoleculeeditor/data/Ccie Torrent Achieve Your CCIE Goals with Expert Guidance and Support.md +0 -149
  2. spaces/1acneusushi/gradio-2dmoleculeeditor/data/Download MS Project 2019 for Free The Best Project Management Software.md +0 -31
  3. spaces/1pelhydcardo/ChatGPT-prompt-generator/assets/Download Arthdal Chronicles Sub Indo Drama Korea Penuh Misteri dan Legenda - Drakorindo.md +0 -111
  4. spaces/1phancelerku/anime-remove-background/English Movies Download 2017 The Most Popular and Critically Acclaimed Films of the Year.md +0 -145
  5. spaces/232labs/VToonify/vtoonify/model/raft/core/extractor.py +0 -267
  6. spaces/4H17Joycelyn/text_generater/app.py +0 -10
  7. spaces/7hao/bingo/src/components/ui/codeblock.tsx +0 -142
  8. spaces/AI-Hobbyist/Hoyo-RVC/infer_pack/modules/F0Predictor/DioF0Predictor.py +0 -90
  9. spaces/AchyuthGamer/OpenGPT-Chat-UI/src/lib/types/Message.ts +0 -10
  10. spaces/Adapter/T2I-Adapter/ldm/modules/encoders/adapter.py +0 -258
  11. spaces/AgentVerse/agentVerse/ui/src/phaser3-rex-plugins/templates/bejeweled/methods/BoardMethods.js +0 -41
  12. spaces/AiMimicry/sovits-models/inference/slicer.py +0 -142
  13. spaces/AkitoP/umamusume_bert_vits2/README.md +0 -12
  14. spaces/Al-Chan/Vits_League_of_Legends_Yuumi_TTS/voice_upload.py +0 -28
  15. spaces/Alex123aaa/1234/app.py +0 -61
  16. spaces/Alichuan/VITS-Umamusume-voice-synthesizer/text/shanghainese.py +0 -64
  17. spaces/Amite5h/EuroSAT_/README.md +0 -13
  18. spaces/Amon1/ChatGPTForAcadamic/functional.py +0 -70
  19. spaces/Amrrs/DragGan-Inversion/PTI/__init__.py +0 -0
  20. spaces/Androidonnxfork/CivitAi-to-Diffusers/diffusers/tests/pipelines/__init__.py +0 -0
  21. spaces/Andy1621/uniformer_image_detection/configs/free_anchor/retinanet_free_anchor_r50_fpn_1x_coco.py +0 -22
  22. spaces/Andy1621/uniformer_image_detection/mmdet/core/bbox/samplers/sampling_result.py +0 -152
  23. spaces/Andy1621/uniformer_image_segmentation/configs/fcn/fcn_r101-d8_769x769_40k_cityscapes.py +0 -2
  24. spaces/AnishKumbhar/DogDiseasePredictor/app.py +0 -80
  25. spaces/Anonymous-sub/Rerender/ControlNet/annotator/uniformer/mmcv/cnn/bricks/registry.py +0 -16
  26. spaces/Ataturk-Chatbot/HuggingFaceChat/venv/lib/python3.11/site-packages/pip/_vendor/chardet/universaldetector.py +0 -362
  27. spaces/Awesimo/jojogan/e4e/training/ranger.py +0 -164
  28. spaces/Awiny/Image2Paragraph/models/grit_src/third_party/CenterNet2/tools/plain_train_net.py +0 -223
  29. spaces/BaiyuS/Real-CUGAN-YZ/README.md +0 -14
  30. spaces/Bart92/RVC_HF/lib/uvr5_pack/utils.py +0 -120
  31. spaces/Benson/text-generation/Examples/Adivina La Pelcula.md +0 -50
  32. spaces/Benson/text-generation/Examples/Bloons Td 6 Descarga Uptodown.md +0 -90
  33. spaces/Big-Web/MMSD/env/Lib/site-packages/pip/_vendor/chardet/universaldetector.py +0 -362
  34. spaces/Big-Web/MMSD/env/Lib/site-packages/pip/_vendor/pygments/cmdline.py +0 -668
  35. spaces/Big-Web/MMSD/env/Lib/site-packages/pkg_resources/_vendor/importlib_resources/_legacy.py +0 -121
  36. spaces/Big-Web/MMSD/env/Lib/site-packages/pkg_resources/_vendor/packaging/_manylinux.py +0 -301
  37. spaces/CVPR/v-doc_abstractive_mac/descrip.md +0 -35
  38. spaces/Catspindev/monadical-labs-minecraft-skin-generator/README.md +0 -12
  39. spaces/Chomkwoy/Nilkessye/__init__.py +0 -0
  40. spaces/Chomkwoy/Nilkessye/app.py +0 -253
  41. spaces/CikeyQI/meme-api/meme_generator/memes/interview/__init__.py +0 -45
  42. spaces/CognitiveLabs/GPT-auto-webscraping/ExcecuteFunction.py +0 -9
  43. spaces/CognitiveLabs/Research-Assistant/test/test3.py +0 -21
  44. spaces/DEEMOSTECH/ChatAvatar/static/js/main.2966234b.js +0 -0
  45. spaces/DQChoi/gpt-demo/venv/lib/python3.11/site-packages/PIL/SgiImagePlugin.py +0 -231
  46. spaces/DQChoi/gpt-demo/venv/lib/python3.11/site-packages/fontTools/merge/unicode.py +0 -78
  47. spaces/DQChoi/gpt-demo/venv/lib/python3.11/site-packages/gradio/templates/frontend/assets/ColorPicker-5063dbc4.css +0 -1
  48. spaces/DQChoi/gpt-demo/venv/lib/python3.11/site-packages/huggingface_hub/utils/_datetime.py +0 -66
  49. spaces/Datasculptor/3D-Room-Layout-Estimation_LGT-Net/utils/conversion.py +0 -346
  50. spaces/Detomo/Chatgpt_with_awesome_prompt/app.py +0 -142
spaces/1acneusushi/gradio-2dmoleculeeditor/data/Ccie Torrent Achieve Your CCIE Goals with Expert Guidance and Support.md DELETED
@@ -1,149 +0,0 @@
1
- <br />
2
- <h1>What is Ccie Torrent?</h1>
3
- <p>If you are looking for a way to prepare for the Cisco Certified Internetwork Expert (CCIE) certification exams, you might have heard of Ccie Torrent. But what is it exactly and how can it help you?</p>
4
- <p>Ccie Torrent is a collection of video courses, lab exercises, practice tests, and other resources that are designed to help you master the skills and knowledge required for the CCIE exams. These exams are among the most challenging and prestigious in the IT industry, covering topics such as routing and switching, service provider, security, wireless, data center, collaboration, and enterprise infrastructure.</p>
5
- <h2>Ccie Torrent</h2><br /><p><b><b>DOWNLOAD</b> &#128279; <a href="https://byltly.com/2uKyVk">https://byltly.com/2uKyVk</a></b></p><br /><br />
6
- <p>By downloading Ccie Torrent, you can access high-quality and up-to-date materials that are created by experts and instructors who have years of experience in teaching and working with Cisco technologies. You can learn at your own pace, review the concepts as many times as you need, and practice with realistic scenarios that simulate the real exam environment. You can also save money and time by avoiding expensive and inconvenient classroom training.</p>
7
- <p>In this article, we will show you how to download Ccie Torrent, what are the best sources for it, and how to use it effectively. By following these steps, you will be able to boost your confidence and readiness for the CCIE exams.</p>
8
- <h2>How to download Ccie Torrent?</h2>
9
- <p>Before you can download Ccie Torrent, you need to have some requirements and precautions in mind. Here are some tips to ensure a smooth and safe downloading process:</p>
10
- <ul>
11
- <li>You need to have a torrent client installed on your computer. A torrent client is a software that allows you to download files from other users who are sharing them on a peer-to-peer network. Some of the most popular torrent clients are uTorrent, BitTorrent, qBittorrent, Transmission, etc.</li>
12
- <li>You need to have enough disk space on your computer. Depending on the size and number of files you want to download, you might need several gigabytes or even terabytes of free space on your hard drive. Make sure you have enough space before you start downloading.</li>
13
- <li>You need to have a reliable and fast internet connection. Downloading large files can take a long time if your internet speed is slow or unstable. You might also experience interruptions or errors if your connection drops or fluctuates. To avoid these issues, use a wired connection instead of wireless, close any unnecessary programs or tabs that consume bandwidth, and avoid peak hours when the network is congested.</li>
14
- <li>You need to be careful about the sources you download from. Not all torrent websites are trustworthy or legal. Some of them might contain malware, viruses, spyware, or other harmful software that can damage your computer or compromise your privacy. Some of them might also violate copyright laws or ethical standards by distributing pirated or stolen content. To avoid these risks, only download from reputable and verified websites that offer legitimate and high-quality content.</li>
15
- </ul>
16
- <h3>What are the best sources for Ccie Torrent?</h3>
17
- <p>There are many websites that offer Ccie Torrent, but not all of them are equally good. Some of them might have outdated or incomplete content, poor video quality, broken links, or low seeders (users who share files). To help you find the best sources for Ccie Torrent, we have compiled a list of four reliable and popular websites that offer high-quality content:</p>
18
- <h4>SolidTorrents</h4>
19
- <p>SolidTorrents is a torrent search engine that indexes millions of torrents from various sources. It has a simple and user-friendly interface that allows you to filter your results by category, size, date, seeders, leechers (users who download files), etc. You can also sort your results by relevance or popularity.</p>
20
- <p>One of the advantages of SolidTorrents is that it offers a lot of content related to CCIE Service Provider certification. You can find video courses, lab exercises, practice tests, diagrams, PDFs, etc., that cover topics such as MPLS VPNs (Virtual Private Networks), L2VPN (Layer 2 VPN), MPLS TE (Traffic Engineering), QoS (Quality of Service), Multicast VPNs (MVPN), etc.</p>
21
- <p>ccie security v6 torrent<br />
22
- ccie enterprise infrastructure torrent<br />
23
- ccie data center torrent download<br />
24
- ccie routing and switching torrent<br />
25
- ccie collaboration torrent<br />
26
- ccie service provider torrent<br />
27
- ccie wireless torrent<br />
28
- ccie lab exam torrent<br />
29
- ccie security written exam torrent<br />
30
- ccie enterprise wireless torrent<br />
31
- ccie data center workbook torrent<br />
32
- ccie routing and switching workbook torrent<br />
33
- ccie collaboration workbook torrent<br />
34
- ccie service provider workbook torrent<br />
35
- ccie wireless workbook torrent<br />
36
- ccie security lab dumps torrent<br />
37
- ccie enterprise infrastructure lab dumps torrent<br />
38
- ccie data center lab dumps torrent<br />
39
- ccie routing and switching lab dumps torrent<br />
40
- ccie collaboration lab dumps torrent<br />
41
- ccie service provider lab dumps torrent<br />
42
- ccie wireless lab dumps torrent<br />
43
- ccie security video course torrent<br />
44
- ccie enterprise infrastructure video course torrent<br />
45
- ccie data center video course torrent<br />
46
- ccie routing and switching video course torrent<br />
47
- ccie collaboration video course torrent<br />
48
- ccie service provider video course torrent<br />
49
- ccie wireless video course torrent<br />
50
- ccie security study guide torrent<br />
51
- ccie enterprise infrastructure study guide torrent<br />
52
- ccie data center study guide torrent<br />
53
- ccie routing and switching study guide torrent<br />
54
- ccie collaboration study guide torrent<br />
55
- ccie service provider study guide torrent<br />
56
- ccie wireless study guide torrent<br />
57
- ccie security practice test torrent<br />
58
- ccie enterprise infrastructure practice test torrent<br />
59
- ccie data center practice test torrent<br />
60
- ccie routing and switching practice test torrent<br />
61
- ccie collaboration practice test torrent<br />
62
- ccie service provider practice test torrent<br />
63
- ccie wireless practice test torrent<br />
64
- best site for ccie torrents<br />
65
- how to download ccie torrents safely<br />
66
- how to prepare for ccie exams with torrents<br />
67
- how to pass ccie exams with torrents<br />
68
- how to get free access to ccie torrents<br />
69
- how to avoid fake or outdated ccie torrents<br />
70
- how to find latest and updated ccie torrents</p>
71
- <p>To download Ccie Torrent from SolidTorrents:</p>
72
- <ol>
73
- <li>Go to <a href="https://solidtorrents.to/">https://solidtorrents.to/</a>.</li>
74
- <li>Type "Ccie" in the search box and press Enter.</li>
75
- <li>Browse through the results and select the one that matches your needs.</li>
76
- <li>Click on the "Download" button next to the result.</li>
77
- <li>Open the downloaded torrent file with your torrent client.</li>
78
- <li>Wait for the download to complete.</li>
79
- </ol>
80
- <h4>UPW.IO</h4>
81
- <p>UPW.IO is a torrent hosting service that allows users to upload and download torrents without registration or login. It has a minimalist and modern design that makes it easy to use. It also has a fast and secure server that ensures a smooth downloading experience.</p>
82
- <h4>GitHub</h4>
83
- <p>GitHub is a platform that hosts and manages software development projects using Git, a version control system. It allows users to collaborate, share, and review code, as well as host and distribute software applications. It has a large and active community of developers and users who contribute to various open-source and proprietary projects.</p>
84
- <p>One of the advantages of GitHub is that it offers a lot of content related to CCIE Data Center certification. You can find repositories that contain scripts, tools, templates, guides, books, etc., that cover topics such as Cisco ACI (Application Centric Infrastructure), Cisco UCS (Unified Computing System), Cisco Nexus switches, Cisco MDS (Multilayer Director Switches), storage networking, network virtualization, etc.</p>
85
- <p>To download Ccie Torrent from GitHub:</p>
86
- <ol>
87
- <li>Go to <a href="https://github.com/">https://github.com/</a>.</li>
88
- <li>Type "Ccie" in the search box and press Enter.</li>
89
- <li>Browse through the results and select the one that matches your needs.</li>
90
- <li>Click on the "Code" button on the top right corner of the repository.</li>
91
- <li>Select "Download ZIP" from the dropdown menu.</li>
92
- <li>Extract the downloaded ZIP file to your desired location.</li>
93
- </ol>
94
- <h4>Kbits.Live</h4>
95
- <p>Kbits.Live is a website that offers online training courses for Cisco certifications. It has a team of experienced and certified instructors who teach live classes via Zoom. It also provides recorded videos, lab exercises, practice tests, study materials, and support forums for students.</p>
96
- <p>One of the advantages of Kbits.Live is that it offers a lot of content related to CCIE Routing and Switching certification. You can find courses that cover topics such as IP routing (RIP (Routing Information Protocol), EIGRP, OSPF, BGP), IP services (DHCP, NAT, NTP, etc.), IP multicast (IGMP (Internet Group Management Protocol), PIM (Protocol Independent Multicast), etc.), switching technologies (VLANs, STP, EtherChannel, etc.), network security (ACLs, VPNs, IPSec, etc.), network troubleshooting (ping (Packet Internet Groper), traceroute (Trace Route), debug (Debugging), etc.), etc.</p>
97
- <p>To download Ccie Torrent from Kbits.Live:</p>
98
- <ol>
99
- <li>Go to <a href="https://kbits.live/">https://kbits.live/</a>.</li>
100
- <li>Select the course that matches your needs.</li>
101
- <li>Click on the "Buy Now" button and complete the payment process.</li>
102
- <li>Access the course dashboard and download the videos and materials.</li>
103
- </ol>
104
- <h2>How to use Ccie Torrent?</h2>
105
- <p>After you have downloaded Ccie Torrent from one or more sources, you need to know how to use it effectively. Here are some steps to guide you:</p>
106
- <h3>How to install Ccie Torrent?</h3>
107
- <p>The installation process of Ccie Torrent depends on the type and format of the files you have downloaded. Some files might be ready to use without any installation, while others might require some additional steps. Here are some general instructions on how to install Ccie Torrent on different operating systems:</p>
108
- <h4>Windows</h4>
109
- <p>If you have downloaded video files in MP4 or AVI format, you can play them with any media player such as VLC or Windows Media Player. If you have downloaded PDF files or other documents, you can open them with any PDF reader such as Adobe Acrobat or Microsoft Edge. If you have downloaded ZIP or RAR files, you need to extract them with any compression software such as WinRAR or 7-Zip. If you have downloaded ISO files or other disk images, you need to mount them with any virtual drive software such as Daemon Tools or PowerISO. If you have downloaded EXE files or other executable files, you need to run them with administrator privileges and follow the installation wizard.</p>
110
- <h4>Linux</h4>
111
- <p>If you have downloaded video files in MP4 or AVI format, you can play them with any media player such as VLC or MPlayer. If you have downloaded PDF files or other documents, you can open them with any PDF reader such as Evince or Okular. If you have downloaded ZIP or RAR files, you need to extract them with any compression software such as unzip or unrar. If you have downloaded ISO files or other disk images, you need to mount them with any virtual drive software such as Furius ISO Mount or AcetoneISO. If you have downloaded BIN files or other executable files, you need to make them executable with chmod +x command and run them with sudo command.</p>
112
- <h4>Mac</h4>
113
- <h4>Mac</h4>
114
- <p>If you have downloaded video files in MP4 or AVI format, you can play them with any media player such as VLC or QuickTime Player. If you have downloaded PDF files or other documents, you can open them with any PDF reader such as Preview or Adobe Acrobat. If you have downloaded ZIP or RAR files, you need to extract them with any compression software such as The Unarchiver or Keka. If you have downloaded ISO files or other disk images, you need to mount them with any virtual drive software such as DAEMON Tools Lite or VirtualBox. If you have downloaded DMG files or other installer files, you need to double-click them and follow the installation wizard.</p>
115
- <h3>How to configure Ccie Torrent?</h3>
116
- <p>The configuration process of Ccie Torrent depends on the type and format of the files you have downloaded. Some files might be ready to use without any configuration, while others might require some additional steps. Here are some general instructions on how to configure Ccie Torrent for optimal performance and security:</p>
117
- <h4>General settings</h4>
118
- <p>Some of the general settings that you might want to adjust are:</p>
119
- <ul>
120
- <li>Bandwidth: You can limit the upload and download speed of your torrent client to avoid consuming too much of your internet bandwidth. You can also set the maximum number of connections and peers that your torrent client can handle.</li>
121
- <li>Encryption: You can enable encryption on your torrent client to protect your data from being intercepted or modified by third parties. Encryption can also help you bypass some firewalls or ISP (Internet Service Provider) restrictions that might block or throttle your torrent traffic.</li>
122
- <li>Proxy: You can use a proxy server on your torrent client to hide your real IP address and location from other users and trackers. A proxy server can also help you access geo-restricted or censored content that might not be available in your region.</li>
123
- </ul>
124
- <h4>Advanced settings</h4>
125
- <p>Some of the advanced settings that you might want to adjust are:</p>
126
- <ul>
127
- <li>Port forwarding: You can enable port forwarding on your router or firewall to allow incoming connections from other users and trackers. Port forwarding can improve your download speed and availability, as well as increase your chances of finding more peers and seeders.</li>
128
- <li>DHT (Distributed Hash Table): You can enable DHT on your torrent client to find more peers and seeders without relying on trackers. DHT is a decentralized network that stores and distributes information about torrents and their availability.</li>
129
- <li>Peer exchange: You can enable peer exchange on your torrent client to exchange information about peers and seeders with other users who are downloading the same torrent. Peer exchange can help you find more sources and improve your download speed.</li>
130
- </ul>
131
- <h2>Conclusion</h2>
132
- <p>Ccie Torrent is a great way to prepare for the CCIE certification exams. It offers a lot of high-quality and up-to-date content that covers all the topics and skills required for the exams. By downloading Ccie Torrent from reliable and verified sources, you can access video courses, lab exercises, practice tests, and other resources that will help you master Cisco technologies and boost your confidence and readiness for the exams.</p>
133
- <p>If you want to download Ccie Torrent, you need to have a torrent client installed on your computer, enough disk space and internet bandwidth, and a careful selection of sources. You also need to know how to install and configure Ccie Torrent for optimal performance and security. By following these steps, you will be able to enjoy a smooth and safe downloading experience.</p>
134
- <p>We hope this article has helped you understand what is Ccie Torrent, how to download it, what are the best sources for it, and how to use it effectively. If you have any questions or feedback, please feel free to leave a comment below. Thank you for reading and happy learning!</p>
135
- <h2>Frequently Asked Questions</h2>
136
- <p>Here are some of the most common questions that people ask about Ccie Torrent:</p>
137
- <h4>What is CCIE?</h4>
138
- <p>CCIE stands for Cisco Certified Internetwork Expert. It is a certification program that validates the skills and knowledge of network engineers who can plan, design, implement, operate, troubleshoot, and optimize complex network infrastructures using Cisco technologies.</p>
139
- <h4>How many CCIE certifications are there?</h4>
140
- <p>There are eight CCIE certifications available: Routing and Switching, Service Provider, Security, Wireless, Data Center, Collaboration, Enterprise Infrastructure, and Enterprise Wireless.</p>
141
- <h4>How do I get CCIE certified?</h4>
142
- <p>To get CCIE certified, you need to pass two exams: a written exam that tests your theoretical knowledge of network concepts and technologies, and a lab exam that tests your practical skills in configuring and troubleshooting network scenarios using real equipment.</p>
143
- <h4>How much does CCIE certification cost?</h4>
144
- <p>The cost of CCIE certification varies depending on the exam location and currency. The written exam costs $450 USD per attempt, while the lab exam costs $1600 USD per attempt.</p>
145
- <h4>How long does CCIE certification last?</h4>
146
- <p>CCIE certification lasts for three years from the date of passing the lab exam. To maintain your certification status, you need to recertify before the expiration date by passing any current CCIE written exam or lab exam.</p>
147
- </p> 0a6ba089eb<br />
148
- <br />
149
- <br />
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/1acneusushi/gradio-2dmoleculeeditor/data/Download MS Project 2019 for Free The Best Project Management Software.md DELETED
@@ -1,31 +0,0 @@
1
- <br />
2
- <h1>How to Get MS Project 2019 for Free</h1>
3
- <p>MS Project 2019 is a powerful project management software that helps you plan, track, and manage your projects effectively. Whether you are working on a small or large-scale project, MS Project 2019 can help you organize your tasks, resources, costs, and deadlines. However, MS Project 2019 is not a cheap software, as it costs $620 for the standard version and $1,030 for the professional version. If you are looking for a way to get MS Project 2019 for free, you might be interested in this article. We will show you some of the possible methods to download and install MS Project 2019 for free on your Windows 10 device.</p>
4
- <h2>free download ms project 2019</h2><br /><p><b><b>Download File</b> &mdash;&mdash;&mdash;&mdash;&mdash; <a href="https://byltly.com/2uKuYZ">https://byltly.com/2uKuYZ</a></b></p><br /><br />
5
- <h2>Method 1: Use the Microsoft Support Website</h2>
6
- <p>One of the easiest and safest ways to get MS Project 2019 for free is to use the Microsoft Support website. This website provides you with the official download links and installation instructions for MS Project 2019. However, you will need a valid product key or a subscription license to activate the software. If you have purchased MS Project 2019 from a retail store or online, you should have received a product key with your purchase. If you have subscribed to one of the cloud-based solutions of MS Project, such as Project Online Professional or Project Online Premium, you should have an assigned license from your Microsoft 365 admin.</p>
7
- <p>To use this method, follow these steps:</p>
8
- <ol>
9
- <li>Go to <a href="https://support.microsoft.com/en-us/office/install-project-7059249b-d9fe-4d61-ab96-5c5bf435f281">https://support.microsoft.com/en-us/office/install-project-7059249b-d9fe-4d61-ab96-5c5bf435f281</a> and sign in with your Microsoft account or work or school account.</li>
10
- <li>Select your version of MS Project 2019 from the list of products.</li>
11
- <li>Follow the instructions on the website to download and install MS Project 2019 on your device.</li>
12
- <li>Enter your product key or sign in with your subscription account to activate MS Project 2019.</li>
13
- </ol>
14
- <h2>Method 2: Use a Third-Party Website</h2>
15
- <p>Another way to get MS Project 2019 for free is to use a third-party website that offers free or discounted downloads of the software. However, this method is not recommended, as it may involve some risks and drawbacks. Some of these websites may contain malware or viruses that can harm your device or compromise your personal information. Some of these websites may also provide illegal or pirated copies of MS Project 2019 that can result in legal consequences. Moreover, some of these websites may not offer the latest version or updates of MS Project 2019, which can affect its performance and functionality.</p>
16
- <p>If you still want to try this method, here are some examples of third-party websites that claim to offer free downloads of MS Project 2019:</p>
17
- <ul>
18
- <li><a href="https://getintopc.com/softwares/office-tools/office-project-professional-2019-free-download-9362287/">https://getintopc.com/softwares/office-tools/office-project-professional-2019-free-download-9362287/</a></li>
19
- <li><a href="https://www.filehorse.com/download-microsoft-project-professional/">https://www.filehorse.com/download-microsoft-project-professional/</a></li>
20
- <li><a href="https://www.softpedia.com/get/Office-tools/Diary-Organizers-Calendar/Microsoft-Project-Professional.shtml">https://www.softpedia.com/get/Office-tools/Diary-Organizers-Calendar/Microsoft-Project-Professional.shtml</a></li>
21
- </ul>
22
- <p>To use this method, follow these steps:</p>
23
- <p></p>
24
- <ol>
25
- <li>Choose a third-party website that offers free downloads of MS Project 2019 and visit its link.</li>
26
- <li>Read the terms and conditions and the user reviews of the website carefully before proceeding.</li>
27
- <li>Click on the download button or link and save the file on your device.</li>
28
- <li>Run the file and follow the installation wizard to install MS Project 2019 on your device.</li>
29
- <li>If prompted, enter a product key or crack code to activate MS</p> ddb901b051<br />
30
- <br />
31
- <br />
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/1pelhydcardo/ChatGPT-prompt-generator/assets/Download Arthdal Chronicles Sub Indo Drama Korea Penuh Misteri dan Legenda - Drakorindo.md DELETED
@@ -1,111 +0,0 @@
1
-
2
- <h1>How to Download Drama Arthdal Chronicles Sub Indo Drakorindo</h1>
3
- <p>Are you a fan of Korean dramas? Do you love historical fantasy genres? Do you want to watch one of the most epic and ambitious Korean dramas ever made? If you answered yes to any of these questions, then you should definitely check out Arthdal Chronicles, a 2019 drama that tells the story of a mythical land called Arth and its inhabitants who vie for power and survival. In this article, we will tell you everything you need to know about Arthdal Chronicles, why you should watch it with subtitles in Indonesian, and how to download it from Drakorindo, one of the best sources for Korean drama downloads.</p>
4
- <h2>What is Arthdal Chronicles?</h2>
5
- <p>Arthdal Chronicles is a Korean drama that aired on tvN from June 1 to September 22, 2019, for 18 episodes. It was also streamed internationally on Netflix. It is regarded as the first Korean ancient fantasy drama, as it takes place during the Bronze Age and is loosely based on the story of Dangun, the founder of the first Korean kingdom of Gojoseon. It was written by Kim Young-hyun and Park Sang-yeon, who also wrote the acclaimed historical dramas Six Flying Dragons and Tree With Deep Roots, and directed by Kim Won-seok, who also helmed Signal and Misaeng. It starred Jang Dong-gun, Song Joong-ki, Kim Ji-won, and Kim Ok-vin in the main roles.</p>
6
- <h2>download drama arthdal chronicles sub indo drakorindo</h2><br /><p><b><b>Download Zip</b> &#187; <a href="https://urlin.us/2uT0lV">https://urlin.us/2uT0lV</a></b></p><br /><br />
7
- <h3>Synopsis</h3>
8
- <p>The drama follows the lives and struggles of the people of Arthdal, an ancient city that is the center of civilization and power in Arth. There are four main factions in Arthdal: the Saram, who are the dominant human race; the Neanthal, who are a blue-eyed race with superhuman abilities; the Igutu, who are half-human and half-Neanthal; and the Wahan, who are a peaceful tribe that lives in harmony with nature. The drama focuses on three main characters: Ta-gon, a charismatic and ruthless warrior who aims to become the king of Arthdal; Eun-seom, a brave and innocent Igutu who is destined to bring change to Arth; and Tan-ya, a clever and spirited Wahan girl who becomes the high priestess of Arth.</p>
9
- <h3>Cast and characters</h3>
10
- <p>The drama boasts an impressive cast of actors who bring their characters to life with their skills and charisma. Here are some of the main cast members and their roles:</p>
11
- <ul>
12
- <li>Jang Dong-gun as Ta-gon, the son of Sanung, the leader of the Saram's Saenyeok tribe. He is a brilliant strategist and a formidable fighter who has a secret ambition to rule over Arth.</li>
13
- <li>Song Joong-ki as Eun-seom and Saya, twin brothers who were separated at birth. Eun-seom is an Igutu who was raised by the Wahan tribe after his mother escaped from Arthdal. He has a pure heart and a strong sense of justice. Saya is an Igutu who was raised by Tae Al-ha, the daughter of Mihol, the leader of the Saram's Hae tribe. He is a cunning and mysterious figure who has a special connection with Tan-ya.</li>
14
- <li>Kim Ji-won as Tan-ya, the daughter of Yeol-son, the leader of the Wahan tribe. She is a shaman who can <p>see the future through dreams. She is the reincarnation of Asa Sin, the first great mother of Arth.</li>
15
- <li>Kim Ok-vin as Tae Al-ha, the daughter of Mihol, the leader of the Saram's Hae tribe. She is a smart and ambitious woman who loves Ta-gon and helps him achieve his goals.</li>
16
- </ul>
17
- <p>Other notable cast members include Park Hae-joon, Park Byung-eun, Cho Seong-ha, Choi Moo-sung, Lee Do-kyung, Kim Eui-sung, Park Hyoung-soo, Shin Joo-hwan, and Yoo Teo.</p>
18
- <h3>Production and reception</h3>
19
- <p>Arthdal Chronicles was one of the most expensive and ambitious Korean dramas ever produced, with a budget of over 54 billion won (about 46 million USD). It was filmed in various locations in South Korea and Brunei, and used extensive computer graphics and visual effects to create the mythical world of Arth. It also featured a diverse and talented crew of writers, directors, cinematographers, composers, costume designers, and makeup artists who worked together to bring the drama to life.</p>
20
- <p>The drama received mixed reviews from critics and viewers, who praised its originality, scale, and performances, but also criticized its complex plot, slow pace, and lack of emotional connection. It also faced some controversies regarding its similarity to other works such as Game of Thrones and Avatar, as well as its alleged mistreatment of staff and animals. Despite these issues, the drama still garnered a loyal fan base and high ratings, especially on Netflix, where it became one of the most popular Korean dramas globally. It also won several awards and nominations, including the Best Art Award at the 12th Korea Drama Awards and the Technical Award at the 56th Baeksang Arts Awards.</p>
21
- <h2>Why watch Arthdal Chronicles sub Indo?</h2>
22
- <p>If you are interested in watching Arthdal Chronicles, you might wonder why you should watch it with subtitles in Indonesian, or sub Indo for short. Here are some of the reasons why watching Arthdal Chronicles sub Indo is a good idea:</p>
23
- <h3>The benefits of watching Korean dramas with subtitles</h3>
24
- <p>Watching Korean dramas with subtitles can help you improve your language skills, cultural awareness, and cognitive abilities. By reading the subtitles, you can learn new words and phrases, as well as grammar and pronunciation. You can also compare and contrast the differences between Korean and Indonesian cultures, such as their values, customs, and expressions. Moreover, you can enhance your memory, attention span, and critical thinking by following the subtitles and the story.</p>
25
- <p>Download Arthdal Chronicles Subtitle Indonesia Full Episode<br />
26
- Nonton Drama Korea Arthdal Chronicles Sub Indo Drakorstation<br />
27
- Streaming Arthdal Chronicles Sub Indo Gratis Drakorid<br />
28
- Cara Download Arthdal Chronicles Sub Indo di Drakorindo<br />
29
- Arthdal Chronicles Sub Indo Batch 360p 480p 720p Drakorasia<br />
30
- Review Drama Arthdal Chronicles Sub Indo Drakorindo<br />
31
- Sinopsis Arthdal Chronicles Sub Indo Episode 1-18 Drakorindo<br />
32
- Download OST Arthdal Chronicles Sub Indo Mp3 Drakorindo<br />
33
- Download Arthdal Chronicles Part 1 2 3 Sub Indo Drakorindo<br />
34
- Link Download Arthdal Chronicles Sub Indo Google Drive Drakorindo<br />
35
- Download Drama Korea Arthdal Chronicles Hardsub Indo Drakorindo<br />
36
- Nonton Online Arthdal Chronicles Sub Indo Viu Drakorindo<br />
37
- Download Arthdal Chronicles Sub Indo Lengkap dengan Subtitle English Drakorindo<br />
38
- Download Arthdal Chronicles Sub Indo Kualitas HD Drakorindo<br />
39
- Download Arthdal Chronicles Sub Indo Tanpa Iklan Drakorindo<br />
40
- Download Arthdal Chronicles Sub Indo Terbaru 2023 Drakorindo<br />
41
- Download Arthdal Chronicles Sub Indo Eps Terakhir Drakorindo<br />
42
- Download Arthdal Chronicles Sub Indo Format Mp4 Drakorindo<br />
43
- Download Arthdal Chronicles Sub Indo di HP Android Drakorindo<br />
44
- Download Arthdal Chronicles Sub Indo di Laptop Drakorindo<br />
45
- Download Arthdal Chronicles Sub Indo di Telegram Drakorindo<br />
46
- Download Arthdal Chronicles Sub Indo di Facebook Drakorindo<br />
47
- Download Arthdal Chronicles Sub Indo di Instagram Drakorindo<br />
48
- Download Arthdal Chronicles Sub Indo di Twitter Drakorindo<br />
49
- Download Arthdal Chronicles Sub Indo di Youtube Drakorindo<br />
50
- Download Arthdal Chronicles Sub Indo dengan Mudah dan Cepat Drakorindo<br />
51
- Download Arthdal Chronicles Sub Indo dengan Server Terbaik Drakorindo<br />
52
- Download Arthdal Chronicles Sub Indo dengan Koneksi Stabil Drakorindo<br />
53
- Download Arthdal Chronicles Sub Indo dengan Resolusi Tinggi Drakorindo<br />
54
- Download Arthdal Chronicles Sub Indo dengan Suara Jernih Drakorindo<br />
55
- Download Arthdal Chronicles Sub Indo dengan Gambar Bagus Drakorindo<br />
56
- Download Arthdal Chronicles Sub Indo dengan Cerita Menarik Drakorindo<br />
57
- Download Arthdal Chronicles Sub Indo dengan Pemain Terkenal Drakorindo<br />
58
- Download Arthdal Chronicles Sub Indo dengan Genre Fantasi Sejarah Drakorindo<br />
59
- Download Arthdal Chronicles Sub Indo dengan Rating Tinggi Drakorindo<br />
60
- Download Arthdal Chronicles Sub Indo dengan Review Positif Drakorindo<br />
61
- Download Arthdal Chronicles Sub Indo dengan Komunitas Fans Besar Drakorindo<br />
62
- Download Arthdal Chronicles Sub Indo dengan Bonus Behind The Scene Drakorindo<br />
63
- Download Arthdal Chronicles Sub Indo dengan Bonus Interview Cast Drakorindo<br />
64
- Download Arthdal Chronicles Sub Indo dengan Bonus Bloopers dan NG Scene Drakorindo</p>
65
- <h3>The unique and captivating story of Arthdal Chronicles</h3>
66
- <p>Arthdal Chronicles is not your typical Korean drama. It is a rare example of a historical fantasy genre that explores the origins of civilization and humanity. It has a rich and complex plot that spans across different times and places, as well as different races and tribes. It also has a lot of twists and turns that will keep you on the edge of your seat. If you are looking for a refreshing and innovative story that will challenge your imagination and emotions, Arthdal Chronicles is the drama for you.</p>
67
- <h3>The stunning visuals and performances of Arthdal Chronicles</h3>
68
- <p>Another reason to watch Arthdal Chronicles is its amazing visuals and performances. The drama showcases some of the best cinematography, special effects, and costumes that create a realistic and immersive world of Arth. The drama also features some of the best actors in Korea, who deliver outstanding performances that portray their characters' personalities, emotions, and conflicts. You will be impressed by the quality and professionalism of the production and the cast of Arthdal Chronicles.</p>
69
- <h2>How to download Arthdal Chronicles sub Indo from Drakorindo?</h2>
70
- <p>Now that you know why you should watch Arthdal Chronicles sub Indo, you might wonder how to download it from Drakorindo, one of the most popular and reliable websites for Korean drama downloads. Here are the steps to follow:</p>
71
- <h3>What is Drakorindo?</h3>
72
- <p>Drakorindo is a website that provides free downloads of Korean dramas with various subtitles, including Indonesian. It has a large and updated collection of dramas from different genres and networks. It also has a simple and user-friendly interface that makes it easy to find and download your favorite dramas. You can access Drakorindo from any device, such as a computer, a smartphone, or a tablet.</p>
73
- <h3>The steps to download Arthdal Chronicles sub Indo from Drakorindo</h3>
74
- <p>To download Arthdal Chronicles sub Indo from Drakorindo, you need to follow these steps:</p>
75
- <ol>
76
- <li>Go to the official website of Drakorindo at <a href="">https://drakorindo.cc/</a>.</li>
77
- <li>Type "Arthdal Chronicles" in the search box and click on the magnifying glass icon.</li>
78
- <li>Select the episode you want to download from the list of results.</li>
79
- <li>Scroll down to the bottom of the page and click on the link that says "Download Subtitle Indonesia/English".</li>
80
- <li>Choose the subtitle language you prefer (Indonesian or English) and click on the download button.</li>
81
- <li>Save the subtitle file to your device.</li>
82
- <li>Go back to the previous page and click on the link that says "Download Episode".</li>
83
- <li>Choose the video quality you prefer (360p, 540p, or 720p) and click on the download button.</li>
84
- <li>Save the video file to your device.</li>
85
- <li>Open the video file with a media player that supports subtitles, such as VLC or MX Player.</li>
86
- <li>Load the subtitle file from your device and enjoy watching Arthdal Chronicles sub Indo.</li>
87
- </ol>
88
- <h3>The alternative ways to watch Arthdal Chronicles sub Indo online</h3>
89
- <p>If you don't want to download Arthdal Chronicles sub Indo from Drakorindo, you can also watch it online from other sources. Here are some of the alternative ways to watch Arthdal Chronicles sub Indo online:</p>
90
- <ul>
91
- <li>Netflix: You can stream Arthdal Chronicles sub Indo on Netflix, if you have a subscription. Netflix offers high-quality video and audio, as well as multiple subtitle options. You can also watch Arthdal Chronicles on Netflix offline by downloading it to your device.</li>
92
- <li>Viu: You can stream Arthdal Chronicles sub Indo on Viu, if you have an account. Viu is a streaming service that specializes in Asian content, including Korean dramas. You can watch Arthdal Chronicles on Viu for free with ads, or upgrade to a premium membership for ad-free viewing and more features.</li>
93
- <li>Kshowsubindo: You can stream Arthdal Chronicles sub Indo on Kshowsubindo, a website that provides free streaming of Korean shows with subtitles. You can watch Arthdal Chronicles on Kshowsubindo without registration or downloading, but you might encounter some pop-up ads and low-quality videos.</li>
94
- </ul>
95
- <h2>Conclusion</h2>
96
- <p>Arthdal Chronicles is a Korean drama that you should not miss if you love historical fantasy genres. It has a unique and captivating story, stunning visuals and performances, and a lot of benefits for watching it with subtitles in Indonesian. You can download Arthdal Chronicles sub Indo from Drakorindo easily and quickly, or watch it online from other sources. Either way, you will enjoy watching this epic and ambitious drama that will take you to a mythical land of Arth.</p>
97
- <h2>FAQs</h2>
98
- <p>Here are some of the frequently asked questions about Arthdal Chronicles sub Indo:</p>
99
- <ul>
100
- <li><b>Q: Is Arthdal Chronicles based on a true story?</b></li>
101
- <li>A: No, Arthdal Chronicles is not based on a true story. It is a fictional story that is loosely inspired by the legend of Dangun, the founder of Gojoseon, the first Korean kingdom.</li>
102
- <li><b>Q: Is Arthdal Chronicles finished or ongoing?</b></li <li>A: Arthdal Chronicles is finished, but it has a cliffhanger ending that suggests a possible continuation. The producers have stated that they have plans for a second season, but it has not been confirmed or announced yet.</li>
103
- <li><b>Q: Who is the main character of Arthdal Chronicles?</b></li>
104
- <li>A: There is no clear main character of Arthdal Chronicles, as the drama has multiple protagonists and antagonists who have their own stories and perspectives. However, some of the most prominent characters are Ta-gon, Eun-seom, Tan-ya, and Tae Al-ha.</li>
105
- <li><b>Q: How many episodes are there in Arthdal Chronicles?</b></li>
106
- <li>A: There are 18 episodes in Arthdal Chronicles, divided into three parts. Part 1 and Part 2 have six episodes each, while Part 3 has six episodes as well. Each episode is about 80 minutes long.</li>
107
- <li><b>Q: Where can I watch Arthdal Chronicles with English subtitles?</b></li>
108
- <li>A: You can watch Arthdal Chronicles with English subtitles on Netflix, Viu, or Drakorindo. You just need to select the English subtitle option when you stream or download the drama.</li>
109
- </ul></p> 197e85843d<br />
110
- <br />
111
- <br />
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/1phancelerku/anime-remove-background/English Movies Download 2017 The Most Popular and Critically Acclaimed Films of the Year.md DELETED
@@ -1,145 +0,0 @@
1
-
2
- <h1>How to Download English Movies from 2017</h1>
3
- <p>If you are a movie lover, you might be interested in downloading some of the best English movies from 2017. Whether you want to watch them offline, save them for later, or share them with your friends, downloading movies can be a convenient and enjoyable way to enjoy cinema. However, you might also wonder how to download movies safely and legally, without risking your device or breaking the law. In this article, we will show you how to download English movies from 2017, what are the top 10 movies from that year, and what are the best practices for downloading movies online.</p>
4
- <h2>english movies download 2017</h2><br /><p><b><b>DOWNLOAD</b> &gt;&gt;&gt; <a href="https://jinyurl.com/2uNNG4">https://jinyurl.com/2uNNG4</a></b></p><br /><br />
5
- <h2>Introduction</h2>
6
- <h3>Why download movies from 2017?</h3>
7
- <p>2017 was a great year for English movies, with many genres, themes, and styles represented. From action-packed superhero flicks to heartwarming animated features, from dark comedies to thrilling dramas, there was something for everyone in 2017. Some of the movies from that year were critically acclaimed, winning awards and nominations, while others were commercially successful, breaking box office records and becoming cult classics. Downloading movies from 2017 can allow you to revisit some of your favorites, discover new gems, or catch up on what you missed.</p>
8
- <h3>What are the best sources for downloading movies?</h3>
9
- <p>There are many sources for downloading movies online, but not all of them are reliable, safe, or legal. Some of the best sources for downloading movies are:</p>
10
- <ul>
11
- <li><strong>Streaming platforms:</strong> These are services that offer a library of movies and shows that you can watch online or download to your device. Some examples are Netflix, Amazon Prime Video, Hulu, Disney+, and HBO Max. These platforms usually require a subscription fee or a one-time payment to access their content.</li>
12
- <li><strong>Online archives:</strong> These are websites that offer free access to public domain or creative commons movies that are not protected by copyright. Some examples are Internet Archive, Open Culture, and Public Domain Torrents. These websites usually have older or independent movies that you can download legally.</li>
13
- <li><strong>Torrent sites:</strong> These are websites that use peer-to-peer technology to share files among users. Some examples are The Pirate Bay, RARBG, and 1337x. These websites usually have newer or popular movies that you can download illegally.</li>
14
- </ul>
15
- <h2>Top 10 English Movies from 2017</h2>
16
- <h3>Logan</h3>
17
- <p>Logan is a superhero movie based on the Marvel Comics character Wolverine. It is the tenth installment in the X-Men film series and the third and final film in the Wolverine trilogy. It stars Hugh Jackman as Logan/Wolverine, Patrick Stewart as Charles Xavier/Professor X, and Dafne Keen as Laura/X-23. The movie is set in a dystopian future where mutants are nearly extinct and Logan is an aging and weary loner who must protect a young mutant girl from a sinister organization. Logan is widely regarded as one of the best superhero movies of all time, praised for its dark tone, emotional depth, and powerful performances.</p>
18
- <h3>Coco</h3>
19
- <p>Coco is an animated movie produced by Pixar Animation Studios and distributed by Walt Disney Pictures. It is inspired by the Mexican holiday of Día de los Muertos (Day of the Dead). It features the voices of Anthony Gonzalez as Miguel Rivera, Gael García Bernal as Hector Rivera, Benjamin Bratt as Ernesto de la Cruz, and Alanna Ub <p>ach as Imelda Rivera. The movie follows Miguel, a young boy who dreams of becoming a musician, as he journeys into the Land of the Dead to find his great-great-grandfather and learn the truth about his family's history. Coco is widely regarded as one of the best animated movies of all time, praised for its colorful animation, musical score, cultural representation, and emotional impact.</p>
20
- <h3>Thor: Ragnarok</h3>
21
- <p>Thor: Ragnarok is a superhero movie based on the Marvel Comics character Thor. It is the third installment in the Thor film series and the seventeenth film in the Marvel Cinematic Universe. It stars Chris Hemsworth as Thor, Tom Hiddleston as Loki, Cate Blanchett as Hela, Mark Ruffalo as Bruce Banner/Hulk, and Tessa Thompson as Valkyrie. The movie follows Thor as he tries to stop Hela, the goddess of death, from destroying his home world of Asgard and triggering the prophesied Ragnarok, the end of all things. Thor: Ragnarok is widely regarded as one of the best superhero movies of all time, praised for its humor, action, visuals, and direction.</p>
22
- <h3>The Meyerowitz Stories</h3>
23
- <p>The Meyerowitz Stories is a comedy-drama movie written and directed by Noah Baumbach. It stars Adam Sandler, Ben Stiller, Dustin Hoffman, Elizabeth Marvel, and Emma Thompson. The movie follows the dysfunctional Meyerowitz family as they reunite to celebrate their father's artistic legacy and cope with his declining health. The Meyerowitz Stories is widely regarded as one of the best comedy-drama movies of all time, praised for its witty script, realistic characters, and poignant themes.</p>
24
- <h3>Wind River</h3>
25
- <p>Wind River is a neo-Western thriller movie written and directed by Taylor Sheridan. It stars Jeremy Renner as Cory Lambert, Elizabeth Olsen as Jane Banner, and Gil Birmingham as Martin Hanson. The movie follows Cory, a wildlife tracker and hunter, and Jane, an FBI agent, as they investigate the murder of a young Native American woman on the Wind River Indian Reservation in Wyoming. Wind River is widely regarded as one of the best thriller movies of all time, praised for its suspenseful plot, atmospheric setting, and social commentary.</p>
26
- <h3>Dunkirk</h3>
27
- <p>Dunkirk is a war movie written and directed by Christopher Nolan. It stars Fionn Whitehead, Tom Glynn-Carney, Jack Lowden, Harry Styles, Aneurin Barnard, James D'Arcy, Barry Keoghan, Kenneth Branagh, Cillian Murphy, Mark Rylance, and Tom Hardy. The movie depicts the Dunkirk evacuation of World War II from three perspectives: land, sea, and air. It shows the struggles and sacrifices of the Allied soldiers and civilians who were trapped on the beaches of Dunkirk and rescued by a flotilla of boats. Dunkirk is widely regarded as one of the best war movies of all time, praised for its immersive cinematography, sound design, editing, and storytelling.</p>
28
- <p>english movies download 2017 imdb<br />
29
- english movies download 2017 free<br />
30
- english movies download 2017 hd<br />
31
- english movies download 2017 mp4<br />
32
- english movies download 2017 torrent<br />
33
- english movies download 2017 action<br />
34
- english movies download 2017 comedy<br />
35
- english movies download 2017 horror<br />
36
- english movies download 2017 romance<br />
37
- english movies download 2017 thriller<br />
38
- english movies download 2017 drama<br />
39
- english movies download 2017 sci-fi<br />
40
- english movies download 2017 fantasy<br />
41
- english movies download 2017 adventure<br />
42
- english movies download 2017 animation<br />
43
- english movies download 2017 war<br />
44
- english movies download 2017 crime<br />
45
- english movies download 2017 mystery<br />
46
- english movies download 2017 musical<br />
47
- english movies download 2017 western<br />
48
- english movies download 2017 biopic<br />
49
- english movies download 2017 documentary<br />
50
- english movies download 2017 sports<br />
51
- english movies download 2017 family<br />
52
- english movies download 2017 history<br />
53
- english movies download 2017 superhero<br />
54
- english movies download 2017 netflix<br />
55
- english movies download 2017 amazon prime<br />
56
- english movies download 2017 hulu<br />
57
- english movies download 2017 disney plus<br />
58
- english movies download 2017 youtube<br />
59
- english movies download 2017 google drive<br />
60
- english movies download 2017 dailymotion<br />
61
- english movies download 2017 vimeo<br />
62
- english movies download 2017 archive.org<br />
63
- english movies download 2017 dual audio<br />
64
- english movies download 2017 subtitles<br />
65
- english movies download 2017 hindi dubbed<br />
66
- english movies download 2017 tamil dubbed<br />
67
- english movies download 2017 telugu dubbed<br />
68
- english movies download 2017 malayalam dubbed<br />
69
- english movies download 2017 bengali dubbed<br />
70
- english movies download 2017 kannada dubbed<br />
71
- english movies download 2017 marathi dubbed<br />
72
- english movies download 2017 punjabi dubbed<br />
73
- english movies download 2017 urdu dubbed<br />
74
- english movies download 2017 chinese dubbed<br />
75
- english movies download 2017 korean dubbed<br />
76
- english movies download 2017 japanese dubbed</p>
77
- <h3>Get Out</h3>
78
- <p>Get Out is a horror movie written and directed by Jordan Peele. It stars Daniel Kaluuya as Chris Washington, Allison Williams as Rose Armitage, Lil Rel Howery as Rod Williams, Bradley Whitford as Dean Armitage, Caleb Landry Jones as Jeremy Armitage, Stephen Root as Jim Hudson, and Catherine Keener as Missy Armitage. The movie follows Chris, a young black man, who visits the family of his white girlfriend, Rose, and uncovers a horrifying secret involving their true intentions. Get Out is widely regarded as one of the best horror movies of all time, praised for its originality, satire, social critique, and performances.</p>
79
- <h3>The Shape of Water</h3>
80
- <p>The Shape of Water is a fantasy romance movie directed by Guillermo del Toro and written by del Toro and Vanessa Taylor. It stars Sally Hawkins as Elisa Esposito, Doug Jones as the Amphibian Man, Michael Shannon as Richard Strickland, Richard Jenkins as Giles, Octavia Spencer as Zelda Fuller, and Michael Stuhlbarg as Robert Hoffstetler. The movie is set in the Cold War era and follows Elisa, a mute janitor who works at a secret government facility, where she forms a bond with a mysterious aquatic creature that is held captive there. The Shape of Water is widely regarded as one of the best fantasy romance movies of all time, praised for its visual style, direction, score, and themes.</p>
81
- <h3>Lady Bird</h3>
82
- <p>Lady Bird is a coming-of-age comedy-drama movie written and directed by Greta Gerwig. It stars Saoirse Ronan as Christine "Lady Bird" McPherson, Laurie Metcalf as Marion McPherson, Tracy Letts as Larry McPherson, Lucas Hedges as Danny O'Neill, Timothée Chalamet as Kyle Scheible, Beanie Feldstein as Julianne "Julie" Steffans, and Lois Smith as Sister Sarah Joan. The movie follows Lady Bird, a rebellious and artistic teenager who navigates her senior year of high school in Sacramento, California in 2002. Lady Bird is widely regarded as one of the best coming-of-age movies of all time, praised for its humor, authenticity, and performances.</p>
83
- <h3>Three Billboards Outside Ebbing, Missouri</h3>
84
- <p>Three Billboards Outside Ebbing, Missouri is a black comedy-drama movie written and directed by Martin McDonagh. It stars Frances McDormand as Mildred Hayes, Woody Harrelson as Bill Willoughby, Sam Rockwell as Jason Dixon, John Hawkes as Charlie Hayes, and Peter Dinklage as James. The movie follows Mildred, a grieving mother who rents three billboards to call attention to the unsolved murder of her daughter and the lack of action by the local police. Three Billboards Outside Ebbing, Missouri is widely regarded as one of the best black comedy-drama movies of all time, praised for its sharp dialogue, dark humor, and performances.</p>
85
- <h2>How to Download Movies Safely and Legally</h2>
86
- <h3>Use a VPN service</h3>
87
- <p>A VPN (Virtual Private Network) is a service that encrypts your internet traffic and hides your IP address, making you anonymous and secure online. A VPN can help you download movies safely and legally by:</p>
88
- <ul>
89
- <li><strong>Bypassing geo-restrictions:</strong> A VPN can help you access streaming platforms or online archives that are not available in your region, such as Netflix US or BBC iPlayer.</li>
90
- <li><strong>Protecting your privacy:</strong> A VPN can help you avoid being tracked or monitored by your ISP (Internet Service Provider), government agencies, hackers, or advertisers.</li>
91
- <li><strong>Preventing legal issues:</strong> A VPN can help you avoid getting into trouble for downloading movies illegally from torrent sites, as it can mask your identity and location.</li>
92
- </ul>
93
- <p>Some of the best VPN services for downloading movies are ExpressVPN, NordVPN, Surfshark, and CyberGhost.</p>
94
- <h3>Choose a reputable site or platform</h3>
95
- <p>Another way to download movies safely and legally is to choose a reputable site or platform that offers high-quality and legal content. Some of the factors to consider when choosing a site or platform are:</p>
96
- <ul>
97
- <li><strong>Licensing and legality:</strong> Make sure that the site or platform has the rights to distribute the movies that you want to download, and that it complies with the laws of your country.</li>
98
- <li><strong>Selection and variety:</strong> Make sure that the site or platform has a large and diverse library of movies that suits your preferences and tastes.</li>
99
- <li><strong>Quality and compatibility:</strong> Make sure that the site or platform offers movies in high resolution and with good audio quality, and that they are compatible with your device and media player.</li>
100
- <li><strong>Customer service and support:</strong> Make sure that the site or platform has a reliable and responsive customer service and support team that can help you with any issues or questions.</li>
101
- </ul>
102
- <h3>Check the file format and size</h3>
103
- <p>A third way to download movies safely and legally is to check the file format and size before downloading them. Some of the factors to consider when checking the file format and size are:</p>
104
- <ul>
105
- <li><strong>File format:</strong> Make sure that the file format is compatible with your device and media player. Some of the most common file formats for movies are MP4, MKV, AVI, MOV, and WMV.</li>
106
- <li><strong>File size:</strong> Make sure that the file size is not too large or too small for the quality and duration of the movie. A larger file size usually means a higher quality, but it also takes longer to download and consumes more storage space. A smaller file size usually means a lower quality, but it also takes less time to download and consumes less storage space. A good rule of thumb is to aim for a file size of around 1 GB per hour of movie.</li>
107
- </ul>
108
- <h3>Scan the file for viruses or malware</h3>
109
- <p>A fourth way to download movies safely and legally is to scan the file for viruses or malware before opening or playing them. Some of the risks of downloading movies from untrusted sources are:</p>
110
- <ul>
111
- <li><strong>Viruses:</strong> These are malicious programs that can infect your device and damage your system, files, or data.</li>
112
- <li><strong>M <p>alware:</strong> These are malicious programs that can spy on your device and steal your personal information, such as passwords, credit card numbers, or identity.</li>
113
- <li><strong>Adware:</strong> These are malicious programs that can display unwanted ads on your device and redirect your browser to unwanted sites.</li>
114
- <li><strong>Ransomware:</strong> These are malicious programs that can lock your device or files and demand a ransom to unlock them.</li>
115
- </ul>
116
- <p>To avoid these risks, you should always scan the file for viruses or malware before opening or playing them. You can use a reliable antivirus or anti-malware software, such as Norton, McAfee, Kaspersky, or Malwarebytes, to scan the file and remove any threats.</p>
117
- <h2>Conclusion</h2>
118
- <p>Downloading English movies from 2017 can be a fun and rewarding way to enjoy some of the best cinema of that year. However, you should also be careful and responsible when downloading movies online, as there are many risks and challenges involved. By following the tips and steps in this article, you can download movies safely and legally, and avoid any problems or issues. Happy watching!</p>
119
- <h2>FAQs</h2>
120
- <p>Here are some of the frequently asked questions about downloading English movies from 2017:</p>
121
- <ol>
122
- <li><strong>What is the best streaming platform for downloading English movies from 2017?</strong></li>
123
- <p>The answer to this question depends on your preferences, budget, and availability. However, some of the most popular and reputable streaming platforms for downloading English movies from 2017 are Netflix, Amazon Prime Video, Hulu, Disney+, and HBO Max. These platforms offer a wide range of movies from different genres, styles, and countries, as well as original and exclusive content. They also offer high-quality and legal downloads, as well as other features such as offline viewing, multiple devices, parental controls, and subtitles.</p>
124
- <li><strong>What is the best online archive for downloading English movies from 2017?</strong></li>
125
- <p>The answer to this question depends on your interests, tastes, and curiosity. However, some of the most interesting and reliable online archives for downloading English movies from 2017 are Internet Archive, Open Culture, and Public Domain Torrents. These websites offer free access to public domain or creative commons movies that are not protected by copyright. They also offer a variety of movies from different eras, cultures, and genres, as well as rare and independent movies that you might not find elsewhere.</p>
126
- <li><strong>What is the best torrent site for downloading English movies from 2017?</strong></li>
127
- <p>The answer to this question depends on your risk tolerance, ethics, and legality. However, some of the most popular and notorious torrent sites for downloading English movies from 2017 are The Pirate Bay, RARBG, and 1337x. These websites offer a huge collection of movies from different sources, qualities, and languages, as well as fast and easy downloads. However, they also pose many dangers and challenges, such as viruses, malware, legal issues, and ethical dilemmas.</p>
128
- <li><strong>How can I download movies faster and easier?</strong></li>
129
- <p>There are some tips and tricks that can help you download movies faster and easier, such as:</p>
130
- <ul>
131
- <li><strong>Use a download manager:</strong> A download manager is a software that can help you manage, organize, and accelerate your downloads. Some examples are Internet Download Manager, Free Download Manager, and JDownloader.</li>
132
- <li><strong>Use a torrent client:</strong> A torrent client is a software that can help you download files from torrent sites. Some examples are BitTorrent, uTorrent, and qBittorrent.</li>
133
- <li><strong>Use a Wi-Fi connection:</strong> A Wi-Fi connection is usually faster and more stable than a mobile data connection. It can also help you save your data plan and avoid extra charges.</li>
134
- <li><strong>Choose the right time:</strong> The speed and availability of downloads can vary depending on the time of the day, the traffic of the site or platform, and the demand of the movie. It is usually better to download movies during off-peak hours, such as late at night or early in the morning.</li>
135
- </ul>
136
- <li><strong>How can I watch downloaded movies on my TV?</strong></li>
137
- <p>There are some ways that you can watch downloaded movies on your TV, such as:</p>
138
- <ul>
139
- <li><strong>Use a HDMI cable:</strong> A HDMI cable is a cable that can connect your device to your TV and transmit audio and video signals. You can use a HDMI cable to connect your laptop, tablet, or smartphone to your TV and play the downloaded movie on your device.</li>
140
- <li><strong>Use a streaming device:</strong> A streaming device is a device that can connect to your TV and stream content from the internet or your device. Some examples are Chromecast, Roku, Fire TV Stick, and Apple TV. You can use a streaming device to cast or mirror the downloaded movie from your device to your TV.</li>
141
- <li><strong>Use a USB drive:</strong> A USB drive is a device that can store data and plug into your TV or other devices. You can use a USB drive to transfer the downloaded movie from your device to your TV and play it using the TV's media player.</li>
142
- </ul>
143
- </ol></p> 401be4b1e0<br />
144
- <br />
145
- <br />
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/232labs/VToonify/vtoonify/model/raft/core/extractor.py DELETED
@@ -1,267 +0,0 @@
1
- import torch
2
- import torch.nn as nn
3
- import torch.nn.functional as F
4
-
5
-
6
- class ResidualBlock(nn.Module):
7
- def __init__(self, in_planes, planes, norm_fn='group', stride=1):
8
- super(ResidualBlock, self).__init__()
9
-
10
- self.conv1 = nn.Conv2d(in_planes, planes, kernel_size=3, padding=1, stride=stride)
11
- self.conv2 = nn.Conv2d(planes, planes, kernel_size=3, padding=1)
12
- self.relu = nn.ReLU(inplace=True)
13
-
14
- num_groups = planes // 8
15
-
16
- if norm_fn == 'group':
17
- self.norm1 = nn.GroupNorm(num_groups=num_groups, num_channels=planes)
18
- self.norm2 = nn.GroupNorm(num_groups=num_groups, num_channels=planes)
19
- if not stride == 1:
20
- self.norm3 = nn.GroupNorm(num_groups=num_groups, num_channels=planes)
21
-
22
- elif norm_fn == 'batch':
23
- self.norm1 = nn.BatchNorm2d(planes)
24
- self.norm2 = nn.BatchNorm2d(planes)
25
- if not stride == 1:
26
- self.norm3 = nn.BatchNorm2d(planes)
27
-
28
- elif norm_fn == 'instance':
29
- self.norm1 = nn.InstanceNorm2d(planes)
30
- self.norm2 = nn.InstanceNorm2d(planes)
31
- if not stride == 1:
32
- self.norm3 = nn.InstanceNorm2d(planes)
33
-
34
- elif norm_fn == 'none':
35
- self.norm1 = nn.Sequential()
36
- self.norm2 = nn.Sequential()
37
- if not stride == 1:
38
- self.norm3 = nn.Sequential()
39
-
40
- if stride == 1:
41
- self.downsample = None
42
-
43
- else:
44
- self.downsample = nn.Sequential(
45
- nn.Conv2d(in_planes, planes, kernel_size=1, stride=stride), self.norm3)
46
-
47
-
48
- def forward(self, x):
49
- y = x
50
- y = self.relu(self.norm1(self.conv1(y)))
51
- y = self.relu(self.norm2(self.conv2(y)))
52
-
53
- if self.downsample is not None:
54
- x = self.downsample(x)
55
-
56
- return self.relu(x+y)
57
-
58
-
59
-
60
- class BottleneckBlock(nn.Module):
61
- def __init__(self, in_planes, planes, norm_fn='group', stride=1):
62
- super(BottleneckBlock, self).__init__()
63
-
64
- self.conv1 = nn.Conv2d(in_planes, planes//4, kernel_size=1, padding=0)
65
- self.conv2 = nn.Conv2d(planes//4, planes//4, kernel_size=3, padding=1, stride=stride)
66
- self.conv3 = nn.Conv2d(planes//4, planes, kernel_size=1, padding=0)
67
- self.relu = nn.ReLU(inplace=True)
68
-
69
- num_groups = planes // 8
70
-
71
- if norm_fn == 'group':
72
- self.norm1 = nn.GroupNorm(num_groups=num_groups, num_channels=planes//4)
73
- self.norm2 = nn.GroupNorm(num_groups=num_groups, num_channels=planes//4)
74
- self.norm3 = nn.GroupNorm(num_groups=num_groups, num_channels=planes)
75
- if not stride == 1:
76
- self.norm4 = nn.GroupNorm(num_groups=num_groups, num_channels=planes)
77
-
78
- elif norm_fn == 'batch':
79
- self.norm1 = nn.BatchNorm2d(planes//4)
80
- self.norm2 = nn.BatchNorm2d(planes//4)
81
- self.norm3 = nn.BatchNorm2d(planes)
82
- if not stride == 1:
83
- self.norm4 = nn.BatchNorm2d(planes)
84
-
85
- elif norm_fn == 'instance':
86
- self.norm1 = nn.InstanceNorm2d(planes//4)
87
- self.norm2 = nn.InstanceNorm2d(planes//4)
88
- self.norm3 = nn.InstanceNorm2d(planes)
89
- if not stride == 1:
90
- self.norm4 = nn.InstanceNorm2d(planes)
91
-
92
- elif norm_fn == 'none':
93
- self.norm1 = nn.Sequential()
94
- self.norm2 = nn.Sequential()
95
- self.norm3 = nn.Sequential()
96
- if not stride == 1:
97
- self.norm4 = nn.Sequential()
98
-
99
- if stride == 1:
100
- self.downsample = None
101
-
102
- else:
103
- self.downsample = nn.Sequential(
104
- nn.Conv2d(in_planes, planes, kernel_size=1, stride=stride), self.norm4)
105
-
106
-
107
- def forward(self, x):
108
- y = x
109
- y = self.relu(self.norm1(self.conv1(y)))
110
- y = self.relu(self.norm2(self.conv2(y)))
111
- y = self.relu(self.norm3(self.conv3(y)))
112
-
113
- if self.downsample is not None:
114
- x = self.downsample(x)
115
-
116
- return self.relu(x+y)
117
-
118
- class BasicEncoder(nn.Module):
119
- def __init__(self, output_dim=128, norm_fn='batch', dropout=0.0):
120
- super(BasicEncoder, self).__init__()
121
- self.norm_fn = norm_fn
122
-
123
- if self.norm_fn == 'group':
124
- self.norm1 = nn.GroupNorm(num_groups=8, num_channels=64)
125
-
126
- elif self.norm_fn == 'batch':
127
- self.norm1 = nn.BatchNorm2d(64)
128
-
129
- elif self.norm_fn == 'instance':
130
- self.norm1 = nn.InstanceNorm2d(64)
131
-
132
- elif self.norm_fn == 'none':
133
- self.norm1 = nn.Sequential()
134
-
135
- self.conv1 = nn.Conv2d(3, 64, kernel_size=7, stride=2, padding=3)
136
- self.relu1 = nn.ReLU(inplace=True)
137
-
138
- self.in_planes = 64
139
- self.layer1 = self._make_layer(64, stride=1)
140
- self.layer2 = self._make_layer(96, stride=2)
141
- self.layer3 = self._make_layer(128, stride=2)
142
-
143
- # output convolution
144
- self.conv2 = nn.Conv2d(128, output_dim, kernel_size=1)
145
-
146
- self.dropout = None
147
- if dropout > 0:
148
- self.dropout = nn.Dropout2d(p=dropout)
149
-
150
- for m in self.modules():
151
- if isinstance(m, nn.Conv2d):
152
- nn.init.kaiming_normal_(m.weight, mode='fan_out', nonlinearity='relu')
153
- elif isinstance(m, (nn.BatchNorm2d, nn.InstanceNorm2d, nn.GroupNorm)):
154
- if m.weight is not None:
155
- nn.init.constant_(m.weight, 1)
156
- if m.bias is not None:
157
- nn.init.constant_(m.bias, 0)
158
-
159
- def _make_layer(self, dim, stride=1):
160
- layer1 = ResidualBlock(self.in_planes, dim, self.norm_fn, stride=stride)
161
- layer2 = ResidualBlock(dim, dim, self.norm_fn, stride=1)
162
- layers = (layer1, layer2)
163
-
164
- self.in_planes = dim
165
- return nn.Sequential(*layers)
166
-
167
-
168
- def forward(self, x):
169
-
170
- # if input is list, combine batch dimension
171
- is_list = isinstance(x, tuple) or isinstance(x, list)
172
- if is_list:
173
- batch_dim = x[0].shape[0]
174
- x = torch.cat(x, dim=0)
175
-
176
- x = self.conv1(x)
177
- x = self.norm1(x)
178
- x = self.relu1(x)
179
-
180
- x = self.layer1(x)
181
- x = self.layer2(x)
182
- x = self.layer3(x)
183
-
184
- x = self.conv2(x)
185
-
186
- if self.training and self.dropout is not None:
187
- x = self.dropout(x)
188
-
189
- if is_list:
190
- x = torch.split(x, [batch_dim, batch_dim], dim=0)
191
-
192
- return x
193
-
194
-
195
- class SmallEncoder(nn.Module):
196
- def __init__(self, output_dim=128, norm_fn='batch', dropout=0.0):
197
- super(SmallEncoder, self).__init__()
198
- self.norm_fn = norm_fn
199
-
200
- if self.norm_fn == 'group':
201
- self.norm1 = nn.GroupNorm(num_groups=8, num_channels=32)
202
-
203
- elif self.norm_fn == 'batch':
204
- self.norm1 = nn.BatchNorm2d(32)
205
-
206
- elif self.norm_fn == 'instance':
207
- self.norm1 = nn.InstanceNorm2d(32)
208
-
209
- elif self.norm_fn == 'none':
210
- self.norm1 = nn.Sequential()
211
-
212
- self.conv1 = nn.Conv2d(3, 32, kernel_size=7, stride=2, padding=3)
213
- self.relu1 = nn.ReLU(inplace=True)
214
-
215
- self.in_planes = 32
216
- self.layer1 = self._make_layer(32, stride=1)
217
- self.layer2 = self._make_layer(64, stride=2)
218
- self.layer3 = self._make_layer(96, stride=2)
219
-
220
- self.dropout = None
221
- if dropout > 0:
222
- self.dropout = nn.Dropout2d(p=dropout)
223
-
224
- self.conv2 = nn.Conv2d(96, output_dim, kernel_size=1)
225
-
226
- for m in self.modules():
227
- if isinstance(m, nn.Conv2d):
228
- nn.init.kaiming_normal_(m.weight, mode='fan_out', nonlinearity='relu')
229
- elif isinstance(m, (nn.BatchNorm2d, nn.InstanceNorm2d, nn.GroupNorm)):
230
- if m.weight is not None:
231
- nn.init.constant_(m.weight, 1)
232
- if m.bias is not None:
233
- nn.init.constant_(m.bias, 0)
234
-
235
- def _make_layer(self, dim, stride=1):
236
- layer1 = BottleneckBlock(self.in_planes, dim, self.norm_fn, stride=stride)
237
- layer2 = BottleneckBlock(dim, dim, self.norm_fn, stride=1)
238
- layers = (layer1, layer2)
239
-
240
- self.in_planes = dim
241
- return nn.Sequential(*layers)
242
-
243
-
244
- def forward(self, x):
245
-
246
- # if input is list, combine batch dimension
247
- is_list = isinstance(x, tuple) or isinstance(x, list)
248
- if is_list:
249
- batch_dim = x[0].shape[0]
250
- x = torch.cat(x, dim=0)
251
-
252
- x = self.conv1(x)
253
- x = self.norm1(x)
254
- x = self.relu1(x)
255
-
256
- x = self.layer1(x)
257
- x = self.layer2(x)
258
- x = self.layer3(x)
259
- x = self.conv2(x)
260
-
261
- if self.training and self.dropout is not None:
262
- x = self.dropout(x)
263
-
264
- if is_list:
265
- x = torch.split(x, [batch_dim, batch_dim], dim=0)
266
-
267
- return x
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/4H17Joycelyn/text_generater/app.py DELETED
@@ -1,10 +0,0 @@
1
- import gradio as gr
2
- from transformers import pipeline
3
-
4
- generator = pipeline('text-generation', model='gpt2')
5
-
6
- def generate(text):
7
- result=generator(text)
8
- return result[0]['generated_text']
9
-
10
- gr.Interface(fn=generate, inputs=gr.inputs.Textbox(), outputs=gr.outputs.Textbox()).launch()
 
 
 
 
 
 
 
 
 
 
 
spaces/7hao/bingo/src/components/ui/codeblock.tsx DELETED
@@ -1,142 +0,0 @@
1
- 'use client'
2
-
3
- import { FC, memo } from 'react'
4
- import { Prism as SyntaxHighlighter } from 'react-syntax-highlighter'
5
- import { coldarkDark } from 'react-syntax-highlighter/dist/cjs/styles/prism'
6
-
7
- import { useCopyToClipboard } from '@/lib/hooks/use-copy-to-clipboard'
8
- import { IconCheck, IconCopy, IconDownload } from '@/components/ui/icons'
9
- import { Button } from '@/components/ui/button'
10
-
11
- interface Props {
12
- language: string
13
- value: string
14
- }
15
-
16
- interface languageMap {
17
- [key: string]: string | undefined
18
- }
19
-
20
- export const programmingLanguages: languageMap = {
21
- javascript: '.js',
22
- python: '.py',
23
- java: '.java',
24
- c: '.c',
25
- cpp: '.cpp',
26
- 'c++': '.cpp',
27
- 'c#': '.cs',
28
- ruby: '.rb',
29
- php: '.php',
30
- swift: '.swift',
31
- 'objective-c': '.m',
32
- kotlin: '.kt',
33
- typescript: '.ts',
34
- go: '.go',
35
- perl: '.pl',
36
- rust: '.rs',
37
- scala: '.scala',
38
- haskell: '.hs',
39
- lua: '.lua',
40
- shell: '.sh',
41
- sql: '.sql',
42
- html: '.html',
43
- css: '.css'
44
- // add more file extensions here, make sure the key is same as language prop in CodeBlock.tsx component
45
- }
46
-
47
- export const generateRandomString = (length: number, lowercase = false) => {
48
- const chars = 'ABCDEFGHJKLMNPQRSTUVWXY3456789' // excluding similar looking characters like Z, 2, I, 1, O, 0
49
- let result = ''
50
- for (let i = 0; i < length; i++) {
51
- result += chars.charAt(Math.floor(Math.random() * chars.length))
52
- }
53
- return lowercase ? result.toLowerCase() : result
54
- }
55
-
56
- const CodeBlock: FC<Props> = memo(({ language, value }) => {
57
- const { isCopied, copyToClipboard } = useCopyToClipboard({ timeout: 2000 })
58
-
59
- const downloadAsFile = () => {
60
- if (typeof window === 'undefined') {
61
- return
62
- }
63
- const fileExtension = programmingLanguages[language] || '.file'
64
- const suggestedFileName = `file-${generateRandomString(
65
- 3,
66
- true
67
- )}${fileExtension}`
68
- const fileName = window.prompt('Enter file name' || '', suggestedFileName)
69
-
70
- if (!fileName) {
71
- // User pressed cancel on prompt.
72
- return
73
- }
74
-
75
- const blob = new Blob([value], { type: 'text/plain' })
76
- const url = URL.createObjectURL(blob)
77
- const link = document.createElement('a')
78
- link.download = fileName
79
- link.href = url
80
- link.style.display = 'none'
81
- document.body.appendChild(link)
82
- link.click()
83
- document.body.removeChild(link)
84
- URL.revokeObjectURL(url)
85
- }
86
-
87
- const onCopy = () => {
88
- if (isCopied) return
89
- copyToClipboard(value)
90
- }
91
-
92
- return (
93
- <div className="codeblock relative w-full bg-zinc-950 font-sans">
94
- <div className="flex w-full items-center justify-between bg-zinc-800 px-6 py-2 pr-4 text-zinc-100">
95
- <span className="text-xs lowercase">{language}</span>
96
- <div className="flex items-center space-x-1">
97
- <Button
98
- variant="ghost"
99
- className="hover:bg-zinc-800 focus-visible:ring-1 focus-visible:ring-slate-700 focus-visible:ring-offset-0"
100
- onClick={downloadAsFile}
101
- size="icon"
102
- >
103
- <IconDownload />
104
- <span className="sr-only">Download</span>
105
- </Button>
106
- <Button
107
- variant="ghost"
108
- size="icon"
109
- className="text-xs hover:bg-zinc-800 focus-visible:ring-1 focus-visible:ring-slate-700 focus-visible:ring-offset-0"
110
- onClick={onCopy}
111
- >
112
- {isCopied ? <IconCheck /> : <IconCopy />}
113
- <span className="sr-only">Copy code</span>
114
- </Button>
115
- </div>
116
- </div>
117
- <SyntaxHighlighter
118
- language={language}
119
- style={coldarkDark}
120
- PreTag="div"
121
- showLineNumbers
122
- customStyle={{
123
- margin: 0,
124
- width: '100%',
125
- background: 'transparent',
126
- padding: '1.5rem 1rem'
127
- }}
128
- codeTagProps={{
129
- style: {
130
- fontSize: '0.9rem',
131
- fontFamily: 'var(--font-mono)'
132
- }
133
- }}
134
- >
135
- {value}
136
- </SyntaxHighlighter>
137
- </div>
138
- )
139
- })
140
- CodeBlock.displayName = 'CodeBlock'
141
-
142
- export { CodeBlock }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/AI-Hobbyist/Hoyo-RVC/infer_pack/modules/F0Predictor/DioF0Predictor.py DELETED
@@ -1,90 +0,0 @@
1
- from infer_pack.modules.F0Predictor.F0Predictor import F0Predictor
2
- import pyworld
3
- import numpy as np
4
-
5
-
6
- class DioF0Predictor(F0Predictor):
7
- def __init__(self, hop_length=512, f0_min=50, f0_max=1100, sampling_rate=44100):
8
- self.hop_length = hop_length
9
- self.f0_min = f0_min
10
- self.f0_max = f0_max
11
- self.sampling_rate = sampling_rate
12
-
13
- def interpolate_f0(self, f0):
14
- """
15
- 对F0进行插值处理
16
- """
17
-
18
- data = np.reshape(f0, (f0.size, 1))
19
-
20
- vuv_vector = np.zeros((data.size, 1), dtype=np.float32)
21
- vuv_vector[data > 0.0] = 1.0
22
- vuv_vector[data <= 0.0] = 0.0
23
-
24
- ip_data = data
25
-
26
- frame_number = data.size
27
- last_value = 0.0
28
- for i in range(frame_number):
29
- if data[i] <= 0.0:
30
- j = i + 1
31
- for j in range(i + 1, frame_number):
32
- if data[j] > 0.0:
33
- break
34
- if j < frame_number - 1:
35
- if last_value > 0.0:
36
- step = (data[j] - data[i - 1]) / float(j - i)
37
- for k in range(i, j):
38
- ip_data[k] = data[i - 1] + step * (k - i + 1)
39
- else:
40
- for k in range(i, j):
41
- ip_data[k] = data[j]
42
- else:
43
- for k in range(i, frame_number):
44
- ip_data[k] = last_value
45
- else:
46
- ip_data[i] = data[i] # 这里可能存在一个没有必要的拷贝
47
- last_value = data[i]
48
-
49
- return ip_data[:, 0], vuv_vector[:, 0]
50
-
51
- def resize_f0(self, x, target_len):
52
- source = np.array(x)
53
- source[source < 0.001] = np.nan
54
- target = np.interp(
55
- np.arange(0, len(source) * target_len, len(source)) / target_len,
56
- np.arange(0, len(source)),
57
- source,
58
- )
59
- res = np.nan_to_num(target)
60
- return res
61
-
62
- def compute_f0(self, wav, p_len=None):
63
- if p_len is None:
64
- p_len = wav.shape[0] // self.hop_length
65
- f0, t = pyworld.dio(
66
- wav.astype(np.double),
67
- fs=self.sampling_rate,
68
- f0_floor=self.f0_min,
69
- f0_ceil=self.f0_max,
70
- frame_period=1000 * self.hop_length / self.sampling_rate,
71
- )
72
- f0 = pyworld.stonemask(wav.astype(np.double), f0, t, self.sampling_rate)
73
- for index, pitch in enumerate(f0):
74
- f0[index] = round(pitch, 1)
75
- return self.interpolate_f0(self.resize_f0(f0, p_len))[0]
76
-
77
- def compute_f0_uv(self, wav, p_len=None):
78
- if p_len is None:
79
- p_len = wav.shape[0] // self.hop_length
80
- f0, t = pyworld.dio(
81
- wav.astype(np.double),
82
- fs=self.sampling_rate,
83
- f0_floor=self.f0_min,
84
- f0_ceil=self.f0_max,
85
- frame_period=1000 * self.hop_length / self.sampling_rate,
86
- )
87
- f0 = pyworld.stonemask(wav.astype(np.double), f0, t, self.sampling_rate)
88
- for index, pitch in enumerate(f0):
89
- f0[index] = round(pitch, 1)
90
- return self.interpolate_f0(self.resize_f0(f0, p_len))
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/AchyuthGamer/OpenGPT-Chat-UI/src/lib/types/Message.ts DELETED
@@ -1,10 +0,0 @@
1
- import type { Timestamps } from "./Timestamps";
2
-
3
- export type Message = Partial<Timestamps> & {
4
- from: "user" | "assistant";
5
- id: ReturnType<typeof crypto.randomUUID>;
6
- content: string;
7
- webSearchId?: string;
8
- score?: -1 | 0 | 1;
9
- isCode: boolean;
10
- };
 
 
 
 
 
 
 
 
 
 
 
spaces/Adapter/T2I-Adapter/ldm/modules/encoders/adapter.py DELETED
@@ -1,258 +0,0 @@
1
- import torch
2
- import torch.nn as nn
3
- from collections import OrderedDict
4
-
5
-
6
- def conv_nd(dims, *args, **kwargs):
7
- """
8
- Create a 1D, 2D, or 3D convolution module.
9
- """
10
- if dims == 1:
11
- return nn.Conv1d(*args, **kwargs)
12
- elif dims == 2:
13
- return nn.Conv2d(*args, **kwargs)
14
- elif dims == 3:
15
- return nn.Conv3d(*args, **kwargs)
16
- raise ValueError(f"unsupported dimensions: {dims}")
17
-
18
-
19
- def avg_pool_nd(dims, *args, **kwargs):
20
- """
21
- Create a 1D, 2D, or 3D average pooling module.
22
- """
23
- if dims == 1:
24
- return nn.AvgPool1d(*args, **kwargs)
25
- elif dims == 2:
26
- return nn.AvgPool2d(*args, **kwargs)
27
- elif dims == 3:
28
- return nn.AvgPool3d(*args, **kwargs)
29
- raise ValueError(f"unsupported dimensions: {dims}")
30
-
31
-
32
- class Downsample(nn.Module):
33
- """
34
- A downsampling layer with an optional convolution.
35
- :param channels: channels in the inputs and outputs.
36
- :param use_conv: a bool determining if a convolution is applied.
37
- :param dims: determines if the signal is 1D, 2D, or 3D. If 3D, then
38
- downsampling occurs in the inner-two dimensions.
39
- """
40
-
41
- def __init__(self, channels, use_conv, dims=2, out_channels=None, padding=1):
42
- super().__init__()
43
- self.channels = channels
44
- self.out_channels = out_channels or channels
45
- self.use_conv = use_conv
46
- self.dims = dims
47
- stride = 2 if dims != 3 else (1, 2, 2)
48
- if use_conv:
49
- self.op = conv_nd(
50
- dims, self.channels, self.out_channels, 3, stride=stride, padding=padding
51
- )
52
- else:
53
- assert self.channels == self.out_channels
54
- self.op = avg_pool_nd(dims, kernel_size=stride, stride=stride)
55
-
56
- def forward(self, x):
57
- assert x.shape[1] == self.channels
58
- return self.op(x)
59
-
60
-
61
- class ResnetBlock(nn.Module):
62
- def __init__(self, in_c, out_c, down, ksize=3, sk=False, use_conv=True):
63
- super().__init__()
64
- ps = ksize // 2
65
- if in_c != out_c or sk == False:
66
- self.in_conv = nn.Conv2d(in_c, out_c, ksize, 1, ps)
67
- else:
68
- # print('n_in')
69
- self.in_conv = None
70
- self.block1 = nn.Conv2d(out_c, out_c, 3, 1, 1)
71
- self.act = nn.ReLU()
72
- self.block2 = nn.Conv2d(out_c, out_c, ksize, 1, ps)
73
- if sk == False:
74
- self.skep = nn.Conv2d(in_c, out_c, ksize, 1, ps)
75
- else:
76
- self.skep = None
77
-
78
- self.down = down
79
- if self.down == True:
80
- self.down_opt = Downsample(in_c, use_conv=use_conv)
81
-
82
- def forward(self, x):
83
- if self.down == True:
84
- x = self.down_opt(x)
85
- if self.in_conv is not None: # edit
86
- x = self.in_conv(x)
87
-
88
- h = self.block1(x)
89
- h = self.act(h)
90
- h = self.block2(h)
91
- if self.skep is not None:
92
- return h + self.skep(x)
93
- else:
94
- return h + x
95
-
96
-
97
- class Adapter(nn.Module):
98
- def __init__(self, channels=[320, 640, 1280, 1280], nums_rb=3, cin=64, ksize=3, sk=False, use_conv=True):
99
- super(Adapter, self).__init__()
100
- self.unshuffle = nn.PixelUnshuffle(8)
101
- self.channels = channels
102
- self.nums_rb = nums_rb
103
- self.body = []
104
- for i in range(len(channels)):
105
- for j in range(nums_rb):
106
- if (i != 0) and (j == 0):
107
- self.body.append(
108
- ResnetBlock(channels[i - 1], channels[i], down=True, ksize=ksize, sk=sk, use_conv=use_conv))
109
- else:
110
- self.body.append(
111
- ResnetBlock(channels[i], channels[i], down=False, ksize=ksize, sk=sk, use_conv=use_conv))
112
- self.body = nn.ModuleList(self.body)
113
- self.conv_in = nn.Conv2d(cin, channels[0], 3, 1, 1)
114
-
115
- def forward(self, x):
116
- # unshuffle
117
- x = self.unshuffle(x)
118
- # extract features
119
- features = []
120
- x = self.conv_in(x)
121
- for i in range(len(self.channels)):
122
- for j in range(self.nums_rb):
123
- idx = i * self.nums_rb + j
124
- x = self.body[idx](x)
125
- features.append(x)
126
-
127
- return features
128
-
129
-
130
- class LayerNorm(nn.LayerNorm):
131
- """Subclass torch's LayerNorm to handle fp16."""
132
-
133
- def forward(self, x: torch.Tensor):
134
- orig_type = x.dtype
135
- ret = super().forward(x.type(torch.float32))
136
- return ret.type(orig_type)
137
-
138
-
139
- class QuickGELU(nn.Module):
140
-
141
- def forward(self, x: torch.Tensor):
142
- return x * torch.sigmoid(1.702 * x)
143
-
144
-
145
- class ResidualAttentionBlock(nn.Module):
146
-
147
- def __init__(self, d_model: int, n_head: int, attn_mask: torch.Tensor = None):
148
- super().__init__()
149
-
150
- self.attn = nn.MultiheadAttention(d_model, n_head)
151
- self.ln_1 = LayerNorm(d_model)
152
- self.mlp = nn.Sequential(
153
- OrderedDict([("c_fc", nn.Linear(d_model, d_model * 4)), ("gelu", QuickGELU()),
154
- ("c_proj", nn.Linear(d_model * 4, d_model))]))
155
- self.ln_2 = LayerNorm(d_model)
156
- self.attn_mask = attn_mask
157
-
158
- def attention(self, x: torch.Tensor):
159
- self.attn_mask = self.attn_mask.to(dtype=x.dtype, device=x.device) if self.attn_mask is not None else None
160
- return self.attn(x, x, x, need_weights=False, attn_mask=self.attn_mask)[0]
161
-
162
- def forward(self, x: torch.Tensor):
163
- x = x + self.attention(self.ln_1(x))
164
- x = x + self.mlp(self.ln_2(x))
165
- return x
166
-
167
-
168
- class StyleAdapter(nn.Module):
169
-
170
- def __init__(self, width=1024, context_dim=768, num_head=8, n_layes=3, num_token=4):
171
- super().__init__()
172
-
173
- scale = width ** -0.5
174
- self.transformer_layes = nn.Sequential(*[ResidualAttentionBlock(width, num_head) for _ in range(n_layes)])
175
- self.num_token = num_token
176
- self.style_embedding = nn.Parameter(torch.randn(1, num_token, width) * scale)
177
- self.ln_post = LayerNorm(width)
178
- self.ln_pre = LayerNorm(width)
179
- self.proj = nn.Parameter(scale * torch.randn(width, context_dim))
180
-
181
- def forward(self, x):
182
- # x shape [N, HW+1, C]
183
- style_embedding = self.style_embedding + torch.zeros(
184
- (x.shape[0], self.num_token, self.style_embedding.shape[-1]), device=x.device)
185
- x = torch.cat([x, style_embedding], dim=1)
186
- x = self.ln_pre(x)
187
- x = x.permute(1, 0, 2) # NLD -> LND
188
- x = self.transformer_layes(x)
189
- x = x.permute(1, 0, 2) # LND -> NLD
190
-
191
- x = self.ln_post(x[:, -self.num_token:, :])
192
- x = x @ self.proj
193
-
194
- return x
195
-
196
-
197
- class ResnetBlock_light(nn.Module):
198
- def __init__(self, in_c):
199
- super().__init__()
200
- self.block1 = nn.Conv2d(in_c, in_c, 3, 1, 1)
201
- self.act = nn.ReLU()
202
- self.block2 = nn.Conv2d(in_c, in_c, 3, 1, 1)
203
-
204
- def forward(self, x):
205
- h = self.block1(x)
206
- h = self.act(h)
207
- h = self.block2(h)
208
-
209
- return h + x
210
-
211
-
212
- class extractor(nn.Module):
213
- def __init__(self, in_c, inter_c, out_c, nums_rb, down=False):
214
- super().__init__()
215
- self.in_conv = nn.Conv2d(in_c, inter_c, 1, 1, 0)
216
- self.body = []
217
- for _ in range(nums_rb):
218
- self.body.append(ResnetBlock_light(inter_c))
219
- self.body = nn.Sequential(*self.body)
220
- self.out_conv = nn.Conv2d(inter_c, out_c, 1, 1, 0)
221
- self.down = down
222
- if self.down == True:
223
- self.down_opt = Downsample(in_c, use_conv=False)
224
-
225
- def forward(self, x):
226
- if self.down == True:
227
- x = self.down_opt(x)
228
- x = self.in_conv(x)
229
- x = self.body(x)
230
- x = self.out_conv(x)
231
-
232
- return x
233
-
234
-
235
- class Adapter_light(nn.Module):
236
- def __init__(self, channels=[320, 640, 1280, 1280], nums_rb=3, cin=64):
237
- super(Adapter_light, self).__init__()
238
- self.unshuffle = nn.PixelUnshuffle(8)
239
- self.channels = channels
240
- self.nums_rb = nums_rb
241
- self.body = []
242
- for i in range(len(channels)):
243
- if i == 0:
244
- self.body.append(extractor(in_c=cin, inter_c=channels[i]//4, out_c=channels[i], nums_rb=nums_rb, down=False))
245
- else:
246
- self.body.append(extractor(in_c=channels[i-1], inter_c=channels[i]//4, out_c=channels[i], nums_rb=nums_rb, down=True))
247
- self.body = nn.ModuleList(self.body)
248
-
249
- def forward(self, x):
250
- # unshuffle
251
- x = self.unshuffle(x)
252
- # extract features
253
- features = []
254
- for i in range(len(self.channels)):
255
- x = self.body[i](x)
256
- features.append(x)
257
-
258
- return features
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/AgentVerse/agentVerse/ui/src/phaser3-rex-plugins/templates/bejeweled/methods/BoardMethods.js DELETED
@@ -1,41 +0,0 @@
1
- export default {
2
- setBoardSize(width, height) {
3
- this.board.setBoardWidth(width).setBoardHeight(height);
4
- return this;
5
- },
6
-
7
- // Chess properties
8
- getChessMoveTo(chess) {
9
- return (chess) ? chess.rexMoveTo : undefined;
10
- },
11
-
12
- getChessTileZ() {
13
- return this.board.chessTileZ;
14
- },
15
-
16
- worldXYToChess(worldX, worldY) {
17
- return this.board.worldXYToChess(worldX, worldY);
18
- },
19
-
20
- tileXYToChess(tileX, tileY) {
21
- return this.board.tileXYToChess(tileX, tileY);
22
- },
23
-
24
- getNeighborChessAtAngle(chess, angle) {
25
- return this.board.getNeighborChessAtAngle(chess, angle);
26
- },
27
-
28
- getNeighborChessAtDirection(chess, direction) {
29
- return this.board.getNeighborChessAtDirection(chess, direction);
30
- },
31
-
32
- // Expose board instance
33
- getBoard() {
34
- return this.board.board;
35
- },
36
-
37
- // Expose match instance
38
- getMatch() {
39
- return this.board.match;
40
- }
41
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/AiMimicry/sovits-models/inference/slicer.py DELETED
@@ -1,142 +0,0 @@
1
- import librosa
2
- import torch
3
- import torchaudio
4
-
5
-
6
- class Slicer:
7
- def __init__(self,
8
- sr: int,
9
- threshold: float = -40.,
10
- min_length: int = 5000,
11
- min_interval: int = 300,
12
- hop_size: int = 20,
13
- max_sil_kept: int = 5000):
14
- if not min_length >= min_interval >= hop_size:
15
- raise ValueError('The following condition must be satisfied: min_length >= min_interval >= hop_size')
16
- if not max_sil_kept >= hop_size:
17
- raise ValueError('The following condition must be satisfied: max_sil_kept >= hop_size')
18
- min_interval = sr * min_interval / 1000
19
- self.threshold = 10 ** (threshold / 20.)
20
- self.hop_size = round(sr * hop_size / 1000)
21
- self.win_size = min(round(min_interval), 4 * self.hop_size)
22
- self.min_length = round(sr * min_length / 1000 / self.hop_size)
23
- self.min_interval = round(min_interval / self.hop_size)
24
- self.max_sil_kept = round(sr * max_sil_kept / 1000 / self.hop_size)
25
-
26
- def _apply_slice(self, waveform, begin, end):
27
- if len(waveform.shape) > 1:
28
- return waveform[:, begin * self.hop_size: min(waveform.shape[1], end * self.hop_size)]
29
- else:
30
- return waveform[begin * self.hop_size: min(waveform.shape[0], end * self.hop_size)]
31
-
32
- # @timeit
33
- def slice(self, waveform):
34
- if len(waveform.shape) > 1:
35
- samples = librosa.to_mono(waveform)
36
- else:
37
- samples = waveform
38
- if samples.shape[0] <= self.min_length:
39
- return {"0": {"slice": False, "split_time": f"0,{len(waveform)}"}}
40
- rms_list = librosa.feature.rms(y=samples, frame_length=self.win_size, hop_length=self.hop_size).squeeze(0)
41
- sil_tags = []
42
- silence_start = None
43
- clip_start = 0
44
- for i, rms in enumerate(rms_list):
45
- # Keep looping while frame is silent.
46
- if rms < self.threshold:
47
- # Record start of silent frames.
48
- if silence_start is None:
49
- silence_start = i
50
- continue
51
- # Keep looping while frame is not silent and silence start has not been recorded.
52
- if silence_start is None:
53
- continue
54
- # Clear recorded silence start if interval is not enough or clip is too short
55
- is_leading_silence = silence_start == 0 and i > self.max_sil_kept
56
- need_slice_middle = i - silence_start >= self.min_interval and i - clip_start >= self.min_length
57
- if not is_leading_silence and not need_slice_middle:
58
- silence_start = None
59
- continue
60
- # Need slicing. Record the range of silent frames to be removed.
61
- if i - silence_start <= self.max_sil_kept:
62
- pos = rms_list[silence_start: i + 1].argmin() + silence_start
63
- if silence_start == 0:
64
- sil_tags.append((0, pos))
65
- else:
66
- sil_tags.append((pos, pos))
67
- clip_start = pos
68
- elif i - silence_start <= self.max_sil_kept * 2:
69
- pos = rms_list[i - self.max_sil_kept: silence_start + self.max_sil_kept + 1].argmin()
70
- pos += i - self.max_sil_kept
71
- pos_l = rms_list[silence_start: silence_start + self.max_sil_kept + 1].argmin() + silence_start
72
- pos_r = rms_list[i - self.max_sil_kept: i + 1].argmin() + i - self.max_sil_kept
73
- if silence_start == 0:
74
- sil_tags.append((0, pos_r))
75
- clip_start = pos_r
76
- else:
77
- sil_tags.append((min(pos_l, pos), max(pos_r, pos)))
78
- clip_start = max(pos_r, pos)
79
- else:
80
- pos_l = rms_list[silence_start: silence_start + self.max_sil_kept + 1].argmin() + silence_start
81
- pos_r = rms_list[i - self.max_sil_kept: i + 1].argmin() + i - self.max_sil_kept
82
- if silence_start == 0:
83
- sil_tags.append((0, pos_r))
84
- else:
85
- sil_tags.append((pos_l, pos_r))
86
- clip_start = pos_r
87
- silence_start = None
88
- # Deal with trailing silence.
89
- total_frames = rms_list.shape[0]
90
- if silence_start is not None and total_frames - silence_start >= self.min_interval:
91
- silence_end = min(total_frames, silence_start + self.max_sil_kept)
92
- pos = rms_list[silence_start: silence_end + 1].argmin() + silence_start
93
- sil_tags.append((pos, total_frames + 1))
94
- # Apply and return slices.
95
- if len(sil_tags) == 0:
96
- return {"0": {"slice": False, "split_time": f"0,{len(waveform)}"}}
97
- else:
98
- chunks = []
99
- # 第一段静音并非从头开始,补上有声片段
100
- if sil_tags[0][0]:
101
- chunks.append(
102
- {"slice": False, "split_time": f"0,{min(waveform.shape[0], sil_tags[0][0] * self.hop_size)}"})
103
- for i in range(0, len(sil_tags)):
104
- # 标识有声片段(跳过第一段)
105
- if i:
106
- chunks.append({"slice": False,
107
- "split_time": f"{sil_tags[i - 1][1] * self.hop_size},{min(waveform.shape[0], sil_tags[i][0] * self.hop_size)}"})
108
- # 标识所有静音片段
109
- chunks.append({"slice": True,
110
- "split_time": f"{sil_tags[i][0] * self.hop_size},{min(waveform.shape[0], sil_tags[i][1] * self.hop_size)}"})
111
- # 最后一段静音并非结尾,补上结尾片段
112
- if sil_tags[-1][1] * self.hop_size < len(waveform):
113
- chunks.append({"slice": False, "split_time": f"{sil_tags[-1][1] * self.hop_size},{len(waveform)}"})
114
- chunk_dict = {}
115
- for i in range(len(chunks)):
116
- chunk_dict[str(i)] = chunks[i]
117
- return chunk_dict
118
-
119
-
120
- def cut(audio_path, db_thresh=-30, min_len=5000):
121
- audio, sr = librosa.load(audio_path, sr=None)
122
- slicer = Slicer(
123
- sr=sr,
124
- threshold=db_thresh,
125
- min_length=min_len
126
- )
127
- chunks = slicer.slice(audio)
128
- return chunks
129
-
130
-
131
- def chunks2audio(audio_path, chunks):
132
- chunks = dict(chunks)
133
- audio, sr = torchaudio.load(audio_path)
134
- if len(audio.shape) == 2 and audio.shape[1] >= 2:
135
- audio = torch.mean(audio, dim=0).unsqueeze(0)
136
- audio = audio.cpu().numpy()[0]
137
- result = []
138
- for k, v in chunks.items():
139
- tag = v["split_time"].split(",")
140
- if tag[0] != tag[1]:
141
- result.append((v["slice"], audio[int(tag[0]):int(tag[1])]))
142
- return result, sr
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/AkitoP/umamusume_bert_vits2/README.md DELETED
@@ -1,12 +0,0 @@
1
- ---
2
- title: Umamusume Bert Vits2
3
- emoji: 📊
4
- colorFrom: red
5
- colorTo: green
6
- sdk: gradio
7
- sdk_version: 3.47.1
8
- app_file: app.py
9
- pinned: false
10
- ---
11
-
12
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/Al-Chan/Vits_League_of_Legends_Yuumi_TTS/voice_upload.py DELETED
@@ -1,28 +0,0 @@
1
- from google.colab import files
2
- import shutil
3
- import os
4
- import argparse
5
- if __name__ == "__main__":
6
- parser = argparse.ArgumentParser()
7
- parser.add_argument("--type", type=str, required=True, help="type of file to upload")
8
- args = parser.parse_args()
9
- file_type = args.type
10
-
11
- basepath = os.getcwd()
12
- uploaded = files.upload() # 上传文件
13
- assert(file_type in ['zip', 'audio', 'video'])
14
- if file_type == "zip":
15
- upload_path = "./custom_character_voice/"
16
- for filename in uploaded.keys():
17
- #将上传的文件移动到指定的位置上
18
- shutil.move(os.path.join(basepath, filename), os.path.join(upload_path, "custom_character_voice.zip"))
19
- elif file_type == "audio":
20
- upload_path = "./raw_audio/"
21
- for filename in uploaded.keys():
22
- #将上传的文件移动到指定的位置上
23
- shutil.move(os.path.join(basepath, filename), os.path.join(upload_path, filename))
24
- elif file_type == "video":
25
- upload_path = "./video_data/"
26
- for filename in uploaded.keys():
27
- # 将上传的文件移动到指定的位置上
28
- shutil.move(os.path.join(basepath, filename), os.path.join(upload_path, filename))
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/Alex123aaa/1234/app.py DELETED
@@ -1,61 +0,0 @@
1
- import os
2
- os.system("pip uninstall -y gradio")
3
- os.system("pip install gradio==3.44.4")
4
- import gradio as gr
5
- from sklearn.datasets import fetch_california_housing
6
- from sklearn.model_selection import train_test_split
7
- from sklearn.linear_model import LinearRegression
8
-
9
-
10
- data = fetch_california_housing()
11
- X = data.data
12
- y = data.target
13
-
14
-
15
- X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=42)
16
-
17
-
18
- X_train = X_train[:, :5]
19
- X_test = X_test[:, :5]
20
-
21
- model = LinearRegression()
22
- model.fit(X_train, y_train)
23
-
24
-
25
- def predict_housing_price(sqft, bedrooms, bathrooms, latitude, longitude):
26
-
27
- if sqft is None or bedrooms is None or bathrooms is None or latitude is None or longitude is None:
28
- return "Please provide all input values."
29
-
30
-
31
- try:
32
- sqft = float(sqft)
33
- bedrooms = float(bedrooms)
34
- bathrooms = float(bathrooms)
35
- latitude = float(latitude)
36
- longitude = float(longitude)
37
- except ValueError:
38
- return "Invalid input. Please provide numeric values."
39
-
40
-
41
- input_features = [sqft, bedrooms, bathrooms, latitude, longitude]
42
- predicted_price = model.predict([input_features])[0]
43
-
44
-
45
- return f"Predicted Price: ${predicted_price:.2f}"
46
-
47
- input_components = [
48
- gr.inputs.Slider(label="Sqft", minimum=0, maximum=5000),
49
- gr.inputs.Slider(label="Bedrooms", minimum=0, maximum=10),
50
- gr.inputs.Slider(label="Bathrooms", minimum=0, maximum=5),
51
- gr.inputs.Slider(label="Latitude", minimum=32.5, maximum=35),
52
- gr.inputs.Slider(label="Longitude", minimum=-125, maximum=-120)
53
- ]
54
-
55
- iface = gr.Interface(
56
- fn=predict_housing_price,
57
- inputs=input_components,
58
- outputs="text"
59
- )
60
-
61
- iface.launch()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/Alichuan/VITS-Umamusume-voice-synthesizer/text/shanghainese.py DELETED
@@ -1,64 +0,0 @@
1
- import re
2
- import cn2an
3
- import opencc
4
-
5
-
6
- converter = opencc.OpenCC('zaonhe')
7
-
8
- # List of (Latin alphabet, ipa) pairs:
9
- _latin_to_ipa = [(re.compile('%s' % x[0]), x[1]) for x in [
10
- ('A', 'ᴇ'),
11
- ('B', 'bi'),
12
- ('C', 'si'),
13
- ('D', 'di'),
14
- ('E', 'i'),
15
- ('F', 'ᴇf'),
16
- ('G', 'dʑi'),
17
- ('H', 'ᴇtɕʰ'),
18
- ('I', 'ᴀi'),
19
- ('J', 'dʑᴇ'),
20
- ('K', 'kʰᴇ'),
21
- ('L', 'ᴇl'),
22
- ('M', 'ᴇm'),
23
- ('N', 'ᴇn'),
24
- ('O', 'o'),
25
- ('P', 'pʰi'),
26
- ('Q', 'kʰiu'),
27
- ('R', 'ᴀl'),
28
- ('S', 'ᴇs'),
29
- ('T', 'tʰi'),
30
- ('U', 'ɦiu'),
31
- ('V', 'vi'),
32
- ('W', 'dᴀbɤliu'),
33
- ('X', 'ᴇks'),
34
- ('Y', 'uᴀi'),
35
- ('Z', 'zᴇ')
36
- ]]
37
-
38
-
39
- def _number_to_shanghainese(num):
40
- num = cn2an.an2cn(num).replace('一十','十').replace('二十', '廿').replace('二', '两')
41
- return re.sub(r'((?:^|[^三四五六七八九])十|廿)两', r'\1二', num)
42
-
43
-
44
- def number_to_shanghainese(text):
45
- return re.sub(r'\d+(?:\.?\d+)?', lambda x: _number_to_shanghainese(x.group()), text)
46
-
47
-
48
- def latin_to_ipa(text):
49
- for regex, replacement in _latin_to_ipa:
50
- text = re.sub(regex, replacement, text)
51
- return text
52
-
53
-
54
- def shanghainese_to_ipa(text):
55
- text = number_to_shanghainese(text.upper())
56
- text = converter.convert(text).replace('-','').replace('$',' ')
57
- text = re.sub(r'[A-Z]', lambda x: latin_to_ipa(x.group())+' ', text)
58
- text = re.sub(r'[、;:]', ',', text)
59
- text = re.sub(r'\s*,\s*', ', ', text)
60
- text = re.sub(r'\s*。\s*', '. ', text)
61
- text = re.sub(r'\s*?\s*', '? ', text)
62
- text = re.sub(r'\s*!\s*', '! ', text)
63
- text = re.sub(r'\s*$', '', text)
64
- return text
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/Amite5h/EuroSAT_/README.md DELETED
@@ -1,13 +0,0 @@
1
- ---
2
- title: EuroSAT
3
- emoji: ⚡
4
- colorFrom: gray
5
- colorTo: purple
6
- sdk: streamlit
7
- sdk_version: 1.21.0
8
- app_file: app.py
9
- pinned: false
10
- license: apache-2.0
11
- ---
12
-
13
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/Amon1/ChatGPTForAcadamic/functional.py DELETED
@@ -1,70 +0,0 @@
1
- # 'primary' 颜色对应 theme.py 中的 primary_hue
2
- # 'secondary' 颜色对应 theme.py 中的 neutral_hue
3
- # 'stop' 颜色对应 theme.py 中的 color_er
4
- # 默认按钮颜色是 secondary
5
- from toolbox import clear_line_break
6
-
7
- def get_functionals():
8
- return {
9
- "英语学术润色": {
10
- # 前言
11
- "Prefix": r"Below is a paragraph from an academic paper. Polish the writing to meet the academic style, " +
12
- r"improve the spelling, grammar, clarity, concision and overall readability. When necessary, rewrite the whole sentence. " +
13
- r"Furthermore, list all modification and explain the reasons to do so in markdown table." + "\n\n",
14
- # 后语
15
- "Suffix": r"",
16
- "Color": r"secondary", # 按钮颜色
17
- },
18
- "中文学术润色": {
19
- "Prefix": r"作为一名中文学术论文写作改进助理,你的任务是改进所提供文本的拼写、语法、清晰、简洁和整体可读性," +
20
- r"同时分解长句,减少重复,并提供改进建议。请只提供文本的更正版本,避免包括解释。请编辑以下文本" + "\n\n",
21
- "Suffix": r"",
22
- },
23
- "查找语法错误": {
24
- "Prefix": r"Can you help me ensure that the grammar and the spelling is correct? " +
25
- r"Do not try to polish the text, if no mistake is found, tell me that this paragraph is good." +
26
- r"If you find grammar or spelling mistakes, please list mistakes you find in a two-column markdown table, " +
27
- r"put the original text the first column, " +
28
- r"put the corrected text in the second column and highlight the key words you fixed.""\n"
29
- r"Example:""\n"
30
- r"Paragraph: How is you? Do you knows what is it?""\n"
31
- r"| Original sentence | Corrected sentence |""\n"
32
- r"| :--- | :--- |""\n"
33
- r"| How **is** you? | How **are** you? |""\n"
34
- r"| Do you **knows** what **is** **it**? | Do you **know** what **it** **is** ? |""\n"
35
- r"Below is a paragraph from an academic paper. "
36
- r"You need to report all grammar and spelling mistakes as the example before."
37
- + "\n\n",
38
- "Suffix": r"",
39
- "PreProcess": clear_line_break, # 预处理:清除换行符
40
- },
41
- "中译英": {
42
- "Prefix": r"Please translate following sentence to English:" + "\n\n",
43
- "Suffix": r"",
44
- },
45
- "学术中英互译": {
46
- "Prefix": r"I want you to act as a scientific English-Chinese translator, " +
47
- r"I will provide you with some paragraphs in one language " +
48
- r"and your task is to accurately and academically translate the paragraphs only into the other language. " +
49
- r"Do not repeat the original provided paragraphs after translation. " +
50
- r"You should use artificial intelligence tools, " +
51
- r"such as natural language processing, and rhetorical knowledge " +
52
- r"and experience about effective writing techniques to reply. " +
53
- r"I'll give you my paragraphs as follows, tell me what language it is written in, and then translate:" + "\n\n",
54
- "Suffix": "",
55
- "Color": "secondary",
56
- },
57
- "英译中": {
58
- "Prefix": r"请翻译成中文:" + "\n\n",
59
- "Suffix": r"",
60
- },
61
- "找图片": {
62
- "Prefix": r"我需要你找一张网络图片。使用Unsplash API(https://source.unsplash.com/960x640/?<英语关键词>)获取图片URL," +
63
- r"然后请使用Markdown格式封装,并且不要有反斜线,不要用代码块。现在,请按以下描述给我发送图片:" + "\n\n",
64
- "Suffix": r"",
65
- },
66
- "解释代码": {
67
- "Prefix": r"请解释以下代码:" + "\n```\n",
68
- "Suffix": "\n```\n",
69
- },
70
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/Amrrs/DragGan-Inversion/PTI/__init__.py DELETED
File without changes
spaces/Androidonnxfork/CivitAi-to-Diffusers/diffusers/tests/pipelines/__init__.py DELETED
File without changes
spaces/Andy1621/uniformer_image_detection/configs/free_anchor/retinanet_free_anchor_r50_fpn_1x_coco.py DELETED
@@ -1,22 +0,0 @@
1
- _base_ = '../retinanet/retinanet_r50_fpn_1x_coco.py'
2
- model = dict(
3
- bbox_head=dict(
4
- _delete_=True,
5
- type='FreeAnchorRetinaHead',
6
- num_classes=80,
7
- in_channels=256,
8
- stacked_convs=4,
9
- feat_channels=256,
10
- anchor_generator=dict(
11
- type='AnchorGenerator',
12
- octave_base_scale=4,
13
- scales_per_octave=3,
14
- ratios=[0.5, 1.0, 2.0],
15
- strides=[8, 16, 32, 64, 128]),
16
- bbox_coder=dict(
17
- type='DeltaXYWHBBoxCoder',
18
- target_means=[.0, .0, .0, .0],
19
- target_stds=[0.1, 0.1, 0.2, 0.2]),
20
- loss_bbox=dict(type='SmoothL1Loss', beta=0.11, loss_weight=0.75)))
21
- optimizer_config = dict(
22
- _delete_=True, grad_clip=dict(max_norm=35, norm_type=2))
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/Andy1621/uniformer_image_detection/mmdet/core/bbox/samplers/sampling_result.py DELETED
@@ -1,152 +0,0 @@
1
- import torch
2
-
3
- from mmdet.utils import util_mixins
4
-
5
-
6
- class SamplingResult(util_mixins.NiceRepr):
7
- """Bbox sampling result.
8
-
9
- Example:
10
- >>> # xdoctest: +IGNORE_WANT
11
- >>> from mmdet.core.bbox.samplers.sampling_result import * # NOQA
12
- >>> self = SamplingResult.random(rng=10)
13
- >>> print(f'self = {self}')
14
- self = <SamplingResult({
15
- 'neg_bboxes': torch.Size([12, 4]),
16
- 'neg_inds': tensor([ 0, 1, 2, 4, 5, 6, 7, 8, 9, 10, 11, 12]),
17
- 'num_gts': 4,
18
- 'pos_assigned_gt_inds': tensor([], dtype=torch.int64),
19
- 'pos_bboxes': torch.Size([0, 4]),
20
- 'pos_inds': tensor([], dtype=torch.int64),
21
- 'pos_is_gt': tensor([], dtype=torch.uint8)
22
- })>
23
- """
24
-
25
- def __init__(self, pos_inds, neg_inds, bboxes, gt_bboxes, assign_result,
26
- gt_flags):
27
- self.pos_inds = pos_inds
28
- self.neg_inds = neg_inds
29
- self.pos_bboxes = bboxes[pos_inds]
30
- self.neg_bboxes = bboxes[neg_inds]
31
- self.pos_is_gt = gt_flags[pos_inds]
32
-
33
- self.num_gts = gt_bboxes.shape[0]
34
- self.pos_assigned_gt_inds = assign_result.gt_inds[pos_inds] - 1
35
-
36
- if gt_bboxes.numel() == 0:
37
- # hack for index error case
38
- assert self.pos_assigned_gt_inds.numel() == 0
39
- self.pos_gt_bboxes = torch.empty_like(gt_bboxes).view(-1, 4)
40
- else:
41
- if len(gt_bboxes.shape) < 2:
42
- gt_bboxes = gt_bboxes.view(-1, 4)
43
-
44
- self.pos_gt_bboxes = gt_bboxes[self.pos_assigned_gt_inds, :]
45
-
46
- if assign_result.labels is not None:
47
- self.pos_gt_labels = assign_result.labels[pos_inds]
48
- else:
49
- self.pos_gt_labels = None
50
-
51
- @property
52
- def bboxes(self):
53
- """torch.Tensor: concatenated positive and negative boxes"""
54
- return torch.cat([self.pos_bboxes, self.neg_bboxes])
55
-
56
- def to(self, device):
57
- """Change the device of the data inplace.
58
-
59
- Example:
60
- >>> self = SamplingResult.random()
61
- >>> print(f'self = {self.to(None)}')
62
- >>> # xdoctest: +REQUIRES(--gpu)
63
- >>> print(f'self = {self.to(0)}')
64
- """
65
- _dict = self.__dict__
66
- for key, value in _dict.items():
67
- if isinstance(value, torch.Tensor):
68
- _dict[key] = value.to(device)
69
- return self
70
-
71
- def __nice__(self):
72
- data = self.info.copy()
73
- data['pos_bboxes'] = data.pop('pos_bboxes').shape
74
- data['neg_bboxes'] = data.pop('neg_bboxes').shape
75
- parts = [f"'{k}': {v!r}" for k, v in sorted(data.items())]
76
- body = ' ' + ',\n '.join(parts)
77
- return '{\n' + body + '\n}'
78
-
79
- @property
80
- def info(self):
81
- """Returns a dictionary of info about the object."""
82
- return {
83
- 'pos_inds': self.pos_inds,
84
- 'neg_inds': self.neg_inds,
85
- 'pos_bboxes': self.pos_bboxes,
86
- 'neg_bboxes': self.neg_bboxes,
87
- 'pos_is_gt': self.pos_is_gt,
88
- 'num_gts': self.num_gts,
89
- 'pos_assigned_gt_inds': self.pos_assigned_gt_inds,
90
- }
91
-
92
- @classmethod
93
- def random(cls, rng=None, **kwargs):
94
- """
95
- Args:
96
- rng (None | int | numpy.random.RandomState): seed or state.
97
- kwargs (keyword arguments):
98
- - num_preds: number of predicted boxes
99
- - num_gts: number of true boxes
100
- - p_ignore (float): probability of a predicted box assinged to \
101
- an ignored truth.
102
- - p_assigned (float): probability of a predicted box not being \
103
- assigned.
104
- - p_use_label (float | bool): with labels or not.
105
-
106
- Returns:
107
- :obj:`SamplingResult`: Randomly generated sampling result.
108
-
109
- Example:
110
- >>> from mmdet.core.bbox.samplers.sampling_result import * # NOQA
111
- >>> self = SamplingResult.random()
112
- >>> print(self.__dict__)
113
- """
114
- from mmdet.core.bbox.samplers.random_sampler import RandomSampler
115
- from mmdet.core.bbox.assigners.assign_result import AssignResult
116
- from mmdet.core.bbox import demodata
117
- rng = demodata.ensure_rng(rng)
118
-
119
- # make probabalistic?
120
- num = 32
121
- pos_fraction = 0.5
122
- neg_pos_ub = -1
123
-
124
- assign_result = AssignResult.random(rng=rng, **kwargs)
125
-
126
- # Note we could just compute an assignment
127
- bboxes = demodata.random_boxes(assign_result.num_preds, rng=rng)
128
- gt_bboxes = demodata.random_boxes(assign_result.num_gts, rng=rng)
129
-
130
- if rng.rand() > 0.2:
131
- # sometimes algorithms squeeze their data, be robust to that
132
- gt_bboxes = gt_bboxes.squeeze()
133
- bboxes = bboxes.squeeze()
134
-
135
- if assign_result.labels is None:
136
- gt_labels = None
137
- else:
138
- gt_labels = None # todo
139
-
140
- if gt_labels is None:
141
- add_gt_as_proposals = False
142
- else:
143
- add_gt_as_proposals = True # make probabalistic?
144
-
145
- sampler = RandomSampler(
146
- num,
147
- pos_fraction,
148
- neg_pos_ub=neg_pos_ub,
149
- add_gt_as_proposals=add_gt_as_proposals,
150
- rng=rng)
151
- self = sampler.sample(assign_result, bboxes, gt_bboxes, gt_labels)
152
- return self
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/Andy1621/uniformer_image_segmentation/configs/fcn/fcn_r101-d8_769x769_40k_cityscapes.py DELETED
@@ -1,2 +0,0 @@
1
- _base_ = './fcn_r50-d8_769x769_40k_cityscapes.py'
2
- model = dict(pretrained='open-mmlab://resnet101_v1c', backbone=dict(depth=101))
 
 
 
spaces/AnishKumbhar/DogDiseasePredictor/app.py DELETED
@@ -1,80 +0,0 @@
1
- import torch
2
- import fastapi
3
- import numpy as np
4
- from PIL import Image
5
-
6
- class TorchTensor(torch.Tensor):
7
- pass
8
-
9
- class Prediction:
10
- prediction: TorchTensor
11
-
12
- app = fastapi.FastAPI(docs_url="/")
13
- from transformers import ViTForImageClassification
14
-
15
- # Define the number of classes in your custom dataset
16
- num_classes = 20
17
-
18
- # Initialize the ViTForImageClassification model
19
- model = ViTForImageClassification.from_pretrained(
20
- 'google/vit-base-patch16-224-in21k',
21
- num_labels=num_classes # Specify the number of classes
22
- )
23
-
24
- class_names = [
25
- "Acral Lick Dermatitis",
26
- "Acute moist dermatitis",
27
- "Canine atopic dermatitis",
28
- "Cherry Eye",
29
- "Ear infections",
30
- "External Parasites",
31
- "Folliculitis",
32
- "Healthy",
33
- "Leishmaniasis",
34
- "Lupus",
35
- "Nuclear sclerosis",
36
- "Otitis externa",
37
- "Pruritus",
38
- "Pyoderma",
39
- "Rabies",
40
- "Ringworm",
41
- "Sarcoptic Mange",
42
- "Sebaceous adenitis",
43
- "Seborrhea",
44
- "Skin tumor"
45
- ]
46
-
47
- model.load_state_dict(torch.load('best_model.pth', map_location='cpu'))
48
- # Define a function to preprocess the input image
49
- def preprocess_input(input: fastapi.UploadFile):
50
- image = Image.open(input.file)
51
- image = image.resize((224, 224)).convert("RGB")
52
- input = np.array(image)
53
- input = np.transpose(input, (2, 0, 1))
54
- input = torch.from_numpy(input).float()
55
- input = input.unsqueeze(0)
56
- return input
57
-
58
- # Define an endpoint to make predictions
59
- @app.post("/predict")
60
- async def predict_endpoint(input:fastapi.UploadFile):
61
- """Make a prediction on an image uploaded by the user."""
62
-
63
- # Preprocess the input image
64
- input = preprocess_input(input)
65
-
66
- # Make a prediction
67
- prediction = model(input)
68
-
69
-
70
- logits = prediction.logits
71
- num_top_predictions = 3
72
- top_predictions = torch.topk(logits, k=num_top_predictions, dim=1)
73
- top_indices = top_predictions.indices.squeeze().tolist()
74
- top_probabilities = torch.softmax(top_predictions.values, dim=1).squeeze().tolist()
75
-
76
- # Return the top N class indices and their probabilities in JSON format
77
- response_data = [{"class_index": class_names[idx], "probability": prob} for idx, prob in zip(top_indices, top_probabilities)]
78
- return {"predictions": response_data}
79
-
80
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/Anonymous-sub/Rerender/ControlNet/annotator/uniformer/mmcv/cnn/bricks/registry.py DELETED
@@ -1,16 +0,0 @@
1
- # Copyright (c) OpenMMLab. All rights reserved.
2
- from annotator.uniformer.mmcv.utils import Registry
3
-
4
- CONV_LAYERS = Registry('conv layer')
5
- NORM_LAYERS = Registry('norm layer')
6
- ACTIVATION_LAYERS = Registry('activation layer')
7
- PADDING_LAYERS = Registry('padding layer')
8
- UPSAMPLE_LAYERS = Registry('upsample layer')
9
- PLUGIN_LAYERS = Registry('plugin layer')
10
-
11
- DROPOUT_LAYERS = Registry('drop out layers')
12
- POSITIONAL_ENCODING = Registry('position encoding')
13
- ATTENTION = Registry('attention')
14
- FEEDFORWARD_NETWORK = Registry('feed-forward Network')
15
- TRANSFORMER_LAYER = Registry('transformerLayer')
16
- TRANSFORMER_LAYER_SEQUENCE = Registry('transformer-layers sequence')
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/Ataturk-Chatbot/HuggingFaceChat/venv/lib/python3.11/site-packages/pip/_vendor/chardet/universaldetector.py DELETED
@@ -1,362 +0,0 @@
1
- ######################## BEGIN LICENSE BLOCK ########################
2
- # The Original Code is Mozilla Universal charset detector code.
3
- #
4
- # The Initial Developer of the Original Code is
5
- # Netscape Communications Corporation.
6
- # Portions created by the Initial Developer are Copyright (C) 2001
7
- # the Initial Developer. All Rights Reserved.
8
- #
9
- # Contributor(s):
10
- # Mark Pilgrim - port to Python
11
- # Shy Shalom - original C code
12
- #
13
- # This library is free software; you can redistribute it and/or
14
- # modify it under the terms of the GNU Lesser General Public
15
- # License as published by the Free Software Foundation; either
16
- # version 2.1 of the License, or (at your option) any later version.
17
- #
18
- # This library is distributed in the hope that it will be useful,
19
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
20
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21
- # Lesser General Public License for more details.
22
- #
23
- # You should have received a copy of the GNU Lesser General Public
24
- # License along with this library; if not, write to the Free Software
25
- # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
26
- # 02110-1301 USA
27
- ######################### END LICENSE BLOCK #########################
28
- """
29
- Module containing the UniversalDetector detector class, which is the primary
30
- class a user of ``chardet`` should use.
31
-
32
- :author: Mark Pilgrim (initial port to Python)
33
- :author: Shy Shalom (original C code)
34
- :author: Dan Blanchard (major refactoring for 3.0)
35
- :author: Ian Cordasco
36
- """
37
-
38
-
39
- import codecs
40
- import logging
41
- import re
42
- from typing import List, Optional, Union
43
-
44
- from .charsetgroupprober import CharSetGroupProber
45
- from .charsetprober import CharSetProber
46
- from .enums import InputState, LanguageFilter, ProbingState
47
- from .escprober import EscCharSetProber
48
- from .latin1prober import Latin1Prober
49
- from .macromanprober import MacRomanProber
50
- from .mbcsgroupprober import MBCSGroupProber
51
- from .resultdict import ResultDict
52
- from .sbcsgroupprober import SBCSGroupProber
53
- from .utf1632prober import UTF1632Prober
54
-
55
-
56
- class UniversalDetector:
57
- """
58
- The ``UniversalDetector`` class underlies the ``chardet.detect`` function
59
- and coordinates all of the different charset probers.
60
-
61
- To get a ``dict`` containing an encoding and its confidence, you can simply
62
- run:
63
-
64
- .. code::
65
-
66
- u = UniversalDetector()
67
- u.feed(some_bytes)
68
- u.close()
69
- detected = u.result
70
-
71
- """
72
-
73
- MINIMUM_THRESHOLD = 0.20
74
- HIGH_BYTE_DETECTOR = re.compile(b"[\x80-\xFF]")
75
- ESC_DETECTOR = re.compile(b"(\033|~{)")
76
- WIN_BYTE_DETECTOR = re.compile(b"[\x80-\x9F]")
77
- ISO_WIN_MAP = {
78
- "iso-8859-1": "Windows-1252",
79
- "iso-8859-2": "Windows-1250",
80
- "iso-8859-5": "Windows-1251",
81
- "iso-8859-6": "Windows-1256",
82
- "iso-8859-7": "Windows-1253",
83
- "iso-8859-8": "Windows-1255",
84
- "iso-8859-9": "Windows-1254",
85
- "iso-8859-13": "Windows-1257",
86
- }
87
- # Based on https://encoding.spec.whatwg.org/#names-and-labels
88
- # but altered to match Python names for encodings and remove mappings
89
- # that break tests.
90
- LEGACY_MAP = {
91
- "ascii": "Windows-1252",
92
- "iso-8859-1": "Windows-1252",
93
- "tis-620": "ISO-8859-11",
94
- "iso-8859-9": "Windows-1254",
95
- "gb2312": "GB18030",
96
- "euc-kr": "CP949",
97
- "utf-16le": "UTF-16",
98
- }
99
-
100
- def __init__(
101
- self,
102
- lang_filter: LanguageFilter = LanguageFilter.ALL,
103
- should_rename_legacy: bool = False,
104
- ) -> None:
105
- self._esc_charset_prober: Optional[EscCharSetProber] = None
106
- self._utf1632_prober: Optional[UTF1632Prober] = None
107
- self._charset_probers: List[CharSetProber] = []
108
- self.result: ResultDict = {
109
- "encoding": None,
110
- "confidence": 0.0,
111
- "language": None,
112
- }
113
- self.done = False
114
- self._got_data = False
115
- self._input_state = InputState.PURE_ASCII
116
- self._last_char = b""
117
- self.lang_filter = lang_filter
118
- self.logger = logging.getLogger(__name__)
119
- self._has_win_bytes = False
120
- self.should_rename_legacy = should_rename_legacy
121
- self.reset()
122
-
123
- @property
124
- def input_state(self) -> int:
125
- return self._input_state
126
-
127
- @property
128
- def has_win_bytes(self) -> bool:
129
- return self._has_win_bytes
130
-
131
- @property
132
- def charset_probers(self) -> List[CharSetProber]:
133
- return self._charset_probers
134
-
135
- def reset(self) -> None:
136
- """
137
- Reset the UniversalDetector and all of its probers back to their
138
- initial states. This is called by ``__init__``, so you only need to
139
- call this directly in between analyses of different documents.
140
- """
141
- self.result = {"encoding": None, "confidence": 0.0, "language": None}
142
- self.done = False
143
- self._got_data = False
144
- self._has_win_bytes = False
145
- self._input_state = InputState.PURE_ASCII
146
- self._last_char = b""
147
- if self._esc_charset_prober:
148
- self._esc_charset_prober.reset()
149
- if self._utf1632_prober:
150
- self._utf1632_prober.reset()
151
- for prober in self._charset_probers:
152
- prober.reset()
153
-
154
- def feed(self, byte_str: Union[bytes, bytearray]) -> None:
155
- """
156
- Takes a chunk of a document and feeds it through all of the relevant
157
- charset probers.
158
-
159
- After calling ``feed``, you can check the value of the ``done``
160
- attribute to see if you need to continue feeding the
161
- ``UniversalDetector`` more data, or if it has made a prediction
162
- (in the ``result`` attribute).
163
-
164
- .. note::
165
- You should always call ``close`` when you're done feeding in your
166
- document if ``done`` is not already ``True``.
167
- """
168
- if self.done:
169
- return
170
-
171
- if not byte_str:
172
- return
173
-
174
- if not isinstance(byte_str, bytearray):
175
- byte_str = bytearray(byte_str)
176
-
177
- # First check for known BOMs, since these are guaranteed to be correct
178
- if not self._got_data:
179
- # If the data starts with BOM, we know it is UTF
180
- if byte_str.startswith(codecs.BOM_UTF8):
181
- # EF BB BF UTF-8 with BOM
182
- self.result = {
183
- "encoding": "UTF-8-SIG",
184
- "confidence": 1.0,
185
- "language": "",
186
- }
187
- elif byte_str.startswith((codecs.BOM_UTF32_LE, codecs.BOM_UTF32_BE)):
188
- # FF FE 00 00 UTF-32, little-endian BOM
189
- # 00 00 FE FF UTF-32, big-endian BOM
190
- self.result = {"encoding": "UTF-32", "confidence": 1.0, "language": ""}
191
- elif byte_str.startswith(b"\xFE\xFF\x00\x00"):
192
- # FE FF 00 00 UCS-4, unusual octet order BOM (3412)
193
- self.result = {
194
- # TODO: This encoding is not supported by Python. Should remove?
195
- "encoding": "X-ISO-10646-UCS-4-3412",
196
- "confidence": 1.0,
197
- "language": "",
198
- }
199
- elif byte_str.startswith(b"\x00\x00\xFF\xFE"):
200
- # 00 00 FF FE UCS-4, unusual octet order BOM (2143)
201
- self.result = {
202
- # TODO: This encoding is not supported by Python. Should remove?
203
- "encoding": "X-ISO-10646-UCS-4-2143",
204
- "confidence": 1.0,
205
- "language": "",
206
- }
207
- elif byte_str.startswith((codecs.BOM_LE, codecs.BOM_BE)):
208
- # FF FE UTF-16, little endian BOM
209
- # FE FF UTF-16, big endian BOM
210
- self.result = {"encoding": "UTF-16", "confidence": 1.0, "language": ""}
211
-
212
- self._got_data = True
213
- if self.result["encoding"] is not None:
214
- self.done = True
215
- return
216
-
217
- # If none of those matched and we've only see ASCII so far, check
218
- # for high bytes and escape sequences
219
- if self._input_state == InputState.PURE_ASCII:
220
- if self.HIGH_BYTE_DETECTOR.search(byte_str):
221
- self._input_state = InputState.HIGH_BYTE
222
- elif (
223
- self._input_state == InputState.PURE_ASCII
224
- and self.ESC_DETECTOR.search(self._last_char + byte_str)
225
- ):
226
- self._input_state = InputState.ESC_ASCII
227
-
228
- self._last_char = byte_str[-1:]
229
-
230
- # next we will look to see if it is appears to be either a UTF-16 or
231
- # UTF-32 encoding
232
- if not self._utf1632_prober:
233
- self._utf1632_prober = UTF1632Prober()
234
-
235
- if self._utf1632_prober.state == ProbingState.DETECTING:
236
- if self._utf1632_prober.feed(byte_str) == ProbingState.FOUND_IT:
237
- self.result = {
238
- "encoding": self._utf1632_prober.charset_name,
239
- "confidence": self._utf1632_prober.get_confidence(),
240
- "language": "",
241
- }
242
- self.done = True
243
- return
244
-
245
- # If we've seen escape sequences, use the EscCharSetProber, which
246
- # uses a simple state machine to check for known escape sequences in
247
- # HZ and ISO-2022 encodings, since those are the only encodings that
248
- # use such sequences.
249
- if self._input_state == InputState.ESC_ASCII:
250
- if not self._esc_charset_prober:
251
- self._esc_charset_prober = EscCharSetProber(self.lang_filter)
252
- if self._esc_charset_prober.feed(byte_str) == ProbingState.FOUND_IT:
253
- self.result = {
254
- "encoding": self._esc_charset_prober.charset_name,
255
- "confidence": self._esc_charset_prober.get_confidence(),
256
- "language": self._esc_charset_prober.language,
257
- }
258
- self.done = True
259
- # If we've seen high bytes (i.e., those with values greater than 127),
260
- # we need to do more complicated checks using all our multi-byte and
261
- # single-byte probers that are left. The single-byte probers
262
- # use character bigram distributions to determine the encoding, whereas
263
- # the multi-byte probers use a combination of character unigram and
264
- # bigram distributions.
265
- elif self._input_state == InputState.HIGH_BYTE:
266
- if not self._charset_probers:
267
- self._charset_probers = [MBCSGroupProber(self.lang_filter)]
268
- # If we're checking non-CJK encodings, use single-byte prober
269
- if self.lang_filter & LanguageFilter.NON_CJK:
270
- self._charset_probers.append(SBCSGroupProber())
271
- self._charset_probers.append(Latin1Prober())
272
- self._charset_probers.append(MacRomanProber())
273
- for prober in self._charset_probers:
274
- if prober.feed(byte_str) == ProbingState.FOUND_IT:
275
- self.result = {
276
- "encoding": prober.charset_name,
277
- "confidence": prober.get_confidence(),
278
- "language": prober.language,
279
- }
280
- self.done = True
281
- break
282
- if self.WIN_BYTE_DETECTOR.search(byte_str):
283
- self._has_win_bytes = True
284
-
285
- def close(self) -> ResultDict:
286
- """
287
- Stop analyzing the current document and come up with a final
288
- prediction.
289
-
290
- :returns: The ``result`` attribute, a ``dict`` with the keys
291
- `encoding`, `confidence`, and `language`.
292
- """
293
- # Don't bother with checks if we're already done
294
- if self.done:
295
- return self.result
296
- self.done = True
297
-
298
- if not self._got_data:
299
- self.logger.debug("no data received!")
300
-
301
- # Default to ASCII if it is all we've seen so far
302
- elif self._input_state == InputState.PURE_ASCII:
303
- self.result = {"encoding": "ascii", "confidence": 1.0, "language": ""}
304
-
305
- # If we have seen non-ASCII, return the best that met MINIMUM_THRESHOLD
306
- elif self._input_state == InputState.HIGH_BYTE:
307
- prober_confidence = None
308
- max_prober_confidence = 0.0
309
- max_prober = None
310
- for prober in self._charset_probers:
311
- if not prober:
312
- continue
313
- prober_confidence = prober.get_confidence()
314
- if prober_confidence > max_prober_confidence:
315
- max_prober_confidence = prober_confidence
316
- max_prober = prober
317
- if max_prober and (max_prober_confidence > self.MINIMUM_THRESHOLD):
318
- charset_name = max_prober.charset_name
319
- assert charset_name is not None
320
- lower_charset_name = charset_name.lower()
321
- confidence = max_prober.get_confidence()
322
- # Use Windows encoding name instead of ISO-8859 if we saw any
323
- # extra Windows-specific bytes
324
- if lower_charset_name.startswith("iso-8859"):
325
- if self._has_win_bytes:
326
- charset_name = self.ISO_WIN_MAP.get(
327
- lower_charset_name, charset_name
328
- )
329
- # Rename legacy encodings with superset encodings if asked
330
- if self.should_rename_legacy:
331
- charset_name = self.LEGACY_MAP.get(
332
- (charset_name or "").lower(), charset_name
333
- )
334
- self.result = {
335
- "encoding": charset_name,
336
- "confidence": confidence,
337
- "language": max_prober.language,
338
- }
339
-
340
- # Log all prober confidences if none met MINIMUM_THRESHOLD
341
- if self.logger.getEffectiveLevel() <= logging.DEBUG:
342
- if self.result["encoding"] is None:
343
- self.logger.debug("no probers hit minimum threshold")
344
- for group_prober in self._charset_probers:
345
- if not group_prober:
346
- continue
347
- if isinstance(group_prober, CharSetGroupProber):
348
- for prober in group_prober.probers:
349
- self.logger.debug(
350
- "%s %s confidence = %s",
351
- prober.charset_name,
352
- prober.language,
353
- prober.get_confidence(),
354
- )
355
- else:
356
- self.logger.debug(
357
- "%s %s confidence = %s",
358
- group_prober.charset_name,
359
- group_prober.language,
360
- group_prober.get_confidence(),
361
- )
362
- return self.result
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/Awesimo/jojogan/e4e/training/ranger.py DELETED
@@ -1,164 +0,0 @@
1
- # Ranger deep learning optimizer - RAdam + Lookahead + Gradient Centralization, combined into one optimizer.
2
-
3
- # https://github.com/lessw2020/Ranger-Deep-Learning-Optimizer
4
- # and/or
5
- # https://github.com/lessw2020/Best-Deep-Learning-Optimizers
6
-
7
- # Ranger has now been used to capture 12 records on the FastAI leaderboard.
8
-
9
- # This version = 20.4.11
10
-
11
- # Credits:
12
- # Gradient Centralization --> https://arxiv.org/abs/2004.01461v2 (a new optimization technique for DNNs), github: https://github.com/Yonghongwei/Gradient-Centralization
13
- # RAdam --> https://github.com/LiyuanLucasLiu/RAdam
14
- # Lookahead --> rewritten by lessw2020, but big thanks to Github @LonePatient and @RWightman for ideas from their code.
15
- # Lookahead paper --> MZhang,G Hinton https://arxiv.org/abs/1907.08610
16
-
17
- # summary of changes:
18
- # 4/11/20 - add gradient centralization option. Set new testing benchmark for accuracy with it, toggle with use_gc flag at init.
19
- # full code integration with all updates at param level instead of group, moves slow weights into state dict (from generic weights),
20
- # supports group learning rates (thanks @SHolderbach), fixes sporadic load from saved model issues.
21
- # changes 8/31/19 - fix references to *self*.N_sma_threshold;
22
- # changed eps to 1e-5 as better default than 1e-8.
23
-
24
- import math
25
- import torch
26
- from torch.optim.optimizer import Optimizer
27
-
28
-
29
- class Ranger(Optimizer):
30
-
31
- def __init__(self, params, lr=1e-3, # lr
32
- alpha=0.5, k=6, N_sma_threshhold=5, # Ranger options
33
- betas=(.95, 0.999), eps=1e-5, weight_decay=0, # Adam options
34
- use_gc=True, gc_conv_only=False
35
- # Gradient centralization on or off, applied to conv layers only or conv + fc layers
36
- ):
37
-
38
- # parameter checks
39
- if not 0.0 <= alpha <= 1.0:
40
- raise ValueError(f'Invalid slow update rate: {alpha}')
41
- if not 1 <= k:
42
- raise ValueError(f'Invalid lookahead steps: {k}')
43
- if not lr > 0:
44
- raise ValueError(f'Invalid Learning Rate: {lr}')
45
- if not eps > 0:
46
- raise ValueError(f'Invalid eps: {eps}')
47
-
48
- # parameter comments:
49
- # beta1 (momentum) of .95 seems to work better than .90...
50
- # N_sma_threshold of 5 seems better in testing than 4.
51
- # In both cases, worth testing on your dataset (.90 vs .95, 4 vs 5) to make sure which works best for you.
52
-
53
- # prep defaults and init torch.optim base
54
- defaults = dict(lr=lr, alpha=alpha, k=k, step_counter=0, betas=betas, N_sma_threshhold=N_sma_threshhold,
55
- eps=eps, weight_decay=weight_decay)
56
- super().__init__(params, defaults)
57
-
58
- # adjustable threshold
59
- self.N_sma_threshhold = N_sma_threshhold
60
-
61
- # look ahead params
62
-
63
- self.alpha = alpha
64
- self.k = k
65
-
66
- # radam buffer for state
67
- self.radam_buffer = [[None, None, None] for ind in range(10)]
68
-
69
- # gc on or off
70
- self.use_gc = use_gc
71
-
72
- # level of gradient centralization
73
- self.gc_gradient_threshold = 3 if gc_conv_only else 1
74
-
75
- def __setstate__(self, state):
76
- super(Ranger, self).__setstate__(state)
77
-
78
- def step(self, closure=None):
79
- loss = None
80
-
81
- # Evaluate averages and grad, update param tensors
82
- for group in self.param_groups:
83
-
84
- for p in group['params']:
85
- if p.grad is None:
86
- continue
87
- grad = p.grad.data.float()
88
-
89
- if grad.is_sparse:
90
- raise RuntimeError('Ranger optimizer does not support sparse gradients')
91
-
92
- p_data_fp32 = p.data.float()
93
-
94
- state = self.state[p] # get state dict for this param
95
-
96
- if len(state) == 0: # if first time to run...init dictionary with our desired entries
97
- # if self.first_run_check==0:
98
- # self.first_run_check=1
99
- # print("Initializing slow buffer...should not see this at load from saved model!")
100
- state['step'] = 0
101
- state['exp_avg'] = torch.zeros_like(p_data_fp32)
102
- state['exp_avg_sq'] = torch.zeros_like(p_data_fp32)
103
-
104
- # look ahead weight storage now in state dict
105
- state['slow_buffer'] = torch.empty_like(p.data)
106
- state['slow_buffer'].copy_(p.data)
107
-
108
- else:
109
- state['exp_avg'] = state['exp_avg'].type_as(p_data_fp32)
110
- state['exp_avg_sq'] = state['exp_avg_sq'].type_as(p_data_fp32)
111
-
112
- # begin computations
113
- exp_avg, exp_avg_sq = state['exp_avg'], state['exp_avg_sq']
114
- beta1, beta2 = group['betas']
115
-
116
- # GC operation for Conv layers and FC layers
117
- if grad.dim() > self.gc_gradient_threshold:
118
- grad.add_(-grad.mean(dim=tuple(range(1, grad.dim())), keepdim=True))
119
-
120
- state['step'] += 1
121
-
122
- # compute variance mov avg
123
- exp_avg_sq.mul_(beta2).addcmul_(1 - beta2, grad, grad)
124
- # compute mean moving avg
125
- exp_avg.mul_(beta1).add_(1 - beta1, grad)
126
-
127
- buffered = self.radam_buffer[int(state['step'] % 10)]
128
-
129
- if state['step'] == buffered[0]:
130
- N_sma, step_size = buffered[1], buffered[2]
131
- else:
132
- buffered[0] = state['step']
133
- beta2_t = beta2 ** state['step']
134
- N_sma_max = 2 / (1 - beta2) - 1
135
- N_sma = N_sma_max - 2 * state['step'] * beta2_t / (1 - beta2_t)
136
- buffered[1] = N_sma
137
- if N_sma > self.N_sma_threshhold:
138
- step_size = math.sqrt(
139
- (1 - beta2_t) * (N_sma - 4) / (N_sma_max - 4) * (N_sma - 2) / N_sma * N_sma_max / (
140
- N_sma_max - 2)) / (1 - beta1 ** state['step'])
141
- else:
142
- step_size = 1.0 / (1 - beta1 ** state['step'])
143
- buffered[2] = step_size
144
-
145
- if group['weight_decay'] != 0:
146
- p_data_fp32.add_(-group['weight_decay'] * group['lr'], p_data_fp32)
147
-
148
- # apply lr
149
- if N_sma > self.N_sma_threshhold:
150
- denom = exp_avg_sq.sqrt().add_(group['eps'])
151
- p_data_fp32.addcdiv_(-step_size * group['lr'], exp_avg, denom)
152
- else:
153
- p_data_fp32.add_(-step_size * group['lr'], exp_avg)
154
-
155
- p.data.copy_(p_data_fp32)
156
-
157
- # integrated look ahead...
158
- # we do it at the param level instead of group level
159
- if state['step'] % group['k'] == 0:
160
- slow_p = state['slow_buffer'] # get access to slow param tensor
161
- slow_p.add_(self.alpha, p.data - slow_p) # (fast weights - slow weights) * alpha
162
- p.data.copy_(slow_p) # copy interpolated weights to RAdam param tensor
163
-
164
- return loss
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/Awiny/Image2Paragraph/models/grit_src/third_party/CenterNet2/tools/plain_train_net.py DELETED
@@ -1,223 +0,0 @@
1
- #!/usr/bin/env python
2
- # Copyright (c) Facebook, Inc. and its affiliates.
3
- """
4
- Detectron2 training script with a plain training loop.
5
-
6
- This script reads a given config file and runs the training or evaluation.
7
- It is an entry point that is able to train standard models in detectron2.
8
-
9
- In order to let one script support training of many models,
10
- this script contains logic that are specific to these built-in models and therefore
11
- may not be suitable for your own project.
12
- For example, your research project perhaps only needs a single "evaluator".
13
-
14
- Therefore, we recommend you to use detectron2 as a library and take
15
- this file as an example of how to use the library.
16
- You may want to write your own script with your datasets and other customizations.
17
-
18
- Compared to "train_net.py", this script supports fewer default features.
19
- It also includes fewer abstraction, therefore is easier to add custom logic.
20
- """
21
-
22
- import logging
23
- import os
24
- from collections import OrderedDict
25
- import torch
26
- from torch.nn.parallel import DistributedDataParallel
27
-
28
- import detectron2.utils.comm as comm
29
- from detectron2.checkpoint import DetectionCheckpointer, PeriodicCheckpointer
30
- from detectron2.config import get_cfg
31
- from detectron2.data import (
32
- MetadataCatalog,
33
- build_detection_test_loader,
34
- build_detection_train_loader,
35
- )
36
- from detectron2.engine import default_argument_parser, default_setup, default_writers, launch
37
- from detectron2.evaluation import (
38
- CityscapesInstanceEvaluator,
39
- CityscapesSemSegEvaluator,
40
- COCOEvaluator,
41
- COCOPanopticEvaluator,
42
- DatasetEvaluators,
43
- LVISEvaluator,
44
- PascalVOCDetectionEvaluator,
45
- SemSegEvaluator,
46
- inference_on_dataset,
47
- print_csv_format,
48
- )
49
- from detectron2.modeling import build_model
50
- from detectron2.solver import build_lr_scheduler, build_optimizer
51
- from detectron2.utils.events import EventStorage
52
-
53
- logger = logging.getLogger("detectron2")
54
-
55
-
56
- def get_evaluator(cfg, dataset_name, output_folder=None):
57
- """
58
- Create evaluator(s) for a given dataset.
59
- This uses the special metadata "evaluator_type" associated with each builtin dataset.
60
- For your own dataset, you can simply create an evaluator manually in your
61
- script and do not have to worry about the hacky if-else logic here.
62
- """
63
- if output_folder is None:
64
- output_folder = os.path.join(cfg.OUTPUT_DIR, "inference")
65
- evaluator_list = []
66
- evaluator_type = MetadataCatalog.get(dataset_name).evaluator_type
67
- if evaluator_type in ["sem_seg", "coco_panoptic_seg"]:
68
- evaluator_list.append(
69
- SemSegEvaluator(
70
- dataset_name,
71
- distributed=True,
72
- output_dir=output_folder,
73
- )
74
- )
75
- if evaluator_type in ["coco", "coco_panoptic_seg"]:
76
- evaluator_list.append(COCOEvaluator(dataset_name, output_dir=output_folder))
77
- if evaluator_type == "coco_panoptic_seg":
78
- evaluator_list.append(COCOPanopticEvaluator(dataset_name, output_folder))
79
- if evaluator_type == "cityscapes_instance":
80
- assert (
81
- torch.cuda.device_count() > comm.get_rank()
82
- ), "CityscapesEvaluator currently do not work with multiple machines."
83
- return CityscapesInstanceEvaluator(dataset_name)
84
- if evaluator_type == "cityscapes_sem_seg":
85
- assert (
86
- torch.cuda.device_count() > comm.get_rank()
87
- ), "CityscapesEvaluator currently do not work with multiple machines."
88
- return CityscapesSemSegEvaluator(dataset_name)
89
- if evaluator_type == "pascal_voc":
90
- return PascalVOCDetectionEvaluator(dataset_name)
91
- if evaluator_type == "lvis":
92
- return LVISEvaluator(dataset_name, cfg, True, output_folder)
93
- if len(evaluator_list) == 0:
94
- raise NotImplementedError(
95
- "no Evaluator for the dataset {} with the type {}".format(dataset_name, evaluator_type)
96
- )
97
- if len(evaluator_list) == 1:
98
- return evaluator_list[0]
99
- return DatasetEvaluators(evaluator_list)
100
-
101
-
102
- def do_test(cfg, model):
103
- results = OrderedDict()
104
- for dataset_name in cfg.DATASETS.TEST:
105
- data_loader = build_detection_test_loader(cfg, dataset_name)
106
- evaluator = get_evaluator(
107
- cfg, dataset_name, os.path.join(cfg.OUTPUT_DIR, "inference", dataset_name)
108
- )
109
- results_i = inference_on_dataset(model, data_loader, evaluator)
110
- results[dataset_name] = results_i
111
- if comm.is_main_process():
112
- logger.info("Evaluation results for {} in csv format:".format(dataset_name))
113
- print_csv_format(results_i)
114
- if len(results) == 1:
115
- results = list(results.values())[0]
116
- return results
117
-
118
-
119
- def do_train(cfg, model, resume=False):
120
- model.train()
121
- optimizer = build_optimizer(cfg, model)
122
- scheduler = build_lr_scheduler(cfg, optimizer)
123
-
124
- checkpointer = DetectionCheckpointer(
125
- model, cfg.OUTPUT_DIR, optimizer=optimizer, scheduler=scheduler
126
- )
127
- start_iter = (
128
- checkpointer.resume_or_load(cfg.MODEL.WEIGHTS, resume=resume).get("iteration", -1) + 1
129
- )
130
- max_iter = cfg.SOLVER.MAX_ITER
131
-
132
- periodic_checkpointer = PeriodicCheckpointer(
133
- checkpointer, cfg.SOLVER.CHECKPOINT_PERIOD, max_iter=max_iter
134
- )
135
-
136
- writers = default_writers(cfg.OUTPUT_DIR, max_iter) if comm.is_main_process() else []
137
-
138
- # compared to "train_net.py", we do not support accurate timing and
139
- # precise BN here, because they are not trivial to implement in a small training loop
140
- data_loader = build_detection_train_loader(cfg)
141
- logger.info("Starting training from iteration {}".format(start_iter))
142
- with EventStorage(start_iter) as storage:
143
- for data, iteration in zip(data_loader, range(start_iter, max_iter)):
144
- storage.iter = iteration
145
-
146
- loss_dict = model(data)
147
- losses = sum(loss_dict.values())
148
- assert torch.isfinite(losses).all(), loss_dict
149
-
150
- loss_dict_reduced = {k: v.item() for k, v in comm.reduce_dict(loss_dict).items()}
151
- losses_reduced = sum(loss for loss in loss_dict_reduced.values())
152
- if comm.is_main_process():
153
- storage.put_scalars(total_loss=losses_reduced, **loss_dict_reduced)
154
-
155
- optimizer.zero_grad()
156
- losses.backward()
157
- optimizer.step()
158
- storage.put_scalar("lr", optimizer.param_groups[0]["lr"], smoothing_hint=False)
159
- scheduler.step()
160
-
161
- if (
162
- cfg.TEST.EVAL_PERIOD > 0
163
- and (iteration + 1) % cfg.TEST.EVAL_PERIOD == 0
164
- and iteration != max_iter - 1
165
- ):
166
- do_test(cfg, model)
167
- # Compared to "train_net.py", the test results are not dumped to EventStorage
168
- comm.synchronize()
169
-
170
- if iteration - start_iter > 5 and (
171
- (iteration + 1) % 20 == 0 or iteration == max_iter - 1
172
- ):
173
- for writer in writers:
174
- writer.write()
175
- periodic_checkpointer.step(iteration)
176
-
177
-
178
- def setup(args):
179
- """
180
- Create configs and perform basic setups.
181
- """
182
- cfg = get_cfg()
183
- cfg.merge_from_file(args.config_file)
184
- cfg.merge_from_list(args.opts)
185
- cfg.freeze()
186
- default_setup(
187
- cfg, args
188
- ) # if you don't like any of the default setup, write your own setup code
189
- return cfg
190
-
191
-
192
- def main(args):
193
- cfg = setup(args)
194
-
195
- model = build_model(cfg)
196
- logger.info("Model:\n{}".format(model))
197
- if args.eval_only:
198
- DetectionCheckpointer(model, save_dir=cfg.OUTPUT_DIR).resume_or_load(
199
- cfg.MODEL.WEIGHTS, resume=args.resume
200
- )
201
- return do_test(cfg, model)
202
-
203
- distributed = comm.get_world_size() > 1
204
- if distributed:
205
- model = DistributedDataParallel(
206
- model, device_ids=[comm.get_local_rank()], broadcast_buffers=False
207
- )
208
-
209
- do_train(cfg, model, resume=args.resume)
210
- return do_test(cfg, model)
211
-
212
-
213
- if __name__ == "__main__":
214
- args = default_argument_parser().parse_args()
215
- print("Command Line Args:", args)
216
- launch(
217
- main,
218
- args.num_gpus,
219
- num_machines=args.num_machines,
220
- machine_rank=args.machine_rank,
221
- dist_url=args.dist_url,
222
- args=(args,),
223
- )
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/BaiyuS/Real-CUGAN-YZ/README.md DELETED
@@ -1,14 +0,0 @@
1
- ---
2
- title: Real CUGAN
3
- emoji: 🐢
4
- colorFrom: gray
5
- colorTo: green
6
- sdk: gradio
7
- sdk_version: 3.6
8
- app_file: app.py
9
- pinned: false
10
- license: gpl-3.0
11
- duplicated_from: DianXian/Real-CUGAN
12
- ---
13
-
14
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/Bart92/RVC_HF/lib/uvr5_pack/utils.py DELETED
@@ -1,120 +0,0 @@
1
- import torch
2
- import numpy as np
3
- from tqdm import tqdm
4
- import json
5
-
6
-
7
- def load_data(file_name: str = "./lib/uvr5_pack/name_params.json") -> dict:
8
- with open(file_name, "r") as f:
9
- data = json.load(f)
10
-
11
- return data
12
-
13
-
14
- def make_padding(width, cropsize, offset):
15
- left = offset
16
- roi_size = cropsize - left * 2
17
- if roi_size == 0:
18
- roi_size = cropsize
19
- right = roi_size - (width % roi_size) + left
20
-
21
- return left, right, roi_size
22
-
23
-
24
- def inference(X_spec, device, model, aggressiveness, data):
25
- """
26
- data : dic configs
27
- """
28
-
29
- def _execute(
30
- X_mag_pad, roi_size, n_window, device, model, aggressiveness, is_half=True
31
- ):
32
- model.eval()
33
- with torch.no_grad():
34
- preds = []
35
-
36
- iterations = [n_window]
37
-
38
- total_iterations = sum(iterations)
39
- for i in tqdm(range(n_window)):
40
- start = i * roi_size
41
- X_mag_window = X_mag_pad[
42
- None, :, :, start : start + data["window_size"]
43
- ]
44
- X_mag_window = torch.from_numpy(X_mag_window)
45
- if is_half:
46
- X_mag_window = X_mag_window.half()
47
- X_mag_window = X_mag_window.to(device)
48
-
49
- pred = model.predict(X_mag_window, aggressiveness)
50
-
51
- pred = pred.detach().cpu().numpy()
52
- preds.append(pred[0])
53
-
54
- pred = np.concatenate(preds, axis=2)
55
- return pred
56
-
57
- def preprocess(X_spec):
58
- X_mag = np.abs(X_spec)
59
- X_phase = np.angle(X_spec)
60
-
61
- return X_mag, X_phase
62
-
63
- X_mag, X_phase = preprocess(X_spec)
64
-
65
- coef = X_mag.max()
66
- X_mag_pre = X_mag / coef
67
-
68
- n_frame = X_mag_pre.shape[2]
69
- pad_l, pad_r, roi_size = make_padding(n_frame, data["window_size"], model.offset)
70
- n_window = int(np.ceil(n_frame / roi_size))
71
-
72
- X_mag_pad = np.pad(X_mag_pre, ((0, 0), (0, 0), (pad_l, pad_r)), mode="constant")
73
-
74
- if list(model.state_dict().values())[0].dtype == torch.float16:
75
- is_half = True
76
- else:
77
- is_half = False
78
- pred = _execute(
79
- X_mag_pad, roi_size, n_window, device, model, aggressiveness, is_half
80
- )
81
- pred = pred[:, :, :n_frame]
82
-
83
- if data["tta"]:
84
- pad_l += roi_size // 2
85
- pad_r += roi_size // 2
86
- n_window += 1
87
-
88
- X_mag_pad = np.pad(X_mag_pre, ((0, 0), (0, 0), (pad_l, pad_r)), mode="constant")
89
-
90
- pred_tta = _execute(
91
- X_mag_pad, roi_size, n_window, device, model, aggressiveness, is_half
92
- )
93
- pred_tta = pred_tta[:, :, roi_size // 2 :]
94
- pred_tta = pred_tta[:, :, :n_frame]
95
-
96
- return (pred + pred_tta) * 0.5 * coef, X_mag, np.exp(1.0j * X_phase)
97
- else:
98
- return pred * coef, X_mag, np.exp(1.0j * X_phase)
99
-
100
-
101
- def _get_name_params(model_path, model_hash):
102
- data = load_data()
103
- flag = False
104
- ModelName = model_path
105
- for type in list(data):
106
- for model in list(data[type][0]):
107
- for i in range(len(data[type][0][model])):
108
- if str(data[type][0][model][i]["hash_name"]) == model_hash:
109
- flag = True
110
- elif str(data[type][0][model][i]["hash_name"]) in ModelName:
111
- flag = True
112
-
113
- if flag:
114
- model_params_auto = data[type][0][model][i]["model_params"]
115
- param_name_auto = data[type][0][model][i]["param_name"]
116
- if type == "equivalent":
117
- return param_name_auto, model_params_auto
118
- else:
119
- flag = False
120
- return param_name_auto, model_params_auto
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/Benson/text-generation/Examples/Adivina La Pelcula.md DELETED
@@ -1,50 +0,0 @@
1
- <br />
2
- <h1>Adivina la película: Un juego divertido y desafiante para los amantes del cine</h1> <p> ¿Te gustan las películas? ¿Crees que puedes reconocer cualquier película de una sola escena, un cartel o un actor? Si es así, entonces deberías probar Guess the Movie, un juego divertido y desafiante que pone a prueba tu conocimiento y memoria cinematográfica. Adivina la película es un juego en el que tienes que adivinar el título de una película basado en diferentes pistas, como imágenes, sonidos, géneros, directores, actores, etc. Puedes jugarlo online o offline, solo o con amigos, y pasarlo en grande mientras aprendes nuevos hechos y curiosidades sobre las películas. </p>
3
- <h2>Adivina la película</h2><br /><p><b><b>Download Zip</b> &#10004;&#10004;&#10004; <a href="https://bltlly.com/2v6MXS">https://bltlly.com/2v6MXS</a></b></p><br /><br /> <h2>Cómo Jugar Adivina la Película</h2> <p>Las reglas de Adivina la Película son simples. Se te dará una pista sobre una película, como una imagen, un clip de sonido, un género, un director, un actor, etc. Tienes que adivinar el título de la película lo más rápido posible. Puede escribir su respuesta o elegir entre varias opciones. Dependiendo del tipo de pista y el nivel de dificultad, obtendrá más o menos puntos por cada suposición correcta. También puede omitir una pista si no la conoce o usar pistas si necesita ayuda. El juego termina cuando se le acaba el tiempo o las pistas. </p> <h3>Tipos de suposiciones</h3> <p>Hay diferentes tipos de suposiciones que puedes hacer en Adivina la película. Algunos de ellos son:</p> <ul> <li>Título: Tienes que adivinar el título completo de la película. </li> <li>Género: Tienes que adivinar el género o categoría de la película. </li> <li>Actor: Tienes que adivinar el nombre de un actor que protagonizó la película. </li> <li>Director: Tienes que adivinar el nombre del director que hizo la película. </li> <li>Año: Tienes que adivinar el año en que se estrenó la película. </li> <li>Cita: Tienes que adivinar qué película contiene una cita famosa. </li> </ul> <h3>Sistema de puntuación</h3> <p>El sistema de puntuación en Adivina la película depende de varios factores, como:</p> <ul> <li>El tipo de pista: Algunas pistas son más fáciles que otras y dan menos puntos. </li> <li El límite de tiempo: Cuanto más rápido adivines, más puntos obtendrás. </li>
4
-
5
-
6
- <li>El número de saltos: Cuantos más saltos uses, menos puntos obtendrás. </li>
7
- </ul>
8
- <p>El juego le mostrará su puntuación después de cada adivinanza y al final del juego. Puedes comparar tu puntuación con la de otros jugadores y ver lo bien que lo hiciste. </p>
9
- <h3>Consejos y trucos</h3>
10
- <p>Adivinar películas puede ser complicado, pero hay algunos consejos y trucos que pueden ayudarle a mejorar sus habilidades y velocidad. Estos son algunos de ellos:</p>
11
- <p></p>
12
- <ul>
13
- <li>Preste atención a los detalles: A veces, un pequeño detalle puede revelar la película, como un logotipo, un accesorio, un traje, una ubicación, etc.</li>
14
- <li>Usa tu memoria: Intenta recordar si has visto u oído de la película antes, y lo que recuerdas de ella. </li>
15
- <li>Usa tu lógica: Trata de deducir la película de las pistas, usando el sentido común y el razonamiento. </li>
16
- <li>Usa tus conocimientos: Trata de usar lo que sabes sobre películas, como géneros, directores, actores, premios, etc.</li>
17
- <li>Utilice su creatividad: Trate de pensar fuera de la caja y llegar a diferentes posibilidades. </li>
18
- </ul>
19
- <h2>Beneficios de jugar a adivinar la película</h2>
20
- <p>Jugar a adivinar la película no solo es divertido y desafiante, sino también beneficioso para el cerebro y la mente. Algunos de los beneficios son:</p>
21
- <ul>
22
- <li>Mejora tu memoria: al adivinar películas, activas tu memoria a largo y corto plazo, y fortaleces tu capacidad de recordar. </li>
23
- <li>Mejora tu conocimiento: adivinando películas, aprendes nuevos hechos y trivia sobre películas, como títulos, géneros, directores, actores, etc.</li>
24
- <li>Aumenta su creatividad: Al adivinar películas, estimula su imaginación y habilidades de pensamiento divergentes. </li>
25
- <li>Reduce el estrés: al adivinar películas, relajas tu mente y te diviertes. </li>
26
- <li>Aumenta la interacción social: adivinando películas, puedes jugar con amigos y familiares, y tener una buena conversación. </li>
27
- </ul>
28
- <h2>Ejemplos de adivinar los juegos de películas</h2>
29
-
30
- <h3>Moviedle</h3>
31
- <p>Moviedle es un juego en línea que te muestra una versión de un segundo de una película y te pide que adivines el título. Puedes elegir entre diferentes géneros y niveles de dificultad. También puedes crear tus propios Moviedles y compartirlos con otros. Moviedle es una forma rápida y divertida de probar tus habilidades de reconocimiento de películas. </p>
32
- <h3>Enmarcado</h3>
33
- <p>Framed es un juego online que te muestra seis fotogramas de una película y te pide que adivines el título. Puedes elegir entre diferentes categorías y niveles de dificultad. También puedes crear tus propios juegos enmarcados y compartirlos con otros. Enmarcado es una forma desafiante y adictiva de probar tus habilidades de observación de películas. </p>
34
- <h3>CineNerdle</h3>
35
- <p>CineNerdle es un juego en línea que te muestra una cuadrícula de fichas de un cartel de película y te pide que adivines el título. Puedes elegir entre diferentes géneros y niveles de dificultad. También puedes crear tus propios CineNerdles y compartirlos con otros. CineNerdle es una forma inteligente y divertida de poner a prueba tus conocimientos cinematográficos. </p>
36
- <h3>Charadas</h3>
37
- <p>Charades es un juego offline que consiste en representar un título de película sin hablar. Puedes jugar con dos o más personas, en equipos o individualmente. Puedes elegir entre diferentes géneros y niveles de dificultad. También puedes crear tus propias cartas de Charadas y usarlas en el juego. Charadas es una forma clásica y entretenida de poner a prueba tus habilidades de actuación cinematográfica. </p>
38
- <h2>Conclusión</h2>
39
- <p>Adivina la película es un juego divertido y desafiante que pone a prueba tu conocimiento de la película y la memoria. Es fácil jugar en línea o fuera de línea, solo o con amigos. Tiene muchos beneficios para el cerebro y la mente, como mejorar la memoria, el conocimiento, la creatividad, etc. También tiene muchos ejemplos de juegos que se basan en adivinanzas de películas, como Moviedle, Enmarcado, CineNerdle, Charadas, etc. Si te gustan las películas y quieres pasar un buen rato mientras aprendes nuevos hechos y trivia sobre ellas, ¡entonces deberías probar Guess the Movie hoy! </p>
40
- <h2>Preguntas frecuentes</h2>
41
-
42
- <ol>
43
- <li><b> ¿Qué es Adivina la película? </b><br/>Adivina la película es un juego donde tienes que adivinar el título de una película basado en diferentes pistas, como imágenes, sonidos, géneros, directores, actores, etc.</li>
44
- <li><b> ¿Cómo se juega Adivina la película? </b><br/>Puedes jugar Adivina la película en línea o fuera de línea, solo o con amigos. Se te dará una pista sobre una película, y tienes que adivinar el título lo más rápido posible. Puede escribir su respuesta o elegir entre varias opciones. También puede omitir una pista o usar sugerencias si necesita ayuda. </li>
45
- <li><b>¿Cuáles son los beneficios de jugar Adivina la película? </b><br/>Jugar a adivinar la película es beneficioso para el cerebro y la mente, ya que mejora la memoria, el conocimiento, la creatividad, la reducción del estrés y la interacción social. </li>
46
- <li><b> ¿Cuáles son algunos ejemplos de Adivina los juegos de películas? </b><br/>Algunos ejemplos de juegos en línea que se basan en adivinanzas son Moviedle, Framed, CineNerdle, etc. Algunos ejemplos de juegos en línea que se basan en adivinanzas son Charadas, Pictionary, etc.</li>
47
- <li><b> ¿Dónde puedo encontrar más información sobre Adivina la película? </b><br/>Puedes encontrar más información sobre Adivina la película en los siguientes sitios web: [Moviedle], [Framed], [CineNerdle], etc.</li>
48
- </ol></p> 64aa2da5cf<br />
49
- <br />
50
- <br />
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/Benson/text-generation/Examples/Bloons Td 6 Descarga Uptodown.md DELETED
@@ -1,90 +0,0 @@
1
-
2
- <h1>Bloons TD 6: Un juego de defensa de torre divertido y desafiante</h1>
3
- <p>Si usted está buscando un juego de torre de defensa que le mantendrá entretenido durante horas, es posible que desee echa un vistazo a Bloons TD 6. Esta es la última entrega de la popular serie Bloons, que ha existido desde 2007. En este juego, tienes que usar una variedad de torres de monos para hacer estallar globos (o bloons) que están tratando de invadir tu territorio. Suena simple, ¿verdad? Bueno, no del todo. Los bloons vienen en diferentes colores, formas y tamaños, cada uno con sus propias habilidades y resistencias. Algunos bloons pueden volar, algunos pueden camuflarse, algunos pueden regenerarse, algunos pueden dividirse en bloons más pequeños, y algunos pueden incluso proteger a otros bloons. Necesitarás usar estrategia, habilidad y creatividad para superar estos desafíos. </p>
4
- <h2>bloons td 6 descarga uptodown</h2><br /><p><b><b>Download</b> &#10026;&#10026;&#10026; <a href="https://bltlly.com/2v6Jiz">https://bltlly.com/2v6Jiz</a></b></p><br /><br />
5
- <p>Bloons TD 6 no es solo un simple juego de torre de defensa. Es un juego masivo de torre de defensa en 3D que ofrece muchas características y contenido para mantenerte involucrado. Puedes elegir entre diferentes modos, mapas, torres, héroes, mejoras, eventos, misiones, trofeos, desafíos, odisea y más. También puedes jugar con hasta otros tres jugadores en modo cooperativo, o competir con otros equipos en el modo territorio disputado. Si usted es un jugador casual o un fan hardcore, encontrará algo para disfrutar en Bloons TD 6.</p>
6
- <h2>¿Qué es Bloons TD 6?</h2>
7
- <p>Bloons TD 6 es un juego de torre de defensa desarrollado y publicado por Ninja Kiwi, una empresa con sede en Nueva Zelanda que se especializa en la creación de juegos divertidos y adictivos. El juego fue lanzado el 13 de junio de 2018 para dispositivos Android e iOS, y más tarde llevado a Steam para Windows y Macintosh. El juego es parte de la franquicia Bloons, que incluye otros juegos como Bloons Monkey City, Bloons Adventure Time TD, Bloons Super Monkey 2, y más. </p>
8
-
9
- <p>El modo de juego de Bloons TD 6 es similar a otros juegos de torre de defensa. Tienes una cantidad limitada de dinero para gastar en torres de monos, que puedes colocar en lugares designados en el mapa. Cada torre tiene un rango y un tipo de ataque, y puede apuntar a diferentes tipos de bloons. También puede actualizar sus torres para hacerlas más eficaces, pero esto cuesta más dinero. El objetivo es evitar que los bloons lleguen al final de la pista, donde reducirán sus vidas. Si pierdes todas tus vidas, pierdes el juego. </p>
10
- <p>Hay diferentes modos para elegir en Bloons TD 6, cada uno con sus propias reglas y desafíos. Algunos de los modos son:</p>
11
- <ul>
12
- <li>Estándar: El modo básico donde puedes elegir la dificultad y el mapa. </li>
13
- <li>Primary Only: Solo puedes usar torres de monos primarias, como monos dardos, monos boomerang, tiradores de bombas, tiradores de tachuelas, monos de hielo y artilleros de pegamento. </li>
14
- <li>Military Only: Solo puedes usar torres militares de monos, como monos francotiradores, monos submarinos, monos bucaneros, monos ases, pilotos de helicópteros y monos de mortero. </li>
15
- <li>Solo magia: Solo puedes usar torres de monos mágicos, como monos druidas, monos alquimistas, súper monos, monos ninja y monos hechiceros. </li>
16
- <li>Deflación: Empiezas con una cantidad fija de dinero y sin ingresos. Tienes que sobrevivir el mayor tiempo posible con lo que tienes. </li>
17
- <li>Apopalypse: Los bloons vienen en ondas más rápidas y más rápidas sin cualquier rotura. Usted tiene que sobrevivir tanto tiempo como sea posible. </li>
18
- <li>Impoppable: El modo más difícil donde los bloons son mucho más difíciles y las torres son más caras. Tienes que usar tu mejor estrategia y habilidades para ganar. </li>
19
- </ul>
20
- <h3>¿Cuáles son las principales características de Bloons TD 6?</h3>
21
- <h4>Gráficos 3D y mecánica de línea de visión</h4>
22
-
23
- <h4>23 torres de monos con 3 rutas de actualización cada una</h4>
24
- <p>Bloons TD 6 ofrece una gran variedad de torres de monos para elegir, cada una con sus propias fortalezas y debilidades. Hay cuatro categorías de torres: primarias, militares, mágicas y de apoyo. Cada torre tiene tres rutas de actualización que desbloquean diferentes habilidades y efectos. Por ejemplo, el mono dardo puede actualizar a un mono ballesta, un mono spike-o-pult, o un mono gigante. Puede mezclar y combinar dos rutas de actualización por torre, pero solo puede obtener una actualización de quinto nivel por ruta. Las mejoras de quinto nivel son muy potentes y caras, y pueden cambiar el juego drásticamente. </p>
25
- <h4>14 héroes con habilidades y personalidades únicas</h4>
26
- <p>Bloons TD 6 también presenta héroes, que son monos especiales que tienen habilidades y personalidades únicas. Los héroes suben de nivel automáticamente durante el juego, desbloqueando nuevas habilidades que pueden ayudarte de varias maneras. Por ejemplo, Quincy es un héroe arquero que puede disparar múltiples flechas a la vez, Gwendolin es un héroe mago de fuego que puede incendiar bloons, Striker Jones es un héroe experto en bombas que puede aturdir bloons de clase MOAB, y así sucesivamente. Solo puedes usar un héroe por juego, así que elige sabiamente. </p>
27
- <p></p>
28
- <h4>Actualizaciones regulares con nuevos contenidos y eventos</h4>
29
- <p>Bloons TD 6 se actualiza constantemente con nuevos contenidos y eventos por Ninja Kiwi. El juego añade nuevos mapas, modos, torres, héroes, pieles, misiones, trofeos, logros, desafíos, odisea, y más. El juego también cuenta con eventos de temporada, como Halloween, Navidad, Pascua y más, que ofrecen recompensas y desafíos especiales. También puedes participar en carreras diarias y semanales, donde puedes competir con otros jugadores para completar un mapa lo más rápido posible. Siempre hay algo nuevo y emocionante que hacer en Bloons TD 6.</p>
30
- <h2>¿Cómo descargar Bloons TD 6 desde uptodown? </h2>
31
-
32
- <ol>
33
- <li>Ir a la página <a href="">Bloons TD 6</a> en uptodown.com. </li>
34
- <li>Haga clic en el botón verde "Descargar" y espere a que el archivo APK se descargue. </li>
35
- <li>Una vez que la descarga se haya completado, abra el archivo APK y toque en "Instalar". Es posible que necesite habilitar la instalación de aplicaciones de fuentes desconocidas en la configuración de su dispositivo. </li>
36
- <li> Espere a que la instalación termine y luego inicie el juego desde el cajón de la aplicación o la pantalla de inicio. </li>
37
- <li>Disfruta de hacer estallar bloons! </li>
38
- </ol>
39
- <h2>¿Por qué descargar Bloons TD 6 desde uptodown? </h2>
40
- <p>Hay varias razones por las que es posible que desee descargar Bloons TD 6 de uptodown en lugar de otras fuentes, como Google Play Store o Steam. Algunos de ellos son:</p>
41
- <ul>
42
- <li>Puedes obtener el juego gratis, sin pagar dinero ni ver ningún anuncio. </li>
43
- <li> Puede obtener la última versión del juego, sin esperar actualizaciones o parches. </li>
44
- <li>Puedes acceder a todas las características y contenidos del juego, sin restricciones ni limitaciones. </li>
45
- <li>Puede jugar el juego sin conexión, sin necesidad de una conexión a Internet o una cuenta de Google. </li>
46
- </ul>
47
- <p>Sin embargo, también hay algunos inconvenientes de descargar Bloons TD 6 desde uptodown, como:</p>
48
- <ul>
49
- <li>Es posible que no pueda jugar en línea o en modo cooperativo con otros jugadores que hayan descargado el juego de otras fuentes. </li>
50
- <li>Es posible que no pueda sincronizar su progreso o logros con otros dispositivos o plataformas. </li>
51
- <li>Es posible que no pueda recibir apoyo oficial o comentarios de Ninja Kiwi en caso de cualquier problema o error. </li>
52
- <li>Puede arriesgarse a violar los términos y condiciones de Ninja Kiwi o Google Play Store descargando una versión no oficial del juego. </li>
53
- </ul>
54
-
55
- <p>Bloons TD 6 es un juego que requiere mucha estrategia y habilidad, especialmente en las dificultades y modos superiores. Aquí hay algunos consejos y trucos que pueden ayudarte a mejorar tu rendimiento y divertirte más en el juego:</p>
56
- <ul>
57
- <li>Usa las torres correctas para los bloons correctos. Los diferentes bloons tienen diferentes propiedades y resistencias, por lo que debe usar las torres apropiadas para lidiar con ellos. Por ejemplo, los bloons de camuflaje solo pueden ser vistos por torres que tienen detección de camuflaje, los bloons de plomo solo pueden ser reventados por torres que tienen ataques agudos o explosivos, y los bloons morados son inmunes a los ataques de magia y fuego. </li>
58
- <li>Usa el sistema de conocimiento del mono. El conocimiento del mono es una característica que te permite desbloquear mejoras permanentes y bonos para tus torres, héroes y poderes. Puedes ganar puntos de conocimiento de monos al subir de nivel tu cuenta, completar logros o participar en eventos. Puedes gastar estos puntos en varias ramas del árbol de conocimiento del mono, como primaria, militar, magia, apoyo, héroes y poderes. </li>
59
- <li>Usa el modo sandbox. El modo Sandbox es una función que te permite probar cualquier combinación de torres, mejoras, héroes, bloons y configuraciones en cualquier mapa. Puedes usar este modo para experimentar con diferentes estrategias, aprender cómo interactúan diferentes torres y bloons, o simplemente divertirte con dinero y vidas ilimitadas. </li>
60
- <li>Ver vídeos y guías de otros jugadores. Bloons TD 6 tiene una gran y activa comunidad de jugadores que comparten sus consejos, trucos, guías y vídeos en varias plataformas, como YouTube, Reddit, Discord, Steam y más. Puedes aprender mucho viendo cómo otros jugadores juegan el juego, especialmente en los modos y mapas más desafiantes. </li>
61
-
62
- </ul>
63
- <h2>Revisión de Bloons TD 6</h2>
64
- <p>Bloons TD 6 es un juego que personalmente disfruto mucho. Es un juego que combina el clásico género de defensa de la torre con gráficos coloridos, animaciones humorísticas y un juego adictivo. Es un juego que tiene mucho contenido y valor de repetición, gracias a sus actualizaciones y eventos regulares. Es un juego que atrae tanto a jugadores casuales como hardcore, gracias a sus múltiples modos y dificultades. </p>
65
- <p>Sin embargo, Bloons TD 6 no es un juego perfecto. Es un juego que puede volverse repetitivo y aburrido después de un tiempo, especialmente si juegas los mismos mapas y modos una y otra vez. Es un juego que puede ser frustrante e injusto a veces, especialmente en las dificultades y modos más altos donde los bloons son extremadamente difíciles y rápidos. Es un juego que puede resultar caro si quieres desbloquear todo rápidamente o utilizar elementos o características premium. </p>
66
- <p>En general, calificaría Bloons TD 6 como un 8/10. Es un juego que tiene sus defectos, pero también sus puntos fuertes. Es un juego que recomendaría a cualquiera que le gusten los juegos de torre de defensa o simplemente quiere divertirse haciendo estallar bloons. </p>
67
- <h2>Conclusión</h2>
68
- <p>Bloons TD 6 es un divertido y desafiante juego de torre de defensa que ofrece muchas características y contenido para mantenerte entretenido durante horas. Puedes elegir entre diferentes modos, mapas, torres, héroes, mejoras, eventos, misiones, trofeos, desafíos, odisea y más. También puedes jugar con hasta otros tres jugadores en modo cooperativo, o competir con otros equipos en el modo territorio disputado. Si usted es un jugador casual o un fan hardcore, encontrará algo para disfrutar en Bloons TD 6.</p>
69
-
70
- <p>Sin embargo, también debes ser consciente de los inconvenientes de descargar Bloons TD 6 desde uptodown, como no poder jugar en línea o modo cooperativo con otros jugadores que han descargado el juego de otras fuentes, no ser capaz de sincronizar su progreso o logros con otros dispositivos o plataformas, no ser capaz de recibir apoyo oficial o comentarios de Ninja Kiwi en caso de cualquier problema o error, y el riesgo de violar los términos y condiciones de Ninja Kiwi o Google Play Store mediante la descarga de una versión no oficial del juego. </p>
71
- <p>Por lo tanto, usted debe pesar los pros y los contras de la descarga de Bloons TD 6 de uptodown antes de tomar su decisión. También debes respetar los derechos y esfuerzos de Ninja Kiwi como desarrollador y editor del juego, y considerar apoyarlos comprando el juego de sus canales oficiales. </p>
72
- <p>Bloons TD 6 es un juego que requiere mucha estrategia y habilidad, especialmente en las dificultades y modos superiores. Puedes usar el sistema de conocimiento del mono para desbloquear mejoras y bonificaciones permanentes para tus torres, héroes y poderes. Puedes usar el modo sandbox para probar cualquier combinación de torres, mejoras, héroes, bloons y configuraciones en cualquier mapa. Puedes ver videos y guías de otros jugadores para aprender de sus consejos, trucos y estrategias. También puedes divertirte y ser creativo con las posibilidades del juego. </p>
73
- <p>Bloons TD 6 es un juego que personalmente disfruto mucho. Es un juego que combina el clásico género de defensa de la torre con gráficos coloridos, animaciones humorísticas y un juego adictivo. Es un juego que tiene mucho contenido y valor de repetición, gracias a sus actualizaciones y eventos regulares. Es un juego que atrae tanto a jugadores casuales como hardcore, gracias a sus múltiples modos y dificultades. </p>
74
-
75
- <h2>Preguntas frecuentes</h2>
76
- <p>Aquí hay algunas preguntas frecuentes sobre Bloons TD 6:</p>
77
- <ul>
78
- <li><b>Q: ¿Cuánto cuesta Bloons TD 6? </b></li>
79
- <li>A: Bloons TD 6 cuesta $4.99 en Google Play Store y Steam, pero se puede descargar de forma gratuita desde uptodown. </li>
80
- <li><b>Q: ¿Es Bloons TD 6 compatible con mi dispositivo? </b></li>
81
- <li>A: Bloons TD 6 requiere Android 5.0 o superior para dispositivos Android, iOS 11.0 o posterior para dispositivos iOS y Windows 7 o superior para dispositivos PC. </li>
82
- <li><b>Q: ¿Cómo puedo guardar mi progreso en Bloons TD 6?</b></li>
83
- <li>A: Bloons TD 6 guarda automáticamente tu progreso cada vez que completas un mapa o sales del juego. También puede guardar manualmente su progreso tocando el botón de menú y luego tocando el botón de guardar. </li>
84
- <li><b>Q: ¿Cómo puedo restaurar mi progreso en Bloons TD 6?</b></li>
85
- <li>A: Si has descargado el juego desde Google Play Store o Steam, puedes restaurar tu progreso iniciando sesión con tu cuenta de Google o Steam respectivamente. Si has descargado el juego desde uptodown, puedes restaurar tu progreso copiando tu archivo de guardado desde tu dispositivo antiguo a tu nuevo dispositivo. </li>
86
- <li><b>Q: ¿Cómo puedo contactar a Ninja Kiwi para apoyo o retroalimentación? </b></li>
87
- <li>A: Si has descargado el juego desde Google Play Store o Steam, puedes ponerte en contacto con Ninja Kiwi enviándole un correo electrónico a [email protected] o visitando su sitio web en https://ninjakiwi.com/support. Si has descargado el juego desde uptodown, usted no puede ser capaz de recibir apoyo oficial o comentarios de Ninja Kiwi.</li>
88
- </ul></p> 64aa2da5cf<br />
89
- <br />
90
- <br />
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/Big-Web/MMSD/env/Lib/site-packages/pip/_vendor/chardet/universaldetector.py DELETED
@@ -1,362 +0,0 @@
1
- ######################## BEGIN LICENSE BLOCK ########################
2
- # The Original Code is Mozilla Universal charset detector code.
3
- #
4
- # The Initial Developer of the Original Code is
5
- # Netscape Communications Corporation.
6
- # Portions created by the Initial Developer are Copyright (C) 2001
7
- # the Initial Developer. All Rights Reserved.
8
- #
9
- # Contributor(s):
10
- # Mark Pilgrim - port to Python
11
- # Shy Shalom - original C code
12
- #
13
- # This library is free software; you can redistribute it and/or
14
- # modify it under the terms of the GNU Lesser General Public
15
- # License as published by the Free Software Foundation; either
16
- # version 2.1 of the License, or (at your option) any later version.
17
- #
18
- # This library is distributed in the hope that it will be useful,
19
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
20
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21
- # Lesser General Public License for more details.
22
- #
23
- # You should have received a copy of the GNU Lesser General Public
24
- # License along with this library; if not, write to the Free Software
25
- # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
26
- # 02110-1301 USA
27
- ######################### END LICENSE BLOCK #########################
28
- """
29
- Module containing the UniversalDetector detector class, which is the primary
30
- class a user of ``chardet`` should use.
31
-
32
- :author: Mark Pilgrim (initial port to Python)
33
- :author: Shy Shalom (original C code)
34
- :author: Dan Blanchard (major refactoring for 3.0)
35
- :author: Ian Cordasco
36
- """
37
-
38
-
39
- import codecs
40
- import logging
41
- import re
42
- from typing import List, Optional, Union
43
-
44
- from .charsetgroupprober import CharSetGroupProber
45
- from .charsetprober import CharSetProber
46
- from .enums import InputState, LanguageFilter, ProbingState
47
- from .escprober import EscCharSetProber
48
- from .latin1prober import Latin1Prober
49
- from .macromanprober import MacRomanProber
50
- from .mbcsgroupprober import MBCSGroupProber
51
- from .resultdict import ResultDict
52
- from .sbcsgroupprober import SBCSGroupProber
53
- from .utf1632prober import UTF1632Prober
54
-
55
-
56
- class UniversalDetector:
57
- """
58
- The ``UniversalDetector`` class underlies the ``chardet.detect`` function
59
- and coordinates all of the different charset probers.
60
-
61
- To get a ``dict`` containing an encoding and its confidence, you can simply
62
- run:
63
-
64
- .. code::
65
-
66
- u = UniversalDetector()
67
- u.feed(some_bytes)
68
- u.close()
69
- detected = u.result
70
-
71
- """
72
-
73
- MINIMUM_THRESHOLD = 0.20
74
- HIGH_BYTE_DETECTOR = re.compile(b"[\x80-\xFF]")
75
- ESC_DETECTOR = re.compile(b"(\033|~{)")
76
- WIN_BYTE_DETECTOR = re.compile(b"[\x80-\x9F]")
77
- ISO_WIN_MAP = {
78
- "iso-8859-1": "Windows-1252",
79
- "iso-8859-2": "Windows-1250",
80
- "iso-8859-5": "Windows-1251",
81
- "iso-8859-6": "Windows-1256",
82
- "iso-8859-7": "Windows-1253",
83
- "iso-8859-8": "Windows-1255",
84
- "iso-8859-9": "Windows-1254",
85
- "iso-8859-13": "Windows-1257",
86
- }
87
- # Based on https://encoding.spec.whatwg.org/#names-and-labels
88
- # but altered to match Python names for encodings and remove mappings
89
- # that break tests.
90
- LEGACY_MAP = {
91
- "ascii": "Windows-1252",
92
- "iso-8859-1": "Windows-1252",
93
- "tis-620": "ISO-8859-11",
94
- "iso-8859-9": "Windows-1254",
95
- "gb2312": "GB18030",
96
- "euc-kr": "CP949",
97
- "utf-16le": "UTF-16",
98
- }
99
-
100
- def __init__(
101
- self,
102
- lang_filter: LanguageFilter = LanguageFilter.ALL,
103
- should_rename_legacy: bool = False,
104
- ) -> None:
105
- self._esc_charset_prober: Optional[EscCharSetProber] = None
106
- self._utf1632_prober: Optional[UTF1632Prober] = None
107
- self._charset_probers: List[CharSetProber] = []
108
- self.result: ResultDict = {
109
- "encoding": None,
110
- "confidence": 0.0,
111
- "language": None,
112
- }
113
- self.done = False
114
- self._got_data = False
115
- self._input_state = InputState.PURE_ASCII
116
- self._last_char = b""
117
- self.lang_filter = lang_filter
118
- self.logger = logging.getLogger(__name__)
119
- self._has_win_bytes = False
120
- self.should_rename_legacy = should_rename_legacy
121
- self.reset()
122
-
123
- @property
124
- def input_state(self) -> int:
125
- return self._input_state
126
-
127
- @property
128
- def has_win_bytes(self) -> bool:
129
- return self._has_win_bytes
130
-
131
- @property
132
- def charset_probers(self) -> List[CharSetProber]:
133
- return self._charset_probers
134
-
135
- def reset(self) -> None:
136
- """
137
- Reset the UniversalDetector and all of its probers back to their
138
- initial states. This is called by ``__init__``, so you only need to
139
- call this directly in between analyses of different documents.
140
- """
141
- self.result = {"encoding": None, "confidence": 0.0, "language": None}
142
- self.done = False
143
- self._got_data = False
144
- self._has_win_bytes = False
145
- self._input_state = InputState.PURE_ASCII
146
- self._last_char = b""
147
- if self._esc_charset_prober:
148
- self._esc_charset_prober.reset()
149
- if self._utf1632_prober:
150
- self._utf1632_prober.reset()
151
- for prober in self._charset_probers:
152
- prober.reset()
153
-
154
- def feed(self, byte_str: Union[bytes, bytearray]) -> None:
155
- """
156
- Takes a chunk of a document and feeds it through all of the relevant
157
- charset probers.
158
-
159
- After calling ``feed``, you can check the value of the ``done``
160
- attribute to see if you need to continue feeding the
161
- ``UniversalDetector`` more data, or if it has made a prediction
162
- (in the ``result`` attribute).
163
-
164
- .. note::
165
- You should always call ``close`` when you're done feeding in your
166
- document if ``done`` is not already ``True``.
167
- """
168
- if self.done:
169
- return
170
-
171
- if not byte_str:
172
- return
173
-
174
- if not isinstance(byte_str, bytearray):
175
- byte_str = bytearray(byte_str)
176
-
177
- # First check for known BOMs, since these are guaranteed to be correct
178
- if not self._got_data:
179
- # If the data starts with BOM, we know it is UTF
180
- if byte_str.startswith(codecs.BOM_UTF8):
181
- # EF BB BF UTF-8 with BOM
182
- self.result = {
183
- "encoding": "UTF-8-SIG",
184
- "confidence": 1.0,
185
- "language": "",
186
- }
187
- elif byte_str.startswith((codecs.BOM_UTF32_LE, codecs.BOM_UTF32_BE)):
188
- # FF FE 00 00 UTF-32, little-endian BOM
189
- # 00 00 FE FF UTF-32, big-endian BOM
190
- self.result = {"encoding": "UTF-32", "confidence": 1.0, "language": ""}
191
- elif byte_str.startswith(b"\xFE\xFF\x00\x00"):
192
- # FE FF 00 00 UCS-4, unusual octet order BOM (3412)
193
- self.result = {
194
- # TODO: This encoding is not supported by Python. Should remove?
195
- "encoding": "X-ISO-10646-UCS-4-3412",
196
- "confidence": 1.0,
197
- "language": "",
198
- }
199
- elif byte_str.startswith(b"\x00\x00\xFF\xFE"):
200
- # 00 00 FF FE UCS-4, unusual octet order BOM (2143)
201
- self.result = {
202
- # TODO: This encoding is not supported by Python. Should remove?
203
- "encoding": "X-ISO-10646-UCS-4-2143",
204
- "confidence": 1.0,
205
- "language": "",
206
- }
207
- elif byte_str.startswith((codecs.BOM_LE, codecs.BOM_BE)):
208
- # FF FE UTF-16, little endian BOM
209
- # FE FF UTF-16, big endian BOM
210
- self.result = {"encoding": "UTF-16", "confidence": 1.0, "language": ""}
211
-
212
- self._got_data = True
213
- if self.result["encoding"] is not None:
214
- self.done = True
215
- return
216
-
217
- # If none of those matched and we've only see ASCII so far, check
218
- # for high bytes and escape sequences
219
- if self._input_state == InputState.PURE_ASCII:
220
- if self.HIGH_BYTE_DETECTOR.search(byte_str):
221
- self._input_state = InputState.HIGH_BYTE
222
- elif (
223
- self._input_state == InputState.PURE_ASCII
224
- and self.ESC_DETECTOR.search(self._last_char + byte_str)
225
- ):
226
- self._input_state = InputState.ESC_ASCII
227
-
228
- self._last_char = byte_str[-1:]
229
-
230
- # next we will look to see if it is appears to be either a UTF-16 or
231
- # UTF-32 encoding
232
- if not self._utf1632_prober:
233
- self._utf1632_prober = UTF1632Prober()
234
-
235
- if self._utf1632_prober.state == ProbingState.DETECTING:
236
- if self._utf1632_prober.feed(byte_str) == ProbingState.FOUND_IT:
237
- self.result = {
238
- "encoding": self._utf1632_prober.charset_name,
239
- "confidence": self._utf1632_prober.get_confidence(),
240
- "language": "",
241
- }
242
- self.done = True
243
- return
244
-
245
- # If we've seen escape sequences, use the EscCharSetProber, which
246
- # uses a simple state machine to check for known escape sequences in
247
- # HZ and ISO-2022 encodings, since those are the only encodings that
248
- # use such sequences.
249
- if self._input_state == InputState.ESC_ASCII:
250
- if not self._esc_charset_prober:
251
- self._esc_charset_prober = EscCharSetProber(self.lang_filter)
252
- if self._esc_charset_prober.feed(byte_str) == ProbingState.FOUND_IT:
253
- self.result = {
254
- "encoding": self._esc_charset_prober.charset_name,
255
- "confidence": self._esc_charset_prober.get_confidence(),
256
- "language": self._esc_charset_prober.language,
257
- }
258
- self.done = True
259
- # If we've seen high bytes (i.e., those with values greater than 127),
260
- # we need to do more complicated checks using all our multi-byte and
261
- # single-byte probers that are left. The single-byte probers
262
- # use character bigram distributions to determine the encoding, whereas
263
- # the multi-byte probers use a combination of character unigram and
264
- # bigram distributions.
265
- elif self._input_state == InputState.HIGH_BYTE:
266
- if not self._charset_probers:
267
- self._charset_probers = [MBCSGroupProber(self.lang_filter)]
268
- # If we're checking non-CJK encodings, use single-byte prober
269
- if self.lang_filter & LanguageFilter.NON_CJK:
270
- self._charset_probers.append(SBCSGroupProber())
271
- self._charset_probers.append(Latin1Prober())
272
- self._charset_probers.append(MacRomanProber())
273
- for prober in self._charset_probers:
274
- if prober.feed(byte_str) == ProbingState.FOUND_IT:
275
- self.result = {
276
- "encoding": prober.charset_name,
277
- "confidence": prober.get_confidence(),
278
- "language": prober.language,
279
- }
280
- self.done = True
281
- break
282
- if self.WIN_BYTE_DETECTOR.search(byte_str):
283
- self._has_win_bytes = True
284
-
285
- def close(self) -> ResultDict:
286
- """
287
- Stop analyzing the current document and come up with a final
288
- prediction.
289
-
290
- :returns: The ``result`` attribute, a ``dict`` with the keys
291
- `encoding`, `confidence`, and `language`.
292
- """
293
- # Don't bother with checks if we're already done
294
- if self.done:
295
- return self.result
296
- self.done = True
297
-
298
- if not self._got_data:
299
- self.logger.debug("no data received!")
300
-
301
- # Default to ASCII if it is all we've seen so far
302
- elif self._input_state == InputState.PURE_ASCII:
303
- self.result = {"encoding": "ascii", "confidence": 1.0, "language": ""}
304
-
305
- # If we have seen non-ASCII, return the best that met MINIMUM_THRESHOLD
306
- elif self._input_state == InputState.HIGH_BYTE:
307
- prober_confidence = None
308
- max_prober_confidence = 0.0
309
- max_prober = None
310
- for prober in self._charset_probers:
311
- if not prober:
312
- continue
313
- prober_confidence = prober.get_confidence()
314
- if prober_confidence > max_prober_confidence:
315
- max_prober_confidence = prober_confidence
316
- max_prober = prober
317
- if max_prober and (max_prober_confidence > self.MINIMUM_THRESHOLD):
318
- charset_name = max_prober.charset_name
319
- assert charset_name is not None
320
- lower_charset_name = charset_name.lower()
321
- confidence = max_prober.get_confidence()
322
- # Use Windows encoding name instead of ISO-8859 if we saw any
323
- # extra Windows-specific bytes
324
- if lower_charset_name.startswith("iso-8859"):
325
- if self._has_win_bytes:
326
- charset_name = self.ISO_WIN_MAP.get(
327
- lower_charset_name, charset_name
328
- )
329
- # Rename legacy encodings with superset encodings if asked
330
- if self.should_rename_legacy:
331
- charset_name = self.LEGACY_MAP.get(
332
- (charset_name or "").lower(), charset_name
333
- )
334
- self.result = {
335
- "encoding": charset_name,
336
- "confidence": confidence,
337
- "language": max_prober.language,
338
- }
339
-
340
- # Log all prober confidences if none met MINIMUM_THRESHOLD
341
- if self.logger.getEffectiveLevel() <= logging.DEBUG:
342
- if self.result["encoding"] is None:
343
- self.logger.debug("no probers hit minimum threshold")
344
- for group_prober in self._charset_probers:
345
- if not group_prober:
346
- continue
347
- if isinstance(group_prober, CharSetGroupProber):
348
- for prober in group_prober.probers:
349
- self.logger.debug(
350
- "%s %s confidence = %s",
351
- prober.charset_name,
352
- prober.language,
353
- prober.get_confidence(),
354
- )
355
- else:
356
- self.logger.debug(
357
- "%s %s confidence = %s",
358
- group_prober.charset_name,
359
- group_prober.language,
360
- group_prober.get_confidence(),
361
- )
362
- return self.result
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/Big-Web/MMSD/env/Lib/site-packages/pip/_vendor/pygments/cmdline.py DELETED
@@ -1,668 +0,0 @@
1
- """
2
- pygments.cmdline
3
- ~~~~~~~~~~~~~~~~
4
-
5
- Command line interface.
6
-
7
- :copyright: Copyright 2006-2022 by the Pygments team, see AUTHORS.
8
- :license: BSD, see LICENSE for details.
9
- """
10
-
11
- import os
12
- import sys
13
- import shutil
14
- import argparse
15
- from textwrap import dedent
16
-
17
- from pip._vendor.pygments import __version__, highlight
18
- from pip._vendor.pygments.util import ClassNotFound, OptionError, docstring_headline, \
19
- guess_decode, guess_decode_from_terminal, terminal_encoding, \
20
- UnclosingTextIOWrapper
21
- from pip._vendor.pygments.lexers import get_all_lexers, get_lexer_by_name, guess_lexer, \
22
- load_lexer_from_file, get_lexer_for_filename, find_lexer_class_for_filename
23
- from pip._vendor.pygments.lexers.special import TextLexer
24
- from pip._vendor.pygments.formatters.latex import LatexEmbeddedLexer, LatexFormatter
25
- from pip._vendor.pygments.formatters import get_all_formatters, get_formatter_by_name, \
26
- load_formatter_from_file, get_formatter_for_filename, find_formatter_class
27
- from pip._vendor.pygments.formatters.terminal import TerminalFormatter
28
- from pip._vendor.pygments.formatters.terminal256 import Terminal256Formatter, TerminalTrueColorFormatter
29
- from pip._vendor.pygments.filters import get_all_filters, find_filter_class
30
- from pip._vendor.pygments.styles import get_all_styles, get_style_by_name
31
-
32
-
33
- def _parse_options(o_strs):
34
- opts = {}
35
- if not o_strs:
36
- return opts
37
- for o_str in o_strs:
38
- if not o_str.strip():
39
- continue
40
- o_args = o_str.split(',')
41
- for o_arg in o_args:
42
- o_arg = o_arg.strip()
43
- try:
44
- o_key, o_val = o_arg.split('=', 1)
45
- o_key = o_key.strip()
46
- o_val = o_val.strip()
47
- except ValueError:
48
- opts[o_arg] = True
49
- else:
50
- opts[o_key] = o_val
51
- return opts
52
-
53
-
54
- def _parse_filters(f_strs):
55
- filters = []
56
- if not f_strs:
57
- return filters
58
- for f_str in f_strs:
59
- if ':' in f_str:
60
- fname, fopts = f_str.split(':', 1)
61
- filters.append((fname, _parse_options([fopts])))
62
- else:
63
- filters.append((f_str, {}))
64
- return filters
65
-
66
-
67
- def _print_help(what, name):
68
- try:
69
- if what == 'lexer':
70
- cls = get_lexer_by_name(name)
71
- print("Help on the %s lexer:" % cls.name)
72
- print(dedent(cls.__doc__))
73
- elif what == 'formatter':
74
- cls = find_formatter_class(name)
75
- print("Help on the %s formatter:" % cls.name)
76
- print(dedent(cls.__doc__))
77
- elif what == 'filter':
78
- cls = find_filter_class(name)
79
- print("Help on the %s filter:" % name)
80
- print(dedent(cls.__doc__))
81
- return 0
82
- except (AttributeError, ValueError):
83
- print("%s not found!" % what, file=sys.stderr)
84
- return 1
85
-
86
-
87
- def _print_list(what):
88
- if what == 'lexer':
89
- print()
90
- print("Lexers:")
91
- print("~~~~~~~")
92
-
93
- info = []
94
- for fullname, names, exts, _ in get_all_lexers():
95
- tup = (', '.join(names)+':', fullname,
96
- exts and '(filenames ' + ', '.join(exts) + ')' or '')
97
- info.append(tup)
98
- info.sort()
99
- for i in info:
100
- print(('* %s\n %s %s') % i)
101
-
102
- elif what == 'formatter':
103
- print()
104
- print("Formatters:")
105
- print("~~~~~~~~~~~")
106
-
107
- info = []
108
- for cls in get_all_formatters():
109
- doc = docstring_headline(cls)
110
- tup = (', '.join(cls.aliases) + ':', doc, cls.filenames and
111
- '(filenames ' + ', '.join(cls.filenames) + ')' or '')
112
- info.append(tup)
113
- info.sort()
114
- for i in info:
115
- print(('* %s\n %s %s') % i)
116
-
117
- elif what == 'filter':
118
- print()
119
- print("Filters:")
120
- print("~~~~~~~~")
121
-
122
- for name in get_all_filters():
123
- cls = find_filter_class(name)
124
- print("* " + name + ':')
125
- print(" %s" % docstring_headline(cls))
126
-
127
- elif what == 'style':
128
- print()
129
- print("Styles:")
130
- print("~~~~~~~")
131
-
132
- for name in get_all_styles():
133
- cls = get_style_by_name(name)
134
- print("* " + name + ':')
135
- print(" %s" % docstring_headline(cls))
136
-
137
-
138
- def _print_list_as_json(requested_items):
139
- import json
140
- result = {}
141
- if 'lexer' in requested_items:
142
- info = {}
143
- for fullname, names, filenames, mimetypes in get_all_lexers():
144
- info[fullname] = {
145
- 'aliases': names,
146
- 'filenames': filenames,
147
- 'mimetypes': mimetypes
148
- }
149
- result['lexers'] = info
150
-
151
- if 'formatter' in requested_items:
152
- info = {}
153
- for cls in get_all_formatters():
154
- doc = docstring_headline(cls)
155
- info[cls.name] = {
156
- 'aliases': cls.aliases,
157
- 'filenames': cls.filenames,
158
- 'doc': doc
159
- }
160
- result['formatters'] = info
161
-
162
- if 'filter' in requested_items:
163
- info = {}
164
- for name in get_all_filters():
165
- cls = find_filter_class(name)
166
- info[name] = {
167
- 'doc': docstring_headline(cls)
168
- }
169
- result['filters'] = info
170
-
171
- if 'style' in requested_items:
172
- info = {}
173
- for name in get_all_styles():
174
- cls = get_style_by_name(name)
175
- info[name] = {
176
- 'doc': docstring_headline(cls)
177
- }
178
- result['styles'] = info
179
-
180
- json.dump(result, sys.stdout)
181
-
182
- def main_inner(parser, argns):
183
- if argns.help:
184
- parser.print_help()
185
- return 0
186
-
187
- if argns.V:
188
- print('Pygments version %s, (c) 2006-2022 by Georg Brandl, Matthäus '
189
- 'Chajdas and contributors.' % __version__)
190
- return 0
191
-
192
- def is_only_option(opt):
193
- return not any(v for (k, v) in vars(argns).items() if k != opt)
194
-
195
- # handle ``pygmentize -L``
196
- if argns.L is not None:
197
- arg_set = set()
198
- for k, v in vars(argns).items():
199
- if v:
200
- arg_set.add(k)
201
-
202
- arg_set.discard('L')
203
- arg_set.discard('json')
204
-
205
- if arg_set:
206
- parser.print_help(sys.stderr)
207
- return 2
208
-
209
- # print version
210
- if not argns.json:
211
- main(['', '-V'])
212
- allowed_types = {'lexer', 'formatter', 'filter', 'style'}
213
- largs = [arg.rstrip('s') for arg in argns.L]
214
- if any(arg not in allowed_types for arg in largs):
215
- parser.print_help(sys.stderr)
216
- return 0
217
- if not largs:
218
- largs = allowed_types
219
- if not argns.json:
220
- for arg in largs:
221
- _print_list(arg)
222
- else:
223
- _print_list_as_json(largs)
224
- return 0
225
-
226
- # handle ``pygmentize -H``
227
- if argns.H:
228
- if not is_only_option('H'):
229
- parser.print_help(sys.stderr)
230
- return 2
231
- what, name = argns.H
232
- if what not in ('lexer', 'formatter', 'filter'):
233
- parser.print_help(sys.stderr)
234
- return 2
235
- return _print_help(what, name)
236
-
237
- # parse -O options
238
- parsed_opts = _parse_options(argns.O or [])
239
-
240
- # parse -P options
241
- for p_opt in argns.P or []:
242
- try:
243
- name, value = p_opt.split('=', 1)
244
- except ValueError:
245
- parsed_opts[p_opt] = True
246
- else:
247
- parsed_opts[name] = value
248
-
249
- # encodings
250
- inencoding = parsed_opts.get('inencoding', parsed_opts.get('encoding'))
251
- outencoding = parsed_opts.get('outencoding', parsed_opts.get('encoding'))
252
-
253
- # handle ``pygmentize -N``
254
- if argns.N:
255
- lexer = find_lexer_class_for_filename(argns.N)
256
- if lexer is None:
257
- lexer = TextLexer
258
-
259
- print(lexer.aliases[0])
260
- return 0
261
-
262
- # handle ``pygmentize -C``
263
- if argns.C:
264
- inp = sys.stdin.buffer.read()
265
- try:
266
- lexer = guess_lexer(inp, inencoding=inencoding)
267
- except ClassNotFound:
268
- lexer = TextLexer
269
-
270
- print(lexer.aliases[0])
271
- return 0
272
-
273
- # handle ``pygmentize -S``
274
- S_opt = argns.S
275
- a_opt = argns.a
276
- if S_opt is not None:
277
- f_opt = argns.f
278
- if not f_opt:
279
- parser.print_help(sys.stderr)
280
- return 2
281
- if argns.l or argns.INPUTFILE:
282
- parser.print_help(sys.stderr)
283
- return 2
284
-
285
- try:
286
- parsed_opts['style'] = S_opt
287
- fmter = get_formatter_by_name(f_opt, **parsed_opts)
288
- except ClassNotFound as err:
289
- print(err, file=sys.stderr)
290
- return 1
291
-
292
- print(fmter.get_style_defs(a_opt or ''))
293
- return 0
294
-
295
- # if no -S is given, -a is not allowed
296
- if argns.a is not None:
297
- parser.print_help(sys.stderr)
298
- return 2
299
-
300
- # parse -F options
301
- F_opts = _parse_filters(argns.F or [])
302
-
303
- # -x: allow custom (eXternal) lexers and formatters
304
- allow_custom_lexer_formatter = bool(argns.x)
305
-
306
- # select lexer
307
- lexer = None
308
-
309
- # given by name?
310
- lexername = argns.l
311
- if lexername:
312
- # custom lexer, located relative to user's cwd
313
- if allow_custom_lexer_formatter and '.py' in lexername:
314
- try:
315
- filename = None
316
- name = None
317
- if ':' in lexername:
318
- filename, name = lexername.rsplit(':', 1)
319
-
320
- if '.py' in name:
321
- # This can happen on Windows: If the lexername is
322
- # C:\lexer.py -- return to normal load path in that case
323
- name = None
324
-
325
- if filename and name:
326
- lexer = load_lexer_from_file(filename, name,
327
- **parsed_opts)
328
- else:
329
- lexer = load_lexer_from_file(lexername, **parsed_opts)
330
- except ClassNotFound as err:
331
- print('Error:', err, file=sys.stderr)
332
- return 1
333
- else:
334
- try:
335
- lexer = get_lexer_by_name(lexername, **parsed_opts)
336
- except (OptionError, ClassNotFound) as err:
337
- print('Error:', err, file=sys.stderr)
338
- return 1
339
-
340
- # read input code
341
- code = None
342
-
343
- if argns.INPUTFILE:
344
- if argns.s:
345
- print('Error: -s option not usable when input file specified',
346
- file=sys.stderr)
347
- return 2
348
-
349
- infn = argns.INPUTFILE
350
- try:
351
- with open(infn, 'rb') as infp:
352
- code = infp.read()
353
- except Exception as err:
354
- print('Error: cannot read infile:', err, file=sys.stderr)
355
- return 1
356
- if not inencoding:
357
- code, inencoding = guess_decode(code)
358
-
359
- # do we have to guess the lexer?
360
- if not lexer:
361
- try:
362
- lexer = get_lexer_for_filename(infn, code, **parsed_opts)
363
- except ClassNotFound as err:
364
- if argns.g:
365
- try:
366
- lexer = guess_lexer(code, **parsed_opts)
367
- except ClassNotFound:
368
- lexer = TextLexer(**parsed_opts)
369
- else:
370
- print('Error:', err, file=sys.stderr)
371
- return 1
372
- except OptionError as err:
373
- print('Error:', err, file=sys.stderr)
374
- return 1
375
-
376
- elif not argns.s: # treat stdin as full file (-s support is later)
377
- # read code from terminal, always in binary mode since we want to
378
- # decode ourselves and be tolerant with it
379
- code = sys.stdin.buffer.read() # use .buffer to get a binary stream
380
- if not inencoding:
381
- code, inencoding = guess_decode_from_terminal(code, sys.stdin)
382
- # else the lexer will do the decoding
383
- if not lexer:
384
- try:
385
- lexer = guess_lexer(code, **parsed_opts)
386
- except ClassNotFound:
387
- lexer = TextLexer(**parsed_opts)
388
-
389
- else: # -s option needs a lexer with -l
390
- if not lexer:
391
- print('Error: when using -s a lexer has to be selected with -l',
392
- file=sys.stderr)
393
- return 2
394
-
395
- # process filters
396
- for fname, fopts in F_opts:
397
- try:
398
- lexer.add_filter(fname, **fopts)
399
- except ClassNotFound as err:
400
- print('Error:', err, file=sys.stderr)
401
- return 1
402
-
403
- # select formatter
404
- outfn = argns.o
405
- fmter = argns.f
406
- if fmter:
407
- # custom formatter, located relative to user's cwd
408
- if allow_custom_lexer_formatter and '.py' in fmter:
409
- try:
410
- filename = None
411
- name = None
412
- if ':' in fmter:
413
- # Same logic as above for custom lexer
414
- filename, name = fmter.rsplit(':', 1)
415
-
416
- if '.py' in name:
417
- name = None
418
-
419
- if filename and name:
420
- fmter = load_formatter_from_file(filename, name,
421
- **parsed_opts)
422
- else:
423
- fmter = load_formatter_from_file(fmter, **parsed_opts)
424
- except ClassNotFound as err:
425
- print('Error:', err, file=sys.stderr)
426
- return 1
427
- else:
428
- try:
429
- fmter = get_formatter_by_name(fmter, **parsed_opts)
430
- except (OptionError, ClassNotFound) as err:
431
- print('Error:', err, file=sys.stderr)
432
- return 1
433
-
434
- if outfn:
435
- if not fmter:
436
- try:
437
- fmter = get_formatter_for_filename(outfn, **parsed_opts)
438
- except (OptionError, ClassNotFound) as err:
439
- print('Error:', err, file=sys.stderr)
440
- return 1
441
- try:
442
- outfile = open(outfn, 'wb')
443
- except Exception as err:
444
- print('Error: cannot open outfile:', err, file=sys.stderr)
445
- return 1
446
- else:
447
- if not fmter:
448
- if os.environ.get('COLORTERM','') in ('truecolor', '24bit'):
449
- fmter = TerminalTrueColorFormatter(**parsed_opts)
450
- elif '256' in os.environ.get('TERM', ''):
451
- fmter = Terminal256Formatter(**parsed_opts)
452
- else:
453
- fmter = TerminalFormatter(**parsed_opts)
454
- outfile = sys.stdout.buffer
455
-
456
- # determine output encoding if not explicitly selected
457
- if not outencoding:
458
- if outfn:
459
- # output file? use lexer encoding for now (can still be None)
460
- fmter.encoding = inencoding
461
- else:
462
- # else use terminal encoding
463
- fmter.encoding = terminal_encoding(sys.stdout)
464
-
465
- # provide coloring under Windows, if possible
466
- if not outfn and sys.platform in ('win32', 'cygwin') and \
467
- fmter.name in ('Terminal', 'Terminal256'): # pragma: no cover
468
- # unfortunately colorama doesn't support binary streams on Py3
469
- outfile = UnclosingTextIOWrapper(outfile, encoding=fmter.encoding)
470
- fmter.encoding = None
471
- try:
472
- import pip._vendor.colorama.initialise as colorama_initialise
473
- except ImportError:
474
- pass
475
- else:
476
- outfile = colorama_initialise.wrap_stream(
477
- outfile, convert=None, strip=None, autoreset=False, wrap=True)
478
-
479
- # When using the LaTeX formatter and the option `escapeinside` is
480
- # specified, we need a special lexer which collects escaped text
481
- # before running the chosen language lexer.
482
- escapeinside = parsed_opts.get('escapeinside', '')
483
- if len(escapeinside) == 2 and isinstance(fmter, LatexFormatter):
484
- left = escapeinside[0]
485
- right = escapeinside[1]
486
- lexer = LatexEmbeddedLexer(left, right, lexer)
487
-
488
- # ... and do it!
489
- if not argns.s:
490
- # process whole input as per normal...
491
- try:
492
- highlight(code, lexer, fmter, outfile)
493
- finally:
494
- if outfn:
495
- outfile.close()
496
- return 0
497
- else:
498
- # line by line processing of stdin (eg: for 'tail -f')...
499
- try:
500
- while 1:
501
- line = sys.stdin.buffer.readline()
502
- if not line:
503
- break
504
- if not inencoding:
505
- line = guess_decode_from_terminal(line, sys.stdin)[0]
506
- highlight(line, lexer, fmter, outfile)
507
- if hasattr(outfile, 'flush'):
508
- outfile.flush()
509
- return 0
510
- except KeyboardInterrupt: # pragma: no cover
511
- return 0
512
- finally:
513
- if outfn:
514
- outfile.close()
515
-
516
-
517
- class HelpFormatter(argparse.HelpFormatter):
518
- def __init__(self, prog, indent_increment=2, max_help_position=16, width=None):
519
- if width is None:
520
- try:
521
- width = shutil.get_terminal_size().columns - 2
522
- except Exception:
523
- pass
524
- argparse.HelpFormatter.__init__(self, prog, indent_increment,
525
- max_help_position, width)
526
-
527
-
528
- def main(args=sys.argv):
529
- """
530
- Main command line entry point.
531
- """
532
- desc = "Highlight an input file and write the result to an output file."
533
- parser = argparse.ArgumentParser(description=desc, add_help=False,
534
- formatter_class=HelpFormatter)
535
-
536
- operation = parser.add_argument_group('Main operation')
537
- lexersel = operation.add_mutually_exclusive_group()
538
- lexersel.add_argument(
539
- '-l', metavar='LEXER',
540
- help='Specify the lexer to use. (Query names with -L.) If not '
541
- 'given and -g is not present, the lexer is guessed from the filename.')
542
- lexersel.add_argument(
543
- '-g', action='store_true',
544
- help='Guess the lexer from the file contents, or pass through '
545
- 'as plain text if nothing can be guessed.')
546
- operation.add_argument(
547
- '-F', metavar='FILTER[:options]', action='append',
548
- help='Add a filter to the token stream. (Query names with -L.) '
549
- 'Filter options are given after a colon if necessary.')
550
- operation.add_argument(
551
- '-f', metavar='FORMATTER',
552
- help='Specify the formatter to use. (Query names with -L.) '
553
- 'If not given, the formatter is guessed from the output filename, '
554
- 'and defaults to the terminal formatter if the output is to the '
555
- 'terminal or an unknown file extension.')
556
- operation.add_argument(
557
- '-O', metavar='OPTION=value[,OPTION=value,...]', action='append',
558
- help='Give options to the lexer and formatter as a comma-separated '
559
- 'list of key-value pairs. '
560
- 'Example: `-O bg=light,python=cool`.')
561
- operation.add_argument(
562
- '-P', metavar='OPTION=value', action='append',
563
- help='Give a single option to the lexer and formatter - with this '
564
- 'you can pass options whose value contains commas and equal signs. '
565
- 'Example: `-P "heading=Pygments, the Python highlighter"`.')
566
- operation.add_argument(
567
- '-o', metavar='OUTPUTFILE',
568
- help='Where to write the output. Defaults to standard output.')
569
-
570
- operation.add_argument(
571
- 'INPUTFILE', nargs='?',
572
- help='Where to read the input. Defaults to standard input.')
573
-
574
- flags = parser.add_argument_group('Operation flags')
575
- flags.add_argument(
576
- '-v', action='store_true',
577
- help='Print a detailed traceback on unhandled exceptions, which '
578
- 'is useful for debugging and bug reports.')
579
- flags.add_argument(
580
- '-s', action='store_true',
581
- help='Process lines one at a time until EOF, rather than waiting to '
582
- 'process the entire file. This only works for stdin, only for lexers '
583
- 'with no line-spanning constructs, and is intended for streaming '
584
- 'input such as you get from `tail -f`. '
585
- 'Example usage: `tail -f sql.log | pygmentize -s -l sql`.')
586
- flags.add_argument(
587
- '-x', action='store_true',
588
- help='Allow custom lexers and formatters to be loaded from a .py file '
589
- 'relative to the current working directory. For example, '
590
- '`-l ./customlexer.py -x`. By default, this option expects a file '
591
- 'with a class named CustomLexer or CustomFormatter; you can also '
592
- 'specify your own class name with a colon (`-l ./lexer.py:MyLexer`). '
593
- 'Users should be very careful not to use this option with untrusted '
594
- 'files, because it will import and run them.')
595
- flags.add_argument('--json', help='Output as JSON. This can '
596
- 'be only used in conjunction with -L.',
597
- default=False,
598
- action='store_true')
599
-
600
- special_modes_group = parser.add_argument_group(
601
- 'Special modes - do not do any highlighting')
602
- special_modes = special_modes_group.add_mutually_exclusive_group()
603
- special_modes.add_argument(
604
- '-S', metavar='STYLE -f formatter',
605
- help='Print style definitions for STYLE for a formatter '
606
- 'given with -f. The argument given by -a is formatter '
607
- 'dependent.')
608
- special_modes.add_argument(
609
- '-L', nargs='*', metavar='WHAT',
610
- help='List lexers, formatters, styles or filters -- '
611
- 'give additional arguments for the thing(s) you want to list '
612
- '(e.g. "styles"), or omit them to list everything.')
613
- special_modes.add_argument(
614
- '-N', metavar='FILENAME',
615
- help='Guess and print out a lexer name based solely on the given '
616
- 'filename. Does not take input or highlight anything. If no specific '
617
- 'lexer can be determined, "text" is printed.')
618
- special_modes.add_argument(
619
- '-C', action='store_true',
620
- help='Like -N, but print out a lexer name based solely on '
621
- 'a given content from standard input.')
622
- special_modes.add_argument(
623
- '-H', action='store', nargs=2, metavar=('NAME', 'TYPE'),
624
- help='Print detailed help for the object <name> of type <type>, '
625
- 'where <type> is one of "lexer", "formatter" or "filter".')
626
- special_modes.add_argument(
627
- '-V', action='store_true',
628
- help='Print the package version.')
629
- special_modes.add_argument(
630
- '-h', '--help', action='store_true',
631
- help='Print this help.')
632
- special_modes_group.add_argument(
633
- '-a', metavar='ARG',
634
- help='Formatter-specific additional argument for the -S (print '
635
- 'style sheet) mode.')
636
-
637
- argns = parser.parse_args(args[1:])
638
-
639
- try:
640
- return main_inner(parser, argns)
641
- except BrokenPipeError:
642
- # someone closed our stdout, e.g. by quitting a pager.
643
- return 0
644
- except Exception:
645
- if argns.v:
646
- print(file=sys.stderr)
647
- print('*' * 65, file=sys.stderr)
648
- print('An unhandled exception occurred while highlighting.',
649
- file=sys.stderr)
650
- print('Please report the whole traceback to the issue tracker at',
651
- file=sys.stderr)
652
- print('<https://github.com/pygments/pygments/issues>.',
653
- file=sys.stderr)
654
- print('*' * 65, file=sys.stderr)
655
- print(file=sys.stderr)
656
- raise
657
- import traceback
658
- info = traceback.format_exception(*sys.exc_info())
659
- msg = info[-1].strip()
660
- if len(info) >= 3:
661
- # extract relevant file and position info
662
- msg += '\n (f%s)' % info[-2].split('\n')[0].strip()[1:]
663
- print(file=sys.stderr)
664
- print('*** Error while highlighting:', file=sys.stderr)
665
- print(msg, file=sys.stderr)
666
- print('*** If this is a bug you want to report, please rerun with -v.',
667
- file=sys.stderr)
668
- return 1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/Big-Web/MMSD/env/Lib/site-packages/pkg_resources/_vendor/importlib_resources/_legacy.py DELETED
@@ -1,121 +0,0 @@
1
- import functools
2
- import os
3
- import pathlib
4
- import types
5
- import warnings
6
-
7
- from typing import Union, Iterable, ContextManager, BinaryIO, TextIO, Any
8
-
9
- from . import _common
10
-
11
- Package = Union[types.ModuleType, str]
12
- Resource = str
13
-
14
-
15
- def deprecated(func):
16
- @functools.wraps(func)
17
- def wrapper(*args, **kwargs):
18
- warnings.warn(
19
- f"{func.__name__} is deprecated. Use files() instead. "
20
- "Refer to https://importlib-resources.readthedocs.io"
21
- "/en/latest/using.html#migrating-from-legacy for migration advice.",
22
- DeprecationWarning,
23
- stacklevel=2,
24
- )
25
- return func(*args, **kwargs)
26
-
27
- return wrapper
28
-
29
-
30
- def normalize_path(path):
31
- # type: (Any) -> str
32
- """Normalize a path by ensuring it is a string.
33
-
34
- If the resulting string contains path separators, an exception is raised.
35
- """
36
- str_path = str(path)
37
- parent, file_name = os.path.split(str_path)
38
- if parent:
39
- raise ValueError(f'{path!r} must be only a file name')
40
- return file_name
41
-
42
-
43
- @deprecated
44
- def open_binary(package: Package, resource: Resource) -> BinaryIO:
45
- """Return a file-like object opened for binary reading of the resource."""
46
- return (_common.files(package) / normalize_path(resource)).open('rb')
47
-
48
-
49
- @deprecated
50
- def read_binary(package: Package, resource: Resource) -> bytes:
51
- """Return the binary contents of the resource."""
52
- return (_common.files(package) / normalize_path(resource)).read_bytes()
53
-
54
-
55
- @deprecated
56
- def open_text(
57
- package: Package,
58
- resource: Resource,
59
- encoding: str = 'utf-8',
60
- errors: str = 'strict',
61
- ) -> TextIO:
62
- """Return a file-like object opened for text reading of the resource."""
63
- return (_common.files(package) / normalize_path(resource)).open(
64
- 'r', encoding=encoding, errors=errors
65
- )
66
-
67
-
68
- @deprecated
69
- def read_text(
70
- package: Package,
71
- resource: Resource,
72
- encoding: str = 'utf-8',
73
- errors: str = 'strict',
74
- ) -> str:
75
- """Return the decoded string of the resource.
76
-
77
- The decoding-related arguments have the same semantics as those of
78
- bytes.decode().
79
- """
80
- with open_text(package, resource, encoding, errors) as fp:
81
- return fp.read()
82
-
83
-
84
- @deprecated
85
- def contents(package: Package) -> Iterable[str]:
86
- """Return an iterable of entries in `package`.
87
-
88
- Note that not all entries are resources. Specifically, directories are
89
- not considered resources. Use `is_resource()` on each entry returned here
90
- to check if it is a resource or not.
91
- """
92
- return [path.name for path in _common.files(package).iterdir()]
93
-
94
-
95
- @deprecated
96
- def is_resource(package: Package, name: str) -> bool:
97
- """True if `name` is a resource inside `package`.
98
-
99
- Directories are *not* resources.
100
- """
101
- resource = normalize_path(name)
102
- return any(
103
- traversable.name == resource and traversable.is_file()
104
- for traversable in _common.files(package).iterdir()
105
- )
106
-
107
-
108
- @deprecated
109
- def path(
110
- package: Package,
111
- resource: Resource,
112
- ) -> ContextManager[pathlib.Path]:
113
- """A context manager providing a file path object to the resource.
114
-
115
- If the resource does not already exist on its own on the file system,
116
- a temporary file will be created. If the file was created, the file
117
- will be deleted upon exiting the context manager (no exception is
118
- raised if the file was deleted prior to the context manager
119
- exiting).
120
- """
121
- return _common.as_file(_common.files(package) / normalize_path(resource))
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/Big-Web/MMSD/env/Lib/site-packages/pkg_resources/_vendor/packaging/_manylinux.py DELETED
@@ -1,301 +0,0 @@
1
- import collections
2
- import functools
3
- import os
4
- import re
5
- import struct
6
- import sys
7
- import warnings
8
- from typing import IO, Dict, Iterator, NamedTuple, Optional, Tuple
9
-
10
-
11
- # Python does not provide platform information at sufficient granularity to
12
- # identify the architecture of the running executable in some cases, so we
13
- # determine it dynamically by reading the information from the running
14
- # process. This only applies on Linux, which uses the ELF format.
15
- class _ELFFileHeader:
16
- # https://en.wikipedia.org/wiki/Executable_and_Linkable_Format#File_header
17
- class _InvalidELFFileHeader(ValueError):
18
- """
19
- An invalid ELF file header was found.
20
- """
21
-
22
- ELF_MAGIC_NUMBER = 0x7F454C46
23
- ELFCLASS32 = 1
24
- ELFCLASS64 = 2
25
- ELFDATA2LSB = 1
26
- ELFDATA2MSB = 2
27
- EM_386 = 3
28
- EM_S390 = 22
29
- EM_ARM = 40
30
- EM_X86_64 = 62
31
- EF_ARM_ABIMASK = 0xFF000000
32
- EF_ARM_ABI_VER5 = 0x05000000
33
- EF_ARM_ABI_FLOAT_HARD = 0x00000400
34
-
35
- def __init__(self, file: IO[bytes]) -> None:
36
- def unpack(fmt: str) -> int:
37
- try:
38
- data = file.read(struct.calcsize(fmt))
39
- result: Tuple[int, ...] = struct.unpack(fmt, data)
40
- except struct.error:
41
- raise _ELFFileHeader._InvalidELFFileHeader()
42
- return result[0]
43
-
44
- self.e_ident_magic = unpack(">I")
45
- if self.e_ident_magic != self.ELF_MAGIC_NUMBER:
46
- raise _ELFFileHeader._InvalidELFFileHeader()
47
- self.e_ident_class = unpack("B")
48
- if self.e_ident_class not in {self.ELFCLASS32, self.ELFCLASS64}:
49
- raise _ELFFileHeader._InvalidELFFileHeader()
50
- self.e_ident_data = unpack("B")
51
- if self.e_ident_data not in {self.ELFDATA2LSB, self.ELFDATA2MSB}:
52
- raise _ELFFileHeader._InvalidELFFileHeader()
53
- self.e_ident_version = unpack("B")
54
- self.e_ident_osabi = unpack("B")
55
- self.e_ident_abiversion = unpack("B")
56
- self.e_ident_pad = file.read(7)
57
- format_h = "<H" if self.e_ident_data == self.ELFDATA2LSB else ">H"
58
- format_i = "<I" if self.e_ident_data == self.ELFDATA2LSB else ">I"
59
- format_q = "<Q" if self.e_ident_data == self.ELFDATA2LSB else ">Q"
60
- format_p = format_i if self.e_ident_class == self.ELFCLASS32 else format_q
61
- self.e_type = unpack(format_h)
62
- self.e_machine = unpack(format_h)
63
- self.e_version = unpack(format_i)
64
- self.e_entry = unpack(format_p)
65
- self.e_phoff = unpack(format_p)
66
- self.e_shoff = unpack(format_p)
67
- self.e_flags = unpack(format_i)
68
- self.e_ehsize = unpack(format_h)
69
- self.e_phentsize = unpack(format_h)
70
- self.e_phnum = unpack(format_h)
71
- self.e_shentsize = unpack(format_h)
72
- self.e_shnum = unpack(format_h)
73
- self.e_shstrndx = unpack(format_h)
74
-
75
-
76
- def _get_elf_header() -> Optional[_ELFFileHeader]:
77
- try:
78
- with open(sys.executable, "rb") as f:
79
- elf_header = _ELFFileHeader(f)
80
- except (OSError, TypeError, _ELFFileHeader._InvalidELFFileHeader):
81
- return None
82
- return elf_header
83
-
84
-
85
- def _is_linux_armhf() -> bool:
86
- # hard-float ABI can be detected from the ELF header of the running
87
- # process
88
- # https://static.docs.arm.com/ihi0044/g/aaelf32.pdf
89
- elf_header = _get_elf_header()
90
- if elf_header is None:
91
- return False
92
- result = elf_header.e_ident_class == elf_header.ELFCLASS32
93
- result &= elf_header.e_ident_data == elf_header.ELFDATA2LSB
94
- result &= elf_header.e_machine == elf_header.EM_ARM
95
- result &= (
96
- elf_header.e_flags & elf_header.EF_ARM_ABIMASK
97
- ) == elf_header.EF_ARM_ABI_VER5
98
- result &= (
99
- elf_header.e_flags & elf_header.EF_ARM_ABI_FLOAT_HARD
100
- ) == elf_header.EF_ARM_ABI_FLOAT_HARD
101
- return result
102
-
103
-
104
- def _is_linux_i686() -> bool:
105
- elf_header = _get_elf_header()
106
- if elf_header is None:
107
- return False
108
- result = elf_header.e_ident_class == elf_header.ELFCLASS32
109
- result &= elf_header.e_ident_data == elf_header.ELFDATA2LSB
110
- result &= elf_header.e_machine == elf_header.EM_386
111
- return result
112
-
113
-
114
- def _have_compatible_abi(arch: str) -> bool:
115
- if arch == "armv7l":
116
- return _is_linux_armhf()
117
- if arch == "i686":
118
- return _is_linux_i686()
119
- return arch in {"x86_64", "aarch64", "ppc64", "ppc64le", "s390x"}
120
-
121
-
122
- # If glibc ever changes its major version, we need to know what the last
123
- # minor version was, so we can build the complete list of all versions.
124
- # For now, guess what the highest minor version might be, assume it will
125
- # be 50 for testing. Once this actually happens, update the dictionary
126
- # with the actual value.
127
- _LAST_GLIBC_MINOR: Dict[int, int] = collections.defaultdict(lambda: 50)
128
-
129
-
130
- class _GLibCVersion(NamedTuple):
131
- major: int
132
- minor: int
133
-
134
-
135
- def _glibc_version_string_confstr() -> Optional[str]:
136
- """
137
- Primary implementation of glibc_version_string using os.confstr.
138
- """
139
- # os.confstr is quite a bit faster than ctypes.DLL. It's also less likely
140
- # to be broken or missing. This strategy is used in the standard library
141
- # platform module.
142
- # https://github.com/python/cpython/blob/fcf1d003bf4f0100c/Lib/platform.py#L175-L183
143
- try:
144
- # os.confstr("CS_GNU_LIBC_VERSION") returns a string like "glibc 2.17".
145
- version_string = os.confstr("CS_GNU_LIBC_VERSION")
146
- assert version_string is not None
147
- _, version = version_string.split()
148
- except (AssertionError, AttributeError, OSError, ValueError):
149
- # os.confstr() or CS_GNU_LIBC_VERSION not available (or a bad value)...
150
- return None
151
- return version
152
-
153
-
154
- def _glibc_version_string_ctypes() -> Optional[str]:
155
- """
156
- Fallback implementation of glibc_version_string using ctypes.
157
- """
158
- try:
159
- import ctypes
160
- except ImportError:
161
- return None
162
-
163
- # ctypes.CDLL(None) internally calls dlopen(NULL), and as the dlopen
164
- # manpage says, "If filename is NULL, then the returned handle is for the
165
- # main program". This way we can let the linker do the work to figure out
166
- # which libc our process is actually using.
167
- #
168
- # We must also handle the special case where the executable is not a
169
- # dynamically linked executable. This can occur when using musl libc,
170
- # for example. In this situation, dlopen() will error, leading to an
171
- # OSError. Interestingly, at least in the case of musl, there is no
172
- # errno set on the OSError. The single string argument used to construct
173
- # OSError comes from libc itself and is therefore not portable to
174
- # hard code here. In any case, failure to call dlopen() means we
175
- # can proceed, so we bail on our attempt.
176
- try:
177
- process_namespace = ctypes.CDLL(None)
178
- except OSError:
179
- return None
180
-
181
- try:
182
- gnu_get_libc_version = process_namespace.gnu_get_libc_version
183
- except AttributeError:
184
- # Symbol doesn't exist -> therefore, we are not linked to
185
- # glibc.
186
- return None
187
-
188
- # Call gnu_get_libc_version, which returns a string like "2.5"
189
- gnu_get_libc_version.restype = ctypes.c_char_p
190
- version_str: str = gnu_get_libc_version()
191
- # py2 / py3 compatibility:
192
- if not isinstance(version_str, str):
193
- version_str = version_str.decode("ascii")
194
-
195
- return version_str
196
-
197
-
198
- def _glibc_version_string() -> Optional[str]:
199
- """Returns glibc version string, or None if not using glibc."""
200
- return _glibc_version_string_confstr() or _glibc_version_string_ctypes()
201
-
202
-
203
- def _parse_glibc_version(version_str: str) -> Tuple[int, int]:
204
- """Parse glibc version.
205
-
206
- We use a regexp instead of str.split because we want to discard any
207
- random junk that might come after the minor version -- this might happen
208
- in patched/forked versions of glibc (e.g. Linaro's version of glibc
209
- uses version strings like "2.20-2014.11"). See gh-3588.
210
- """
211
- m = re.match(r"(?P<major>[0-9]+)\.(?P<minor>[0-9]+)", version_str)
212
- if not m:
213
- warnings.warn(
214
- "Expected glibc version with 2 components major.minor,"
215
- " got: %s" % version_str,
216
- RuntimeWarning,
217
- )
218
- return -1, -1
219
- return int(m.group("major")), int(m.group("minor"))
220
-
221
-
222
- @functools.lru_cache()
223
- def _get_glibc_version() -> Tuple[int, int]:
224
- version_str = _glibc_version_string()
225
- if version_str is None:
226
- return (-1, -1)
227
- return _parse_glibc_version(version_str)
228
-
229
-
230
- # From PEP 513, PEP 600
231
- def _is_compatible(name: str, arch: str, version: _GLibCVersion) -> bool:
232
- sys_glibc = _get_glibc_version()
233
- if sys_glibc < version:
234
- return False
235
- # Check for presence of _manylinux module.
236
- try:
237
- import _manylinux # noqa
238
- except ImportError:
239
- return True
240
- if hasattr(_manylinux, "manylinux_compatible"):
241
- result = _manylinux.manylinux_compatible(version[0], version[1], arch)
242
- if result is not None:
243
- return bool(result)
244
- return True
245
- if version == _GLibCVersion(2, 5):
246
- if hasattr(_manylinux, "manylinux1_compatible"):
247
- return bool(_manylinux.manylinux1_compatible)
248
- if version == _GLibCVersion(2, 12):
249
- if hasattr(_manylinux, "manylinux2010_compatible"):
250
- return bool(_manylinux.manylinux2010_compatible)
251
- if version == _GLibCVersion(2, 17):
252
- if hasattr(_manylinux, "manylinux2014_compatible"):
253
- return bool(_manylinux.manylinux2014_compatible)
254
- return True
255
-
256
-
257
- _LEGACY_MANYLINUX_MAP = {
258
- # CentOS 7 w/ glibc 2.17 (PEP 599)
259
- (2, 17): "manylinux2014",
260
- # CentOS 6 w/ glibc 2.12 (PEP 571)
261
- (2, 12): "manylinux2010",
262
- # CentOS 5 w/ glibc 2.5 (PEP 513)
263
- (2, 5): "manylinux1",
264
- }
265
-
266
-
267
- def platform_tags(linux: str, arch: str) -> Iterator[str]:
268
- if not _have_compatible_abi(arch):
269
- return
270
- # Oldest glibc to be supported regardless of architecture is (2, 17).
271
- too_old_glibc2 = _GLibCVersion(2, 16)
272
- if arch in {"x86_64", "i686"}:
273
- # On x86/i686 also oldest glibc to be supported is (2, 5).
274
- too_old_glibc2 = _GLibCVersion(2, 4)
275
- current_glibc = _GLibCVersion(*_get_glibc_version())
276
- glibc_max_list = [current_glibc]
277
- # We can assume compatibility across glibc major versions.
278
- # https://sourceware.org/bugzilla/show_bug.cgi?id=24636
279
- #
280
- # Build a list of maximum glibc versions so that we can
281
- # output the canonical list of all glibc from current_glibc
282
- # down to too_old_glibc2, including all intermediary versions.
283
- for glibc_major in range(current_glibc.major - 1, 1, -1):
284
- glibc_minor = _LAST_GLIBC_MINOR[glibc_major]
285
- glibc_max_list.append(_GLibCVersion(glibc_major, glibc_minor))
286
- for glibc_max in glibc_max_list:
287
- if glibc_max.major == too_old_glibc2.major:
288
- min_minor = too_old_glibc2.minor
289
- else:
290
- # For other glibc major versions oldest supported is (x, 0).
291
- min_minor = -1
292
- for glibc_minor in range(glibc_max.minor, min_minor, -1):
293
- glibc_version = _GLibCVersion(glibc_max.major, glibc_minor)
294
- tag = "manylinux_{}_{}".format(*glibc_version)
295
- if _is_compatible(tag, arch, glibc_version):
296
- yield linux.replace("linux", tag)
297
- # Handle the legacy manylinux1, manylinux2010, manylinux2014 tags.
298
- if glibc_version in _LEGACY_MANYLINUX_MAP:
299
- legacy_tag = _LEGACY_MANYLINUX_MAP[glibc_version]
300
- if _is_compatible(legacy_tag, arch, glibc_version):
301
- yield linux.replace("linux", legacy_tag)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/CVPR/v-doc_abstractive_mac/descrip.md DELETED
@@ -1,35 +0,0 @@
1
- # V-Doc : Visual questions answers with Documents
2
- This repository contains code for the paper [V-Doc : Visual questions answers with Documents](https://arxiv.org/pdf/2205.13724.pdf). The demo videos can be accessed by this [link](https://drive.google.com/file/d/1Ztp9LBcrEcJA3NlbFWn1RfNyfwt8Y6Qk/view).
3
-
4
- <h4 align="center">
5
- <b>Ding, Y.*, Huang, Z.*, Wang, R., Zhang, Y., Chen, X., Ma, Y., Chung, H., & Han, C. (CVPR 2022) <br/><a href="https://arxiv.org/pdf/2205.13724.pdf">V-Doc : Visual questions answers with Documents</a><br/></b></span>
6
- </h4>
7
-
8
- <p align="center">
9
- <img src="https://github.com/usydnlp/vdoc/blob/main/images/system_architecture.png">
10
- </p>
11
-
12
- ### Dataset in Dataset Storage Module
13
-
14
- The dataset we used to trained the model is provided in following links:
15
-
16
-
17
- [PubVQA Dataset](https://drive.google.com/drive/folders/1YMuctGPJbsy45Iz23ygcN1VGHWQp3aaU?ths=true) for training Mac-Network.
18
-
19
- Dataset for training LayoutLMv2([FUNSD-QA](https://drive.google.com/file/d/1Ev_sLTx3U9nAr2TGgUT5BXB1rpfLMlcq/view?usp=sharing)).
20
-
21
- ### Dataset Generation
22
- To run the scene based question generation code, we need to fetch the JSON files from the source.
23
-
24
- #### Extract OCR information
25
- ```bash
26
- python3 ./document_collection.py
27
- ```
28
- After the step above, a new folder called <code>./input_ocr</code> will be generated.
29
- #### Generate questions
30
- ```bash
31
- python3 ./scene_based/pdf_generate_question.py
32
- ```
33
- To limit the number of generated questions, you can change the code in <code>pdf_generate_question.py</code> line 575 and line 591-596
34
-
35
- After the steps above, you can see a json file under the <code>./output_qa_dataset</code>.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/Catspindev/monadical-labs-minecraft-skin-generator/README.md DELETED
@@ -1,12 +0,0 @@
1
- ---
2
- title: Monadical Labs Minecraft Skin Generator
3
- emoji: 🚀
4
- colorFrom: gray
5
- colorTo: gray
6
- sdk: gradio
7
- sdk_version: 3.43.2
8
- app_file: app.py
9
- pinned: false
10
- ---
11
-
12
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/Chomkwoy/Nilkessye/__init__.py DELETED
File without changes
spaces/Chomkwoy/Nilkessye/app.py DELETED
@@ -1,253 +0,0 @@
1
- import gradio as gr
2
- import numpy as np
3
- import torch
4
- import io
5
- from PIL import Image
6
- from transformers import PreTrainedModel, VisionEncoderDecoderModel, VisionEncoderDecoderConfig
7
- import cv2
8
- from tqdm.auto import tqdm
9
-
10
- import load_book
11
- import utils.hangul
12
- from model import exkp
13
- import syllable_model
14
- import ocr_utils
15
-
16
-
17
- class OcrModel(PreTrainedModel):
18
- config_class = VisionEncoderDecoderConfig
19
-
20
- def __init__(self, config):
21
- super().__init__(config)
22
- self.centernet = exkp(
23
- n=5,
24
- nstack=4,
25
- dims=[256, 256, 384, 384, 384, 512],
26
- modules=[2, 2, 2, 2, 2, 4],
27
- num_classes=4
28
- )
29
- self.recog = VisionEncoderDecoderModel(config)
30
-
31
- def forward(self, pixel_values, **kwargs):
32
- outputs = self.centernet(pixel_values, **kwargs)
33
- return outputs
34
-
35
-
36
- def main():
37
- model = OcrModel.from_pretrained('Chomkwoy/nilkessye')
38
- if torch.cuda.is_available():
39
- print("Enabling CUDA")
40
- model = model.cuda()
41
- recog = syllable_model.SyllableRecognizer(model.recog)
42
-
43
- def upload_file(file):
44
- yield (
45
- [], # gallery
46
- "", # output_textbox
47
- gr.Textbox(show_label=False, visible=True), # progress_indicator
48
- )
49
-
50
- image = Image.open(io.BytesIO(file))
51
- yield (
52
- [image], # gallery
53
- "", # output_textbox
54
- "처리중... 이미지 자르는 중", # progress_indicator
55
- )
56
-
57
- image_np = np.array(image)[..., :3]
58
- generator = recognize_page(
59
- image_np,
60
- model, recog,
61
- return_line_infos=True,
62
- batch_size=16
63
- )
64
-
65
- # Crop image
66
- image = next(generator)
67
- yield (
68
- [Image.fromarray(image)], # gallery
69
- "", # output_textbox
70
- "처리중... 글자 위치 인식 중", # progress_indicator
71
- )
72
-
73
- # Get lines
74
- line_infos = next(generator)
75
- image = draw_detections(image, line_infos)
76
-
77
- # Read syllables
78
- num_batches = next(generator)
79
-
80
- yield (
81
- [Image.fromarray(image)], # gallery
82
- "", # output_textbox
83
- f"처리중... 글자 읽는 중 (0/{num_batches})", # progress_indicator
84
- )
85
-
86
- # Free memory
87
- i = 0
88
- while True:
89
- try:
90
- pred_syllables = next(generator)
91
- i += 1
92
- yield (
93
- [Image.fromarray(image)], # gallery
94
- gen_html(pred_syllables, line_infos), # output_textbox
95
- f"처리중... 글자 읽는 중 ({i}/{num_batches})", # progress_indicator
96
- )
97
- except StopIteration:
98
- break
99
-
100
- yield (
101
- [Image.fromarray(image)], # gallery
102
- gen_html(pred_syllables, line_infos), # output_textbox
103
- gr.Textbox(visible=False), # progress_indicator
104
- )
105
-
106
- with gr.Blocks() as demo:
107
- gr.Markdown("""
108
- # 닐거쎠: 옛한글 글자 인식기
109
-
110
- 이미지 파일을 업로드해보세요. 한자는 인식되지 않습니다.
111
-
112
- 만든사람: ᄎᆞᆷ괴
113
- """)
114
-
115
- progress_indicator = gr.Textbox(visible=False)
116
-
117
- with gr.Row():
118
- gallery = gr.Gallery(
119
- columns=1,
120
- allow_preview=False,
121
- object_fit="contain",
122
- label="보기"
123
- )
124
-
125
- with gr.Column():
126
- upload_button = gr.UploadButton(
127
- '파일 올리기',
128
- type='binary'
129
- )
130
- output_textbox = gr.HTML(
131
- label="인식 결과",
132
- value="여기에 결과가 표시됩니다."
133
- )
134
-
135
- upload_button.upload(
136
- fn=upload_file,
137
- inputs=upload_button,
138
- outputs=[gallery, output_textbox, progress_indicator]
139
- )
140
-
141
- demo.queue(max_size=20).launch(server_name='0.0.0.0')
142
-
143
-
144
- def gen_html(pred_syllables, line_infos):
145
- output_lines = []
146
- offset = 0
147
- for line in line_infos:
148
- if offset >= len(pred_syllables):
149
- break
150
- line_len = len(line['line'])
151
- cur_line = '.'.join(pred_syllables[offset:offset + line_len])
152
- cur_line_hangul = utils.hangul.convert_yale_to_hangul(cur_line)
153
- output_lines.append({
154
- 'is_anno': line['is_anno'],
155
- 'text': cur_line_hangul
156
- })
157
- offset += line_len
158
-
159
- output_html = ""
160
- for line in output_lines:
161
- if line['is_anno']:
162
- output_html += f"<span style='letter-spacing: .1rem;'>{line['text']}</span>"
163
- else:
164
- output_html += f"<span style='font-size: 1.5em; letter-spacing: .1rem;'>{line['text']}</span>"
165
-
166
- return output_html
167
-
168
-
169
- def draw_detections(image, line_infos):
170
- image = image.copy()
171
- for line_idx, line_info in enumerate(line_infos):
172
- cv2.rectangle(image,
173
- (int(line_info['bbox'][0][0]), int(line_info['bbox'][0][1])),
174
- (int(line_info['bbox'][1][0]), int(line_info['bbox'][1][1])),
175
- [255, 255, 255], 6)
176
-
177
- for line_idx, line_info in enumerate(line_infos):
178
- for bbox, center, seq, cls in line_info['line']:
179
- color = [[160, 158, 255], [212, 56, 13], [107, 255, 171], [255, 205, 66]][int(cls)]
180
- shapes = image.copy()
181
- cv2.rectangle(shapes, *bbox, color, cv2.FILLED)
182
- alpha = 0.75
183
- image = cv2.addWeighted(image, alpha, shapes, 1 - alpha, 0)
184
- cv2.rectangle(image, *bbox, color, 2)
185
-
186
- for line_idx, line_info in enumerate(line_infos):
187
- cv2.putText(
188
- image, f"{line_idx}",
189
- (int(line_info['bbox'][0][0]), int(line_info['bbox'][0][1]) + 15),
190
- cv2.FONT_HERSHEY_SIMPLEX, 0.7, [250, 225, 0], 2
191
- )
192
- return image
193
-
194
-
195
- def recognize_page(orig_image, centernet, syllable_recognizer, return_line_infos=False, batch_size=32):
196
- orig_image, bbox, orig_size = load_book.process_page(orig_image)
197
- yield orig_image
198
-
199
- orig_size = (orig_image.shape[1], orig_image.shape[0])
200
- image = cv2.resize(orig_image, dsize=(512, 512), interpolation=cv2.INTER_AREA)
201
-
202
- image = image.astype(np.float32) / 255. - .5 # to [-.5, +.5] range
203
- image = image.transpose((2, 0, 1)) # [H, W, C] to [C, H, W]
204
- image = torch.as_tensor(image)
205
-
206
- # Run object detection
207
- centernet.eval()
208
- with torch.no_grad():
209
- output = centernet(torch.as_tensor(image)[None].to(centernet.device))
210
-
211
- sw, sh = orig_size[0] * 4 / 512, orig_size[1] * 4 / 512
212
-
213
- tiles = ocr_utils.get_pred_detections(
214
- output, sw=sw, sh=sh,
215
- threshold=0.3,
216
- ae_threshold=20.0
217
- )
218
-
219
- line_infos = ocr_utils.detect_lines(tiles)
220
- yield line_infos
221
-
222
- yield from recognize_lines(line_infos, orig_image, syllable_recognizer, batch_size=batch_size)
223
-
224
-
225
- def recognize_lines(line_infos, orig_image, syllable_recognizer, batch_size=32):
226
- tiles = []
227
- for line_idx, line_info in enumerate(line_infos):
228
- for bbox, center, seq, cls in line_info['line']:
229
- (tlx, tly), (brx, bry) = bbox
230
- w, h = brx - tlx, bry - tly
231
- pw, ph = w / 5, h / 5
232
- tile = orig_image[
233
- max(0, int(tly - ph)):min(orig_image.shape[0], int(bry + ph)),
234
- max(0, int(tlx - pw)):min(orig_image.shape[1], int(brx + pw)),
235
- ]
236
- tiles.append((tile, bbox, center, seq, cls))
237
-
238
- hangul_tiles = [(i, tile) for i, (tile, _, _, _, cls) in enumerate(tiles) if cls in [0, 2]]
239
-
240
- pred_syllables = ["〓"] * len(tiles)
241
- batches = list(ocr_utils.batched(hangul_tiles, batch_size))
242
- yield len(batches)
243
-
244
- for batch in tqdm(batches):
245
- indices, images = zip(*batch)
246
- batch_pred_syllables = syllable_recognizer.recognize(images)
247
- for i, pred_syllable in zip(indices, batch_pred_syllables):
248
- pred_syllables[i] = pred_syllable
249
- yield pred_syllables[:i + 1]
250
-
251
-
252
- if __name__ == "__main__":
253
- main()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/CikeyQI/meme-api/meme_generator/memes/interview/__init__.py DELETED
@@ -1,45 +0,0 @@
1
- from pathlib import Path
2
- from typing import List
3
-
4
- from pil_utils import BuildImage
5
-
6
- from meme_generator import add_meme
7
- from meme_generator.exception import TextOverLength
8
-
9
- img_dir = Path(__file__).parent / "images"
10
-
11
-
12
- def interview(images: List[BuildImage], texts: List[str], args):
13
- if len(images) == 2:
14
- self_img = images[0]
15
- user_img = images[1]
16
- else:
17
- self_img = BuildImage.open(img_dir / "huaji.png")
18
- user_img = images[0]
19
- self_img = self_img.convert("RGBA").square().resize((124, 124))
20
- user_img = user_img.convert("RGBA").square().resize((124, 124))
21
-
22
- text = texts[0] if texts else "采访大佬经验"
23
-
24
- frame = BuildImage.new("RGBA", (600, 310), "white")
25
- microphone = BuildImage.open(img_dir / "microphone.png")
26
- frame.paste(microphone, (330, 103), alpha=True)
27
- frame.paste(self_img, (419, 40), alpha=True)
28
- frame.paste(user_img, (57, 40), alpha=True)
29
- try:
30
- frame.draw_text((20, 200, 580, 310), text, max_fontsize=50, min_fontsize=20)
31
- except ValueError:
32
- raise TextOverLength(text)
33
- return frame.save_jpg()
34
-
35
-
36
- add_meme(
37
- "interview",
38
- interview,
39
- min_images=1,
40
- max_images=2,
41
- min_texts=0,
42
- max_texts=1,
43
- default_texts=["采访大佬经验"],
44
- keywords=["采访"],
45
- )
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/CognitiveLabs/GPT-auto-webscraping/ExcecuteFunction.py DELETED
@@ -1,9 +0,0 @@
1
- import importlib
2
-
3
- def execute_function():
4
- module = "output"
5
- function = "extract_info"
6
- module = importlib.import_module(module)
7
- function = getattr(module, function)
8
- print("returning function")
9
- return function
 
 
 
 
 
 
 
 
 
 
spaces/CognitiveLabs/Research-Assistant/test/test3.py DELETED
@@ -1,21 +0,0 @@
1
- import openai
2
-
3
- openai.api_key = "sk-DQ1nFYzAVzGMznofdi0nig7MebfA9PWrTxCHlLIZIqc4X8xu"
4
- openai.api_base = "https://api.chatanywhere.cn/v1"
5
-
6
- def generator():
7
- messages = [{
8
- "role": "user",
9
- "content": "What is the meaning of life?",
10
- }]
11
- response = ""
12
- for chunk in openai.ChatCompletion.create(
13
- model="gpt-3.5-turbo",
14
- messages=messages,
15
- temperature=0.9,
16
- stream=True,
17
- ):
18
- content = chunk["choices"][0].get("delta", {}).get("content")
19
- if content:
20
- response += content
21
- yield response
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/DEEMOSTECH/ChatAvatar/static/js/main.2966234b.js DELETED
The diff for this file is too large to render. See raw diff
 
spaces/DQChoi/gpt-demo/venv/lib/python3.11/site-packages/PIL/SgiImagePlugin.py DELETED
@@ -1,231 +0,0 @@
1
- #
2
- # The Python Imaging Library.
3
- # $Id$
4
- #
5
- # SGI image file handling
6
- #
7
- # See "The SGI Image File Format (Draft version 0.97)", Paul Haeberli.
8
- # <ftp://ftp.sgi.com/graphics/SGIIMAGESPEC>
9
- #
10
- #
11
- # History:
12
- # 2017-22-07 mb Add RLE decompression
13
- # 2016-16-10 mb Add save method without compression
14
- # 1995-09-10 fl Created
15
- #
16
- # Copyright (c) 2016 by Mickael Bonfill.
17
- # Copyright (c) 2008 by Karsten Hiddemann.
18
- # Copyright (c) 1997 by Secret Labs AB.
19
- # Copyright (c) 1995 by Fredrik Lundh.
20
- #
21
- # See the README file for information on usage and redistribution.
22
- #
23
-
24
-
25
- import os
26
- import struct
27
-
28
- from . import Image, ImageFile
29
- from ._binary import i16be as i16
30
- from ._binary import o8
31
-
32
-
33
- def _accept(prefix):
34
- return len(prefix) >= 2 and i16(prefix) == 474
35
-
36
-
37
- MODES = {
38
- (1, 1, 1): "L",
39
- (1, 2, 1): "L",
40
- (2, 1, 1): "L;16B",
41
- (2, 2, 1): "L;16B",
42
- (1, 3, 3): "RGB",
43
- (2, 3, 3): "RGB;16B",
44
- (1, 3, 4): "RGBA",
45
- (2, 3, 4): "RGBA;16B",
46
- }
47
-
48
-
49
- ##
50
- # Image plugin for SGI images.
51
- class SgiImageFile(ImageFile.ImageFile):
52
- format = "SGI"
53
- format_description = "SGI Image File Format"
54
-
55
- def _open(self):
56
- # HEAD
57
- headlen = 512
58
- s = self.fp.read(headlen)
59
-
60
- if not _accept(s):
61
- msg = "Not an SGI image file"
62
- raise ValueError(msg)
63
-
64
- # compression : verbatim or RLE
65
- compression = s[2]
66
-
67
- # bpc : 1 or 2 bytes (8bits or 16bits)
68
- bpc = s[3]
69
-
70
- # dimension : 1, 2 or 3 (depending on xsize, ysize and zsize)
71
- dimension = i16(s, 4)
72
-
73
- # xsize : width
74
- xsize = i16(s, 6)
75
-
76
- # ysize : height
77
- ysize = i16(s, 8)
78
-
79
- # zsize : channels count
80
- zsize = i16(s, 10)
81
-
82
- # layout
83
- layout = bpc, dimension, zsize
84
-
85
- # determine mode from bits/zsize
86
- rawmode = ""
87
- try:
88
- rawmode = MODES[layout]
89
- except KeyError:
90
- pass
91
-
92
- if rawmode == "":
93
- msg = "Unsupported SGI image mode"
94
- raise ValueError(msg)
95
-
96
- self._size = xsize, ysize
97
- self.mode = rawmode.split(";")[0]
98
- if self.mode == "RGB":
99
- self.custom_mimetype = "image/rgb"
100
-
101
- # orientation -1 : scanlines begins at the bottom-left corner
102
- orientation = -1
103
-
104
- # decoder info
105
- if compression == 0:
106
- pagesize = xsize * ysize * bpc
107
- if bpc == 2:
108
- self.tile = [
109
- ("SGI16", (0, 0) + self.size, headlen, (self.mode, 0, orientation))
110
- ]
111
- else:
112
- self.tile = []
113
- offset = headlen
114
- for layer in self.mode:
115
- self.tile.append(
116
- ("raw", (0, 0) + self.size, offset, (layer, 0, orientation))
117
- )
118
- offset += pagesize
119
- elif compression == 1:
120
- self.tile = [
121
- ("sgi_rle", (0, 0) + self.size, headlen, (rawmode, orientation, bpc))
122
- ]
123
-
124
-
125
- def _save(im, fp, filename):
126
- if im.mode != "RGB" and im.mode != "RGBA" and im.mode != "L":
127
- msg = "Unsupported SGI image mode"
128
- raise ValueError(msg)
129
-
130
- # Get the keyword arguments
131
- info = im.encoderinfo
132
-
133
- # Byte-per-pixel precision, 1 = 8bits per pixel
134
- bpc = info.get("bpc", 1)
135
-
136
- if bpc not in (1, 2):
137
- msg = "Unsupported number of bytes per pixel"
138
- raise ValueError(msg)
139
-
140
- # Flip the image, since the origin of SGI file is the bottom-left corner
141
- orientation = -1
142
- # Define the file as SGI File Format
143
- magic_number = 474
144
- # Run-Length Encoding Compression - Unsupported at this time
145
- rle = 0
146
-
147
- # Number of dimensions (x,y,z)
148
- dim = 3
149
- # X Dimension = width / Y Dimension = height
150
- x, y = im.size
151
- if im.mode == "L" and y == 1:
152
- dim = 1
153
- elif im.mode == "L":
154
- dim = 2
155
- # Z Dimension: Number of channels
156
- z = len(im.mode)
157
-
158
- if dim == 1 or dim == 2:
159
- z = 1
160
-
161
- # assert we've got the right number of bands.
162
- if len(im.getbands()) != z:
163
- msg = f"incorrect number of bands in SGI write: {z} vs {len(im.getbands())}"
164
- raise ValueError(msg)
165
-
166
- # Minimum Byte value
167
- pinmin = 0
168
- # Maximum Byte value (255 = 8bits per pixel)
169
- pinmax = 255
170
- # Image name (79 characters max, truncated below in write)
171
- img_name = os.path.splitext(os.path.basename(filename))[0]
172
- img_name = img_name.encode("ascii", "ignore")
173
- # Standard representation of pixel in the file
174
- colormap = 0
175
- fp.write(struct.pack(">h", magic_number))
176
- fp.write(o8(rle))
177
- fp.write(o8(bpc))
178
- fp.write(struct.pack(">H", dim))
179
- fp.write(struct.pack(">H", x))
180
- fp.write(struct.pack(">H", y))
181
- fp.write(struct.pack(">H", z))
182
- fp.write(struct.pack(">l", pinmin))
183
- fp.write(struct.pack(">l", pinmax))
184
- fp.write(struct.pack("4s", b"")) # dummy
185
- fp.write(struct.pack("79s", img_name)) # truncates to 79 chars
186
- fp.write(struct.pack("s", b"")) # force null byte after img_name
187
- fp.write(struct.pack(">l", colormap))
188
- fp.write(struct.pack("404s", b"")) # dummy
189
-
190
- rawmode = "L"
191
- if bpc == 2:
192
- rawmode = "L;16B"
193
-
194
- for channel in im.split():
195
- fp.write(channel.tobytes("raw", rawmode, 0, orientation))
196
-
197
- if hasattr(fp, "flush"):
198
- fp.flush()
199
-
200
-
201
- class SGI16Decoder(ImageFile.PyDecoder):
202
- _pulls_fd = True
203
-
204
- def decode(self, buffer):
205
- rawmode, stride, orientation = self.args
206
- pagesize = self.state.xsize * self.state.ysize
207
- zsize = len(self.mode)
208
- self.fd.seek(512)
209
-
210
- for band in range(zsize):
211
- channel = Image.new("L", (self.state.xsize, self.state.ysize))
212
- channel.frombytes(
213
- self.fd.read(2 * pagesize), "raw", "L;16B", stride, orientation
214
- )
215
- self.im.putband(channel.im, band)
216
-
217
- return -1, 0
218
-
219
-
220
- #
221
- # registry
222
-
223
-
224
- Image.register_decoder("SGI16", SGI16Decoder)
225
- Image.register_open(SgiImageFile.format, SgiImageFile, _accept)
226
- Image.register_save(SgiImageFile.format, _save)
227
- Image.register_mime(SgiImageFile.format, "image/sgi")
228
-
229
- Image.register_extensions(SgiImageFile.format, [".bw", ".rgb", ".rgba", ".sgi"])
230
-
231
- # End of file
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/DQChoi/gpt-demo/venv/lib/python3.11/site-packages/fontTools/merge/unicode.py DELETED
@@ -1,78 +0,0 @@
1
- # Copyright 2021 Behdad Esfahbod. All Rights Reserved.
2
-
3
-
4
- def is_Default_Ignorable(u):
5
- # http://www.unicode.org/reports/tr44/#Default_Ignorable_Code_Point
6
- #
7
- # TODO Move me to unicodedata module and autogenerate.
8
- #
9
- # Unicode 14.0:
10
- # $ grep '; Default_Ignorable_Code_Point ' DerivedCoreProperties.txt | sed 's/;.*#/#/'
11
- # 00AD # Cf SOFT HYPHEN
12
- # 034F # Mn COMBINING GRAPHEME JOINER
13
- # 061C # Cf ARABIC LETTER MARK
14
- # 115F..1160 # Lo [2] HANGUL CHOSEONG FILLER..HANGUL JUNGSEONG FILLER
15
- # 17B4..17B5 # Mn [2] KHMER VOWEL INHERENT AQ..KHMER VOWEL INHERENT AA
16
- # 180B..180D # Mn [3] MONGOLIAN FREE VARIATION SELECTOR ONE..MONGOLIAN FREE VARIATION SELECTOR THREE
17
- # 180E # Cf MONGOLIAN VOWEL SEPARATOR
18
- # 180F # Mn MONGOLIAN FREE VARIATION SELECTOR FOUR
19
- # 200B..200F # Cf [5] ZERO WIDTH SPACE..RIGHT-TO-LEFT MARK
20
- # 202A..202E # Cf [5] LEFT-TO-RIGHT EMBEDDING..RIGHT-TO-LEFT OVERRIDE
21
- # 2060..2064 # Cf [5] WORD JOINER..INVISIBLE PLUS
22
- # 2065 # Cn <reserved-2065>
23
- # 2066..206F # Cf [10] LEFT-TO-RIGHT ISOLATE..NOMINAL DIGIT SHAPES
24
- # 3164 # Lo HANGUL FILLER
25
- # FE00..FE0F # Mn [16] VARIATION SELECTOR-1..VARIATION SELECTOR-16
26
- # FEFF # Cf ZERO WIDTH NO-BREAK SPACE
27
- # FFA0 # Lo HALFWIDTH HANGUL FILLER
28
- # FFF0..FFF8 # Cn [9] <reserved-FFF0>..<reserved-FFF8>
29
- # 1BCA0..1BCA3 # Cf [4] SHORTHAND FORMAT LETTER OVERLAP..SHORTHAND FORMAT UP STEP
30
- # 1D173..1D17A # Cf [8] MUSICAL SYMBOL BEGIN BEAM..MUSICAL SYMBOL END PHRASE
31
- # E0000 # Cn <reserved-E0000>
32
- # E0001 # Cf LANGUAGE TAG
33
- # E0002..E001F # Cn [30] <reserved-E0002>..<reserved-E001F>
34
- # E0020..E007F # Cf [96] TAG SPACE..CANCEL TAG
35
- # E0080..E00FF # Cn [128] <reserved-E0080>..<reserved-E00FF>
36
- # E0100..E01EF # Mn [240] VARIATION SELECTOR-17..VARIATION SELECTOR-256
37
- # E01F0..E0FFF # Cn [3600] <reserved-E01F0>..<reserved-E0FFF>
38
- return (
39
- u == 0x00AD
40
- or u == 0x034F # Cf SOFT HYPHEN
41
- or u == 0x061C # Mn COMBINING GRAPHEME JOINER
42
- or 0x115F <= u <= 0x1160 # Cf ARABIC LETTER MARK
43
- or 0x17B4 # Lo [2] HANGUL CHOSEONG FILLER..HANGUL JUNGSEONG FILLER
44
- <= u
45
- <= 0x17B5
46
- or 0x180B # Mn [2] KHMER VOWEL INHERENT AQ..KHMER VOWEL INHERENT AA
47
- <= u
48
- <= 0x180D
49
- or u # Mn [3] MONGOLIAN FREE VARIATION SELECTOR ONE..MONGOLIAN FREE VARIATION SELECTOR THREE
50
- == 0x180E
51
- or u == 0x180F # Cf MONGOLIAN VOWEL SEPARATOR
52
- or 0x200B <= u <= 0x200F # Mn MONGOLIAN FREE VARIATION SELECTOR FOUR
53
- or 0x202A <= u <= 0x202E # Cf [5] ZERO WIDTH SPACE..RIGHT-TO-LEFT MARK
54
- or 0x2060 # Cf [5] LEFT-TO-RIGHT EMBEDDING..RIGHT-TO-LEFT OVERRIDE
55
- <= u
56
- <= 0x2064
57
- or u == 0x2065 # Cf [5] WORD JOINER..INVISIBLE PLUS
58
- or 0x2066 <= u <= 0x206F # Cn <reserved-2065>
59
- or u == 0x3164 # Cf [10] LEFT-TO-RIGHT ISOLATE..NOMINAL DIGIT SHAPES
60
- or 0xFE00 <= u <= 0xFE0F # Lo HANGUL FILLER
61
- or u == 0xFEFF # Mn [16] VARIATION SELECTOR-1..VARIATION SELECTOR-16
62
- or u == 0xFFA0 # Cf ZERO WIDTH NO-BREAK SPACE
63
- or 0xFFF0 <= u <= 0xFFF8 # Lo HALFWIDTH HANGUL FILLER
64
- or 0x1BCA0 <= u <= 0x1BCA3 # Cn [9] <reserved-FFF0>..<reserved-FFF8>
65
- or 0x1D173 # Cf [4] SHORTHAND FORMAT LETTER OVERLAP..SHORTHAND FORMAT UP STEP
66
- <= u
67
- <= 0x1D17A
68
- or u == 0xE0000 # Cf [8] MUSICAL SYMBOL BEGIN BEAM..MUSICAL SYMBOL END PHRASE
69
- or u == 0xE0001 # Cn <reserved-E0000>
70
- or 0xE0002 <= u <= 0xE001F # Cf LANGUAGE TAG
71
- or 0xE0020 <= u <= 0xE007F # Cn [30] <reserved-E0002>..<reserved-E001F>
72
- or 0xE0080 <= u <= 0xE00FF # Cf [96] TAG SPACE..CANCEL TAG
73
- or 0xE0100 <= u <= 0xE01EF # Cn [128] <reserved-E0080>..<reserved-E00FF>
74
- or 0xE01F0 # Mn [240] VARIATION SELECTOR-17..VARIATION SELECTOR-256
75
- <= u
76
- <= 0xE0FFF
77
- or False # Cn [3600] <reserved-E01F0>..<reserved-E0FFF>
78
- )
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/DQChoi/gpt-demo/venv/lib/python3.11/site-packages/gradio/templates/frontend/assets/ColorPicker-5063dbc4.css DELETED
@@ -1 +0,0 @@
1
- label.svelte-1ojmf70.svelte-1ojmf70.svelte-1ojmf70{display:flex;align-items:center;cursor:pointer;color:var(--body-text-color);font-weight:var(--checkbox-label-text-weight);font-size:var(--checkbox-label-text-size);line-height:var(--line-md)}label.svelte-1ojmf70>.svelte-1ojmf70+.svelte-1ojmf70{margin-left:var(--size-2)}input.svelte-1ojmf70.svelte-1ojmf70.svelte-1ojmf70{--ring-color:transparent;position:relative;box-shadow:var(--input-shadow);border:1px solid var(--checkbox-border-color);border-radius:var(--checkbox-border-radius);background-color:var(--checkbox-background-color);line-height:var(--line-sm)}input.svelte-1ojmf70.svelte-1ojmf70.svelte-1ojmf70:checked,input.svelte-1ojmf70.svelte-1ojmf70.svelte-1ojmf70:checked:hover,input.svelte-1ojmf70.svelte-1ojmf70.svelte-1ojmf70:checked:focus{border-color:var(--checkbox-border-color-selected);background-image:var(--checkbox-check);background-color:var(--checkbox-background-color-selected)}input.svelte-1ojmf70.svelte-1ojmf70.svelte-1ojmf70:hover{border-color:var(--checkbox-border-color-hover);background-color:var(--checkbox-background-color-hover)}input.svelte-1ojmf70.svelte-1ojmf70.svelte-1ojmf70:focus{border-color:var(--checkbox-border-color-focus);background-color:var(--checkbox-background-color-focus)}input[disabled].svelte-1ojmf70.svelte-1ojmf70.svelte-1ojmf70,.disabled.svelte-1ojmf70.svelte-1ojmf70.svelte-1ojmf70{cursor:not-allowed}.wrap.svelte-1qxcj04.svelte-1qxcj04.svelte-1qxcj04{display:flex;flex-wrap:wrap;gap:var(--checkbox-label-gap)}label.svelte-1qxcj04.svelte-1qxcj04.svelte-1qxcj04{display:flex;align-items:center;transition:var(--button-transition);cursor:pointer;box-shadow:var(--checkbox-label-shadow);border:var(--checkbox-label-border-width) solid var(--checkbox-label-border-color);border-radius:var(--button-small-radius);background:var(--checkbox-label-background-fill);padding:var(--checkbox-label-padding);color:var(--checkbox-label-text-color);font-weight:var(--checkbox-label-text-weight);font-size:var(--checkbox-label-text-size);line-height:var(--line-md)}label.svelte-1qxcj04.svelte-1qxcj04.svelte-1qxcj04:hover{background:var(--checkbox-label-background-fill-hover)}label.svelte-1qxcj04.svelte-1qxcj04.svelte-1qxcj04:focus{background:var(--checkbox-label-background-fill-focus)}label.selected.svelte-1qxcj04.svelte-1qxcj04.svelte-1qxcj04{background:var(--checkbox-label-background-fill-selected);color:var(--checkbox-label-text-color-selected)}label.svelte-1qxcj04>.svelte-1qxcj04+.svelte-1qxcj04{margin-left:var(--size-2)}input.svelte-1qxcj04.svelte-1qxcj04.svelte-1qxcj04{--ring-color:transparent;position:relative;box-shadow:var(--checkbox-shadow);border:var(--checkbox-border-width) solid var(--checkbox-border-color);border-radius:var(--checkbox-border-radius);background-color:var(--checkbox-background-color);line-height:var(--line-sm)}input.svelte-1qxcj04.svelte-1qxcj04.svelte-1qxcj04:checked,input.svelte-1qxcj04.svelte-1qxcj04.svelte-1qxcj04:checked:hover,input.svelte-1qxcj04.svelte-1qxcj04.svelte-1qxcj04:checked:focus{border-color:var(--checkbox-border-color-selected);background-image:var(--checkbox-check);background-color:var(--checkbox-background-color-selected)}input.svelte-1qxcj04.svelte-1qxcj04.svelte-1qxcj04:hover{border-color:var(--checkbox-border-color-hover);background-color:var(--checkbox-background-color-hover)}input.svelte-1qxcj04.svelte-1qxcj04.svelte-1qxcj04:focus{border-color:var(--checkbox-border-color-focus);background-color:var(--checkbox-background-color-focus)}input[disabled].svelte-1qxcj04.svelte-1qxcj04.svelte-1qxcj04,.disabled.svelte-1qxcj04.svelte-1qxcj04.svelte-1qxcj04{cursor:not-allowed}.options.svelte-1aonegi{--window-padding:var(--size-8);position:fixed;z-index:var(--layer-top);margin-left:0;box-shadow:var(--shadow-drop-lg);border-radius:var(--container-radius);background:var(--background-fill-primary);min-width:fit-content;max-width:inherit;overflow:auto;color:var(--body-text-color);list-style:none}.item.svelte-1aonegi{display:flex;cursor:pointer;padding:var(--size-2)}.item.svelte-1aonegi:hover,.active.svelte-1aonegi{background:var(--background-fill-secondary)}.inner-item.svelte-1aonegi{padding-right:var(--size-1)}.hide.svelte-1aonegi{visibility:hidden}label.svelte-c0u3f0.svelte-c0u3f0.svelte-c0u3f0:not(.container),label.svelte-c0u3f0:not(.container) .wrap.svelte-c0u3f0.svelte-c0u3f0,label.svelte-c0u3f0:not(.container) .wrap-inner.svelte-c0u3f0.svelte-c0u3f0,label.svelte-c0u3f0:not(.container) .secondary-wrap.svelte-c0u3f0.svelte-c0u3f0,label.svelte-c0u3f0:not(.container) .token.svelte-c0u3f0.svelte-c0u3f0,label.svelte-c0u3f0:not(.container) input.svelte-c0u3f0.svelte-c0u3f0{height:100%}.container.svelte-c0u3f0 .wrap.svelte-c0u3f0.svelte-c0u3f0{box-shadow:var(--input-shadow);border:var(--input-border-width) solid var(--border-color-primary)}.wrap.svelte-c0u3f0.svelte-c0u3f0.svelte-c0u3f0{position:relative;border-radius:var(--input-radius);background:var(--input-background-fill)}.wrap.svelte-c0u3f0.svelte-c0u3f0.svelte-c0u3f0:focus-within{box-shadow:var(--input-shadow-focus);border-color:var(--input-border-color-focus)}.wrap-inner.svelte-c0u3f0.svelte-c0u3f0.svelte-c0u3f0{display:flex;position:relative;flex-wrap:wrap;align-items:center;gap:var(--checkbox-label-gap);padding:var(--checkbox-label-padding)}.token.svelte-c0u3f0.svelte-c0u3f0.svelte-c0u3f0{display:flex;align-items:center;transition:var(--button-transition);cursor:pointer;box-shadow:var(--checkbox-label-shadow);border:var(--checkbox-label-border-width) solid var(--checkbox-label-border-color);border-radius:var(--button-small-radius);background:var(--checkbox-label-background-fill);padding:var(--checkbox-label-padding);color:var(--checkbox-label-text-color);font-weight:var(--checkbox-label-text-weight);font-size:var(--checkbox-label-text-size);line-height:var(--line-md)}.token.svelte-c0u3f0>.svelte-c0u3f0+.svelte-c0u3f0{margin-left:var(--size-2)}.token-remove.svelte-c0u3f0.svelte-c0u3f0.svelte-c0u3f0{fill:var(--body-text-color);display:flex;justify-content:center;align-items:center;cursor:pointer;border:var(--checkbox-border-width) solid var(--border-color-primary);border-radius:var(--radius-full);background:var(--background-fill-primary);padding:var(--size-0-5);width:18px;height:18px}.secondary-wrap.svelte-c0u3f0.svelte-c0u3f0.svelte-c0u3f0{display:flex;flex:1 1 0%;align-items:center;border:none;min-width:min-content}input.svelte-c0u3f0.svelte-c0u3f0.svelte-c0u3f0{margin:var(--spacing-sm);outline:none;border:none;background:inherit;width:var(--size-full);color:var(--body-text-color);font-size:var(--input-text-size)}input.svelte-c0u3f0.svelte-c0u3f0.svelte-c0u3f0:disabled{-webkit-text-fill-color:var(--body-text-color);-webkit-opacity:1;opacity:1;cursor:not-allowed}.remove-all.svelte-c0u3f0.svelte-c0u3f0.svelte-c0u3f0{margin-left:var(--size-1);width:20px;height:20px}.hide.svelte-c0u3f0.svelte-c0u3f0.svelte-c0u3f0{display:none}.subdued.svelte-c0u3f0.svelte-c0u3f0.svelte-c0u3f0{color:var(--body-text-color-subdued)}label.svelte-gigvtq.svelte-gigvtq:not(.container),label.svelte-gigvtq:not(.container)>input.svelte-gigvtq{height:100%;border:none}.container.svelte-gigvtq>input.svelte-gigvtq{border:var(--input-border-width) solid var(--input-border-color);border-radius:var(--input-radius)}input[type=number].svelte-gigvtq.svelte-gigvtq{display:block;position:relative;outline:none!important;box-shadow:var(--input-shadow);background:var(--input-background-fill);padding:var(--input-padding);width:100%;color:var(--body-text-color);font-size:var(--input-text-size);line-height:var(--line-sm)}input.svelte-gigvtq.svelte-gigvtq:disabled{-webkit-text-fill-color:var(--body-text-color);-webkit-opacity:1;opacity:1}input.svelte-gigvtq.svelte-gigvtq:focus{box-shadow:var(--input-shadow-focus);border-color:var(--input-border-color-focus)}input.svelte-gigvtq.svelte-gigvtq::placeholder{color:var(--input-placeholder-color)}input.svelte-gigvtq.svelte-gigvtq:out-of-range{border:var(--input-border-width) solid var(--error-border-color)}.wrap.svelte-1p9xokt.svelte-1p9xokt.svelte-1p9xokt{display:flex;flex-wrap:wrap;gap:var(--checkbox-label-gap)}label.svelte-1p9xokt.svelte-1p9xokt.svelte-1p9xokt{display:flex;align-items:center;transition:var(--button-transition);cursor:pointer;box-shadow:var(--checkbox-label-shadow);border:var(--checkbox-label-border-width) solid var(--checkbox-label-border-color);border-radius:var(--button-small-radius);background:var(--checkbox-label-background-fill);padding:var(--checkbox-label-padding);color:var(--checkbox-label-text-color);font-weight:var(--checkbox-label-text-weight);font-size:var(--checkbox-label-text-size);line-height:var(--line-md)}label.svelte-1p9xokt.svelte-1p9xokt.svelte-1p9xokt:hover{background:var(--checkbox-label-background-fill-hover)}label.svelte-1p9xokt.svelte-1p9xokt.svelte-1p9xokt:focus{background:var(--checkbox-label-background-fill-focus)}label.selected.svelte-1p9xokt.svelte-1p9xokt.svelte-1p9xokt{background:var(--checkbox-label-background-fill-selected);color:var(--checkbox-label-text-color-selected)}label.svelte-1p9xokt>.svelte-1p9xokt+.svelte-1p9xokt{margin-left:var(--size-2)}input.svelte-1p9xokt.svelte-1p9xokt.svelte-1p9xokt{--ring-color:transparent;position:relative;box-shadow:var(--checkbox-shadow);border:var(--checkbox-border-width) solid var(--checkbox-border-color);border-radius:var(--radius-full);background-color:var(--checkbox-background-color);line-height:var(--line-sm)}input.svelte-1p9xokt.svelte-1p9xokt.svelte-1p9xokt:checked,input.svelte-1p9xokt.svelte-1p9xokt.svelte-1p9xokt:checked:hover,input.svelte-1p9xokt.svelte-1p9xokt.svelte-1p9xokt:checked:focus{border-color:var(--checkbox-border-color-selected);background-image:var(--radio-circle);background-color:var(--checkbox-background-color-selected)}input.svelte-1p9xokt.svelte-1p9xokt.svelte-1p9xokt:hover{border-color:var(--checkbox-border-color-hover);background-color:var(--checkbox-background-color-hover)}input.svelte-1p9xokt.svelte-1p9xokt.svelte-1p9xokt:focus{border-color:var(--checkbox-border-color-focus);background-color:var(--checkbox-background-color-focus)}input[disabled].svelte-1p9xokt.svelte-1p9xokt.svelte-1p9xokt,.disabled.svelte-1p9xokt.svelte-1p9xokt.svelte-1p9xokt{cursor:not-allowed}label.svelte-1kcgrqr.svelte-1kcgrqr{display:block;width:100%}input.svelte-1kcgrqr.svelte-1kcgrqr,textarea.svelte-1kcgrqr.svelte-1kcgrqr{display:block;position:relative;outline:none!important;box-shadow:var(--input-shadow);background:var(--input-background-fill);padding:var(--input-padding);width:100%;color:var(--body-text-color);font-weight:var(--input-text-weight);font-size:var(--input-text-size);line-height:var(--line-sm);border:none}label.svelte-1kcgrqr.svelte-1kcgrqr:not(.container),label.svelte-1kcgrqr:not(.container)>input.svelte-1kcgrqr,label.svelte-1kcgrqr:not(.container)>textarea.svelte-1kcgrqr{height:100%}.container.svelte-1kcgrqr>input.svelte-1kcgrqr,.container.svelte-1kcgrqr>textarea.svelte-1kcgrqr{border:var(--input-border-width) solid var(--input-border-color);border-radius:var(--input-radius)}input.svelte-1kcgrqr.svelte-1kcgrqr:disabled,textarea.svelte-1kcgrqr.svelte-1kcgrqr:disabled{-webkit-text-fill-color:var(--body-text-color);-webkit-opacity:1;opacity:1}input.svelte-1kcgrqr.svelte-1kcgrqr:focus,textarea.svelte-1kcgrqr.svelte-1kcgrqr:focus{box-shadow:var(--input-shadow-focus);border-color:var(--input-border-color-focus)}input.svelte-1kcgrqr.svelte-1kcgrqr::placeholder,textarea.svelte-1kcgrqr.svelte-1kcgrqr::placeholder{color:var(--input-placeholder-color)}button.svelte-1kcgrqr.svelte-1kcgrqr{display:flex;position:absolute;top:var(--block-label-margin);right:var(--block-label-margin);align-items:center;box-shadow:var(--shadow-drop);border:1px solid var(--color-border-primary);border-top:none;border-right:none;border-radius:var(--block-label-right-radius);background:var(--block-label-background-fill);padding:5px;width:22px;height:22px;overflow:hidden;color:var(--block-label-color);font:var(--font-sans);font-size:var(--button-small-text-size)}.wrap.svelte-1cl284s{display:flex;flex-direction:column;width:100%}.head.svelte-1cl284s{display:flex;justify-content:space-between}input[type=number].svelte-1cl284s{display:block;position:relative;outline:none!important;box-shadow:var(--input-shadow);border:var(--input-border-width) solid var(--input-border-color);border-radius:var(--input-radius);background:var(--input-background-fill);padding:var(--size-2) var(--size-2);height:var(--size-6);color:var(--body-text-color);font-size:var(--input-text-size);line-height:var(--line-sm);text-align:center}input.svelte-1cl284s:disabled{-webkit-text-fill-color:var(--body-text-color);-webkit-opacity:1;opacity:1}input[type=number].svelte-1cl284s:focus{box-shadow:var(--input-shadow-focus);border-color:var(--input-border-color-focus)}input.svelte-1cl284s::placeholder{color:var(--input-placeholder-color)}input[type=range].svelte-1cl284s{width:100%;accent-color:var(--slider-color)}input[disabled].svelte-1cl284s{cursor:not-allowed}input.svelte-56zyyb{display:block;position:relative;background:var(--background-fill-primary);line-height:var(--line-sm)}
 
 
spaces/DQChoi/gpt-demo/venv/lib/python3.11/site-packages/huggingface_hub/utils/_datetime.py DELETED
@@ -1,66 +0,0 @@
1
- # coding=utf-8
2
- # Copyright 2022-present, the HuggingFace Inc. team.
3
- #
4
- # Licensed under the Apache License, Version 2.0 (the "License");
5
- # you may not use this file except in compliance with the License.
6
- # You may obtain a copy of the License at
7
- #
8
- # http://www.apache.org/licenses/LICENSE-2.0
9
- #
10
- # Unless required by applicable law or agreed to in writing, software
11
- # distributed under the License is distributed on an "AS IS" BASIS,
12
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- # See the License for the specific language governing permissions and
14
- # limitations under the License.
15
- """Contains utilities to handle datetimes in Huggingface Hub."""
16
- from datetime import datetime, timedelta, timezone
17
-
18
-
19
- # Local machine offset compared to UTC.
20
- # Taken from https://stackoverflow.com/a/3168394.
21
- # `utcoffset()` returns `None` if no offset -> empty timedelta.
22
- UTC_OFFSET = datetime.now(timezone.utc).astimezone().utcoffset() or timedelta()
23
-
24
-
25
- def parse_datetime(date_string: str) -> datetime:
26
- """
27
- Parses a date_string returned from the server to a datetime object.
28
-
29
- This parser is a weak-parser is the sense that it handles only a single format of
30
- date_string. It is expected that the server format will never change. The
31
- implementation depends only on the standard lib to avoid an external dependency
32
- (python-dateutil). See full discussion about this decision on PR:
33
- https://github.com/huggingface/huggingface_hub/pull/999.
34
-
35
- Example:
36
- ```py
37
- > parse_datetime('2022-08-19T07:19:38.123Z')
38
- datetime.datetime(2022, 8, 19, 7, 19, 38, 123000, tzinfo=timezone.utc)
39
- ```
40
-
41
- Args:
42
- date_string (`str`):
43
- A string representing a datetime returned by the Hub server.
44
- String is expected to follow '%Y-%m-%dT%H:%M:%S.%fZ' pattern.
45
-
46
- Returns:
47
- A python datetime object.
48
-
49
- Raises:
50
- :class:`ValueError`:
51
- If `date_string` cannot be parsed.
52
- """
53
- try:
54
- # Datetime ending with a Z means "UTC". Here we parse the date as local machine
55
- # timezone and then move it to the appropriate UTC timezone.
56
- # See https://en.wikipedia.org/wiki/ISO_8601#Coordinated_Universal_Time_(UTC)
57
- # Taken from https://stackoverflow.com/a/3168394.
58
-
59
- dt = datetime.strptime(date_string, "%Y-%m-%dT%H:%M:%S.%fZ")
60
- dt += UTC_OFFSET # By default, datetime is not timezoned -> move to UTC time
61
- return dt.astimezone(timezone.utc) # Set explicit timezone
62
- except ValueError as e:
63
- raise ValueError(
64
- f"Cannot parse '{date_string}' as a datetime. Date string is expected to"
65
- " follow '%Y-%m-%dT%H:%M:%S.%fZ' pattern."
66
- ) from e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/Datasculptor/3D-Room-Layout-Estimation_LGT-Net/utils/conversion.py DELETED
@@ -1,346 +0,0 @@
1
- """
2
- @date: 2021/06/19
3
- @description:
4
- Specification of 4 coordinate systems:
5
- Pixel coordinates (used in panoramic images), the range is related to the image size,
6
- generally converted to UV coordinates first, the first is horizontal coordinates,
7
- increasing to the right, the second is column coordinates, increasing down
8
-
9
- Uv coordinates (used in panoramic images), the range is [0~1], the upper left corner is the origin,
10
- u is the abscissa and increases to the right, V is the column coordinate and increases to the right
11
-
12
- Longitude and latitude coordinates (spherical), the range of longitude lon is [-pi~ PI],
13
- and the range of dimension is [-pi/2~ PI /2]. The center of the panorama is the origin,
14
- and the longitude increases to the right and the dimension increases to the down
15
-
16
- Xyz coordinate (used in 3-dimensional space, of course,
17
- it can also represent longitude and latitude coordinates on the sphere).
18
- If on the sphere, the coordinate mode length is 1, when y is projected to the height of the camera,
19
- the real position information of space points will be obtained
20
-
21
- Correspondence between longitude and latitude coordinates and xyz coordinates:
22
- | -pi/2
23
- |
24
- lef _ _ _ _ _ |_ _ _ _ _
25
- -pi / | \
26
- pi | - - - - - -\ - z 0 mid
27
- right \_ _ _ _ _ /_|_ _ _ _ _ _/
28
- / |
29
- / |
30
- x/ | y pi/2
31
- """
32
-
33
- import numpy as np
34
- import torch
35
- import functools
36
-
37
-
38
- @functools.lru_cache()
39
- def get_u(w, is_np, b=None):
40
- u = pixel2uv(np.array(range(w)) if is_np else torch.arange(0, w), w=w, axis=0)
41
- if b is not None:
42
- u = u[np.newaxis].repeat(b) if is_np else u.repeat(b, 1)
43
- return u
44
-
45
-
46
- @functools.lru_cache()
47
- def get_lon(w, is_np, b=None):
48
- lon = pixel2lonlat(np.array(range(w)) if is_np else torch.arange(0, w), w=w, axis=0)
49
- if b is not None:
50
- lon = lon[np.newaxis].repeat(b, axis=0) if is_np else lon.repeat(b, 1)
51
- return lon
52
-
53
-
54
- def pixel2uv(pixel, w=1024, h=512, axis=None):
55
- pixel = pixel.astype(np.float) if isinstance(pixel, np.ndarray) else pixel.float()
56
- # +0.5 will make left/right and up/down coordinates symmetric
57
- if axis is None:
58
- u = (pixel[..., 0:1] + 0.5) / w
59
- v = (pixel[..., 1:] + 0.5) / h
60
- elif axis == 0:
61
- u = (pixel + 0.5) / (w * 1.0)
62
- return u
63
- elif axis == 1:
64
- v = (pixel + 0.5) / (h * 1.0)
65
- return v
66
- else:
67
- assert False, "axis error"
68
-
69
- lst = [u, v]
70
- uv = np.concatenate(lst, axis=-1) if isinstance(pixel, np.ndarray) else torch.cat(lst, dim=-1)
71
- return uv
72
-
73
-
74
- def pixel2lonlat(pixel, w=1024, h=512, axis=None):
75
- uv = pixel2uv(pixel, w, h, axis)
76
- lonlat = uv2lonlat(uv, axis)
77
- return lonlat
78
-
79
-
80
- def pixel2xyz(pixel, w=1024, h=512):
81
- lonlat = pixel2lonlat(pixel, w, h)
82
- xyz = lonlat2xyz(lonlat)
83
- return xyz
84
-
85
-
86
- def uv2lonlat(uv, axis=None):
87
- if axis is None:
88
- lon = (uv[..., 0:1] - 0.5) * 2 * np.pi
89
- lat = (uv[..., 1:] - 0.5) * np.pi
90
- elif axis == 0:
91
- lon = (uv - 0.5) * 2 * np.pi
92
- return lon
93
- elif axis == 1:
94
- lat = (uv - 0.5) * np.pi
95
- return lat
96
- else:
97
- assert False, "axis error"
98
-
99
- lst = [lon, lat]
100
- lonlat = np.concatenate(lst, axis=-1) if isinstance(uv, np.ndarray) else torch.cat(lst, dim=-1)
101
- return lonlat
102
-
103
-
104
- def uv2xyz(uv, plan_y=None, spherical=False):
105
- lonlat = uv2lonlat(uv)
106
- xyz = lonlat2xyz(lonlat)
107
- if spherical:
108
- # Projection onto the sphere
109
- return xyz
110
-
111
- if plan_y is None:
112
- from utils.boundary import boundary_type
113
- plan_y = boundary_type(uv)
114
- # Projection onto the specified plane
115
- xyz = xyz * (plan_y / xyz[..., 1])[..., None]
116
-
117
- return xyz
118
-
119
-
120
- def lonlat2xyz(lonlat, plan_y=None):
121
- lon = lonlat[..., 0:1]
122
- lat = lonlat[..., 1:]
123
- cos = np.cos if isinstance(lonlat, np.ndarray) else torch.cos
124
- sin = np.sin if isinstance(lonlat, np.ndarray) else torch.sin
125
- x = cos(lat) * sin(lon)
126
- y = sin(lat)
127
- z = cos(lat) * cos(lon)
128
- lst = [x, y, z]
129
- xyz = np.concatenate(lst, axis=-1) if isinstance(lonlat, np.ndarray) else torch.cat(lst, dim=-1)
130
-
131
- if plan_y is not None:
132
- xyz = xyz * (plan_y / xyz[..., 1])[..., None]
133
-
134
- return xyz
135
-
136
-
137
- #####################
138
-
139
-
140
- def xyz2lonlat(xyz):
141
- atan2 = np.arctan2 if isinstance(xyz, np.ndarray) else torch.atan2
142
- asin = np.arcsin if isinstance(xyz, np.ndarray) else torch.asin
143
- norm = np.linalg.norm(xyz, axis=-1) if isinstance(xyz, np.ndarray) else torch.norm(xyz, p=2, dim=-1)
144
- xyz_norm = xyz / norm[..., None]
145
- x = xyz_norm[..., 0:1]
146
- y = xyz_norm[..., 1:2]
147
- z = xyz_norm[..., 2:]
148
- lon = atan2(x, z)
149
- lat = asin(y)
150
- lst = [lon, lat]
151
- lonlat = np.concatenate(lst, axis=-1) if isinstance(xyz, np.ndarray) else torch.cat(lst, dim=-1)
152
- return lonlat
153
-
154
-
155
- def xyz2uv(xyz):
156
- lonlat = xyz2lonlat(xyz)
157
- uv = lonlat2uv(lonlat)
158
- return uv
159
-
160
-
161
- def xyz2pixel(xyz, w=1024, h=512):
162
- uv = xyz2uv(xyz)
163
- pixel = uv2pixel(uv, w, h)
164
- return pixel
165
-
166
-
167
- def lonlat2uv(lonlat, axis=None):
168
- if axis is None:
169
- u = lonlat[..., 0:1] / (2 * np.pi) + 0.5
170
- v = lonlat[..., 1:] / np.pi + 0.5
171
- elif axis == 0:
172
- u = lonlat / (2 * np.pi) + 0.5
173
- return u
174
- elif axis == 1:
175
- v = lonlat / np.pi + 0.5
176
- return v
177
- else:
178
- assert False, "axis error"
179
-
180
- lst = [u, v]
181
- uv = np.concatenate(lst, axis=-1) if isinstance(lonlat, np.ndarray) else torch.cat(lst, dim=-1)
182
- return uv
183
-
184
-
185
- def lonlat2pixel(lonlat, w=1024, h=512, axis=None, need_round=True):
186
- uv = lonlat2uv(lonlat, axis)
187
- pixel = uv2pixel(uv, w, h, axis, need_round)
188
- return pixel
189
-
190
-
191
- def uv2pixel(uv, w=1024, h=512, axis=None, need_round=True):
192
- """
193
- :param uv: [[u1, v1], [u2, v2] ...]
194
- :param w: width of panorama image
195
- :param h: height of panorama image
196
- :param axis: sometimes the input data is only u(axis =0) or only v(axis=1)
197
- :param need_round:
198
- :return:
199
- """
200
- if axis is None:
201
- pu = uv[..., 0:1] * w - 0.5
202
- pv = uv[..., 1:] * h - 0.5
203
- elif axis == 0:
204
- pu = uv * w - 0.5
205
- if need_round:
206
- pu = pu.round().astype(np.int) if isinstance(uv, np.ndarray) else pu.round().int()
207
- return pu
208
- elif axis == 1:
209
- pv = uv * h - 0.5
210
- if need_round:
211
- pv = pv.round().astype(np.int) if isinstance(uv, np.ndarray) else pv.round().int()
212
- return pv
213
- else:
214
- assert False, "axis error"
215
-
216
- lst = [pu, pv]
217
- if need_round:
218
- pixel = np.concatenate(lst, axis=-1).round().astype(np.int) if isinstance(uv, np.ndarray) else torch.cat(lst,
219
- dim=-1).round().int()
220
- else:
221
- pixel = np.concatenate(lst, axis=-1) if isinstance(uv, np.ndarray) else torch.cat(lst, dim=-1)
222
- pixel[..., 0] = pixel[..., 0] % w
223
- pixel[..., 1] = pixel[..., 1] % h
224
-
225
- return pixel
226
-
227
-
228
- #####################
229
-
230
-
231
- def xyz2depth(xyz, plan_y=1):
232
- """
233
- :param xyz:
234
- :param plan_y:
235
- :return:
236
- """
237
- xyz = xyz * (plan_y / xyz[..., 1])[..., None]
238
- xz = xyz[..., ::2]
239
- depth = np.linalg.norm(xz, axis=-1) if isinstance(xz, np.ndarray) else torch.norm(xz, dim=-1)
240
- return depth
241
-
242
-
243
- def uv2depth(uv, plan_y=None):
244
- if plan_y is None:
245
- from utils.boundary import boundary_type
246
- plan_y = boundary_type(uv)
247
-
248
- xyz = uv2xyz(uv, plan_y)
249
- depth = xyz2depth(xyz, plan_y)
250
- return depth
251
-
252
-
253
- def lonlat2depth(lonlat, plan_y=None):
254
- if plan_y is None:
255
- from utils.boundary import boundary_type
256
- plan_y = boundary_type(lonlat2uv(lonlat))
257
-
258
- xyz = lonlat2xyz(lonlat, plan_y)
259
- depth = xyz2depth(xyz, plan_y)
260
- return depth
261
-
262
-
263
- def depth2xyz(depth, plan_y=1):
264
- """
265
- :param depth: [patch_num] or [b, patch_num]
266
- :param plan_y:
267
- :return:
268
- """
269
- is_np = isinstance(depth, np.ndarray)
270
- w = depth.shape[-1]
271
-
272
- lon = get_lon(w, is_np, b=depth.shape[0] if len(depth.shape) == 2 else None)
273
- if not is_np:
274
- lon = lon.to(depth.device)
275
-
276
- cos = np.cos if is_np else torch.cos
277
- sin = np.sin if is_np else torch.sin
278
- # polar covert to cartesian
279
- if len(depth.shape) == 2:
280
- b = depth.shape[0]
281
- xyz = np.zeros((b, w, 3)) if is_np else torch.zeros((b, w, 3))
282
- else:
283
- xyz = np.zeros((w, 3)) if is_np else torch.zeros((w, 3))
284
-
285
- if not is_np:
286
- xyz = xyz.to(depth.device)
287
-
288
- xyz[..., 0] = depth * sin(lon)
289
- xyz[..., 1] = plan_y
290
- xyz[..., 2] = depth * cos(lon)
291
- return xyz
292
-
293
-
294
- def depth2uv(depth, plan_y=1):
295
- xyz = depth2xyz(depth, plan_y)
296
- uv = xyz2uv(xyz)
297
- return uv
298
-
299
-
300
- def depth2pixel(depth, w=1024, h=512, need_round=True, plan_y=1):
301
- uv = depth2uv(depth, plan_y)
302
- pixel = uv2pixel(uv, w, h, need_round=need_round)
303
- return pixel
304
-
305
-
306
- if __name__ == '__main__':
307
- a = np.array([[0.5, 1, 0.5]])
308
- a = xyz2pixel(a)
309
- print(a)
310
-
311
-
312
- if __name__ == '__main__1':
313
- np.set_printoptions(suppress=True)
314
-
315
- a = np.array([[0, 0], [1023, 511]])
316
- a = pixel2xyz(a)
317
- a = xyz2pixel(a)
318
- print(a)
319
-
320
- ###########
321
- a = torch.tensor([[0, 0], [1023, 511]])
322
- a = pixel2xyz(a)
323
- a = xyz2pixel(a)
324
- print(a)
325
-
326
- ###########
327
- u = np.array([0, 256, 512, 1023])
328
- lon = pixel2lonlat(u, axis=0)
329
- u = lonlat2pixel(lon, axis=0)
330
- print(u)
331
-
332
- u = torch.tensor([0, 256, 512, 1023])
333
- lon = pixel2lonlat(u, axis=0)
334
- u = lonlat2pixel(lon, axis=0)
335
- print(u)
336
-
337
- ###########
338
- v = np.array([0, 256, 511])
339
- lat = pixel2lonlat(v, axis=1)
340
- v = lonlat2pixel(lat, axis=1)
341
- print(v)
342
-
343
- v = torch.tensor([0, 256, 511])
344
- lat = pixel2lonlat(v, axis=1)
345
- v = lonlat2pixel(lat, axis=1)
346
- print(v)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/Detomo/Chatgpt_with_awesome_prompt/app.py DELETED
@@ -1,142 +0,0 @@
1
- import gradio as gr
2
- import os
3
- import openai
4
- import json
5
- import tiktoken
6
- import pandas as pd
7
-
8
- openai.api_key = os.environ["OPENAI_API_KEY"]
9
- prompt_templates = {"Default ChatGPT": ""}
10
-
11
- def num_tokens_from_messages(messages, model="gpt-3.5-turbo"):
12
- """Returns the number of tokens used by a list of messages."""
13
- try:
14
- encoding = tiktoken.encoding_for_model(model)
15
- except KeyError:
16
- encoding = tiktoken.get_encoding("cl100k_base")
17
- if model == "gpt-3.5-turbo":
18
- num_tokens = 0
19
- for message in messages:
20
- num_tokens += 4 # every message follows <im_start>{role/name}\n{content}<im_end>\n
21
- for key, value in message.items():
22
- num_tokens += len(encoding.encode(value))
23
- if key == "name": # if there's a name, the role is omitted
24
- num_tokens += -1 # role is always required and always 1 token
25
- num_tokens += 2 # every reply is primed with <im_start>assistant
26
- return num_tokens
27
- else:
28
- raise NotImplementedError(f"""num_tokens_from_messages() is not presently implemented for model {model}.
29
- See https://github.com/openai/openai-python/blob/main/chatml.md for information on how messages are converted to tokens.""")
30
-
31
-
32
- def get_empty_state():
33
- return {"total_tokens": 0, "messages": [], "threshold": 0}
34
-
35
- def download_prompt_templates():
36
- df = pd.read_csv('prompts.csv', encoding='unicode_escape')
37
- prompt_templates.update(dict(zip(df['act'], df['prompt'])))
38
- choices = list(prompt_templates.keys())
39
- return gr.update(value=choices[0], choices=choices)
40
-
41
- def on_token_change(user_token):
42
- openai.api_key = user_token or os.environ.get("OPENAI_API_KEY")
43
-
44
- def on_prompt_template_change(prompt_template):
45
- if not isinstance(prompt_template, str): return
46
- return prompt_templates[prompt_template]
47
-
48
- def submit_message(prompt, prompt_template, temperature, max_tokens, state):
49
-
50
- history = state['messages']
51
-
52
- if not prompt:
53
- return gr.update(value='', visible=state['total_tokens'] < 1_000), [(history[i]['content'], history[i+1]['content']) for i in range(0, len(history)-1, 2)], f"Total tokens used: {state['total_tokens']} / 4090", state
54
-
55
- prompt_template = prompt_templates[prompt_template]
56
- print(prompt_template)
57
- system_prompt = []
58
- if prompt_template:
59
- system_prompt = [{ "role": "system", "content": prompt_template}]
60
-
61
- prompt_msg = {"role": "user", "content": prompt }
62
-
63
- # check length token message
64
- messages = system_prompt + history + [prompt_msg]
65
- history_id = 2
66
- while num_tokens_from_messages(messages) >= 4090:
67
- messages = system_prompt + history[history_id:] + [prompt_msg]
68
- history_id +=2
69
- state['threshold'] +=1
70
- if history_id > len(history):
71
- break
72
- try:
73
- completion = openai.ChatCompletion.create(model="gpt-3.5-turbo", messages=messages, temperature=temperature, max_tokens=max_tokens)
74
- history.append(prompt_msg)
75
- history.append(completion.choices[0].message.to_dict())
76
-
77
- state['total_tokens'] += completion['usage']['total_tokens']
78
-
79
- except Exception as e:
80
- history.append(prompt_msg)
81
- history.append({
82
- "role": "system",
83
- "content": f"Error: {e}"
84
- })
85
-
86
- total_tokens_used_msg = f"Total tokens used: {state['total_tokens']} / 4090. "
87
- chat_messages = [(history[i]['content'], history[i+1]['content']) for i in range(0, len(history)-1, 2)]
88
-
89
- if state['threshold'] >= 3:
90
- input_visibility = False
91
- total_tokens_used_msg += "Reach the limit of this conversation. Start the new one"
92
- else:
93
- input_visibility = True
94
-
95
- return gr.update(value='', visible=input_visibility), chat_messages, total_tokens_used_msg, state
96
-
97
- def clear_conversation():
98
- return gr.update(value=None, visible=True), None, "", get_empty_state()
99
-
100
- css = """
101
- #col-container {max-width: 80%; margin-left: auto; margin-right: auto;}
102
- #chatbox {min-height: 400px;}
103
- #header {text-align: center;}
104
- #prompt_template_preview {padding: 1em; border-width: 1px; border-style: solid; border-color: #e0e0e0; border-radius: 4px;}
105
- #total_tokens_str {text-align: right; font-size: 0.8em; color: #666; height: 1em;}
106
- #label {font-size: 0.8em; padding: 0.5em; margin: 0;}
107
- """
108
-
109
- with gr.Blocks(css=css) as demo:
110
-
111
- state = gr.State(get_empty_state())
112
-
113
-
114
- with gr.Column(elem_id="col-container"):
115
- gr.Markdown("""## OpenAI ChatGPT with awesome prompts
116
- Current limit is 4090 tokens per conversation<br>
117
- Input your text with a custom insruction (If need).""",
118
- elem_id="header")
119
-
120
- with gr.Row():
121
- with gr.Column():
122
- chatbot = gr.Chatbot(elem_id="chatbox")
123
- input_message = gr.Textbox(show_label=False, placeholder="Enter text and press enter", visible=True).style(container=False)
124
- total_tokens_str = gr.Markdown(elem_id="total_tokens_str")
125
- btn_clear_conversation = gr.Button("🔃 Start New Conversation")
126
- with gr.Column():
127
- prompt_template = gr.Dropdown(label="Set a custom insruction for the chatbot:", choices=list(prompt_templates.keys()))
128
- prompt_template_preview = gr.Markdown(elem_id="prompt_template_preview")
129
-
130
- with gr.Accordion("Advanced parameters", open=False):
131
- temperature = gr.Slider(minimum=0, maximum=2.0, value=0.7, step=0.1, interactive=True, label="Temperature (higher = more creative/chaotic)")
132
- max_tokens = gr.Slider(minimum=100, maximum=4096, value=1000, step=1, interactive=True, label="Max tokens per response")
133
-
134
- input_message.submit(submit_message, [input_message, prompt_template, temperature, max_tokens, state], [input_message, chatbot, total_tokens_str, state])
135
- btn_clear_conversation.click(clear_conversation, [], [input_message, chatbot, total_tokens_str, state])
136
- prompt_template.change(on_prompt_template_change, inputs=[prompt_template], outputs=[prompt_template_preview])
137
-
138
- demo.load(download_prompt_templates, inputs=None, outputs=[prompt_template])
139
-
140
-
141
- # demo.launch(debug=True, height='800px', auth=("admin", "dtm1234"))
142
- demo.launch(debug=True, height='800px')