Commit
·
cd66926
1
Parent(s):
58633e5
Update parquet files (step 117 of 249)
Browse filesThis view is limited to 50 files because it contains too many changes.
See raw diff
- spaces/1acneusushi/gradio-2dmoleculeeditor/data/2020 Design Torrent 47 How to Install Activate and Use the Most Advanced Design Tool.md +0 -119
- spaces/1acneusushi/gradio-2dmoleculeeditor/data/Best Site To Download Cracked Pc Games For Free LINK.md +0 -10
- spaces/1acneusushi/gradio-2dmoleculeeditor/data/Gta Eflc No Cd Crack Razor The Benefits of Playing GTA EFLC Without a CD.md +0 -130
- spaces/1gistliPinn/ChatGPT4/Examples/Aalavandhan Hd 1080p Movie Torrent Download Dont Miss the Chance to See Kamal Haasan in Dual Roles.md +0 -5
- spaces/1gistliPinn/ChatGPT4/Examples/Beyonce Dangerously In Love Album Zip.md +0 -9
- spaces/1gistliPinn/ChatGPT4/Examples/Download Shab Hd 720p Full Movie In Hindi.md +0 -61
- spaces/1pelhydcardo/ChatGPT-prompt-generator/Heroes-Season-2-Hindi-Dubbed.md +0 -70
- spaces/1pelhydcardo/ChatGPT-prompt-generator/assets/Aliens Drive Me Crazy MOD APK 3.1.9 An Epic Shooter and Driving Adventure.md +0 -88
- spaces/1pelhydcardo/ChatGPT-prompt-generator/assets/Download Blade Forge 3D MOD APK and Become a Master Blacksmith.md +0 -101
- spaces/1phancelerku/anime-remove-background/Download Mortal Kombat 11 for Android The Ultimate Fighting Game.md +0 -142
- spaces/1phancelerku/anime-remove-background/European Truck Simulator APK Mod Customize Your Truck and Explore Amazing Cities.md +0 -114
- spaces/AI-Hobbyist/Hoyo-RVC/infer_pack/attentions.py +0 -417
- spaces/AI-Hobbyist/Hoyo-RVC/infer_pack/modules/F0Predictor/F0Predictor.py +0 -16
- spaces/AI-Naga/Vehicle_Damage_Detection/README.md +0 -12
- spaces/AIFILMS/generate_human_motion/VQ-Trans/utils/motion_process.py +0 -59
- spaces/AIGC-Audio/AudioGPT/NeuralSeq/egs/datasets/audio/emotion/pre_align.py +0 -25
- spaces/AIGC-Audio/AudioGPT/text_to_audio/Make_An_Audio/ldm/models/diffusion/dpm_solver/sampler.py +0 -87
- spaces/AISuperheroes/01ST-CSV-Dataset-Analyzer/download.py +0 -139
- spaces/ATang0729/Forecast4Muses/Model/Model6/Model6_1_ClothesKeyPoint/work_dirs_1-x/td_hm_res50_4xb64-120e_deepfashion2_long_sleeved_shirt_256x192/__init__.py +0 -0
- spaces/AbandonedMuse/UnlimitedMusicGen/audiocraft/models/lm.py +0 -527
- spaces/AgentVerse/agentVerse/ui/src/phaser3-rex-plugins/templates/ui/chart/GetChartDataset.js +0 -21
- spaces/AgentVerse/agentVerse/ui/src/phaser3-rex-plugins/templates/ui/gridsizer/ResetGrid.js +0 -77
- spaces/Aloento/9Nine-PITS/commons.py +0 -192
- spaces/Ame42/rwms/power_BI_module.py +0 -19
- spaces/Andy1621/uniformer_image_detection/configs/ghm/retinanet_ghm_x101_32x4d_fpn_1x_coco.py +0 -13
- spaces/Andy1621/uniformer_image_detection/configs/resnest/mask_rcnn_s50_fpn_syncbn-backbone+head_mstrain_1x_coco.py +0 -64
- spaces/Andy1621/uniformer_image_segmentation/configs/danet/danet_r101-d8_512x512_160k_ade20k.py +0 -2
- spaces/Anew1007/extras/Dockerfile +0 -21
- spaces/AnishKumbhar/ChatBot/text-generation-webui-main/js/save_files.js +0 -40
- spaces/Apex-X/Tm/app.py +0 -69
- spaces/Arnx/MusicGenXvAKN/tests/modules/test_lstm.py +0 -32
- spaces/Ataturk-Chatbot/HuggingFaceChat/venv/lib/python3.11/site-packages/pip/_vendor/rich/_palettes.py +0 -309
- spaces/Ataturk-Chatbot/HuggingFaceChat/venv/lib/python3.11/site-packages/pip/_vendor/rich/color.py +0 -622
- spaces/Ataturk-Chatbot/HuggingFaceChat/venv/lib/python3.11/site-packages/setuptools/_distutils/command/check.py +0 -151
- spaces/Awiny/Image2Paragraph/models/grit_src/third_party/CenterNet2/detectron2/layers/wrappers.py +0 -132
- spaces/Benson/text-generation/Examples/Bus Simulator Ultimate Mod Apk Revdl.md +0 -94
- spaces/Benson/text-generation/Examples/Descargar Fnf Msica Batalla Original Mod.md +0 -70
- spaces/Big-Web/MMSD/env/Lib/site-packages/botocore/docs/example.py +0 -236
- spaces/Big-Web/MMSD/env/Lib/site-packages/botocore/retries/quota.py +0 -56
- spaces/Big-Web/MMSD/env/Lib/site-packages/pip/_vendor/pygments/token.py +0 -213
- spaces/Big-Web/MMSD/env/Lib/site-packages/setuptools/sandbox.py +0 -530
- spaces/BridgeEight/internlm-20B-chat-w4-turbomind/README.md +0 -13
- spaces/CVPR/Dual-Key_Backdoor_Attacks/datagen/detectron2/MODEL_ZOO.md +0 -882
- spaces/CVPR/Dual-Key_Backdoor_Attacks/datagen/grid-feats-vqa/grid_feats/__init__.py +0 -8
- spaces/CVPR/LIVE/pybind11/tests/pybind11_cross_module_tests.cpp +0 -123
- spaces/CVPR/LIVE/pybind11/tests/test_custom_type_casters.py +0 -90
- spaces/CVPR/WALT/mmdet/models/detectors/fsaf.py +0 -17
- spaces/CVPR/regionclip-demo/detectron2/checkpoint/c2_model_loading.py +0 -407
- spaces/Caoyunkang/Segment-Any-Anomaly/SAM/segment_anything/modeling/image_encoder.py +0 -395
- spaces/CikeyQI/meme-api/meme_generator/meme.py +0 -185
spaces/1acneusushi/gradio-2dmoleculeeditor/data/2020 Design Torrent 47 How to Install Activate and Use the Most Advanced Design Tool.md
DELETED
@@ -1,119 +0,0 @@
|
|
1 |
-
|
2 |
-
<h1>2020 Design Torrent 47: What You Need to Know</h1>
|
3 |
-
<p>If you are looking for a software that can help you create stunning kitchen and bathroom designs, you might have heard of <strong>2020 Design</strong>. This software is one of the most popular and powerful tools for interior designers, contractors, and homeowners. But what if you don't want to pay for the full version of the software? Is there a way to get it for free? That's where <strong>2020 Design Torrent 47</strong> comes in. In this article, we will tell you everything you need to know about this torrent, including what it is, how it works, why you might want to use it, and how to use it safely and effectively.</p>
|
4 |
-
<h2>2020 Design Torrent 47</h2><br /><p><b><b>DOWNLOAD</b> <a href="https://byltly.com/2uKyz4">https://byltly.com/2uKyz4</a></b></p><br /><br />
|
5 |
-
<h2>What is 2020 Design?</h2>
|
6 |
-
<h3>A brief introduction to the software</h3>
|
7 |
-
<p>2020 Design is a software that allows you to create realistic and interactive 3D renderings of kitchen and bathroom spaces. You can choose from thousands of products, materials, colors, and styles from leading manufacturers and brands. You can also customize every detail of your design, from cabinets and countertops to faucets and lighting. You can even add accessories, appliances, and furniture to complete your vision.</p>
|
8 |
-
<p>With 2020 Design, you can also generate accurate floor plans, elevations, and perspectives of your design. You can also create stunning presentations and reports for your clients or yourself. You can export your design in various formats, such as PDF, JPG, DWG, or DXF. You can also share your design online or print it out.</p>
|
9 |
-
<h3>The features and benefits of 2020 Design</h3>
|
10 |
-
<p>Some of the features and benefits of using 2020 Design are:</p>
|
11 |
-
<ul>
|
12 |
-
<li>It has a user-friendly interface that is easy to learn and use.</li>
|
13 |
-
<li>It has a large catalog of products and materials from leading brands and manufacturers.</li>
|
14 |
-
<li>It has a powerful rendering engine that produces realistic and high-quality images.</li>
|
15 |
-
<li>It has a dynamic pricing feature that calculates the cost of your design based on the products and materials you choose.</li>
|
16 |
-
<li>It has a cloud-based service that allows you to access your design from any device and collaborate with others.</li>
|
17 |
-
<li>It has a built-in training and support system that helps you learn new skills and solve problems.</li>
|
18 |
-
</ul>
|
19 |
-
<h2>What is a torrent?</h2>
|
20 |
-
<h3>A brief explanation of how torrents work</h3>
|
21 |
-
<p>A torrent is a file that contains information about other files that are shared by users on a peer-to-peer (P2P) network. A P2P network is a system where users can share files directly with each other without using a central server. To download a file from a P2P network, you need a torrent client, which is a software that connects you to other users who have the file you want. The torrent client then downloads small pieces of the file from different users until you have the complete file.</p>
|
22 |
-
<h3>The advantages and disadvantages of using torrents</h3>
|
23 |
-
<p>Some of the advantages of using torrents are:</p>
|
24 |
-
<ul>
|
25 |
-
<li>You can download large files faster than using other methods.</li>
|
26 |
-
<li>You can download files that are not available on other platforms or websites.</li>
|
27 |
-
<li>You can download files for free without paying for them.</li>
|
28 |
-
</ul>
|
29 |
-
<p>Some of the disadvantages of using torrents are:</p>
|
30 |
-
<p>2020 Design Software Crack Torrent 47<br />
|
31 |
-
Download 2020 Design Full Version Torrent 47<br />
|
32 |
-
2020 Design Kitchen and Bathroom Torrent 47<br />
|
33 |
-
How to Install 2020 Design Torrent 47<br />
|
34 |
-
2020 Design License Key Generator Torrent 47<br />
|
35 |
-
2020 Design v12 Free Download Torrent 47<br />
|
36 |
-
2020 Design Catalogs and Cloud Torrent 47<br />
|
37 |
-
2020 Design Training Videos Torrent 47<br />
|
38 |
-
2020 Design System Requirements Torrent 47<br />
|
39 |
-
2020 Design Support and Updates Torrent 47<br />
|
40 |
-
Best Alternatives to 2020 Design Torrent 47<br />
|
41 |
-
2020 Design Reviews and Ratings Torrent 47<br />
|
42 |
-
How to Use 2020 Design Torrent 47<br />
|
43 |
-
2020 Design Tips and Tricks Torrent 47<br />
|
44 |
-
2020 Design Features and Benefits Torrent 47<br />
|
45 |
-
How to Uninstall 2020 Design Torrent 47<br />
|
46 |
-
How to Activate 2020 Design Torrent 47<br />
|
47 |
-
How to Update 2020 Design Torrent 47<br />
|
48 |
-
How to Import and Export in 2020 Design Torrent 47<br />
|
49 |
-
How to Customize and Personalize in 2020 Design Torrent 47<br />
|
50 |
-
How to Create and Edit in 2020 Design Torrent 47<br />
|
51 |
-
How to Render and Print in 2020 Design Torrent 47<br />
|
52 |
-
How to Share and Collaborate in 2020 Design Torrent 47<br />
|
53 |
-
How to Troubleshoot and Fix in 2020 Design Torrent 47<br />
|
54 |
-
How to Optimize and Enhance in 2020 Design Torrent 47<br />
|
55 |
-
Pros and Cons of Using 2020 Design Torrent 47<br />
|
56 |
-
Comparison of Different Versions of 2020 Design Torrent 47<br />
|
57 |
-
Frequently Asked Questions About 2020 Design Torrent 47<br />
|
58 |
-
User Testimonials and Feedback About 2020 Design Torrent 47<br />
|
59 |
-
Case Studies and Success Stories About Using 2020 Design Torrent </p>
|
60 |
-
<ul>
|
61 |
-
<li>You might download files that are infected with viruses or malware.</li>
|
62 |
-
<li>You might download files that are illegal or infringe on copyrights.</li>
|
63 |
-
<li>You might expose your personal information or IP address to other users or authorities.</li>
|
64 |
-
</ul>
|
65 |
-
<h2>Why use 2020 Design Torrent 47?</h2>
|
66 |
-
<h3>The reasons to download 2020 Design via torrent</h3>
|
67 |
-
<p>If you are interested in using 2020 Design but don't want to pay for it, you might consider downloading it via torrent. Some of the reasons why you might want to do this are:</p>
|
68 |
-
<ul>
|
69 |
-
<li>You want to try out the software before buying it.</li>
|
70 |
-
<li>You want to use the software for personal or educational purposes only.</li>
|
71 |
-
<li>You want to access the latest version or features of the software that are not available in the official website.</li>
|
72 |
-
</ul>
|
73 |
-
<h3>The risks and challenges of using 2020 Design Torrent 47</h3>
|
74 |
-
<p>However, downloading 2020 Design via torrent also comes with some risks and challenges. Some of them are:</p>
|
75 |
-
<ul>
|
76 |
-
<li>You might download a fake or corrupted file that does not work or damages your computer.</li>
|
77 |
-
<li>You might download a file that contains viruses or malware that infect your computer or steal your data.</li>
|
78 |
-
<li>You might download a file that violates the terms and conditions of the software or infringes on the intellectual property rights of the developers or manufacturers.</li>
|
79 |
-
<li>You might face legal consequences or penalties if you are caught downloading or using pirated software.</li>
|
80 |
-
<li>You might not be able to access updates, support, or features that are available only for licensed users.</li>
|
81 |
-
</ul>
|
82 |
-
<h2>How to use 2020 Design Torrent 47?</h2>
|
83 |
-
<h3>The steps to download and install 2020 Design Torrent 47</h3>
|
84 |
-
<p>If you decide to download and install 2020 Design Torrent 47, here are some steps that you need to follow:</p>
|
85 |
-
<ol>
|
86 |
-
<li>Find a reliable torrent website that offers 2020 Design Torrent 47. You can use search engines or online forums to find such websites. Some examples are SuprBay, Peatix, or Tealfeed. Make sure to check the reviews, ratings, comments, or feedbacks from other users before downloading anything.</li>
|
87 |
-
<li>Download a torrent client that can handle torrent files. Some examples are uTorrent, BitTorrent, or qBittorrent. Install the torrent client on your computer and run it.</li>
|
88 |
-
<li>Download the torrent file for 2020 Design Torrent 47 from the torrent website. Open the torrent file with your torrent client and choose where you want to save the file on your computer. Wait for the download to finish.</li>
|
89 |
-
<li>Extract the downloaded file using a software like WinRAR or WinZip. You should see a folder containing several files related to 2020 Design. Look for an executable file (.exe) that can install the software on your computer. Run the executable file as an administrator and follow the instructions on the screen.</li>
|
90 |
-
<li>Activate the software using a crack, patch, keygen, serial number, or license key that is provided in the folder or on the torrent website. This will allow you to bypass any security checks or verification processes that might prevent you from using the software without paying for it.</li>
|
91 |
-
</ol>
|
92 |
-
<h3>The tips and tricks to optimize 2020 Design Torrent 47</h3>
|
93 |
-
<p>To make sure that you get the best experience out of using 2020 Design Torrent 47, here are some tips and tricks that you can follow:</p>
|
94 |
-
<ul>
|
95 |
-
<li>Scan your computer regularly with an antivirus or anti-malware software to detect and remove any potential threats that might come from downloading or installing pirated software.</li>
|
96 |
-
<p>help you avoid being tracked or blocked by your ISP (internet service provider) or authorities.</li>
|
97 |
-
<li>Backup your files and data regularly in case something goes wrong with the software or your computer.</li>
|
98 |
-
<li>Do not share or distribute the software or the torrent file with others without permission from the developers or manufacturers.</li>
|
99 |
-
<li>Support the developers or manufacturers of 2020 Design by purchasing the software if you like it and use it for commercial purposes.</li>
|
100 |
-
</ul>
|
101 |
-
<h2>Conclusion</h2>
|
102 |
-
<h3>A summary of the main points</h3>
|
103 |
-
<p>In conclusion, 2020 Design Torrent 47 is a file that allows you to download and install 2020 Design, a software that helps you create amazing kitchen and bathroom designs. You might want to use this torrent if you want to try out the software for free or access its latest features. However, you also need to be aware of the risks and challenges of using this torrent, such as viruses, malware, legal issues, or compatibility problems. You also need to follow some steps and tips to download and install 2020 Design Torrent 47 safely and effectively.</p>
|
104 |
-
<h3>A call to action for the readers</h3>
|
105 |
-
<p>If you are interested in using 2020 Design Torrent 47, you can find it on various torrent websites online. However, we recommend that you use it with caution and responsibility. We also encourage you to support the original creators of 2020 Design by buying the software if you find it useful and valuable. 2020 Design is a great tool for interior design enthusiasts and professionals alike. You can learn more about it on its official website.</p>
|
106 |
-
<h2>FAQs</h2>
|
107 |
-
<h3>Q1: Is 2020 Design Torrent 47 legal?</h3>
|
108 |
-
<p>A1: No, it is not. Downloading or using pirated software is illegal in most countries and regions. You might face fines, lawsuits, or even jail time if you are caught doing so. You might also violate the terms and conditions of the software or the intellectual property rights of the developers or manufacturers.</p>
|
109 |
-
<h3>Q2: Is 2020 Design Torrent 47 safe?</h3>
|
110 |
-
<p>A2: Not necessarily. There is no guarantee that the file you download is authentic, complete, or virus-free. You might download a fake or corrupted file that does not work or damages your computer. You might also download a file that contains viruses or malware that infect your computer or steal your data. You might also expose your personal information or IP address to other users or authorities.</p>
|
111 |
-
<h3>Q3: Is 2020 Design Torrent 47 compatible with my system?</h3>
|
112 |
-
<p>A3: It depends. Different versions of 2020 Design might have different system requirements and specifications. You need to check if your computer meets the minimum requirements for running the software before downloading or installing it. You also need to make sure that your computer has enough space and memory to handle the software.</p>
|
113 |
-
<h3>Q4: How can I update 2020 Design Torrent 47?</h3>
|
114 |
-
<p>A4: You might not be able to. Most pirated software does not have access to official updates, patches, or fixes from the developers or manufacturers. You might miss out on important features, improvements, or bug fixes that are available only for licensed users. You might also encounter errors, glitches, or crashes when using the software.</p>
|
115 |
-
<h3>Q5: Where can I find more resources on 2020 Design?</h3>
|
116 |
-
<p>A5: You can find more resources on 2020 Design on its official website. There you can find more information about the software, its features, its pricing, its support, its training, and its community. You can also watch videos, read blogs, download catalogs, request demos, or contact sales representatives.</p>
|
117 |
-
</p> 0a6ba089eb<br />
|
118 |
-
<br />
|
119 |
-
<br />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/1acneusushi/gradio-2dmoleculeeditor/data/Best Site To Download Cracked Pc Games For Free LINK.md
DELETED
@@ -1,10 +0,0 @@
|
|
1 |
-
|
2 |
-
<h1>Best Site to Download Cracked PC Games for Free in 2023</h1>
|
3 |
-
<p>If you are a PC gamer, you might be looking for a way to download cracked PC games for free in 2023. Cracked PC games are games that have been modified to bypass the copy protection or DRM (digital rights management) system and allow you to play them without paying for them. However, downloading cracked PC games is not a good idea for several reasons. First of all, downloading cracked PC games is illegal and unethical, and you could face legal consequences if you get caught. Second, cracked PC games often contain viruses, malware, or spyware that can harm your computer or steal your personal information. Third, cracked PC games usually do not work properly or have limited functionality, and you might miss out on important updates or bug fixes.</p>
|
4 |
-
<h2>best site to download cracked pc games for free</h2><br /><p><b><b>Download File</b> ✫✫✫ <a href="https://byltly.com/2uKyF6">https://byltly.com/2uKyF6</a></b></p><br /><br />
|
5 |
-
<p>So, what is the best site to download cracked PC games for free in 2023? The answer is simple: there is no such thing. The only way to download PC games legally and safely is to buy them from the official website or an authorized dealer. This way, you will get the full version of the game with all the features and benefits, as well as lifetime support and updates. You will also support the developers who worked hard to create this amazing product.</p>
|
6 |
-
<p>However, if you still want to try PC games before buying them, there is a solution: you can download the demo version or the free trial from the official website or other online platforms. The demo version or the free trial allows you to test some of the features and gameplay of the game for a limited time without any limitations. You can also save and load your progress, but you cannot export it. This way, you can see for yourself if the game is worth your money and if it suits your needs and preferences.</p>
|
7 |
-
<p>In conclusion, PC games are a great source of entertainment and fun that can help you relax and enjoy yourself. However, they are not available for free download crack in 2023 or any other year. The only way to download PC games legally and safely is to buy them from the official website or an authorized dealer. Alternatively, you can download the demo version or the free trial and try them for a limited time. We hope this article has helped you understand why downloading cracked PC games is not a good idea and how to download PC games legally and safely.</p>
|
8 |
-
<p></p> ddb901b051<br />
|
9 |
-
<br />
|
10 |
-
<br />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/1acneusushi/gradio-2dmoleculeeditor/data/Gta Eflc No Cd Crack Razor The Benefits of Playing GTA EFLC Without a CD.md
DELETED
@@ -1,130 +0,0 @@
|
|
1 |
-
<br />
|
2 |
-
<h1>Waves License Center Crack: What You Need to Know</h1>
|
3 |
-
<p>If you are a music producer, engineer, or enthusiast, you probably have heard of Waves plugins. Waves is one of the world's leading developers of audio plugins and signal processors for the professional and consumer electronics audio markets. They offer a wide range of products, from compressors, equalizers, reverbs, delays, to virtual instruments, mastering tools, and more.</p>
|
4 |
-
<h2>Waves License Center Crack</h2><br /><p><b><b>Download</b> ->>> <a href="https://byltly.com/2uKxh2">https://byltly.com/2uKxh2</a></b></p><br /><br />
|
5 |
-
<p>But how do you manage your Waves plugins and licenses? That's where Waves License Center comes in. Waves License Center is an application that allows you to activate, deactivate, recover, and transfer your Waves licenses. It also lets you update your plugins and access your Waves account.</p>
|
6 |
-
<p>However, some people might be tempted to use a cracked version of Waves License Center instead of paying for a legitimate one. This might seem like a good idea at first, but it can actually cause more harm than good. In this article, we will explain how Waves License Center works, what are the risks of using a crack, what are the benefits of using a legitimate one, and how to get and activate your Waves licenses.</p>
|
7 |
-
<h2>How Waves License Center Works</h2>
|
8 |
-
<p>Waves License Center is part of Waves Central, which is the main hub for managing your Waves products. You can download Waves Central for free from the official website. Once you install it on your computer, you can launch it and access Waves License Center.</p>
|
9 |
-
<p>How to fix Waves License Center error<br />
|
10 |
-
Waves License Center offline installer download<br />
|
11 |
-
Waves License Center activation code generator<br />
|
12 |
-
Waves License Center not detecting device<br />
|
13 |
-
Waves License Center alternative software<br />
|
14 |
-
Waves License Center crack for Mac OS<br />
|
15 |
-
Waves License Center crack for Windows 10<br />
|
16 |
-
Waves License Center crack for Linux<br />
|
17 |
-
Waves License Center crack for Android<br />
|
18 |
-
Waves License Center crack for iOS<br />
|
19 |
-
Waves License Center free download full version<br />
|
20 |
-
Waves License Center license key recovery<br />
|
21 |
-
Waves License Center license transfer tutorial<br />
|
22 |
-
Waves License Center offline activation guide<br />
|
23 |
-
Waves License Center online activation bypass<br />
|
24 |
-
Waves License Center troubleshooting tips<br />
|
25 |
-
Waves License Center update patch download<br />
|
26 |
-
Waves License Center uninstall instructions<br />
|
27 |
-
Waves License Center compatibility issues<br />
|
28 |
-
Waves License Center customer support contact<br />
|
29 |
-
Waves License Center hacked version download<br />
|
30 |
-
Waves License Center serial number finder<br />
|
31 |
-
Waves License Center registration code crack<br />
|
32 |
-
Waves License Center keygen download link<br />
|
33 |
-
Waves License Center torrent file download<br />
|
34 |
-
Waves License Center review and rating<br />
|
35 |
-
Waves License Center features and benefits<br />
|
36 |
-
Waves License Center system requirements<br />
|
37 |
-
Waves License Center price and discount<br />
|
38 |
-
Waves License Center coupon code and promo code<br />
|
39 |
-
Waves License Center refund policy and guarantee<br />
|
40 |
-
Waves License Center testimonials and feedback<br />
|
41 |
-
Waves License Center comparison with other software<br />
|
42 |
-
Waves License Center pros and cons analysis<br />
|
43 |
-
Waves License Center best practices and tips<br />
|
44 |
-
Waves License Center FAQs and answers<br />
|
45 |
-
Waves License Center video tutorial and demo<br />
|
46 |
-
Waves License Center blog posts and articles<br />
|
47 |
-
Waves License Center forum and community<br />
|
48 |
-
Waves License Center social media and news<br />
|
49 |
-
How to use Waves plugins without license center <br />
|
50 |
-
How to install waves plugins without license center <br />
|
51 |
-
How to activate waves plugins without license center <br />
|
52 |
-
How to update waves plugins without license center <br />
|
53 |
-
How to uninstall waves plugins without license center <br />
|
54 |
-
How to transfer waves plugins without license center <br />
|
55 |
-
How to backup waves plugins without license center <br />
|
56 |
-
How to restore waves plugins without license center <br />
|
57 |
-
How to troubleshoot waves plugins without license center <br />
|
58 |
-
How to get waves plugins without license center for free</p>
|
59 |
-
<p>Waves License Center allows you to activate your licenses directly to your computer or to a USB flash drive. You can also deactivate your licenses from one device and move them to another. This way, you can use your plugins on different computers or studios without having to buy multiple licenses.</p>
|
60 |
-
<p>To activate your licenses, you need to log in to your Waves account using your email and password. If you don't have an account yet, you can create one for free. Then, you need to select the licenses that you want to activate and choose where to activate them: either on your computer or on a USB flash drive. You can also use the Easy Activate option, which will automatically activate all your available licenses on your computer.</p>
|
61 |
-
<p>To deactivate your licenses, you need to select the device that has the licenses that you want to deactivate and click on Deactivate Licenses. You can also use the Easy Deactivate option, which will automatically deactivate all your licenses on your device.</p>
|
62 |
-
<p>To recover your licenses, you need to use the Recover option in case you lose access to your device or it gets damaged or stolen. This will deactivate all your licenses from that device and make them available for activation again.</p>
|
63 |
-
<p>To transfer your licenses, you need to use the Move option in case you want to move your licenses from one device to another without deactivating them first. This will save you time and hassle.</p>
|
64 |
-
<h2>The Risks of Using a Waves License Center Crack</h2>
|
65 |
-
<p>Some people might think that using a cracked version of Waves License Center is a smart way to save money and get access to all the plugins they want. However, this is actually a very risky and irresponsible thing to do. Here are some of the reasons why:</p>
|
66 |
-
<ul>
|
67 |
-
<li>You might get malware or viruses on your computer. Cracked software often comes with hidden malicious code that can infect your system and compromise its security and performance. You might lose your data, expose your personal information, or damage your hardware.</li>
|
68 |
-
<li>You might face legal issues or penalties. Using cracked software is illegal and violates the terms and conditions of Waves. You might get sued by Waves or face fines or other consequences from law enforcement agencies.</li>
|
69 |
-
<li>You might miss out on updates and support. Cracked software usually does not receive updates or bug fixes from the developers. This means that you might encounter errors, crashes, or compatibility issues with your DAW or operating system. You also won't be able to contact Waves for technical support or customer service.</li>
|
70 |
-
<li>You might compromise your quality and reputation. Cracked software might not work properly or sound as good as the original ones. You might experience glitches, artifacts, latency, or distortion in your audio. You also won't be able to benefit from the latest features and improvements that Waves offers. Moreover, using cracked software is unethical and unprofessional. You might lose respect and credibility from your clients, colleagues, or peers.</li>
|
71 |
-
</ul>
|
72 |
-
<h2>The Benefits of Using a Legitimate Waves License Center</h2>
|
73 |
-
<p>On the other hand, using a legitimate version of Waves License Center has many benefits that outweigh the cost. Here are some of them:</p>
|
74 |
-
<ul>
|
75 |
-
<li>You will get clean and safe software that won't harm your computer or compromise its security and performance.</li>
|
76 |
-
<li>You will be legal and compliant with the terms and conditions of Waves. You won't have to worry about getting sued or fined by anyone.</li>
|
77 |
-
<li>You will get updates and support from Waves regularly. You will be able to enjoy the latest features and improvements that Waves offers for their plugins. You will also be able to contact Waves for technical support or customer service whenever you need it.</li>
|
78 |
-
<li>You will get quality and reputation that match your standards and expectations. You will be able to use reliable and professional plugins that sound great and work smoothly with your DAW or operating system. You will also be able to show respect and integrity for yourself and others in the industry.</li>
|
79 |
-
</ul>
|
80 |
-
<h2>How to Get a Legitimate Waves License Center</h2>
|
81 |
-
<p>If you are convinced that using a legitimate version of Waves License Center is the best way to go, here are some options for getting one:</p>
|
82 |
-
<ul>
|
83 |
-
<li>You can buy individual plugins or bundles from the official website of Waves. They often have discounts and promotions that make their products more affordable.</li>
|
84 |
-
<li>You can subscribe to one of their plans that give you access to hundreds of plugins for a monthly or annual fee.</li>
|
85 |
-
<li>You can rent-to-own some of their plugins through Splice.com for a low monthly fee until you own them forever.</li>
|
86 |
-
<li>You can join their loyalty program that rewards you with points for every purchase that you can redeem for discounts or free products.</li>
|
87 |
-
</ul>
|
88 |
-
<h2>How to Activate Your Waves Licenses</h2>
|
89 |
-
<p>Once you have purchased or subscribed to any of their products, here is how you can activate your licenses using Waves Central:</p>
|
90 |
-
<ol>
|
91 |
-
<li>Download and install Waves Central from their website.</li>
|
92 |
-
<li>Launch it and log in with your email and password.</li>
|
93 |
-
<li>Select Offline Installer at the top left corner.</li>
|
94 |
-
<li>Select Install Products at the top right corner.</li>
|
95 |
-
<li>Select My Products at the left sidebar.</li>
|
96 |
-
<li>Select all the products that you want to install and click Install at the bottom right corner.</li>
|
97 |
-
<li>Select where you want to install them: either on Local Disk (C:) or on an external drive (if connected).</li>
|
98 |
-
<li>Wait for the installation process to finish.</li>
|
99 |
-
<li>Select Licenses at the top left corner.</li>
|
100 |
-
<li>Select Activate Licenses at the top right corner.</li>
|
101 |
-
<li>Select all the licenses that you want to activate and click Activate at the bottom right corner.</li>
|
102 |
-
<li>Select where you want to activate them: either on this computer (Local Licenses) or on an external drive (if connected).</li>
|
103 |
-
<li>Wait for the activation process to finish.</li>
|
104 |
-
</ol>
|
105 |
-
<h2>How to Use Your Plugins</h2>
|
106 |
-
<p>Now that you have activated your licenses, here are some tips and tricks on how to use your plugins effectively and creatively:</p>
|
107 |
-
<table border="1">
|
108 |
-
<tr><th>Plugin</th><th>Tip/Trick</th></tr>
|
109 |
-
<tr><td>R-Comp</td><td>Use the ARC (Auto Release Control) feature to automatically adjust the release time according to the input signal. This can help you achieve a more natural and consistent compression.</td></tr>
|
110 |
-
<tr><td>CLA-2A</td><td>Use the Compress/Limit switch to change the compression ratio and the knee shape. Compress mode has a 3:1 ratio and a soft knee, while Limit mode has a 100:1 ratio and a hard knee. Compress mode is good for smooth and gentle compression, while Limit mode is good for aggressive and tight compression.</td></tr>
|
111 |
-
<tr><td>API 2500</td><td>Use the Thrust filter to change the frequency response of the detector circuit. This can affect how the compressor reacts to different parts of the spectrum. The three options are Normal, Medium, and High. Normal has a flat response, Medium has a high-pass filter that reduces low frequencies, and High has a band-pass filter that boosts mid frequencies.</td></tr>
|
112 |
-
<tr><td>SSL G-Master Buss Compressor</td><td>Use the Auto Fade feature to create a smooth fade-out at the end of your mix. You can set the fade time from 1 to 60 seconds and activate it by clicking on the Fade button. You can also use the Auto Fade feature as a creative effect by automating it during your mix.</td></tr>
|
113 |
-
<tr><td>F6</td><td>Use the dynamic EQ bands to apply compression or expansion to specific frequency ranges. You can adjust the threshold, range, attack, release, and Q parameters for each band. You can also solo or bypass each band for easier monitoring.</td></tr>
|
114 |
-
<tr><td>OVox</td><td>Use the Note Mapper to create custom scales and chords for your vocal harmonies. You can drag and drop notes on the grid to assign them to different MIDI notes. You can also use the Scale and Chord menus to select from preset options.</td></tr>
|
115 |
-
<tr><td>PuigTec EQs</td><td>Use the Boost/Cut controls to create resonant peaks or dips at specific frequencies. The Boost and Cut controls work independently, so you can boost and cut at the same frequency for a unique EQ curve. This can help you add color and character to your sound.</td></tr>
|
116 |
-
<tr><td>Abbey Road TG Mastering Chain</td><td>Use the Tape Delay module to add some vintage delay effects to your mix. You can adjust the delay time, feedback, wow, flutter, and saturation parameters. You can also use the Sync button to sync the delay time to your DAW tempo.</td></tr>
|
117 |
-
</table>
|
118 |
-
<h2>Conclusion</h2>
|
119 |
-
<p>In conclusion, Waves License Center is an essential tool for managing your Waves plugins and licenses. It allows you to activate, deactivate, recover, and transfer your licenses with ease and flexibility. However, using a cracked version of Waves License Center is not a smart idea, as it can expose you to many risks and disadvantages. Instead, you should use a legitimate version of Waves License Center that will give you many benefits and advantages. You should also learn how to use your plugins effectively and creatively to get the best results from your music production.</p>
|
120 |
-
<h3>FAQs</h3>
|
121 |
-
<ul>
|
122 |
-
<li>Q: How do I update my Waves plugins?<br>A: You can update your Waves plugins using Waves Central. Just select Update at the top left corner and follow the instructions.</li>
|
123 |
-
<li>Q: How do I uninstall my Waves plugins?<br>A: You can uninstall your Waves plugins using Waves Central. Just select Uninstall at the top left corner and follow the instructions.</li>
|
124 |
-
<li>Q: How do I get support from Waves?<br>A: You can get support from Waves by visiting their website and clicking on Support at the top right corner. You can also contact them by phone or email.</li>
|
125 |
-
<li>Q: How do I get more plugins from Waves?<br>A: You can get more plugins from Waves by visiting their website and clicking on Products at the top left corner. You can browse by category, type, or collection.</li>
|
126 |
-
<li>Q: How do I learn more about Waves plugins?<br>A: You can learn more about Waves plugins by visiting their website and clicking on Learn at the top right corner. You can find tutorials, tips, articles, webinars, courses, and more.</li>
|
127 |
-
</ul>
|
128 |
-
</p> 0a6ba089eb<br />
|
129 |
-
<br />
|
130 |
-
<br />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/1gistliPinn/ChatGPT4/Examples/Aalavandhan Hd 1080p Movie Torrent Download Dont Miss the Chance to See Kamal Haasan in Dual Roles.md
DELETED
@@ -1,5 +0,0 @@
|
|
1 |
-
|
2 |
-
<p>Downloading torrents is risky for you: your IP and leaked private data being actively tracked by your <b>ISP</b> and <b>Government Agencies</b>. Protect yourself from expensive lawsuits and fines NOW! You must use a VPN. It is the only way to download torrents fully anonymous by encrypting all traffic with zero logs.</p>
|
3 |
-
<h2>Aalavandhan Hd 1080p Movie Torrent Download</h2><br /><p><b><b>Download</b> === <a href="https://imgfil.com/2uy1oj">https://imgfil.com/2uy1oj</a></b></p><br /><br /> aaccfb2cb3<br />
|
4 |
-
<br />
|
5 |
-
<br />
|
|
|
|
|
|
|
|
|
|
|
|
spaces/1gistliPinn/ChatGPT4/Examples/Beyonce Dangerously In Love Album Zip.md
DELETED
@@ -1,9 +0,0 @@
|
|
1 |
-
|
2 |
-
<p>the album, which was released on june 16, 2013 in the united kingdom, includes 13 songs, including collaborations with rappers jay-z and kanye west. the album earned knowles an naacp image award for outstanding literary work. "pray you catch me," featuring john legend, was the album's lead single.</p>
|
3 |
-
<h2>beyonce dangerously in love album zip</h2><br /><p><b><b>Download</b> — <a href="https://imgfil.com/2uy08T">https://imgfil.com/2uy08T</a></b></p><br /><br />
|
4 |
-
<p>in <strong>blue </strong>beyonce takes a break from the rollicking party. instead, she opts for a bittersweet ballad that somehow manages to sound modern and retro. beyonc gets to the point: are you looking at me? i see you lookin at me. oooooo! am i pretty? yes, im pretty. wanna dance with me? what you thinkin, baby? </p>
|
5 |
-
<p>bey comes off as a very confident artist, perhaps with good reason. she knew she had a very strong debut album and was prepared for the high expectations she knew would be held for her as a popstar. she knew the press would be looking to her, and she made sure the singer was ready. "i like to be challenged and i think i'm the best challenge and so i like to be challenged. when i was younger, i didn't think i was. i was too timid and shy and i didn't really go out and try new things. i think i have a little bit of the confidence and the star quality to stand up for myself and not take any crap," she told mtv news in 2003. "i think i'm pretty strong, that's what i've been told. and i think i'm pretty strong, but i also think i'm really good at letting my guard down. and i like to be loved."</p>
|
6 |
-
<p>thats not to say that she didnt have her own set of challenges. with beyonc, every promo was like a whirlwind. she was an artist who was driven and driven hard, but she also had some real moments of weakness. the singer told vh1s behind the music she had serious bouts of fatigue and stress, and she had to work extremely hard on the new album to make sure that her personality didnt get lost in the mix. but like many artists that have had a successful debut, <em>dangerously in love</em> didn't sell many copies. the first single, <em>crazy in love</em>, barely made the radio airwaves and was a commercial flop. the album flopped, too, with the only real success coming from the r&b/soul-pop crossover smash <em>irreemplazable</em>. that was great for the singer, but as the tour neared its conclusion, it was clear that <em>dangerously in love</em> wasnt going to be the runaway smash the industry was expecting. soon, beyonce would be a household name, but as she would soon find out, that doesnt always make it easier to navigate the waters of the pop world. </p>
|
7 |
-
<p></p> 899543212b<br />
|
8 |
-
<br />
|
9 |
-
<br />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/1gistliPinn/ChatGPT4/Examples/Download Shab Hd 720p Full Movie In Hindi.md
DELETED
@@ -1,61 +0,0 @@
|
|
1 |
-
<br />
|
2 |
-
<h1>Download Shab Hd 720p Full Movie In Hindi: A Review</h1>
|
3 |
-
|
4 |
-
<p>Shab is a 2017 Hindi movie directed by Onir and starring Raveena Tandon, Ashish Bisht, Arpita Chatterjee, and Sanjay Suri. The movie is a romantic drama that revolves around several personalities who are looking for happiness and love in a complex, unforgiving, and cold city. The movie explores themes such as identity, sexuality, loneliness, and betrayal.</p>
|
5 |
-
<h2>Download Shab Hd 720p Full Movie In Hindi</h2><br /><p><b><b>DOWNLOAD</b> > <a href="https://imgfil.com/2uxXbC">https://imgfil.com/2uxXbC</a></b></p><br /><br />
|
6 |
-
|
7 |
-
<p>The movie was released on June 30, 2017 and received mixed reviews from critics and audiences. Some praised the movie for its realistic portrayal of urban life and relationships, while others criticized it for its slow pace, lack of depth, and poor execution. The movie was also a box office flop, earning only Rs. 1.15 crore against a budget of Rs. 6 crore.</p>
|
8 |
-
|
9 |
-
<h2>Download Shab Hd 720p Full Movie In Hindi: The Plot</h2>
|
10 |
-
|
11 |
-
<p>The movie follows the lives of four characters who are connected by fate and desire. Afzar (Bisht) is a young man from a small town who comes to Delhi to become a model. He meets Sonal (Tandon), a wealthy and influential fashion patron who offers him a chance to fulfill his dreams. However, he soon realizes that Sonal has ulterior motives and expects him to be her toy boy.</p>
|
12 |
-
|
13 |
-
<p>Raina (Chatterjee) is a waitress at a cafe who has a dark past and a secret identity. She lives with her boyfriend Benoit (Simon Frenay), a French musician who is unaware of her true self. She also has a platonic relationship with Afzar, whom she considers as her friend and confidant.</p>
|
14 |
-
|
15 |
-
<p>Neil (Suri) is a successful fashion designer who is gay and closeted. He is in love with Ashish (Areesz Ganddi), a struggling actor who is also gay but open about his sexuality. Neil faces pressure from his family and society to get married and have children.</p>
|
16 |
-
|
17 |
-
<p>The movie shows how these characters deal with their personal and professional challenges, their hopes and dreams, their secrets and lies, and their love and loss.</p>
|
18 |
-
<p></p>
|
19 |
-
|
20 |
-
<h3>Download Shab Hd 720p Full Movie In Hindi: The Verdict</h3>
|
21 |
-
|
22 |
-
<p>Shab is a movie that tries to be bold and provocative, but fails to deliver on its promise. The movie has a good premise and a talented cast, but suffers from poor execution and direction. The movie is slow, dull, and boring, with no engaging moments or twists. The movie also lacks depth and emotion, as the characters are poorly developed and unrelatable.</p>
|
23 |
-
|
24 |
-
<p>The movie does have some positive aspects, such as the cinematography by Ashish Bisht, who captures the mood and atmosphere of Delhi in an authentic way. The movie also has some decent performances by the actors, especially Raveena Tandon, who plays her role with grace and dignity.</p>
|
25 |
-
|
26 |
-
<p>Overall, Shab is a movie that disappoints on all levels. It is not a movie that will make you feel anything or learn anything. It is not a movie that will entertain you or inspire you. It is not a movie that you should download or watch.</p>
|
27 |
-
<h4>Download Shab Hd 720p Full Movie In Hindi: The Technical Aspects</h4>
|
28 |
-
|
29 |
-
<p>One of the technical aspects of Shab that deserves some praise is the sound design by Resul Pookutty, who won an Oscar for his work on Slumdog Millionaire. The sound design of Shab creates a realistic and immersive experience for the viewers, as it captures the sounds of the city and the characters. The sound design also enhances the mood and tone of the movie, as it conveys the emotions and tensions of the scenes.</p>
|
30 |
-
|
31 |
-
<p>The movie also features a decent music score by Mithoon, who composed some melodious and soulful songs for the movie. The songs are sung by popular singers such as Arijit Singh, KK, Mohammed Irfan, and Neha Bhasin. The songs fit well with the theme and genre of the movie, as they express the feelings and thoughts of the characters.</p>
|
32 |
-
|
33 |
-
<p>The movie also has a good editing by Irene Dhar Malik, who manages to keep the movie coherent and smooth despite its non-linear narrative. The movie also uses some visual effects and graphics to indicate the time and location of the events.</p>
|
34 |
-
|
35 |
-
<h5>Download Shab Hd 720p Full Movie In Hindi: The Conclusion</h5>
|
36 |
-
|
37 |
-
<p>Shab is a movie that attempts to be a realistic and artistic portrayal of urban life and relationships. It is a movie that has a good concept and a good cast, but fails to execute it well. It is a movie that is slow, boring, and shallow, with no memorable moments or messages. It is a movie that you should not download or watch.</p>
|
38 |
-
|
39 |
-
<p>If you are looking for a movie that will make you feel something or learn something, you should look elsewhere. There are many other movies that are better than Shab in terms of story, direction, performance, and entertainment. Shab is a movie that will make you regret wasting your time and money.</p>
|
40 |
-
<h6>Download Shab Hd 720p Full Movie In Hindi: The Bonus Features</h6>
|
41 |
-
|
42 |
-
<p>If you are still interested in watching Shab, you can check out the bonus features on the BluRay disc. The disc includes some featurettes, interviews, and behind-the-scenes footage that show how the movie was made and what inspired it. The disc also includes some deleted scenes and songs that were not included in the movie.</p>
|
43 |
-
|
44 |
-
<p>Some of the bonus features are:
|
45 |
-
|
46 |
-
- Making of Shab: A 20-minute documentary that shows the process of making the movie, from the script to the casting to the shooting. It features interviews with the director, the writers, the producers, and the cast and crew.
|
47 |
-
- Onir's Vision: A 10-minute featurette that shows how the director Onir conceived and executed his vision for the movie. It features interviews with Onir and some clips from his previous movies.
|
48 |
-
- The Music of Shab: A 15-minute featurette that shows how the music composer Mithoon created the songs and the background score for the movie. It features interviews with Mithoon and the singers, and some footage of the recording sessions.
|
49 |
-
- The Characters of Shab: A 10-minute featurette that shows how the actors prepared for their roles and portrayed their characters. It features interviews with Raveena Tandon, Ashish Bisht, Arpita Chatterjee, Sanjay Suri, and others.
|
50 |
-
- Deleted Scenes and Songs: A 5-minute segment that shows some scenes and songs that were cut from the movie due to various reasons.</p>
|
51 |
-
|
52 |
-
<p>Download Shab Hd 720p Full Movie In Hindi is a BluRay disc that offers a mediocre viewing experience and some average bonus features. It is a BluRay disc that will not satisfy fans of Shab or romantic drama movies.</p>
|
53 |
-
<p>Download Shab Hd 720p Full Movie In Hindi is a movie that tells the story of several personalities who are looking for happiness and love in a complex, unforgiving, and cold city. It is a movie that features a talented cast, a realistic plot, and a good sound design. It is a movie that fails to deliver on its promise.</p>
|
54 |
-
|
55 |
-
<p>The movie is slow, dull, and boring, with no engaging moments or twists. The movie also lacks depth and emotion, as the characters are poorly developed and unrelatable. The movie also suffers from poor execution and direction, as it does not capture the mood and tone of the story.</p>
|
56 |
-
|
57 |
-
<p>The movie is not a movie that will make you feel anything or learn anything. It is not a movie that will entertain you or inspire you. It is not a movie that you should download or watch.</p>
|
58 |
-
|
59 |
-
<p>If you are looking for a movie that will make you feel something or learn something, you should look elsewhere. There are many other movies that are better than Shab in terms of story, direction, performance, and entertainment. Shab is a movie that will make you regret wasting your time and money.</p> 3cee63e6c2<br />
|
60 |
-
<br />
|
61 |
-
<br />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/1pelhydcardo/ChatGPT-prompt-generator/Heroes-Season-2-Hindi-Dubbed.md
DELETED
@@ -1,70 +0,0 @@
|
|
1 |
-
## Heroes Season 2 Hindi Dubbed
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-

|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
**Click Here ::: [https://kneedacexbrew.blogspot.com/?d=2txjmB](https://kneedacexbrew.blogspot.com/?d=2txjmB)**
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
Here is a possible title and article with html formatting for the keyword "Heroes Season 2 Hindi Dubbed":
|
26 |
-
|
27 |
-
# Heroes Season 2 Hindi Dubbed: Where to Watch the Sci-Fi Drama Online
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
Heroes is a popular American sci-fi drama series that follows the lives of ordinary people who discover they have extraordinary abilities. The second season of Heroes aired from September 2007 to December 2007 and consisted of 11 episodes. The season introduced new characters and new threats, such as the deadly virus Shanti, the mysterious Company, and the ancient samurai Takezo Kensei.
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
If you are a fan of Heroes and want to watch the second season in Hindi dubbed, you may be wondering where to find it online. Unfortunately, there is no official source for Heroes Season 2 Hindi Dubbed as of now. However, there are some unofficial websites that claim to offer the Hindi dubbed version of Heroes Season 2. These websites are not authorized by the creators or distributors of Heroes and may contain low-quality videos, malware, or pop-up ads. Therefore, we do not recommend using these websites to watch Heroes Season 2 Hindi Dubbed.
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
The best way to watch Heroes Season 2 Hindi Dubbed is to wait for an official release by a licensed streaming platform or a DVD/Blu-ray release. Alternatively, you can watch Heroes Season 2 in English with subtitles on various online platforms, such as Amazon Prime Video[^1^], Netflix[^2^], or NBC.com[^3^]. You can also buy or rent Heroes Season 2 on iTunes[^4^], Google Play, or YouTube.
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
Heroes Season 2 is a thrilling and captivating season that explores the themes of destiny, identity, and sacrifice. If you are looking for a sci-fi drama with a diverse cast of characters and a complex plot, you should definitely give Heroes Season 2 a try.
|
44 |
-
|
45 |
-
Here is a possible continuation of the article:
|
46 |
-
|
47 |
-
Some of the highlights of Heroes Season 2 are:
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
- The introduction of new heroes, such as Maya and Alejandro Herrera, who can kill or heal with their eyes; Monica Dawson, who can mimic any physical skill she sees; and Elle Bishop, who can generate electricity.
|
52 |
-
|
53 |
-
- The revelation of the origins of some of the main characters, such as Peter Petrelli, Hiro Nakamura, and Adam Monroe (the real name of Takezo Kensei).
|
54 |
-
|
55 |
-
- The development of the relationships between the characters, such as the romance between Claire Bennet and West Rosen, the friendship between Matt Parkman and Mohinder Suresh, and the rivalry between Sylar and Noah Bennet.
|
56 |
-
|
57 |
-
- The exploration of the mythology and history of the heroes, such as the legend of Takezo Kensei, the prophecy of Isaac Mendez, and the secrets of the Company.
|
58 |
-
|
59 |
-
- The suspense and drama of the main storyline, which involves a race against time to stop a deadly virus from wiping out most of humanity.
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
Heroes Season 2 Hindi Dubbed is a must-watch for fans of sci-fi and superheroes. It is a season that will keep you on the edge of your seat and make you care about the characters and their fates. If you have not watched Heroes Season 2 yet, you should definitely give it a chance.
|
64 |
-
|
65 |
-
dfd1c89656
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/1pelhydcardo/ChatGPT-prompt-generator/assets/Aliens Drive Me Crazy MOD APK 3.1.9 An Epic Shooter and Driving Adventure.md
DELETED
@@ -1,88 +0,0 @@
|
|
1 |
-
<br />
|
2 |
-
<h1>Aliens Drive Me Crazy Mod APK 3.1 1: A Fun and Action-Packed Game for Android</h1>
|
3 |
-
<p>If you are looking for a game that combines shooting, driving, and adventure, then you should try Aliens Drive Me Crazy Mod APK 3.1 1. This is a modified version of the original game that gives you unlimited coins, unlocked weapons and vehicles, and no ads. In this article, we will tell you what this game is about, why you should play it, and how to download and install it on your Android device.</p>
|
4 |
-
<h2>aliens drive me crazy mod apk 3.1 1</h2><br /><p><b><b>Download File</b> ✦ <a href="https://urlin.us/2uSXgX">https://urlin.us/2uSXgX</a></b></p><br /><br />
|
5 |
-
<h2>Introduction</h2>
|
6 |
-
<h3>What is Aliens Drive Me Crazy?</h3>
|
7 |
-
<p>Aliens Drive Me Crazy is a game developed by Rebel Twins, a studio that specializes in creating fun and addictive games for mobile devices. The game was released in 2014 and has received over 10 million downloads on Google Play Store. The game has a simple premise: aliens have invaded the Earth and you have to stop them. You will play as a hero who can drive various vehicles, shoot different weapons, and explore different locations. You will also face boss battles, rescue hostages, and collect coins and items along the way.</p>
|
8 |
-
<h3>Why should you play Aliens Drive Me Crazy Mod APK 3.1 1?</h3>
|
9 |
-
<p>Aliens Drive Me Crazy is a game that will keep you entertained for hours with its fast-paced and thrilling gameplay. You will enjoy the following benefits when you play the modded version of the game:</p>
|
10 |
-
<ul>
|
11 |
-
<li>You will have unlimited coins to buy anything you want in the game.</li>
|
12 |
-
<li>You will have access to all the weapons and vehicles in the game without having to unlock them.</li>
|
13 |
-
<li>You will not be bothered by annoying ads that interrupt your gaming experience.</li>
|
14 |
-
</ul>
|
15 |
-
<h2>Features of Aliens Drive Me Crazy Mod APK 3.1 1</h2>
|
16 |
-
<h3>Unlimited coins</h3>
|
17 |
-
<p>Coins are the main currency in the game that you can use to buy weapons, vehicles, upgrades, costumes, and more. You can earn coins by completing missions, destroying enemies, rescuing hostages, and collecting items. However, if you want to get everything in the game without spending too much time and effort, you can use the modded version of the game that gives you unlimited coins. You can buy anything you want in the game without worrying about running out of money.</p>
|
18 |
-
<h3>Unlocked weapons and vehicles</h3>
|
19 |
-
<p>The game offers a variety of weapons and vehicles that you can use to fight against the aliens. You can choose from pistols, shotguns, rifles, rocket launchers, grenades, swords, hammers, and more. You can also drive cars, motorcycles, tanks, helicopters, jetpacks, and more. However, some of these weapons and vehicles are locked and require you to reach certain levels or pay coins to unlock them. If you want to use them right away without any restrictions, you can use the modded version of the game that unlocks all of them for you.</p>
|
20 |
-
<h3>No ads</h3>
|
21 |
-
<p>The original version of the game contains ads that may pop up randomly or after every level. These ads can be annoying and distracting, especially when you are in the middle of an intense action scene. If you want to enjoy the game without any interruptions or distractions, you can use the modded version of the game that removes all the ads from the game.</p>
|
22 |
-
<h2>How to download and install Aliens Drive Me Crazy Mod APK 3.1 1</ <h2>How to download and install Aliens Drive Me Crazy Mod APK 3.1 1</h2>
|
23 |
-
<p>If you are interested in playing Aliens Drive Me Crazy Mod APK 3.1 1, you will need to download and install the APK file on your Android device. Here are the steps you need to follow:</p>
|
24 |
-
<p>aliens drive me crazy hack apk download<br />
|
25 |
-
aliens drive me crazy mod apk unlimited money<br />
|
26 |
-
aliens drive me crazy mod apk latest version<br />
|
27 |
-
aliens drive me crazy mod apk android 1<br />
|
28 |
-
aliens drive me crazy mod apk revdl<br />
|
29 |
-
aliens drive me crazy mod apk free shopping<br />
|
30 |
-
aliens drive me crazy mod apk rexdl<br />
|
31 |
-
aliens drive me crazy mod apk happymod<br />
|
32 |
-
aliens drive me crazy mod apk no ads<br />
|
33 |
-
aliens drive me crazy mod apk offline<br />
|
34 |
-
aliens drive me crazy premium apk<br />
|
35 |
-
aliens drive me crazy pro apk<br />
|
36 |
-
aliens drive me crazy full apk<br />
|
37 |
-
aliens drive me crazy unlocked apk<br />
|
38 |
-
aliens drive me crazy cheat apk<br />
|
39 |
-
aliens drive me crazy cracked apk<br />
|
40 |
-
aliens drive me crazy unlimited coins apk<br />
|
41 |
-
aliens drive me crazy unlimited gems apk<br />
|
42 |
-
aliens drive me crazy unlimited weapons apk<br />
|
43 |
-
aliens drive me crazy unlimited health apk<br />
|
44 |
-
download aliens drive me crazy mod apk for android<br />
|
45 |
-
download aliens drive me crazy mod apk for pc<br />
|
46 |
-
download aliens drive me crazy mod apk for ios<br />
|
47 |
-
download aliens drive me crazy mod apk for windows 10<br />
|
48 |
-
download aliens drive me crazy mod apk for laptop<br />
|
49 |
-
how to install aliens drive me crazy mod apk<br />
|
50 |
-
how to play aliens drive me crazy mod apk<br />
|
51 |
-
how to update aliens drive me crazy mod apk<br />
|
52 |
-
how to hack aliens drive me crazy mod apk<br />
|
53 |
-
how to get aliens drive me crazy mod apk<br />
|
54 |
-
aliens drive me crazy game mod apk<br />
|
55 |
-
aliens drive me crazy shooting game mod apk<br />
|
56 |
-
aliens drive me crazy adventure game mod apk<br />
|
57 |
-
aliens drive me crazy action game mod apk<br />
|
58 |
-
aliens drive me crazy arcade game mod apk<br />
|
59 |
-
best alien games for android mod apk<br />
|
60 |
-
best alien shooting games for android mod apk<br />
|
61 |
-
best alien driving games for android mod apk<br />
|
62 |
-
best alien invasion games for android mod apk<br />
|
63 |
-
best alien adventure games for android mod apk</p>
|
64 |
-
<h3>Step 1: Download the APK file from a trusted source</h3>
|
65 |
-
<p>The first thing you need to do is to find a reliable website that offers the modded version of the game. You can search for it on Google or use the link we have provided below. Make sure you download the latest version of the game, which is 3.1 1. The file size is about 70 MB, so make sure you have enough space on your device.</p>
|
66 |
-
<p><a href="">Download Aliens Drive Me Crazy Mod APK 3.1 1 here</a></p>
|
67 |
-
<h3>Step 2: Enable unknown sources on your device</h3>
|
68 |
-
<p>The next thing you need to do is to allow your device to install apps from unknown sources. This is because the modded version of the game is not available on the official Google Play Store, so you need to enable this option to install it. To do this, go to your device settings, then security, then unknown sources, and toggle it on. You may see a warning message, but don't worry, it is safe to install the game.</p>
|
69 |
-
<h3>Step 3: Install the APK file and enjoy the game</h3>
|
70 |
-
<p>The final thing you need to do is to locate the downloaded APK file on your device and tap on it to start the installation process. Follow the instructions on the screen and wait for a few seconds until the installation is complete. Once it is done, you can launch the game and enjoy all the features of Aliens Drive Me Crazy Mod APK 3.1 1.</p>
|
71 |
-
<h2>Conclusion</h2>
|
72 |
-
<p>Aliens Drive Me Crazy Mod APK 3.1 1 is a fun and action-packed game that will keep you entertained for hours. You will love the unlimited coins, unlocked weapons and vehicles, and no ads that this modded version of the game offers. You will also enjoy the colorful graphics, smooth controls, and hilarious sound effects that make this game a joy to play. If you are looking for a game that combines shooting, driving, and adventure, then you should download and install Aliens Drive Me Crazy Mod APK 3.1 1 on your Android device today.</p>
|
73 |
-
<h2>FAQs</h2>
|
74 |
-
<p>Here are some of the frequently asked questions about Aliens Drive Me Crazy Mod APK 3.1 1:</p>
|
75 |
-
<ol>
|
76 |
-
<li>Is Aliens Drive Me Crazy Mod APK 3.1 1 safe to download and install?</li>
|
77 |
-
<p>Yes, it is safe to download and install Aliens Drive Me Crazy Mod APK 3.1 1 as long as you use a trusted source like the one we have provided above. The modded version of the game does not contain any viruses or malware that can harm your device or compromise your privacy.</p>
|
78 |
-
<li>Do I need to root my device to play Aliens Drive Me Crazy Mod APK 3.1 1?</li>
|
79 |
-
<p>No, you do not need to root your device to play Aliens Drive Me Crazy Mod APK 3.1 1. The modded version of the game works fine on both rooted and non-rooted devices.</p>
|
80 |
-
<li>Can I play Aliens Drive Me Crazy Mod APK 3.1 1 offline?</li>
|
81 |
-
<p>Yes, you can play Aliens Drive Me Crazy Mod APK 3.1 1 offline without any internet connection. However, some features of the game may require an internet connection, such as leaderboards, achievements, and social media integration.</p>
|
82 |
-
<li>Can I play Aliens Drive Me Crazy Mod APK 3.1 1 with my friends?</li>
|
83 |
-
<p>Yes, you can play Aliens Drive Me Crazy Mod APK 3.1 1 with your friends online or locally. The game supports multiplayer mode where you can team up with your friends or compete against them in various missions and challenges.</p>
|
84 |
-
<li>How can I update Aliens Drive Me Crazy Mod APK 3.1 1?</li>
|
85 |
-
<p>To update Aliens Drive Me Crazy Mod APK 3.1 1, you will need to download and install the latest version of the modded version of the game from the same source you used before. You may also need to uninstall the previous version of the game before installing the new one.</p>
|
86 |
-
</ol></p> 197e85843d<br />
|
87 |
-
<br />
|
88 |
-
<br />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/1pelhydcardo/ChatGPT-prompt-generator/assets/Download Blade Forge 3D MOD APK and Become a Master Blacksmith.md
DELETED
@@ -1,101 +0,0 @@
|
|
1 |
-
|
2 |
-
<h1>Blade Forge 3D Mod APK: A Fun and Creative Game for Blacksmith Lovers</h1>
|
3 |
-
<p>Do you love crafting weapons and blades? Do you want to experience the life of a blacksmith in a fun and realistic way? If yes, then you should try Blade Forge 3D, a simulation game that lets you create your own blades from scratch. And if you want to enjoy the game even more, you should download Blade Forge 3D Mod APK, a modified version that gives you unlimited money, no ads, and access to all blades. In this article, we will tell you everything you need to know about Blade Forge 3D Mod APK, including its features, how to download and install it, and some frequently asked questions.</p>
|
4 |
-
<h2>blade forge 3d mod apk</h2><br /><p><b><b>Download</b> 🗸🗸🗸 <a href="https://urlin.us/2uT2NM">https://urlin.us/2uT2NM</a></b></p><br /><br />
|
5 |
-
<h2>Introduction</h2>
|
6 |
-
<h3>What is Blade Forge 3D?</h3>
|
7 |
-
<p>Blade Forge 3D is a simulation game developed by Kwalee Ltd, a UK-based game studio. The game was released in May 2020 and has gained over 10 million downloads on Google Play Store. The game is rated 4.0 out of 5 stars by more than 100 thousand users.</p>
|
8 |
-
<p>In Blade Forge 3D, you play as a blacksmith who can craft different types of blades using various materials and techniques. You can choose from different shapes, sizes, colors, and designs for your blades. You can also test your blades on different objects and enemies to see how they perform. The game is easy to play but hard to master, as you need to balance the quality, durability, and sharpness of your blades.</p>
|
9 |
-
<h3>What is Blade Forge 3D Mod APK?</h3>
|
10 |
-
<p>Blade Forge 3D Mod APK is a modified version of the original game that gives you some extra benefits that are not available in the official version. These benefits include unlimited money, no ads, and unlock all blades. With these features, you can enjoy the game without any limitations or interruptions. You can craft any blade you want without worrying about the cost or the availability. You can also get rid of the annoying ads that pop up every now and then. You can download Blade Forge 3D Mod APK for free from various websites on the internet.</p>
|
11 |
-
<h2>Features of Blade Forge 3D Mod APK</h2>
|
12 |
-
<h3>Unlimited Money</h3>
|
13 |
-
<p>One of the main features of Blade Forge 3D Mod APK is that it gives you unlimited money. Money is used in the game to buy materials, upgrade your tools, and unlock new blades. Normally, you have to earn money by completing tasks and selling your blades. However, with Blade Forge 3D Mod APK, you don't have to worry about that. You can get as much money as you want without doing anything. You can spend your money freely and buy whatever you need or want.</p>
|
14 |
-
<p>blade forge 3d unlimited money apk<br />
|
15 |
-
download blade forge 3d mod apk latest version<br />
|
16 |
-
blade forge 3d hack apk free download<br />
|
17 |
-
blade forge 3d mod apk android 1<br />
|
18 |
-
blade forge 3d mod apk no ads<br />
|
19 |
-
blade forge 3d simulation game mod apk<br />
|
20 |
-
blade forge 3d mod apk revdl<br />
|
21 |
-
blade forge 3d mod apk happymod<br />
|
22 |
-
blade forge 3d mod apk offline<br />
|
23 |
-
blade forge 3d mod apk unlimited gems<br />
|
24 |
-
blade forge 3d mod apk rexdl<br />
|
25 |
-
blade forge 3d mod apk pure<br />
|
26 |
-
blade forge 3d mod apk vip unlocked<br />
|
27 |
-
blade forge 3d mod apk for pc<br />
|
28 |
-
blade forge 3d mod apk online<br />
|
29 |
-
blade forge 3d mod apk unlimited everything<br />
|
30 |
-
blade forge 3d mod apk obb<br />
|
31 |
-
blade forge 3d mod apk ios<br />
|
32 |
-
blade forge 3d mod apk unlimited coins<br />
|
33 |
-
blade forge 3d mod apk all unlocked<br />
|
34 |
-
blade forge 3d mod apk unlimited levels<br />
|
35 |
-
blade forge 3d mod apk full version<br />
|
36 |
-
blade forge 3d mod apk pro<br />
|
37 |
-
blade forge 3d mod apk premium<br />
|
38 |
-
blade forge 3d mod apk mega mod<br />
|
39 |
-
blade forge 3d mod apk unlimited energy<br />
|
40 |
-
blade forge 3d mod apk god mode<br />
|
41 |
-
blade forge 3d mod apk unlimited weapons<br />
|
42 |
-
blade forge 3d mod apk no root<br />
|
43 |
-
blade forge 3d mod apk cheat<br />
|
44 |
-
blade forge 3d mod apk update<br />
|
45 |
-
blade forge 3d mod apk new version<br />
|
46 |
-
blade forge 3d mod apk old version<br />
|
47 |
-
blade forge 3d mod apk original<br />
|
48 |
-
blade forge 3d mod apk cracked<br />
|
49 |
-
blade forge 3d mod apk unlimited gold<br />
|
50 |
-
blade forge 3d mod apk unlocked everything<br />
|
51 |
-
blade forge 3d mod apk high damage<br />
|
52 |
-
blade forge 3d mod apk easy win<br />
|
53 |
-
blade forge 3d mod apk no verification</p>
|
54 |
-
<h3>No Ads</h3>
|
55 |
-
<p>Another feature of Blade Forge 3D Mod APK is that it removes all the ads from the game. Ads are annoying and distracting, especially when they interrupt your gameplay or cover your screen. They can also consume your data and battery life. With Blade Forge 3D Mod APK, you don't have to deal with any ads at all. You can play the game smoothly and peacefully without any interruptions or distractions.</p>
|
56 |
-
<h3>Unlock All Blades</h3>
|
57 |
-
<p>The last feature of Blade Forge 3D Mod APK is that it unlocks all the blades in the game. Blades are the main items in the game that you can craft and use. There are many types of blades in the game, such as swords, daggers, axes, spears, scythes, etc. Each blade has its own characteristics and abilities. Some blades are more powerful, rare, or expensive than others. Normally, you have to unlock the blades by completing certain tasks or paying money. However, with Blade Forge 3D Mod APK, you can access all the blades from the start. You can choose any blade you like and craft it with ease.</p>
|
58 |
-
<h2>How to Download and Install Blade Forge 3D Mod APK</h2>
|
59 |
-
<h3>Step 1: Enable Unknown Sources</h3>
|
60 |
-
<p>Before you can install Blade Forge 3D Mod APK, you need to enable unknown sources on your device. This is because the APK file is not from the official Google Play Store and your device may block it by default. To enable unknown sources, follow these steps:</p>
|
61 |
-
<ul>
|
62 |
-
<li>Go to your device's settings and look for security or privacy options.</li>
|
63 |
-
<li>Find the option that says "allow installation of apps from unknown sources" or something similar.</li>
|
64 |
-
<li>Toggle it on and confirm your choice.</li>
|
65 |
-
</ul>
|
66 |
-
<h3>Step 2: Download the APK File</h3>
|
67 |
-
<p>Next, you need to download the APK file of Blade Forge 3D Mod APK from a reliable website. There are many websites that offer the APK file, but some of them may be fake or malicious. To avoid any risks, you should download the APK file from a trusted source, such as [APKPure] or [APKFab]. These websites are safe and verified by millions of users. To download the APK file, follow these steps:</p>
|
68 |
-
<ul>
|
69 |
-
<li>Go to the website of your choice and search for Blade Forge 3D Mod APK.</li>
|
70 |
-
<li>Select the latest version of the APK file and click on the download button.</li>
|
71 |
-
<li>Wait for the download to finish and save the file in your device's storage.</li>
|
72 |
-
</ul>
|
73 |
-
<h3>Step 3: Install the APK File</h3>
|
74 |
-
<p>Finally, you need to install the APK file of Blade Forge 3D Mod APK on your device. This is a simple and quick process that only takes a few minutes. To install the APK file, follow these steps:</p>
|
75 |
-
<ul>
|
76 |
-
<li>Locate the APK file in your device's storage and tap on it.</li>
|
77 |
-
<li>A pop-up window will appear asking you to confirm the installation. Tap on "install" and wait for the process to complete.</li>
|
78 |
-
<li>Once the installation is done, you can open the game and enjoy Blade Forge 3D Mod APK.</li>
|
79 |
-
</ul>
|
80 |
-
<h2>Conclusion</h2>
|
81 |
-
<p>Blade Forge 3D is a fun and creative game that lets you craft your own blades and test them on various objects and enemies. The game is easy to play but hard to master, as you need to balance the quality, durability, and sharpness of your blades. If you want to enhance your gaming experience, you should download Blade Forge 3D Mod APK, a modified version that gives you unlimited money, no ads, and access to all blades. You can download Blade Forge 3D Mod APK for free from various websites on the internet. You just need to follow some simple steps to enable unknown sources, download the APK file, and install it on your device. Then, you can enjoy Blade Forge 3D Mod APK without any limitations or interruptions.</p>
|
82 |
-
<h2>FAQs</h2>
|
83 |
-
<p>Here are some frequently asked questions about Blade Forge 3D Mod APK:</p>
|
84 |
-
<h4>Q: Is Blade Forge 3D Mod APK safe to use?</h4>
|
85 |
-
<p>A: Yes, Blade Forge 3D Mod APK is safe to use as long as you download it from a reliable website. The APK file does not contain any viruses or malware that can harm your device or data. However, you should always be careful when downloading any files from unknown sources and scan them with an antivirus before installing them.</p>
|
86 |
-
<h4>Q: Do I need to root my device to use Blade Forge 3D Mod APK?</h4>
|
87 |
-
<p>A: No, you do not need to root your device to use Blade Forge 3D Mod APK. The modded version works fine on both rooted and non-rooted devices. You just need to enable unknown sources and install the APK file as usual.</p>
|
88 |
-
<h4>Q: Will I get banned for using Blade Forge 3D Mod APK?</h4>
|
89 |
-
<p>A: No, you will not get banned for using Blade Forge 3D Mod APK. The modded version does not interfere with the game's servers or online features. You can play the game normally without any risk of getting banned.</p>
|
90 |
-
<h4>Q: Can I update Blade Forge 3D Mod APK?</h4>
|
91 |
-
<p>A: Yes, you can update Blade Forge 3D Mod APK whenever a new version is available. However, you may have to uninstall the previous version and download the new version from the same website. You may also lose your progress and data if you update the modded version, so make sure to back up your files before updating.</p>
|
92 |
-
<h4>Q: What are some alternatives to Blade Forge 3D Mod APK?</h4>
|
93 |
-
<p>A: If you are looking for some other games that are similar to Blade Forge 3D, you can try these alternatives:</p>
|
94 |
-
<ul>
|
95 |
-
<li>Forge Ahead: A casual game that lets you smash ores and forge metal into coins and jewels.</li>
|
96 |
-
<li>Forge of Empires: A strategy game that lets you build and manage your own city through different ages and civilizations.</li>
|
97 |
-
<li>Blade Bound: A hack and slash game that lets you fight against evil forces using various weapons and skills.</li>
|
98 |
-
</ul>
|
99 |
-
<p>I hope this article has helped you learn more about Blade Forge 3D Mod APK and how to download and install it on your device. If you have any questions or feedback, feel free to leave a comment below. Thank you for reading and have fun playing Blade Forge 3D Mod APK!</p> 197e85843d<br />
|
100 |
-
<br />
|
101 |
-
<br />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/1phancelerku/anime-remove-background/Download Mortal Kombat 11 for Android The Ultimate Fighting Game.md
DELETED
@@ -1,142 +0,0 @@
|
|
1 |
-
<br />
|
2 |
-
<h1>Download Game Mortal Kombat 11 Android: How to Enjoy the Ultimate Fighting Experience on Your Mobile Device</h1>
|
3 |
-
<p>If you are a fan of fighting games, you must have heard of Mortal Kombat, one of the most popular and influential franchises in the genre. Mortal Kombat is known for its brutal and visceral combat, its iconic characters, and its trademark fatalities. And now, you can enjoy the latest installment of this legendary series, Mortal Kombat 11, on your android device. But how do you download game mortal kombat 11 android? And how do you optimize your gaming experience? In this article, we will answer these questions and more. Read on to find out how to unleash your power and become the ultimate fighter on your mobile device.</p>
|
4 |
-
<h2>download game mortal kombat 11 android</h2><br /><p><b><b>Download File</b> 🗹 <a href="https://jinyurl.com/2uNPgt">https://jinyurl.com/2uNPgt</a></b></p><br /><br />
|
5 |
-
<h2>What is Mortal Kombat 11?</h2>
|
6 |
-
<p>Mortal Kombat 11 is the eleventh main entry in the Mortal Kombat series, developed by NetherRealm Studios and published by Warner Bros. Interactive Entertainment. It was released in April 2019 for PlayStation 4, Xbox One, Nintendo Switch, and Windows PC, and later in November 2020 for PlayStation 5 and Xbox Series X/S. It is also available for android devices through two different methods, which we will discuss later.</p>
|
7 |
-
<h3>The latest installment of the iconic fighting game franchise</h3>
|
8 |
-
<p>Mortal Kombat 11 continues the story of the previous game, Mortal Kombat X, in which Raiden, the god of thunder, has become corrupted by the power of Shinnok's amulet and has decided to protect Earthrealm by any means necessary. This leads him to clash with other characters, both old and new, who have their own agendas and motivations. The game also introduces a new villain, Kronika, the keeper of time, who wants to erase Raiden's interference and create a new timeline.</p>
|
9 |
-
<h3>The features and gameplay of Mortal Kombat 11</h3>
|
10 |
-
<p>Mortal Kombat 11 is a fighting game that allows you to choose from a roster of over 30 characters, each with their own unique abilities, moves, and fatalities. You can customize your characters with different skins, gear, abilities, intros, outros, taunts, and banners. You can also use a new feature called Fatal Blow, which is a powerful attack that can be activated when your health is below 30%. Another new feature is Krushing Blow, which is a cinematic variation of a special move that triggers when certain conditions are met.</p>
|
11 |
-
<p>The game offers various modes for you to play, such as Story Mode, which lets you follow the narrative of the game; Towers of Time, which are dynamic challenges that change periodically; Klassic Towers, which are traditional arcade ladders; Online Mode, which lets you compete with other players around the world; Training Mode, which lets you practice your skills; and Krypt Mode, which lets you explore Shang Tsung's island and unlock various rewards.</p>
|
12 |
-
<h3>The characters and modes of Mortal Kombat 11</h3>
|
13 |
-
<p>Mortal Kombat 11 features a diverse cast of characters from different realms and timelines. Some of them are returning favorites from previous games such as Scorpion, Sub-Zero, Liu Kang, Sonya Blade, Raiden, and Shao Kahn; some of them are new additions from Mortal Kombat X, such as Cassie Cage, Jacqui Briggs, Kotal Kahn, and D'Vorah; and some of them are brand new characters, such as Geras, Cetrion, and The Terminator. You can also unlock and play as guest characters from other franchises, such as Joker, Spawn, RoboCop, and Rambo.</p>
|
14 |
-
<h2>How to download game mortal kombat 11 android?</h2>
|
15 |
-
<p>As we mentioned earlier, there are two ways to download game mortal kombat 11 android: the official way and the unofficial way. Let's take a look at each of them and see how they differ.</p>
|
16 |
-
<h3>The official way: Mortal Kombat Mobile app</h3>
|
17 |
-
<p>The official way to download game mortal kombat 11 android is to use the Mortal Kombat Mobile app, which is a free-to-play version of the game that is compatible with android devices. The Mortal Kombat Mobile app is not exactly the same as the console or PC version of the game, but it does share some similarities and features.</p>
|
18 |
-
<p>How to download game mortal kombat 11 on android<br />
|
19 |
-
Download game mortal kombat 11 apk for android<br />
|
20 |
-
Mortal kombat 11 android game free download<br />
|
21 |
-
Download game mortal kombat 11 mod apk android<br />
|
22 |
-
Mortal kombat 11 mobile game download for android<br />
|
23 |
-
Download game mortal kombat 11 offline android<br />
|
24 |
-
Mortal kombat 11 android game download play store<br />
|
25 |
-
Download game mortal kombat 11 full version android<br />
|
26 |
-
Mortal kombat 11 android game size and requirements<br />
|
27 |
-
Download game mortal kombat 11 hack android<br />
|
28 |
-
Mortal kombat 11 android game release date and news<br />
|
29 |
-
Download game mortal kombat 11 latest version android<br />
|
30 |
-
Mortal kombat 11 android game features and gameplay<br />
|
31 |
-
Download game mortal kombat 11 online android<br />
|
32 |
-
Mortal kombat 11 android game review and rating<br />
|
33 |
-
Download game mortal kombat 11 unlimited money android<br />
|
34 |
-
Mortal kombat 11 android game characters and roster<br />
|
35 |
-
Download game mortal kombat 11 data obb android<br />
|
36 |
-
Mortal kombat 11 android game tips and tricks<br />
|
37 |
-
Download game mortal kombat 11 cheats android<br />
|
38 |
-
Mortal kombat 11 android game graphics and performance<br />
|
39 |
-
Download game mortal kombat 11 update android<br />
|
40 |
-
Mortal kombat 11 android game story and mode<br />
|
41 |
-
Download game mortal kombat 11 cracked android<br />
|
42 |
-
Mortal kombat 11 android game controller support<br />
|
43 |
-
Download game mortal kombat 11 beta android<br />
|
44 |
-
Mortal kombat 11 android game fatalities and moves<br />
|
45 |
-
Download game mortal kombat 11 highly compressed android<br />
|
46 |
-
Mortal kombat 11 android game best settings and optimization<br />
|
47 |
-
Download game mortal kombat 11 patch android<br />
|
48 |
-
Mortal kombat 11 android game system requirements and compatibility<br />
|
49 |
-
Download game mortal kombat 11 original android<br />
|
50 |
-
Mortal kombat 11 android game bugs and issues<br />
|
51 |
-
Download game mortal kombat 11 premium edition android<br />
|
52 |
-
Mortal kombat 11 android game skins and costumes<br />
|
53 |
-
Download game mortal kombat 11 ultimate edition android<br />
|
54 |
-
Mortal kombat 11 android game multiplayer and faction wars<br />
|
55 |
-
Download game mortal kombat 11 steam key android<br />
|
56 |
-
Mortal kombat 11 android game achievements and rewards<br />
|
57 |
-
Download game mortal kombat 11 dlc pack android</p>
|
58 |
-
<h4>How to install and play Mortal Kombat Mobile app</h4>
|
59 |
-
<p>To install and play Mortal Kombat Mobile app, you need to follow these steps:</p>
|
60 |
-
<ol>
|
61 |
-
<li>Go to the Google Play Store and search for Mortal Kombat Mobile app.</li>
|
62 |
-
<li>Download and install the app on your device. The app requires about 1.1 GB of storage space.</li>
|
63 |
-
<li>Launch the app and accept the terms and conditions.</li>
|
64 |
-
<li>Create or log in to your WB Games account. This will allow you to sync your progress and access online features.</li>
|
65 |
-
<li>Choose your preferred language and region.</li>
|
66 |
-
<li>Enjoy the game!</li>
|
67 |
-
</ol>
|
68 |
-
<h4>The benefits and drawbacks of Mortal Kombat Mobile app</h4>
|
69 |
-
<p>The Mortal Kombat Mobile app has some benefits and drawbacks that you should be aware of before you decide to download it. Here are some of them:</p>
|
70 |
-
<table>
|
71 |
-
<tr><th>Benefits</th><th>Drawbacks</th></tr>
|
72 |
-
<tr><td>- It is free to download and play.</td><td>- It has in-app purchases and ads that can affect your gaming experience.</td></tr>
|
73 |
-
<tr><td>- It has high-quality graphics and sound effects.</td><td>- It requires a stable internet connection to play.</td></tr>
|
74 |
-
<tr><td>- It has a large roster of characters that you can collect and upgrade.</td><td>- It has a different gameplay system than the console or PC version, which may not appeal to some fans.</td></tr>
|
75 |
-
<tr><td>- It has exclusive content and events that are not available in the console or PC version.</td><td>- It has limited modes and features compared to the console or PC version.</td></tr>
|
76 |
-
<tr><td>- It allows you to link your account with the console or PC version and unlock rewards in both games.</td><td>- It may not run smoothly on some devices or cause battery drain or overheating issues.</td></tr>
|
77 |
-
</table> <h3>The unofficial way: Mortal Kombat 11 Mobile website</h3>
|
78 |
-
<p>The unofficial way to download game mortal kombat 11 android is to use the Mortal Kombat 11 Mobile website, which is a fan-made version of the game that claims to be compatible with android devices. The Mortal Kombat 11 Mobile website is not endorsed or supported by the official developers or publishers of the game, and it may contain malware or viruses that can harm your device or steal your personal information.</p>
|
79 |
-
<h4>How to access and download Mortal Kombat 11 Mobile website</h4>
|
80 |
-
<p>To access and download Mortal Kombat 11 Mobile website, you need to follow these steps:</p>
|
81 |
-
<ol>
|
82 |
-
<li>Go to your browser and search for Mortal Kombat 11 Mobile website.</li>
|
83 |
-
<li>Find and click on the link that leads you to the website. Be careful not to click on any ads or pop-ups that may appear.</li>
|
84 |
-
<li>On the website, you will see a button that says "Download Now". Click on it and wait for the download to start.</li>
|
85 |
-
<li>Once the download is complete, you will need to install the APK file on your device. You may need to enable unknown sources in your settings to do this.</li>
|
86 |
-
<li>Launch the game and enjoy!</li>
|
87 |
-
</ol>
|
88 |
-
<h4>The advantages and disadvantages of Mortal Kombat 11 Mobile website</h4>
|
89 |
-
<p>The Mortal Kombat 11 Mobile website has some advantages and disadvantages that you should be aware of before you decide to download it. Here are some of them:</p>
|
90 |
-
<table>
|
91 |
-
<tr><th>Advantages</th><th>Disadvantages</th></tr>
|
92 |
-
<tr><td>- It claims to offer the same gameplay and features as the console or PC version of the game.</td><td>- It is not authorized or verified by the official developers or publishers of the game.</td></tr>
|
93 |
-
<tr><td>- It does not require any in-app purchases or ads to play.</td><td>- It may contain malware or viruses that can damage your device or compromise your security.</td></tr>
|
94 |
-
<tr><td>- It does not require an internet connection to play.</td><td>- It may not work properly on some devices or cause crashes or glitches.</td></tr>
|
95 |
-
<tr><td>- It allows you to play as any character without unlocking them.</td><td>- It may violate the intellectual property rights of the original creators of the game.</td></tr>
|
96 |
-
<tr><td>- It updates regularly with new content and fixes.</td><td>- It may be removed or blocked by the authorities at any time.</td></tr>
|
97 |
-
</table> <h2>How to optimize your mortal kombat 11 android experience?</h2>
|
98 |
-
<p>Now that you know how to download game mortal kombat 11 android, you may wonder how to make the most of your gaming experience. Whether you choose the official or the unofficial way, there are some tips and tricks that can help you improve your performance and enjoyment of the game. Here are some of them:</p>
|
99 |
-
<h3>Tips and tricks for playing Mortal Kombat 11 on android</h3>
|
100 |
-
<p>Here are some tips and tricks that can help you play Mortal Kombat 11 on android better:</p>
|
101 |
-
<ul>
|
102 |
-
<li>Learn the basics of the game, such as the controls, the combos, the special moves, and the fatalities. You can find tutorials and guides in the game or online.</li>
|
103 |
-
<li>Practice your skills in Training Mode or Klassic Towers before you challenge other players or take on harder modes.</li>
|
104 |
-
<li>Customize your characters with the best gear, abilities, and cosmetics that suit your playstyle and preferences. You can unlock more options by playing the game or spending in-game currency.</li>
|
105 |
-
<li>Use Fatal Blows and Krushing Blows wisely, as they can turn the tide of a fight in your favor. Save them for when you need them most, and don't waste them on easy opponents.</li>
|
106 |
-
<li>Experiment with different characters and find your favorites. Each character has their own strengths and weaknesses, and some may suit you better than others.</li>
|
107 |
-
<li>Join a faction and participate in Faction Wars, which are online competitions that reward you with exclusive items and bonuses.</li>
|
108 |
-
<li>Complete daily objectives and quests to earn more rewards and progress faster in the game.</li>
|
109 |
-
<li>Watch replays of your matches or other players' matches to learn from your mistakes or get inspired by their strategies.</li>
|
110 |
-
</ul>
|
111 |
-
<h3>Best devices and settings for running Mortal Kombat 11 on android</h3>
|
112 |
-
<p>Here are some recommendations for the best devices and settings for running Mortal Kombat 11 on android:</p>
|
113 |
-
<ul>
|
114 |
-
<li>The minimum requirements for running Mortal Kombat 11 on android are: Android 5.0 or higher, 1.5 GB of RAM, and a quad-core CPU. However, these may not be enough to run the game smoothly or at high quality.</li>
|
115 |
-
<li>The recommended devices for running Mortal Kombat 11 on android are: Samsung Galaxy S10 or higher, OnePlus 7T or higher, Google Pixel 4 or higher, Huawei P30 Pro or higher, or any other flagship device from 2019 or later.</li>
|
116 |
-
<li>The best settings for running Mortal Kombat 11 on android are: High graphics quality, high frame rate, low power mode off, sound effects on, music on, vibration off, notifications off, and auto-save on.</li>
|
117 |
-
</ul>
|
118 |
-
<h3>Common issues and solutions for Mortal Kombat 11 on android</h3>
|
119 |
-
<p>Here are some common issues and solutions for Mortal Kombat 11 on android:</p>
|
120 |
-
<ul>
|
121 |
-
<li>If the game crashes or freezes, try clearing the cache, restarting the device, updating the app, or reinstalling the app.</li>
|
122 |
-
<li>If the game lags or stutters, try lowering the graphics quality, closing other apps, freeing up storage space, or using a faster internet connection.</li>
|
123 |
-
<li>If the game does not load or sync properly, try checking your internet connection, logging out and logging back in to your WB Games account, or contacting customer support.</li>
|
124 |
-
<li>If the game does not recognize your inputs or gestures, try calibrating your screen, cleaning your screen, or using a stylus or a controller.</li>
|
125 |
-
</ul>
|
126 |
-
<h2>Conclusion</h2>
|
127 |
-
<p>Mortal Kombat 11 is one of the best fighting games ever made, and you can enjoy it on your android device with either the official or the unofficial way. However, each way has its pros and cons, so you should weigh them carefully before you decide to download game mortal kombat 11 android. Also, you should follow some tips and tricks to optimize your gaming experience and avoid some common issues. We hope this article has helped you learn how to download game mortal kombat 11 android and how to have fun with it. Now go ahead and unleash your power!</p>
|
128 |
-
<h2>FAQs</h2>
|
129 |
-
<p>Here are some frequently asked questions about downloading game mortal kombat 11 android:</p>
|
130 |
-
<ol>
|
131 |
-
<li><b>Is Mortal Kombat 11 free on android?</b></li>
|
132 |
-
<p>Mortal Kombat 11 is not free on android. However, you can download the Mortal Kombat Mobile app for free from the Google Play Store. This is a free-to-play version of the game that has some similarities and features with Mortal Kombat 11. Alternatively, you can access and download the Mortal Kombat 11 Mobile website for free from your browser. This is a fan-made version of the game that claims to offer the same gameplay and features as Mortal Kombat 11. However, this is not an official or authorized way to download game mortal kombat 11 android, and it may pose some risks to your device or security.</p>
|
133 |
-
<li><b>Can I play Mortal Kombat 11 on android with a controller?</b></li>
|
134 |
-
<p>Yes, you can play Mortal Kombat 11 on android with a controller, as long as your device supports it. You can use either a wired or a wireless controller, such as a PS4, Xbox One, or Switch controller. To connect your controller to your device, you need to follow the instructions of your device and controller manufacturer. Once your controller is connected, you can customize the controls in the game settings.</p>
|
135 |
-
<li><b>Can I play Mortal Kombat 11 on android with my friends?</b></li>
|
136 |
-
<p>Yes, you can play Mortal Kombat 11 on android with your friends, either online or offline. To play online, you need to have an internet connection and a WB Games account. You can then invite your friends to join your faction, chat with them, and challenge them to matches. To play offline, you need to have two devices with the game installed and connected via Bluetooth or Wi-Fi. You can then select the Versus mode and choose your opponent.</p>
|
137 |
-
<li><b>How do I unlock more characters in Mortal Kombat 11 on android?</b></li>
|
138 |
-
<p>There are different ways to unlock more characters in Mortal Kombat 11 on android, depending on which way you download the game. If you use the Mortal Kombat Mobile app, you can unlock more characters by opening packs, completing towers, participating in events, or spending in-game currency. If you use the Mortal Kombat 11 Mobile website, you can unlock more characters by downloading updates, entering codes, or using cheats.</p>
|
139 |
-
<li><b>How do I perform fatalities in Mortal Kombat 11 on android?</b></li>
|
140 |
-
<p>Fatalities are finishing moves that you can perform at the end of a match to brutally kill your opponent. To perform fatalities in Mortal Kombat 11 on android, you need to know the specific input and distance for each character and fatality. You can find this information in the game menu or online. Once you have this information, you need to defeat your opponent until their health bar flashes red and the announcer says "Finish Him/Her". Then, you need to input the correct sequence of buttons or gestures within a few seconds and watch the gruesome result.</p> 401be4b1e0<br />
|
141 |
-
<br />
|
142 |
-
<br />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/1phancelerku/anime-remove-background/European Truck Simulator APK Mod Customize Your Truck and Explore Amazing Cities.md
DELETED
@@ -1,114 +0,0 @@
|
|
1 |
-
|
2 |
-
<h1>European Truck Simulator Mod APK: Drive Across Europe With Unlimited Money</h1>
|
3 |
-
<p>Do you love driving trucks and exploring new places? Do you want to experience the thrill of being a real trucker in Europe? If yes, then you should try European Truck Simulator, a realistic and immersive truck simulation game that lets you travel across many countries from Europe, visit incredible places like Berlin, Prague, Madrid, Rome, Paris and more. You can play the career mode of this truck simulator, make money, purchase new trucks and upgrades, and challenge your friends with the online multiplayer mode.</p>
|
4 |
-
<h2>european truck simulator apk mod</h2><br /><p><b><b>DOWNLOAD</b> ➡ <a href="https://jinyurl.com/2uNNCD">https://jinyurl.com/2uNNCD</a></b></p><br /><br />
|
5 |
-
<p>But what if you want to enjoy the game without any limitations or restrictions? What if you want to have unlimited money to buy any truck or upgrade you want? Well, there is a way to do that. You can use European Truck Simulator Mod APK, a modified version of the game that gives you access to unlimited money and other features. In this article, we will tell you everything you need to know about European Truck Simulator Mod APK, including what it is, why you should use it, how to download and install it, and some tips and tricks for playing the game. Let's get started!</p>
|
6 |
-
<h2>What is European Truck Simulator?</h2>
|
7 |
-
<p>European Truck Simulator is a truck simulation game developed by Ovidiu Pop, a popular developer of simulation games. The game was released in 2015 and has since gained millions of downloads and positive reviews from players. The game features 12 European truck brands with 4x2 and 6x4 axles, more than 20 realistic cities, country roads, highways and offroads, easy controls (tilt, buttons or touch steering wheel), realistic weather conditions and day/night cycle, visual damage on trucks, detailed interiors for each truck brand, amazing engine sounds, improved AI traffic system, online multiplayer with servers or convoy mode, achievements and leaderboards, controller support, and more.</p>
|
8 |
-
<p>The game is available for free on Google Play Store , but it also offers in-app purchases that range from $0.99 to $49.99 per item. These purchases allow you to buy more money, remove ads, unlock all trucks, and get premium features. However, if you don't want to spend real money on the game, you can use European Truck Simulator Mod APK instead.</p>
|
9 |
-
<h2>How to download and install European Truck Simulator Mod APK?</h2>
|
10 |
-
<p>European Truck Simulator Mod APK is a modified version of the game that gives you unlimited money and other features that are not available in the original version. You can use this mod APK to buy any truck or upgrade you want, without worrying about running out of money. You can also enjoy the game without any ads or interruptions.</p>
|
11 |
-
<p>european truck simulator mod apk unlimited money<br />
|
12 |
-
euro truck driver simulator apk mod<br />
|
13 |
-
european truck simulator 2 mod apk<br />
|
14 |
-
euro truck evolution simulator mod apk<br />
|
15 |
-
european truck simulator 4.2 mod apk<br />
|
16 |
-
euro truck driver 2018 mod apk<br />
|
17 |
-
european truck simulator multiplayer mod apk<br />
|
18 |
-
euro truck simulator pro 2 mod apk<br />
|
19 |
-
european truck simulator hack mod apk<br />
|
20 |
-
euro truck driver 3d mod apk<br />
|
21 |
-
european truck simulator android mod apk<br />
|
22 |
-
euro truck simulator offroad cargo transport mod apk<br />
|
23 |
-
european truck simulator latest mod apk<br />
|
24 |
-
euro truck driver 2019 mod apk<br />
|
25 |
-
european truck simulator 3.1 mod apk<br />
|
26 |
-
euro truck simulator bus mod apk<br />
|
27 |
-
european truck simulator free download mod apk<br />
|
28 |
-
euro truck driver 2.6.0 mod apk<br />
|
29 |
-
european truck simulator full version mod apk<br />
|
30 |
-
euro truck simulator cargo delivery mod apk<br />
|
31 |
-
european truck simulator offline mod apk<br />
|
32 |
-
euro truck driver 2.5.0 mod apk<br />
|
33 |
-
european truck simulator premium mod apk<br />
|
34 |
-
euro truck driver 2.3.0 mod apk<br />
|
35 |
-
european truck simulator unlocked mod apk<br />
|
36 |
-
euro truck driver 2.2.0 mod apk<br />
|
37 |
-
european truck simulator all trucks mod apk<br />
|
38 |
-
euro truck driver online multiplayer mod apk<br />
|
39 |
-
european truck simulator realistic mod apk<br />
|
40 |
-
euro truck driver ovilex mod apk<br />
|
41 |
-
european truck simulator graphics mod apk<br />
|
42 |
-
euro truck driver hack version download apk<br />
|
43 |
-
european truck simulator cheats mod apk<br />
|
44 |
-
euro truck driver unlimited coins and gems apk<br />
|
45 |
-
european truck simulator best mods apk<br />
|
46 |
-
euro truck driver game download for android hack version<br />
|
47 |
-
european truck simulator new update mod apk<br />
|
48 |
-
euro truck driver old version hack download for android <br />
|
49 |
-
european truck simulator no ads mod apk <br />
|
50 |
-
euro truck driver game download for android apkpure <br />
|
51 |
-
european truck simulator controller support mod apk <br />
|
52 |
-
euro truck driver game download for android uptodown <br />
|
53 |
-
european truck simulator customizations mod apk <br />
|
54 |
-
euro truck driver game download for android mob.org <br />
|
55 |
-
european truck simulator weather conditions mod apk <br />
|
56 |
-
euro truck driver game download for android rexdl <br />
|
57 |
-
european truck simulator damage mod apk <br />
|
58 |
-
euro truck driver game download for android revdl <br />
|
59 |
-
european truck simulator interior mods apk</p>
|
60 |
-
<p>To download and install European Truck Simulator Mod APK, you need to follow these steps:</p>
|
61 |
-
<ol>
|
62 |
-
<li>Go to , a reliable website that offers mod APKs for various games and apps.</li>
|
63 |
-
<li>Search for European Truck Simulator Mod APK in the search bar or browse through the categories.</li>
|
64 |
-
<li>Click on the download button and wait for the file to be downloaded on your device.</li>
|
65 |
-
<li>Once the file is downloaded, go to your device settings and enable unknown sources. This will allow you to install apps from sources other than Google Play Store.</li>
|
66 |
-
<li>Locate the downloaded file in your file manager and tap on it to start the installation process.</li>
|
67 |
-
<li>Follow the instructions on the screen and wait for the installation to be completed.</li>
|
68 |
-
<li>Launch the game and enjoy!</li>
|
69 |
-
</ol>
|
70 |
-
<h2>Why use European Truck Simulator Mod APK?</h2>
|
71 |
-
<p>You might be wondering why you should use European Truck Simulator Mod APK instead of the original version of the game. Well, there are many reasons why using this mod APK can enhance your gaming experience. Here are some of them:</p>
|
72 |
-
<h3>Benefits of the mod APK</ <h3>Benefits of the mod APK</h3>
|
73 |
-
<ul>
|
74 |
-
<li>Unlimited money: With European Truck Simulator Mod APK, you can have unlimited money to spend on buying new trucks, upgrading your existing ones, customizing your vehicles, and more. You don't have to worry about earning money by completing missions or watching ads. You can enjoy the game without any financial constraints.</li>
|
75 |
-
<li>No ads: Ads can be annoying and distracting, especially when you are trying to focus on driving your truck. They can also consume your data and battery. With European Truck Simulator Mod APK, you can get rid of all the ads and play the game without any interruptions.</li>
|
76 |
-
<li>All trucks unlocked: The game features 12 European truck brands with different models and specifications. However, not all of them are available from the start. You have to unlock them by progressing through the game or by paying real money. With European Truck Simulator Mod APK, you can access all the trucks from the beginning and choose the one that suits your style and preference.</li>
|
77 |
-
<li>Premium features: The game also offers some premium features that can enhance your gameplay, such as removing the speed limiter, enabling realistic fuel consumption, changing the license plate, and more. These features are only available for users who pay real money or watch ads. With European Truck Simulator Mod APK, you can get these features for free and enjoy the game to the fullest.</li>
|
78 |
-
</ul>
|
79 |
-
<h3>Risks of the mod APK</h3>
|
80 |
-
<p>While using European Truck Simulator Mod APK can have many benefits, it also comes with some risks that you should be aware of. Here are some of them:</p>
|
81 |
-
<ul>
|
82 |
-
<li>Compatibility issues: The mod APK may not be compatible with all devices or versions of the game. It may cause some glitches or errors that can affect your gameplay or damage your device. You should always check the compatibility of the mod APK before downloading and installing it.</li>
|
83 |
-
<li>Security issues: The mod APK may contain viruses or malware that can harm your device or steal your personal information. You should always download the mod APK from a trusted source and scan it with an antivirus before installing it.</li>
|
84 |
-
<li>Ban issues: The mod APK may violate the terms and conditions of the game or Google Play Store. It may be detected by the game developers or Google and result in a ban or suspension of your account. You should always use the mod APK at your own risk and discretion.</li>
|
85 |
-
</ul>
|
86 |
-
<h2>Tips and tricks for playing European Truck Simulator</h2>
|
87 |
-
<p>Now that you know how to download and install European Truck Simulator Mod APK, you might be wondering how to play the game and have fun. Well, we have some tips and tricks for you that can help you improve your skills and enjoy the game more. Here are some of them:</p>
|
88 |
-
<h3>Customize your truck</h3>
|
89 |
-
<p>One of the best things about European Truck Simulator is that you can customize your truck according to your taste and preference. You can change the color, paint job, accessories, wheels, lights, horns, exhausts, and more. You can also upgrade your engine, transmission, brakes, suspension, fuel tank, and more. Customizing your truck can make it look more unique and attractive, as well as improve its performance and efficiency.</p>
|
90 |
-
<h3>Follow the traffic rules</h3>
|
91 |
-
<p>European Truck Simulator is a realistic simulation game that follows the traffic rules and regulations of Europe. You have to obey the speed limits, traffic lights, signs, signals, lane markings, and more. You also have to respect other vehicles on the road, such as cars, buses, motorcycles, bicycles, pedestrians, etc. If you break any traffic rule or cause any accident, you will be fined or penalized by the police. Following the traffic rules can make your driving experience more safe and smooth.</p>
|
92 |
-
<h3>Explore different routes and cities</h3>
|
93 |
-
<p>European Truck Simulator offers you a vast map of Europe with more than 20 realistic cities to visit. You can explore different routes and roads that connect these cities, such as country roads, highways, offroads, etc. You can also enjoy the scenic views of nature, landmarks, monuments, buildings, etc. that you encounter along the way. Exploring different routes and cities can make your gameplay more diverse and interesting.</p>
|
94 |
-
<h3>Join online multiplayer mode</h3>
|
95 |
-
<p>If you want to challenge yourself and compete with other players from around the world, you can join the online multiplayer mode of European Truck Simulator. You can either join a server or create a convoy with your friends. You can chat with other players using voice or text messages. You can also compare your scores and achievements with other players on the leaderboards. Joining online multiplayer mode can make your gameplay more social and fun.</p>
|
96 |
-
<h2>Conclusion</h2>
|
97 |
-
<p>European Truck Simulator is a great game for anyone who loves driving trucks and exploring <p>European Truck Simulator is a great game for anyone who loves driving trucks and exploring new places. It offers a realistic and immersive truck simulation experience that can keep you entertained for hours. However, if you want to enjoy the game without any limitations or restrictions, you can use European Truck Simulator Mod APK, a modified version of the game that gives you unlimited money and other features. You can download and install this mod APK from a reliable website and follow the instructions given in this article. You can also use some tips and tricks to improve your skills and have fun playing the game.</p>
|
98 |
-
<p>We hope this article was helpful and informative for you. If you have any questions or feedback, please feel free to leave a comment below. Thank you for reading and happy trucking!</p>
|
99 |
-
<h2>FAQs</h2>
|
100 |
-
<p>Here are some frequently asked questions about European Truck Simulator Mod APK:</p>
|
101 |
-
<ol>
|
102 |
-
<li>Is European Truck Simulator Mod APK safe to use?</li>
|
103 |
-
<p>European Truck Simulator Mod APK is generally safe to use, as long as you download it from a trusted source and scan it with an antivirus before installing it. However, you should always use it at your own risk and discretion, as it may violate the terms and conditions of the game or Google Play Store.</p>
|
104 |
-
<li>What are the requirements for using European Truck Simulator Mod APK?</li>
|
105 |
-
<p>To use European Truck Simulator Mod APK, you need to have an Android device with Android 4.1 or higher, at least 1 GB of RAM, and at least 200 MB of free storage space. You also need to enable unknown sources in your device settings to install the mod APK.</p>
|
106 |
-
<li>Can I play European Truck Simulator Mod APK offline?</li>
|
107 |
-
<p>Yes, you can play European Truck Simulator Mod APK offline, as it does not require an internet connection to run. However, you will not be able to access the online multiplayer mode or update the game without an internet connection.</p>
|
108 |
-
<li>Can I use European Truck Simulator Mod APK with other mods or cheats?</li>
|
109 |
-
<p>No, you cannot use European Truck Simulator Mod APK with other mods or cheats, as it may cause compatibility issues or errors that can affect your gameplay or damage your device. You should only use one mod or cheat at a time.</p>
|
110 |
-
<li>Can I update European Truck Simulator Mod APK?</li>
|
111 |
-
<p>Yes, you can update European Truck Simulator Mod APK, as long as the mod APK is compatible with the latest version of the game. You can check for updates on the website where you downloaded the mod APK or on the game itself. However, you may lose some of the mod features or data after updating, so you should always backup your data before updating.</p>
|
112 |
-
</ol></p> 401be4b1e0<br />
|
113 |
-
<br />
|
114 |
-
<br />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/AI-Hobbyist/Hoyo-RVC/infer_pack/attentions.py
DELETED
@@ -1,417 +0,0 @@
|
|
1 |
-
import copy
|
2 |
-
import math
|
3 |
-
import numpy as np
|
4 |
-
import torch
|
5 |
-
from torch import nn
|
6 |
-
from torch.nn import functional as F
|
7 |
-
|
8 |
-
from infer_pack import commons
|
9 |
-
from infer_pack import modules
|
10 |
-
from infer_pack.modules import LayerNorm
|
11 |
-
|
12 |
-
|
13 |
-
class Encoder(nn.Module):
|
14 |
-
def __init__(
|
15 |
-
self,
|
16 |
-
hidden_channels,
|
17 |
-
filter_channels,
|
18 |
-
n_heads,
|
19 |
-
n_layers,
|
20 |
-
kernel_size=1,
|
21 |
-
p_dropout=0.0,
|
22 |
-
window_size=10,
|
23 |
-
**kwargs
|
24 |
-
):
|
25 |
-
super().__init__()
|
26 |
-
self.hidden_channels = hidden_channels
|
27 |
-
self.filter_channels = filter_channels
|
28 |
-
self.n_heads = n_heads
|
29 |
-
self.n_layers = n_layers
|
30 |
-
self.kernel_size = kernel_size
|
31 |
-
self.p_dropout = p_dropout
|
32 |
-
self.window_size = window_size
|
33 |
-
|
34 |
-
self.drop = nn.Dropout(p_dropout)
|
35 |
-
self.attn_layers = nn.ModuleList()
|
36 |
-
self.norm_layers_1 = nn.ModuleList()
|
37 |
-
self.ffn_layers = nn.ModuleList()
|
38 |
-
self.norm_layers_2 = nn.ModuleList()
|
39 |
-
for i in range(self.n_layers):
|
40 |
-
self.attn_layers.append(
|
41 |
-
MultiHeadAttention(
|
42 |
-
hidden_channels,
|
43 |
-
hidden_channels,
|
44 |
-
n_heads,
|
45 |
-
p_dropout=p_dropout,
|
46 |
-
window_size=window_size,
|
47 |
-
)
|
48 |
-
)
|
49 |
-
self.norm_layers_1.append(LayerNorm(hidden_channels))
|
50 |
-
self.ffn_layers.append(
|
51 |
-
FFN(
|
52 |
-
hidden_channels,
|
53 |
-
hidden_channels,
|
54 |
-
filter_channels,
|
55 |
-
kernel_size,
|
56 |
-
p_dropout=p_dropout,
|
57 |
-
)
|
58 |
-
)
|
59 |
-
self.norm_layers_2.append(LayerNorm(hidden_channels))
|
60 |
-
|
61 |
-
def forward(self, x, x_mask):
|
62 |
-
attn_mask = x_mask.unsqueeze(2) * x_mask.unsqueeze(-1)
|
63 |
-
x = x * x_mask
|
64 |
-
for i in range(self.n_layers):
|
65 |
-
y = self.attn_layers[i](x, x, attn_mask)
|
66 |
-
y = self.drop(y)
|
67 |
-
x = self.norm_layers_1[i](x + y)
|
68 |
-
|
69 |
-
y = self.ffn_layers[i](x, x_mask)
|
70 |
-
y = self.drop(y)
|
71 |
-
x = self.norm_layers_2[i](x + y)
|
72 |
-
x = x * x_mask
|
73 |
-
return x
|
74 |
-
|
75 |
-
|
76 |
-
class Decoder(nn.Module):
|
77 |
-
def __init__(
|
78 |
-
self,
|
79 |
-
hidden_channels,
|
80 |
-
filter_channels,
|
81 |
-
n_heads,
|
82 |
-
n_layers,
|
83 |
-
kernel_size=1,
|
84 |
-
p_dropout=0.0,
|
85 |
-
proximal_bias=False,
|
86 |
-
proximal_init=True,
|
87 |
-
**kwargs
|
88 |
-
):
|
89 |
-
super().__init__()
|
90 |
-
self.hidden_channels = hidden_channels
|
91 |
-
self.filter_channels = filter_channels
|
92 |
-
self.n_heads = n_heads
|
93 |
-
self.n_layers = n_layers
|
94 |
-
self.kernel_size = kernel_size
|
95 |
-
self.p_dropout = p_dropout
|
96 |
-
self.proximal_bias = proximal_bias
|
97 |
-
self.proximal_init = proximal_init
|
98 |
-
|
99 |
-
self.drop = nn.Dropout(p_dropout)
|
100 |
-
self.self_attn_layers = nn.ModuleList()
|
101 |
-
self.norm_layers_0 = nn.ModuleList()
|
102 |
-
self.encdec_attn_layers = nn.ModuleList()
|
103 |
-
self.norm_layers_1 = nn.ModuleList()
|
104 |
-
self.ffn_layers = nn.ModuleList()
|
105 |
-
self.norm_layers_2 = nn.ModuleList()
|
106 |
-
for i in range(self.n_layers):
|
107 |
-
self.self_attn_layers.append(
|
108 |
-
MultiHeadAttention(
|
109 |
-
hidden_channels,
|
110 |
-
hidden_channels,
|
111 |
-
n_heads,
|
112 |
-
p_dropout=p_dropout,
|
113 |
-
proximal_bias=proximal_bias,
|
114 |
-
proximal_init=proximal_init,
|
115 |
-
)
|
116 |
-
)
|
117 |
-
self.norm_layers_0.append(LayerNorm(hidden_channels))
|
118 |
-
self.encdec_attn_layers.append(
|
119 |
-
MultiHeadAttention(
|
120 |
-
hidden_channels, hidden_channels, n_heads, p_dropout=p_dropout
|
121 |
-
)
|
122 |
-
)
|
123 |
-
self.norm_layers_1.append(LayerNorm(hidden_channels))
|
124 |
-
self.ffn_layers.append(
|
125 |
-
FFN(
|
126 |
-
hidden_channels,
|
127 |
-
hidden_channels,
|
128 |
-
filter_channels,
|
129 |
-
kernel_size,
|
130 |
-
p_dropout=p_dropout,
|
131 |
-
causal=True,
|
132 |
-
)
|
133 |
-
)
|
134 |
-
self.norm_layers_2.append(LayerNorm(hidden_channels))
|
135 |
-
|
136 |
-
def forward(self, x, x_mask, h, h_mask):
|
137 |
-
"""
|
138 |
-
x: decoder input
|
139 |
-
h: encoder output
|
140 |
-
"""
|
141 |
-
self_attn_mask = commons.subsequent_mask(x_mask.size(2)).to(
|
142 |
-
device=x.device, dtype=x.dtype
|
143 |
-
)
|
144 |
-
encdec_attn_mask = h_mask.unsqueeze(2) * x_mask.unsqueeze(-1)
|
145 |
-
x = x * x_mask
|
146 |
-
for i in range(self.n_layers):
|
147 |
-
y = self.self_attn_layers[i](x, x, self_attn_mask)
|
148 |
-
y = self.drop(y)
|
149 |
-
x = self.norm_layers_0[i](x + y)
|
150 |
-
|
151 |
-
y = self.encdec_attn_layers[i](x, h, encdec_attn_mask)
|
152 |
-
y = self.drop(y)
|
153 |
-
x = self.norm_layers_1[i](x + y)
|
154 |
-
|
155 |
-
y = self.ffn_layers[i](x, x_mask)
|
156 |
-
y = self.drop(y)
|
157 |
-
x = self.norm_layers_2[i](x + y)
|
158 |
-
x = x * x_mask
|
159 |
-
return x
|
160 |
-
|
161 |
-
|
162 |
-
class MultiHeadAttention(nn.Module):
|
163 |
-
def __init__(
|
164 |
-
self,
|
165 |
-
channels,
|
166 |
-
out_channels,
|
167 |
-
n_heads,
|
168 |
-
p_dropout=0.0,
|
169 |
-
window_size=None,
|
170 |
-
heads_share=True,
|
171 |
-
block_length=None,
|
172 |
-
proximal_bias=False,
|
173 |
-
proximal_init=False,
|
174 |
-
):
|
175 |
-
super().__init__()
|
176 |
-
assert channels % n_heads == 0
|
177 |
-
|
178 |
-
self.channels = channels
|
179 |
-
self.out_channels = out_channels
|
180 |
-
self.n_heads = n_heads
|
181 |
-
self.p_dropout = p_dropout
|
182 |
-
self.window_size = window_size
|
183 |
-
self.heads_share = heads_share
|
184 |
-
self.block_length = block_length
|
185 |
-
self.proximal_bias = proximal_bias
|
186 |
-
self.proximal_init = proximal_init
|
187 |
-
self.attn = None
|
188 |
-
|
189 |
-
self.k_channels = channels // n_heads
|
190 |
-
self.conv_q = nn.Conv1d(channels, channels, 1)
|
191 |
-
self.conv_k = nn.Conv1d(channels, channels, 1)
|
192 |
-
self.conv_v = nn.Conv1d(channels, channels, 1)
|
193 |
-
self.conv_o = nn.Conv1d(channels, out_channels, 1)
|
194 |
-
self.drop = nn.Dropout(p_dropout)
|
195 |
-
|
196 |
-
if window_size is not None:
|
197 |
-
n_heads_rel = 1 if heads_share else n_heads
|
198 |
-
rel_stddev = self.k_channels**-0.5
|
199 |
-
self.emb_rel_k = nn.Parameter(
|
200 |
-
torch.randn(n_heads_rel, window_size * 2 + 1, self.k_channels)
|
201 |
-
* rel_stddev
|
202 |
-
)
|
203 |
-
self.emb_rel_v = nn.Parameter(
|
204 |
-
torch.randn(n_heads_rel, window_size * 2 + 1, self.k_channels)
|
205 |
-
* rel_stddev
|
206 |
-
)
|
207 |
-
|
208 |
-
nn.init.xavier_uniform_(self.conv_q.weight)
|
209 |
-
nn.init.xavier_uniform_(self.conv_k.weight)
|
210 |
-
nn.init.xavier_uniform_(self.conv_v.weight)
|
211 |
-
if proximal_init:
|
212 |
-
with torch.no_grad():
|
213 |
-
self.conv_k.weight.copy_(self.conv_q.weight)
|
214 |
-
self.conv_k.bias.copy_(self.conv_q.bias)
|
215 |
-
|
216 |
-
def forward(self, x, c, attn_mask=None):
|
217 |
-
q = self.conv_q(x)
|
218 |
-
k = self.conv_k(c)
|
219 |
-
v = self.conv_v(c)
|
220 |
-
|
221 |
-
x, self.attn = self.attention(q, k, v, mask=attn_mask)
|
222 |
-
|
223 |
-
x = self.conv_o(x)
|
224 |
-
return x
|
225 |
-
|
226 |
-
def attention(self, query, key, value, mask=None):
|
227 |
-
# reshape [b, d, t] -> [b, n_h, t, d_k]
|
228 |
-
b, d, t_s, t_t = (*key.size(), query.size(2))
|
229 |
-
query = query.view(b, self.n_heads, self.k_channels, t_t).transpose(2, 3)
|
230 |
-
key = key.view(b, self.n_heads, self.k_channels, t_s).transpose(2, 3)
|
231 |
-
value = value.view(b, self.n_heads, self.k_channels, t_s).transpose(2, 3)
|
232 |
-
|
233 |
-
scores = torch.matmul(query / math.sqrt(self.k_channels), key.transpose(-2, -1))
|
234 |
-
if self.window_size is not None:
|
235 |
-
assert (
|
236 |
-
t_s == t_t
|
237 |
-
), "Relative attention is only available for self-attention."
|
238 |
-
key_relative_embeddings = self._get_relative_embeddings(self.emb_rel_k, t_s)
|
239 |
-
rel_logits = self._matmul_with_relative_keys(
|
240 |
-
query / math.sqrt(self.k_channels), key_relative_embeddings
|
241 |
-
)
|
242 |
-
scores_local = self._relative_position_to_absolute_position(rel_logits)
|
243 |
-
scores = scores + scores_local
|
244 |
-
if self.proximal_bias:
|
245 |
-
assert t_s == t_t, "Proximal bias is only available for self-attention."
|
246 |
-
scores = scores + self._attention_bias_proximal(t_s).to(
|
247 |
-
device=scores.device, dtype=scores.dtype
|
248 |
-
)
|
249 |
-
if mask is not None:
|
250 |
-
scores = scores.masked_fill(mask == 0, -1e4)
|
251 |
-
if self.block_length is not None:
|
252 |
-
assert (
|
253 |
-
t_s == t_t
|
254 |
-
), "Local attention is only available for self-attention."
|
255 |
-
block_mask = (
|
256 |
-
torch.ones_like(scores)
|
257 |
-
.triu(-self.block_length)
|
258 |
-
.tril(self.block_length)
|
259 |
-
)
|
260 |
-
scores = scores.masked_fill(block_mask == 0, -1e4)
|
261 |
-
p_attn = F.softmax(scores, dim=-1) # [b, n_h, t_t, t_s]
|
262 |
-
p_attn = self.drop(p_attn)
|
263 |
-
output = torch.matmul(p_attn, value)
|
264 |
-
if self.window_size is not None:
|
265 |
-
relative_weights = self._absolute_position_to_relative_position(p_attn)
|
266 |
-
value_relative_embeddings = self._get_relative_embeddings(
|
267 |
-
self.emb_rel_v, t_s
|
268 |
-
)
|
269 |
-
output = output + self._matmul_with_relative_values(
|
270 |
-
relative_weights, value_relative_embeddings
|
271 |
-
)
|
272 |
-
output = (
|
273 |
-
output.transpose(2, 3).contiguous().view(b, d, t_t)
|
274 |
-
) # [b, n_h, t_t, d_k] -> [b, d, t_t]
|
275 |
-
return output, p_attn
|
276 |
-
|
277 |
-
def _matmul_with_relative_values(self, x, y):
|
278 |
-
"""
|
279 |
-
x: [b, h, l, m]
|
280 |
-
y: [h or 1, m, d]
|
281 |
-
ret: [b, h, l, d]
|
282 |
-
"""
|
283 |
-
ret = torch.matmul(x, y.unsqueeze(0))
|
284 |
-
return ret
|
285 |
-
|
286 |
-
def _matmul_with_relative_keys(self, x, y):
|
287 |
-
"""
|
288 |
-
x: [b, h, l, d]
|
289 |
-
y: [h or 1, m, d]
|
290 |
-
ret: [b, h, l, m]
|
291 |
-
"""
|
292 |
-
ret = torch.matmul(x, y.unsqueeze(0).transpose(-2, -1))
|
293 |
-
return ret
|
294 |
-
|
295 |
-
def _get_relative_embeddings(self, relative_embeddings, length):
|
296 |
-
max_relative_position = 2 * self.window_size + 1
|
297 |
-
# Pad first before slice to avoid using cond ops.
|
298 |
-
pad_length = max(length - (self.window_size + 1), 0)
|
299 |
-
slice_start_position = max((self.window_size + 1) - length, 0)
|
300 |
-
slice_end_position = slice_start_position + 2 * length - 1
|
301 |
-
if pad_length > 0:
|
302 |
-
padded_relative_embeddings = F.pad(
|
303 |
-
relative_embeddings,
|
304 |
-
commons.convert_pad_shape([[0, 0], [pad_length, pad_length], [0, 0]]),
|
305 |
-
)
|
306 |
-
else:
|
307 |
-
padded_relative_embeddings = relative_embeddings
|
308 |
-
used_relative_embeddings = padded_relative_embeddings[
|
309 |
-
:, slice_start_position:slice_end_position
|
310 |
-
]
|
311 |
-
return used_relative_embeddings
|
312 |
-
|
313 |
-
def _relative_position_to_absolute_position(self, x):
|
314 |
-
"""
|
315 |
-
x: [b, h, l, 2*l-1]
|
316 |
-
ret: [b, h, l, l]
|
317 |
-
"""
|
318 |
-
batch, heads, length, _ = x.size()
|
319 |
-
# Concat columns of pad to shift from relative to absolute indexing.
|
320 |
-
x = F.pad(x, commons.convert_pad_shape([[0, 0], [0, 0], [0, 0], [0, 1]]))
|
321 |
-
|
322 |
-
# Concat extra elements so to add up to shape (len+1, 2*len-1).
|
323 |
-
x_flat = x.view([batch, heads, length * 2 * length])
|
324 |
-
x_flat = F.pad(
|
325 |
-
x_flat, commons.convert_pad_shape([[0, 0], [0, 0], [0, length - 1]])
|
326 |
-
)
|
327 |
-
|
328 |
-
# Reshape and slice out the padded elements.
|
329 |
-
x_final = x_flat.view([batch, heads, length + 1, 2 * length - 1])[
|
330 |
-
:, :, :length, length - 1 :
|
331 |
-
]
|
332 |
-
return x_final
|
333 |
-
|
334 |
-
def _absolute_position_to_relative_position(self, x):
|
335 |
-
"""
|
336 |
-
x: [b, h, l, l]
|
337 |
-
ret: [b, h, l, 2*l-1]
|
338 |
-
"""
|
339 |
-
batch, heads, length, _ = x.size()
|
340 |
-
# padd along column
|
341 |
-
x = F.pad(
|
342 |
-
x, commons.convert_pad_shape([[0, 0], [0, 0], [0, 0], [0, length - 1]])
|
343 |
-
)
|
344 |
-
x_flat = x.view([batch, heads, length**2 + length * (length - 1)])
|
345 |
-
# add 0's in the beginning that will skew the elements after reshape
|
346 |
-
x_flat = F.pad(x_flat, commons.convert_pad_shape([[0, 0], [0, 0], [length, 0]]))
|
347 |
-
x_final = x_flat.view([batch, heads, length, 2 * length])[:, :, :, 1:]
|
348 |
-
return x_final
|
349 |
-
|
350 |
-
def _attention_bias_proximal(self, length):
|
351 |
-
"""Bias for self-attention to encourage attention to close positions.
|
352 |
-
Args:
|
353 |
-
length: an integer scalar.
|
354 |
-
Returns:
|
355 |
-
a Tensor with shape [1, 1, length, length]
|
356 |
-
"""
|
357 |
-
r = torch.arange(length, dtype=torch.float32)
|
358 |
-
diff = torch.unsqueeze(r, 0) - torch.unsqueeze(r, 1)
|
359 |
-
return torch.unsqueeze(torch.unsqueeze(-torch.log1p(torch.abs(diff)), 0), 0)
|
360 |
-
|
361 |
-
|
362 |
-
class FFN(nn.Module):
|
363 |
-
def __init__(
|
364 |
-
self,
|
365 |
-
in_channels,
|
366 |
-
out_channels,
|
367 |
-
filter_channels,
|
368 |
-
kernel_size,
|
369 |
-
p_dropout=0.0,
|
370 |
-
activation=None,
|
371 |
-
causal=False,
|
372 |
-
):
|
373 |
-
super().__init__()
|
374 |
-
self.in_channels = in_channels
|
375 |
-
self.out_channels = out_channels
|
376 |
-
self.filter_channels = filter_channels
|
377 |
-
self.kernel_size = kernel_size
|
378 |
-
self.p_dropout = p_dropout
|
379 |
-
self.activation = activation
|
380 |
-
self.causal = causal
|
381 |
-
|
382 |
-
if causal:
|
383 |
-
self.padding = self._causal_padding
|
384 |
-
else:
|
385 |
-
self.padding = self._same_padding
|
386 |
-
|
387 |
-
self.conv_1 = nn.Conv1d(in_channels, filter_channels, kernel_size)
|
388 |
-
self.conv_2 = nn.Conv1d(filter_channels, out_channels, kernel_size)
|
389 |
-
self.drop = nn.Dropout(p_dropout)
|
390 |
-
|
391 |
-
def forward(self, x, x_mask):
|
392 |
-
x = self.conv_1(self.padding(x * x_mask))
|
393 |
-
if self.activation == "gelu":
|
394 |
-
x = x * torch.sigmoid(1.702 * x)
|
395 |
-
else:
|
396 |
-
x = torch.relu(x)
|
397 |
-
x = self.drop(x)
|
398 |
-
x = self.conv_2(self.padding(x * x_mask))
|
399 |
-
return x * x_mask
|
400 |
-
|
401 |
-
def _causal_padding(self, x):
|
402 |
-
if self.kernel_size == 1:
|
403 |
-
return x
|
404 |
-
pad_l = self.kernel_size - 1
|
405 |
-
pad_r = 0
|
406 |
-
padding = [[0, 0], [0, 0], [pad_l, pad_r]]
|
407 |
-
x = F.pad(x, commons.convert_pad_shape(padding))
|
408 |
-
return x
|
409 |
-
|
410 |
-
def _same_padding(self, x):
|
411 |
-
if self.kernel_size == 1:
|
412 |
-
return x
|
413 |
-
pad_l = (self.kernel_size - 1) // 2
|
414 |
-
pad_r = self.kernel_size // 2
|
415 |
-
padding = [[0, 0], [0, 0], [pad_l, pad_r]]
|
416 |
-
x = F.pad(x, commons.convert_pad_shape(padding))
|
417 |
-
return x
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/AI-Hobbyist/Hoyo-RVC/infer_pack/modules/F0Predictor/F0Predictor.py
DELETED
@@ -1,16 +0,0 @@
|
|
1 |
-
class F0Predictor(object):
|
2 |
-
def compute_f0(self, wav, p_len):
|
3 |
-
"""
|
4 |
-
input: wav:[signal_length]
|
5 |
-
p_len:int
|
6 |
-
output: f0:[signal_length//hop_length]
|
7 |
-
"""
|
8 |
-
pass
|
9 |
-
|
10 |
-
def compute_f0_uv(self, wav, p_len):
|
11 |
-
"""
|
12 |
-
input: wav:[signal_length]
|
13 |
-
p_len:int
|
14 |
-
output: f0:[signal_length//hop_length],uv:[signal_length//hop_length]
|
15 |
-
"""
|
16 |
-
pass
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/AI-Naga/Vehicle_Damage_Detection/README.md
DELETED
@@ -1,12 +0,0 @@
|
|
1 |
-
---
|
2 |
-
title: Vehicle Damage Detection
|
3 |
-
emoji: 🏃
|
4 |
-
colorFrom: gray
|
5 |
-
colorTo: purple
|
6 |
-
sdk: gradio
|
7 |
-
sdk_version: 3.18.0
|
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/AIFILMS/generate_human_motion/VQ-Trans/utils/motion_process.py
DELETED
@@ -1,59 +0,0 @@
|
|
1 |
-
import torch
|
2 |
-
from utils.quaternion import quaternion_to_cont6d, qrot, qinv
|
3 |
-
|
4 |
-
def recover_root_rot_pos(data):
|
5 |
-
rot_vel = data[..., 0]
|
6 |
-
r_rot_ang = torch.zeros_like(rot_vel).to(data.device)
|
7 |
-
'''Get Y-axis rotation from rotation velocity'''
|
8 |
-
r_rot_ang[..., 1:] = rot_vel[..., :-1]
|
9 |
-
r_rot_ang = torch.cumsum(r_rot_ang, dim=-1)
|
10 |
-
|
11 |
-
r_rot_quat = torch.zeros(data.shape[:-1] + (4,)).to(data.device)
|
12 |
-
r_rot_quat[..., 0] = torch.cos(r_rot_ang)
|
13 |
-
r_rot_quat[..., 2] = torch.sin(r_rot_ang)
|
14 |
-
|
15 |
-
r_pos = torch.zeros(data.shape[:-1] + (3,)).to(data.device)
|
16 |
-
r_pos[..., 1:, [0, 2]] = data[..., :-1, 1:3]
|
17 |
-
'''Add Y-axis rotation to root position'''
|
18 |
-
r_pos = qrot(qinv(r_rot_quat), r_pos)
|
19 |
-
|
20 |
-
r_pos = torch.cumsum(r_pos, dim=-2)
|
21 |
-
|
22 |
-
r_pos[..., 1] = data[..., 3]
|
23 |
-
return r_rot_quat, r_pos
|
24 |
-
|
25 |
-
|
26 |
-
def recover_from_rot(data, joints_num, skeleton):
|
27 |
-
r_rot_quat, r_pos = recover_root_rot_pos(data)
|
28 |
-
|
29 |
-
r_rot_cont6d = quaternion_to_cont6d(r_rot_quat)
|
30 |
-
|
31 |
-
start_indx = 1 + 2 + 1 + (joints_num - 1) * 3
|
32 |
-
end_indx = start_indx + (joints_num - 1) * 6
|
33 |
-
cont6d_params = data[..., start_indx:end_indx]
|
34 |
-
# print(r_rot_cont6d.shape, cont6d_params.shape, r_pos.shape)
|
35 |
-
cont6d_params = torch.cat([r_rot_cont6d, cont6d_params], dim=-1)
|
36 |
-
cont6d_params = cont6d_params.view(-1, joints_num, 6)
|
37 |
-
|
38 |
-
positions = skeleton.forward_kinematics_cont6d(cont6d_params, r_pos)
|
39 |
-
|
40 |
-
return positions
|
41 |
-
|
42 |
-
|
43 |
-
def recover_from_ric(data, joints_num):
|
44 |
-
r_rot_quat, r_pos = recover_root_rot_pos(data)
|
45 |
-
positions = data[..., 4:(joints_num - 1) * 3 + 4]
|
46 |
-
positions = positions.view(positions.shape[:-1] + (-1, 3))
|
47 |
-
|
48 |
-
'''Add Y-axis rotation to local joints'''
|
49 |
-
positions = qrot(qinv(r_rot_quat[..., None, :]).expand(positions.shape[:-1] + (4,)), positions)
|
50 |
-
|
51 |
-
'''Add root XZ to joints'''
|
52 |
-
positions[..., 0] += r_pos[..., 0:1]
|
53 |
-
positions[..., 2] += r_pos[..., 2:3]
|
54 |
-
|
55 |
-
'''Concate root and joints'''
|
56 |
-
positions = torch.cat([r_pos.unsqueeze(-2), positions], dim=-2)
|
57 |
-
|
58 |
-
return positions
|
59 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/AIGC-Audio/AudioGPT/NeuralSeq/egs/datasets/audio/emotion/pre_align.py
DELETED
@@ -1,25 +0,0 @@
|
|
1 |
-
import os
|
2 |
-
|
3 |
-
from data_gen.tts.base_preprocess import BasePreprocessor
|
4 |
-
import glob
|
5 |
-
import re
|
6 |
-
|
7 |
-
class EmoPreAlign(BasePreprocessor):
|
8 |
-
|
9 |
-
def meta_data(self):
|
10 |
-
spks = ['0012', '0011', '0013', '0014', '0015', '0016', '0017', '0018', '0019', '0020']
|
11 |
-
pattern = re.compile('[\t\n ]+')
|
12 |
-
for spk in spks:
|
13 |
-
for line in open(f"{self.raw_data_dir}/{spk}/{spk}.txt", 'r'): # 打开文件
|
14 |
-
line = re.sub(pattern, ' ', line)
|
15 |
-
if line == ' ': continue
|
16 |
-
split_ = line.split(' ')
|
17 |
-
txt = ' '.join(split_[1: -2])
|
18 |
-
item_name = split_[0]
|
19 |
-
emotion = split_[-2]
|
20 |
-
wav_fn = f'{self.raw_data_dir}/{spk}/{emotion}/{item_name}.wav'
|
21 |
-
yield item_name, wav_fn, txt, spk, emotion
|
22 |
-
|
23 |
-
|
24 |
-
if __name__ == "__main__":
|
25 |
-
EmoPreAlign().process()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/AIGC-Audio/AudioGPT/text_to_audio/Make_An_Audio/ldm/models/diffusion/dpm_solver/sampler.py
DELETED
@@ -1,87 +0,0 @@
|
|
1 |
-
"""SAMPLING ONLY."""
|
2 |
-
import torch
|
3 |
-
|
4 |
-
from .dpm_solver import NoiseScheduleVP, model_wrapper, DPM_Solver
|
5 |
-
|
6 |
-
|
7 |
-
MODEL_TYPES = {
|
8 |
-
"eps": "noise",
|
9 |
-
"v": "v"
|
10 |
-
}
|
11 |
-
|
12 |
-
|
13 |
-
class DPMSolverSampler(object):
|
14 |
-
def __init__(self, model, **kwargs):
|
15 |
-
super().__init__()
|
16 |
-
self.model = model
|
17 |
-
to_torch = lambda x: x.clone().detach().to(torch.float32).to(model.device)
|
18 |
-
self.register_buffer('alphas_cumprod', to_torch(model.alphas_cumprod))
|
19 |
-
|
20 |
-
def register_buffer(self, name, attr):
|
21 |
-
if type(attr) == torch.Tensor:
|
22 |
-
if attr.device != torch.device("cuda"):
|
23 |
-
attr = attr.to(torch.device("cuda"))
|
24 |
-
setattr(self, name, attr)
|
25 |
-
|
26 |
-
@torch.no_grad()
|
27 |
-
def sample(self,
|
28 |
-
S,
|
29 |
-
batch_size,
|
30 |
-
shape,
|
31 |
-
conditioning=None,
|
32 |
-
callback=None,
|
33 |
-
normals_sequence=None,
|
34 |
-
img_callback=None,
|
35 |
-
quantize_x0=False,
|
36 |
-
eta=0.,
|
37 |
-
mask=None,
|
38 |
-
x0=None,
|
39 |
-
temperature=1.,
|
40 |
-
noise_dropout=0.,
|
41 |
-
score_corrector=None,
|
42 |
-
corrector_kwargs=None,
|
43 |
-
verbose=True,
|
44 |
-
x_T=None,
|
45 |
-
log_every_t=100,
|
46 |
-
unconditional_guidance_scale=1.,
|
47 |
-
unconditional_conditioning=None,
|
48 |
-
# this has to come in the same format as the conditioning, # e.g. as encoded tokens, ...
|
49 |
-
**kwargs
|
50 |
-
):
|
51 |
-
if conditioning is not None:
|
52 |
-
if isinstance(conditioning, dict):
|
53 |
-
cbs = conditioning[list(conditioning.keys())[0]].shape[0]
|
54 |
-
if cbs != batch_size:
|
55 |
-
print(f"Warning: Got {cbs} conditionings but batch-size is {batch_size}")
|
56 |
-
else:
|
57 |
-
if conditioning.shape[0] != batch_size:
|
58 |
-
print(f"Warning: Got {conditioning.shape[0]} conditionings but batch-size is {batch_size}")
|
59 |
-
|
60 |
-
# sampling
|
61 |
-
C, H, W = shape
|
62 |
-
size = (batch_size, C, H, W)
|
63 |
-
|
64 |
-
print(f'Data shape for DPM-Solver sampling is {size}, sampling steps {S}')
|
65 |
-
|
66 |
-
device = self.model.betas.device
|
67 |
-
if x_T is None:
|
68 |
-
img = torch.randn(size, device=device)
|
69 |
-
else:
|
70 |
-
img = x_T
|
71 |
-
|
72 |
-
ns = NoiseScheduleVP('discrete', alphas_cumprod=self.alphas_cumprod)
|
73 |
-
|
74 |
-
model_fn = model_wrapper(
|
75 |
-
lambda x, t, c: self.model.apply_model(x, t, c),
|
76 |
-
ns,
|
77 |
-
model_type=MODEL_TYPES[self.model.parameterization],
|
78 |
-
guidance_type="classifier-free",
|
79 |
-
condition=conditioning,
|
80 |
-
unconditional_condition=unconditional_conditioning,
|
81 |
-
guidance_scale=unconditional_guidance_scale,
|
82 |
-
)
|
83 |
-
|
84 |
-
dpm_solver = DPM_Solver(model_fn, ns, predict_x0=True, thresholding=False)
|
85 |
-
x = dpm_solver.sample(img, steps=S, skip_type="time_uniform", method="multistep", order=2, lower_order_final=True)
|
86 |
-
|
87 |
-
return x.to(device), None
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/AISuperheroes/01ST-CSV-Dataset-Analyzer/download.py
DELETED
@@ -1,139 +0,0 @@
|
|
1 |
-
import streamlit as st
|
2 |
-
import pickle
|
3 |
-
import pandas as pd
|
4 |
-
import json
|
5 |
-
import base64
|
6 |
-
import uuid
|
7 |
-
import re
|
8 |
-
|
9 |
-
import importlib.util
|
10 |
-
|
11 |
-
|
12 |
-
def import_from_file(module_name: str, filepath: str):
|
13 |
-
"""
|
14 |
-
Imports a module from file.
|
15 |
-
Args:
|
16 |
-
module_name (str): Assigned to the module's __name__ parameter (does not
|
17 |
-
influence how the module is named outside of this function)
|
18 |
-
filepath (str): Path to the .py file
|
19 |
-
Returns:
|
20 |
-
The module
|
21 |
-
"""
|
22 |
-
spec = importlib.util.spec_from_file_location(module_name, filepath)
|
23 |
-
module = importlib.util.module_from_spec(spec)
|
24 |
-
spec.loader.exec_module(module)
|
25 |
-
return module
|
26 |
-
|
27 |
-
|
28 |
-
def notebook_header(text):
|
29 |
-
"""
|
30 |
-
Insert section header into a jinja file, formatted as notebook cell.
|
31 |
-
Leave 2 blank lines before the header.
|
32 |
-
"""
|
33 |
-
return f"""# # {text}
|
34 |
-
"""
|
35 |
-
|
36 |
-
|
37 |
-
def code_header(text):
|
38 |
-
"""
|
39 |
-
Insert section header into a jinja file, formatted as Python comment.
|
40 |
-
Leave 2 blank lines before the header.
|
41 |
-
"""
|
42 |
-
seperator_len = (75 - len(text)) / 2
|
43 |
-
seperator_len_left = math.floor(seperator_len)
|
44 |
-
seperator_len_right = math.ceil(seperator_len)
|
45 |
-
return f"# {'-' * seperator_len_left} {text} {'-' * seperator_len_right}"
|
46 |
-
|
47 |
-
|
48 |
-
def to_notebook(code):
|
49 |
-
"""Converts Python code to Jupyter notebook format."""
|
50 |
-
notebook = jupytext.reads(code, fmt="py")
|
51 |
-
return jupytext.writes(notebook, fmt="ipynb")
|
52 |
-
|
53 |
-
|
54 |
-
def open_link(url, new_tab=True):
|
55 |
-
"""Dirty hack to open a new web page with a streamlit button."""
|
56 |
-
# From: https://discuss.streamlit.io/t/how-to-link-a-button-to-a-webpage/1661/3
|
57 |
-
if new_tab:
|
58 |
-
js = f"window.open('{url}')" # New tab or window
|
59 |
-
else:
|
60 |
-
js = f"window.location.href = '{url}'" # Current tab
|
61 |
-
html = '<img src onerror="{}">'.format(js)
|
62 |
-
div = Div(text=html)
|
63 |
-
st.bokeh_chart(div)
|
64 |
-
|
65 |
-
|
66 |
-
def download_button(object_to_download, download_filename, button_text):
|
67 |
-
"""
|
68 |
-
Generates a link to download the given object_to_download.
|
69 |
-
From: https://discuss.streamlit.io/t/a-download-button-with-custom-css/4220
|
70 |
-
Params:
|
71 |
-
------
|
72 |
-
object_to_download: The object to be downloaded.
|
73 |
-
download_filename (str): filename and extension of file. e.g. mydata.csv,
|
74 |
-
some_txt_output.txt download_link_text (str): Text to display for download
|
75 |
-
link.
|
76 |
-
button_text (str): Text to display on download button (e.g. 'click here to download file')
|
77 |
-
pickle_it (bool): If True, pickle file.
|
78 |
-
Returns:
|
79 |
-
-------
|
80 |
-
(str): the anchor tag to download object_to_download
|
81 |
-
Examples:
|
82 |
-
--------
|
83 |
-
download_link(your_df, 'YOUR_DF.csv', 'Click to download data!')
|
84 |
-
download_link(your_str, 'YOUR_STRING.txt', 'Click to download text!')
|
85 |
-
"""
|
86 |
-
|
87 |
-
# if:
|
88 |
-
if isinstance(object_to_download, bytes):
|
89 |
-
pass
|
90 |
-
|
91 |
-
elif isinstance(object_to_download, pd.DataFrame):
|
92 |
-
object_to_download = object_to_download.to_csv(index=False)
|
93 |
-
# Try JSON encode for everything else
|
94 |
-
else:
|
95 |
-
object_to_download = json.dumps(object_to_download)
|
96 |
-
|
97 |
-
try:
|
98 |
-
# some strings <-> bytes conversions necessary here
|
99 |
-
b64 = base64.b64encode(object_to_download.encode()).decode()
|
100 |
-
except AttributeError as e:
|
101 |
-
b64 = base64.b64encode(object_to_download).decode()
|
102 |
-
|
103 |
-
button_uuid = str(uuid.uuid4()).replace("-", "")
|
104 |
-
button_id = re.sub("\d+", "", button_uuid)
|
105 |
-
|
106 |
-
custom_css = f"""
|
107 |
-
<style>
|
108 |
-
#{button_id} {{
|
109 |
-
display: inline-flex;
|
110 |
-
align-items: center;
|
111 |
-
justify-content: center;
|
112 |
-
background-color: rgb(255, 255, 255);
|
113 |
-
color: rgb(38, 39, 48);
|
114 |
-
padding: .25rem .75rem;
|
115 |
-
position: relative;
|
116 |
-
text-decoration: none;
|
117 |
-
border-radius: 4px;
|
118 |
-
border-width: 1px;
|
119 |
-
border-style: solid;
|
120 |
-
border-color: rgb(230, 234, 241);
|
121 |
-
border-image: initial;
|
122 |
-
}}
|
123 |
-
#{button_id}:hover {{
|
124 |
-
border-color: rgb(246, 51, 102);
|
125 |
-
color: rgb(246, 51, 102);
|
126 |
-
}}
|
127 |
-
#{button_id}:active {{
|
128 |
-
box-shadow: none;
|
129 |
-
background-color: rgb(246, 51, 102);
|
130 |
-
color: white;
|
131 |
-
}}
|
132 |
-
</style> """
|
133 |
-
|
134 |
-
dl_link = (
|
135 |
-
custom_css
|
136 |
-
+ f'<a download="{download_filename}" id="{button_id}" href="data:file/txt;base64,{b64}">{button_text}</a><br><br>'
|
137 |
-
)
|
138 |
-
|
139 |
-
st.markdown(dl_link, unsafe_allow_html=True)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/ATang0729/Forecast4Muses/Model/Model6/Model6_1_ClothesKeyPoint/work_dirs_1-x/td_hm_res50_4xb64-120e_deepfashion2_long_sleeved_shirt_256x192/__init__.py
DELETED
File without changes
|
spaces/AbandonedMuse/UnlimitedMusicGen/audiocraft/models/lm.py
DELETED
@@ -1,527 +0,0 @@
|
|
1 |
-
# Copyright (c) Meta Platforms, Inc. and affiliates.
|
2 |
-
# All rights reserved.
|
3 |
-
#
|
4 |
-
# This source code is licensed under the license found in the
|
5 |
-
# LICENSE file in the root directory of this source tree.
|
6 |
-
|
7 |
-
from dataclasses import dataclass
|
8 |
-
from functools import partial
|
9 |
-
import logging
|
10 |
-
import math
|
11 |
-
import typing as tp
|
12 |
-
|
13 |
-
import torch
|
14 |
-
from torch import nn
|
15 |
-
|
16 |
-
from ..utils import utils
|
17 |
-
from ..modules.streaming import StreamingModule, State
|
18 |
-
from ..modules.transformer import StreamingTransformer, create_norm_fn
|
19 |
-
from ..modules.conditioners import (
|
20 |
-
ConditionFuser,
|
21 |
-
ClassifierFreeGuidanceDropout,
|
22 |
-
AttributeDropout,
|
23 |
-
ConditioningProvider,
|
24 |
-
ConditioningAttributes,
|
25 |
-
ConditionType,
|
26 |
-
)
|
27 |
-
from ..modules.codebooks_patterns import CodebooksPatternProvider
|
28 |
-
from ..modules.activations import get_activation_fn
|
29 |
-
|
30 |
-
|
31 |
-
logger = logging.getLogger(__name__)
|
32 |
-
ConditionTensors = tp.Dict[str, ConditionType]
|
33 |
-
CFGConditions = tp.Union[ConditionTensors, tp.Tuple[ConditionTensors, ConditionTensors]]
|
34 |
-
|
35 |
-
|
36 |
-
def get_init_fn(method: str, input_dim: int, init_depth: tp.Optional[int] = None):
|
37 |
-
"""LM layer initialization.
|
38 |
-
Inspired from xlformers: https://github.com/fairinternal/xlformers
|
39 |
-
|
40 |
-
Args:
|
41 |
-
method (str): Method name for init function. Valid options are:
|
42 |
-
'gaussian', 'uniform'.
|
43 |
-
input_dim (int): Input dimension of the initialized module.
|
44 |
-
init_depth (Optional[int]): Optional init depth value used to rescale
|
45 |
-
the standard deviation if defined.
|
46 |
-
"""
|
47 |
-
# Compute std
|
48 |
-
std = 1 / math.sqrt(input_dim)
|
49 |
-
# Rescale with depth
|
50 |
-
if init_depth is not None:
|
51 |
-
std = std / math.sqrt(2 * init_depth)
|
52 |
-
|
53 |
-
if method == 'gaussian':
|
54 |
-
return partial(
|
55 |
-
torch.nn.init.trunc_normal_, mean=0.0, std=std, a=-3 * std, b=3 * std
|
56 |
-
)
|
57 |
-
elif method == 'uniform':
|
58 |
-
bound = math.sqrt(3) * std # ensure the standard deviation is `std`
|
59 |
-
return partial(torch.nn.init.uniform_, a=-bound, b=bound)
|
60 |
-
else:
|
61 |
-
raise ValueError("Unsupported layer initialization method")
|
62 |
-
|
63 |
-
|
64 |
-
def init_layer(m: nn.Module,
|
65 |
-
method: str,
|
66 |
-
init_depth: tp.Optional[int] = None,
|
67 |
-
zero_bias_init: bool = False):
|
68 |
-
"""Wrapper around ``get_init_fn`` for proper initialization of LM modules.
|
69 |
-
|
70 |
-
Args:
|
71 |
-
m (nn.Module): Module to initialize.
|
72 |
-
method (str): Method name for the init function.
|
73 |
-
init_depth (Optional[int]): Optional init depth value used to rescale
|
74 |
-
the standard deviation if defined.
|
75 |
-
zero_bias_init (bool): Whether to initialize the bias to 0 or not.
|
76 |
-
"""
|
77 |
-
if isinstance(m, nn.Linear):
|
78 |
-
init_fn = get_init_fn(method, m.in_features, init_depth=init_depth)
|
79 |
-
if m.weight.device.type == 'cpu' and m.weight.dtype == torch.float16:
|
80 |
-
weight = m.weight.float()
|
81 |
-
init_fn(weight)
|
82 |
-
m.weight.data[:] = weight.half()
|
83 |
-
else:
|
84 |
-
init_fn(m.weight)
|
85 |
-
if zero_bias_init and m.bias is not None:
|
86 |
-
nn.init.constant_(m.bias, 0)
|
87 |
-
elif isinstance(m, nn.Embedding):
|
88 |
-
init_fn = get_init_fn(method, m.embedding_dim, init_depth=None)
|
89 |
-
if m.weight.device.type == 'cpu' and m.weight.dtype == torch.float16:
|
90 |
-
weight = m.weight.float()
|
91 |
-
init_fn(weight)
|
92 |
-
m.weight.data[:] = weight.half()
|
93 |
-
else:
|
94 |
-
init_fn(m.weight)
|
95 |
-
|
96 |
-
|
97 |
-
class ScaledEmbedding(nn.Embedding):
|
98 |
-
"""Boost learning rate for embeddings (with `scale`).
|
99 |
-
"""
|
100 |
-
def __init__(self, *args, lr=None, **kwargs):
|
101 |
-
super().__init__(*args, **kwargs)
|
102 |
-
self.lr = lr
|
103 |
-
|
104 |
-
def make_optim_group(self):
|
105 |
-
group = {"params": list(self.parameters())}
|
106 |
-
if self.lr is not None:
|
107 |
-
group["lr"] = self.lr
|
108 |
-
return group
|
109 |
-
|
110 |
-
|
111 |
-
@dataclass
|
112 |
-
class LMOutput:
|
113 |
-
# The logits are already re-aligned with the input codes
|
114 |
-
# hence no extra shift is required, e.g. when computing CE
|
115 |
-
logits: torch.Tensor # [B, K, T, card]
|
116 |
-
mask: torch.Tensor # [B, K, T]
|
117 |
-
|
118 |
-
|
119 |
-
class LMModel(StreamingModule):
|
120 |
-
"""Transformer-based language model on multiple streams of codes.
|
121 |
-
|
122 |
-
Args:
|
123 |
-
pattern_provider (CodebooksPatternProvider): Pattern provider for codebook interleaving.
|
124 |
-
condition_provider (MusicConditioningProvider): Conditioning provider from metadata.
|
125 |
-
fuser (ConditionFuser): Fuser handling the fusing of conditions with language model input.
|
126 |
-
n_q (int): Number of parallel streams to model.
|
127 |
-
card (int): Cardinality, vocabulary size.
|
128 |
-
dim (int): Dimension of the transformer encoder.
|
129 |
-
num_heads (int): Number of heads for the transformer encoder.
|
130 |
-
hidden_scale (int): Scale for hidden feed forward dimension of the transformer encoder.
|
131 |
-
norm (str): Normalization method.
|
132 |
-
norm_first (bool): Use pre-norm instead of post-norm.
|
133 |
-
emb_lr (Optional[float]): Embedding-specific learning rate.
|
134 |
-
bias_proj (bool): Use bias for output projections.
|
135 |
-
weight_init (Optional[str]): Method for weight initialization.
|
136 |
-
depthwise_init (Optional[str]): Method for depthwise weight initialization.
|
137 |
-
zero_bias_init (bool): If true and bias in Linears, initialize bias to zeros.
|
138 |
-
cfg_dropout (float): Classifier-free guidance dropout.
|
139 |
-
cfg_coef (float): Classifier-free guidance coefficient.
|
140 |
-
attribute_dropout (dict): Attribute dropout probabilities.
|
141 |
-
two_step_cfg (bool): Whether to run classifier free-guidance with 2 distinct steps.
|
142 |
-
**kwargs: Additional parameters for the transformer encoder.
|
143 |
-
"""
|
144 |
-
def __init__(self, pattern_provider: CodebooksPatternProvider, condition_provider: ConditioningProvider,
|
145 |
-
fuser: ConditionFuser, n_q: int = 8, card: int = 1024, dim: int = 128, num_heads: int = 8,
|
146 |
-
hidden_scale: int = 4, norm: str = 'layer_norm', norm_first: bool = False,
|
147 |
-
emb_lr: tp.Optional[float] = None, bias_proj: bool = True,
|
148 |
-
weight_init: tp.Optional[str] = None, depthwise_init: tp.Optional[str] = None,
|
149 |
-
zero_bias_init: bool = False, cfg_dropout: float = 0, cfg_coef: float = 1.0,
|
150 |
-
attribute_dropout: tp.Dict[str, tp.Dict[str, float]] = {}, two_step_cfg: bool = False,
|
151 |
-
**kwargs):
|
152 |
-
super().__init__()
|
153 |
-
self.cfg_coef = cfg_coef
|
154 |
-
self.cfg_dropout = ClassifierFreeGuidanceDropout(p=cfg_dropout)
|
155 |
-
self.att_dropout = AttributeDropout(p=attribute_dropout)
|
156 |
-
self.condition_provider = condition_provider
|
157 |
-
self.fuser = fuser
|
158 |
-
self.card = card
|
159 |
-
embed_dim = self.card + 1
|
160 |
-
self.n_q = n_q
|
161 |
-
self.dim = dim
|
162 |
-
self.pattern_provider = pattern_provider
|
163 |
-
self.two_step_cfg = two_step_cfg
|
164 |
-
self.emb = nn.ModuleList([ScaledEmbedding(embed_dim, dim, lr=emb_lr) for _ in range(n_q)])
|
165 |
-
if 'activation' in kwargs:
|
166 |
-
kwargs['activation'] = get_activation_fn(kwargs['activation'])
|
167 |
-
self.transformer = StreamingTransformer(
|
168 |
-
d_model=dim, num_heads=num_heads, dim_feedforward=int(hidden_scale * dim),
|
169 |
-
norm=norm, norm_first=norm_first, **kwargs)
|
170 |
-
self.out_norm: tp.Optional[nn.Module] = None
|
171 |
-
if norm_first:
|
172 |
-
self.out_norm = create_norm_fn(norm, dim)
|
173 |
-
self.linears = nn.ModuleList([nn.Linear(dim, self.card, bias=bias_proj) for _ in range(n_q)])
|
174 |
-
self._init_weights(weight_init, depthwise_init, zero_bias_init)
|
175 |
-
self._fsdp: tp.Optional[nn.Module]
|
176 |
-
self.__dict__['_fsdp'] = None
|
177 |
-
|
178 |
-
def _init_weights(self, weight_init: tp.Optional[str], depthwise_init: tp.Optional[str], zero_bias_init: bool):
|
179 |
-
"""Initialization of the transformer module weights.
|
180 |
-
|
181 |
-
Args:
|
182 |
-
weight_init (Optional[str]): Weight initialization strategy. See ``get_init_fn`` for valid options.
|
183 |
-
depthwise_init (Optional[str]): Depwthwise initialization strategy. The following options are valid:
|
184 |
-
'current' where the depth corresponds to the current layer index or 'global' where the total number
|
185 |
-
of layer is used as depth. If not set, no depthwise initialization strategy is used.
|
186 |
-
zero_bias_init (bool): Whether to initalize bias to zero or not.
|
187 |
-
"""
|
188 |
-
assert depthwise_init is None or depthwise_init in ['current', 'global']
|
189 |
-
assert depthwise_init is None or weight_init is not None, \
|
190 |
-
"If 'depthwise_init' is defined, a 'weight_init' method should be provided."
|
191 |
-
assert not zero_bias_init or weight_init is not None, \
|
192 |
-
"If 'zero_bias_init', a 'weight_init' method should be provided"
|
193 |
-
|
194 |
-
if weight_init is None:
|
195 |
-
return
|
196 |
-
|
197 |
-
for emb_layer in self.emb:
|
198 |
-
init_layer(emb_layer, method=weight_init, init_depth=None, zero_bias_init=zero_bias_init)
|
199 |
-
|
200 |
-
for layer_idx, tr_layer in enumerate(self.transformer.layers):
|
201 |
-
depth = None
|
202 |
-
if depthwise_init == 'current':
|
203 |
-
depth = layer_idx + 1
|
204 |
-
elif depthwise_init == 'global':
|
205 |
-
depth = len(self.transformer.layers)
|
206 |
-
init_fn = partial(init_layer, method=weight_init, init_depth=depth, zero_bias_init=zero_bias_init)
|
207 |
-
tr_layer.apply(init_fn)
|
208 |
-
|
209 |
-
for linear in self.linears:
|
210 |
-
init_layer(linear, method=weight_init, init_depth=None, zero_bias_init=zero_bias_init)
|
211 |
-
|
212 |
-
@property
|
213 |
-
def special_token_id(self) -> int:
|
214 |
-
return self.card
|
215 |
-
|
216 |
-
@property
|
217 |
-
def num_codebooks(self) -> int:
|
218 |
-
return self.n_q
|
219 |
-
|
220 |
-
def forward(self, sequence: torch.Tensor,
|
221 |
-
conditions: tp.List[ConditioningAttributes],
|
222 |
-
condition_tensors: tp.Optional[ConditionTensors] = None) -> torch.Tensor:
|
223 |
-
"""Apply language model on sequence and conditions.
|
224 |
-
Given a tensor of sequence of shape [B, K, S] with K the number of codebooks and
|
225 |
-
S the sequence steps, return the logits with shape [B, card, K, S].
|
226 |
-
|
227 |
-
Args:
|
228 |
-
indices (torch.Tensor): indices of the codes to model.
|
229 |
-
conditions (list[ConditioningAttributes]): conditionings to use when modeling
|
230 |
-
the given codes. Note that when evaluating multiple time with the same conditioning
|
231 |
-
you should pre-compute those and pass them as `condition_tensors`.
|
232 |
-
condition_tensors (dict[str, ConditionType] or None): pre-computed conditioning
|
233 |
-
tensors, see `conditions`.
|
234 |
-
Returns:
|
235 |
-
torch.Tensor: Logits.
|
236 |
-
"""
|
237 |
-
B, K, S = sequence.shape
|
238 |
-
assert K == self.num_codebooks, 'Sequence shape must match the specified number of codebooks'
|
239 |
-
input_ = sum([self.emb[k](sequence[:, k]) for k in range(K)])
|
240 |
-
if condition_tensors is None:
|
241 |
-
assert not self._is_streaming, "Conditions tensors should be precomputed when streaming."
|
242 |
-
# apply dropout modules
|
243 |
-
conditions = self.cfg_dropout(conditions)
|
244 |
-
conditions = self.att_dropout(conditions)
|
245 |
-
tokenized = self.condition_provider.tokenize(conditions)
|
246 |
-
# encode conditions and fuse, both have a streaming cache to not recompute when generating.
|
247 |
-
condition_tensors = self.condition_provider(tokenized)
|
248 |
-
else:
|
249 |
-
assert not conditions, "Shouldn't pass both conditions and condition_tensors."
|
250 |
-
|
251 |
-
input_, cross_attention_input = self.fuser(input_, condition_tensors)
|
252 |
-
|
253 |
-
out = self.transformer(input_, cross_attention_src=cross_attention_input)
|
254 |
-
if self.out_norm:
|
255 |
-
out = self.out_norm(out)
|
256 |
-
logits = torch.stack([self.linears[k](out) for k in range(K)], dim=1) # [B, K, S, card]
|
257 |
-
|
258 |
-
# remove the prefix from the model outputs
|
259 |
-
if len(self.fuser.fuse2cond['prepend']) > 0:
|
260 |
-
logits = logits[:, :, -S:]
|
261 |
-
|
262 |
-
return logits # [B, K, S, card]
|
263 |
-
|
264 |
-
def compute_predictions(
|
265 |
-
self, codes: torch.Tensor,
|
266 |
-
conditions: tp.List[ConditioningAttributes],
|
267 |
-
condition_tensors: tp.Optional[ConditionTensors] = None) -> LMOutput:
|
268 |
-
"""Given an input tensor of codes [B, K, T] and list of conditions, runs the model
|
269 |
-
forward using the specified codes interleaving pattern.
|
270 |
-
|
271 |
-
Args:
|
272 |
-
codes (torch.Tensor): Input codes of shape [B, K, T] with B the batch size,
|
273 |
-
K the number of codebooks and T the number of timesteps.
|
274 |
-
conditions (list[ConditioningAttributes]): conditionings to use when modeling
|
275 |
-
the given codes. Note that when evaluating multiple time with the same conditioning
|
276 |
-
you should pre-compute those and pass them as `condition_tensors`.
|
277 |
-
condition_tensors (dict[str, ConditionType] or None): pre-computed conditioning
|
278 |
-
tensors, see `conditions`.
|
279 |
-
Returns:
|
280 |
-
LMOutput: Language model outputs
|
281 |
-
logits (torch.Tensor) of shape [B, K, T, card] corresponding to the provided codes,
|
282 |
-
i.e. the first item corresponds to logits to predict the first code, meaning that
|
283 |
-
no additional shifting of codes and logits is required.
|
284 |
-
mask (torch.Tensor) of shape [B, K, T], mask over valid and invalid positions.
|
285 |
-
Given the specified interleaving strategies, parts of the logits and codes should
|
286 |
-
not be considered as valid predictions because of invalid context.
|
287 |
-
"""
|
288 |
-
B, K, T = codes.shape
|
289 |
-
codes = codes.contiguous()
|
290 |
-
# map codes [B, K, T] into pattern sequence [B, K, S] using special_token_id for masked tokens
|
291 |
-
pattern = self.pattern_provider.get_pattern(T)
|
292 |
-
sequence_codes, sequence_indexes, sequence_mask = pattern.build_pattern_sequence(
|
293 |
-
codes, self.special_token_id, keep_only_valid_steps=True
|
294 |
-
)
|
295 |
-
# apply model on pattern sequence
|
296 |
-
model = self if self._fsdp is None else self._fsdp
|
297 |
-
logits = model(sequence_codes, conditions, condition_tensors) # [B, K, S, card]
|
298 |
-
# map back the logits on pattern sequence to logits on original codes: [B, K, S, card] -> [B, K, T, card]
|
299 |
-
# and provide the corresponding mask over invalid positions of tokens
|
300 |
-
logits = logits.permute(0, 3, 1, 2) # [B, card, K, S]
|
301 |
-
# note: we use nans as special token to make it obvious if we feed unexpected logits
|
302 |
-
logits, logits_indexes, logits_mask = pattern.revert_pattern_logits(
|
303 |
-
logits, float('nan'), keep_only_valid_steps=True
|
304 |
-
)
|
305 |
-
logits = logits.permute(0, 2, 3, 1) # [B, K, T, card]
|
306 |
-
logits_mask = logits_mask[None, :, :].expand(B, -1, -1) # [K, T] -> [B, K, T]
|
307 |
-
return LMOutput(logits, logits_mask)
|
308 |
-
|
309 |
-
def _sample_next_token(self,
|
310 |
-
sequence: torch.Tensor,
|
311 |
-
cfg_conditions: CFGConditions,
|
312 |
-
unconditional_state: State,
|
313 |
-
use_sampling: bool = False,
|
314 |
-
temp: float = 1.0,
|
315 |
-
top_k: int = 0,
|
316 |
-
top_p: float = 0.0,
|
317 |
-
cfg_coef: tp.Optional[float] = None) -> torch.Tensor:
|
318 |
-
"""Sample next token from the model given a sequence and a set of conditions. The model supports
|
319 |
-
multiple sampling strategies (greedy sampling, softmax, top-k, top-p...).
|
320 |
-
|
321 |
-
Args:
|
322 |
-
sequence (torch.Tensor): Current sequence of shape [B, K, S]
|
323 |
-
with K corresponding to the number of codebooks and S the number of sequence steps.
|
324 |
-
S = 1 in streaming mode, except for the first step that contains a bigger prompt.
|
325 |
-
condition_tensors (Dict[str, ConditionType): Set of conditions. If CFG is used,
|
326 |
-
should be twice the batch size, being the concatenation of the conditions + null conditions.
|
327 |
-
use_sampling (bool): Whether to use a sampling strategy or not.
|
328 |
-
temp (float): Sampling temperature.
|
329 |
-
top_k (int): K for "top-k" sampling.
|
330 |
-
top_p (float): P for "top-p" sampling.
|
331 |
-
cfg_coef (float): classifier free guidance coefficient
|
332 |
-
Returns:
|
333 |
-
next_token (torch.Tensor): Next token tensor of shape [B, K, 1].
|
334 |
-
"""
|
335 |
-
B = sequence.shape[0]
|
336 |
-
cfg_coef = self.cfg_coef if cfg_coef is None else cfg_coef
|
337 |
-
model = self if self._fsdp is None else self._fsdp
|
338 |
-
if self.two_step_cfg and cfg_conditions != {}:
|
339 |
-
assert isinstance(cfg_conditions, tuple)
|
340 |
-
condition_tensors, null_condition_tensors = cfg_conditions
|
341 |
-
cond_logits = model(sequence, conditions=[], condition_tensors=condition_tensors)
|
342 |
-
state = self.get_streaming_state()
|
343 |
-
self.set_streaming_state(unconditional_state)
|
344 |
-
uncond_logits = model(sequence, conditions=[], condition_tensors=null_condition_tensors)
|
345 |
-
unconditional_state.update(self.get_streaming_state())
|
346 |
-
self.set_streaming_state(state)
|
347 |
-
logits = uncond_logits + (cond_logits - uncond_logits) * self.cfg_coef
|
348 |
-
else:
|
349 |
-
assert isinstance(cfg_conditions, dict)
|
350 |
-
condition_tensors = cfg_conditions
|
351 |
-
if condition_tensors:
|
352 |
-
# Preparing for CFG, predicting both conditional and unconditional logits.
|
353 |
-
sequence = torch.cat([sequence, sequence], dim=0)
|
354 |
-
all_logits = model(
|
355 |
-
sequence,
|
356 |
-
conditions=[], condition_tensors=condition_tensors)
|
357 |
-
if condition_tensors:
|
358 |
-
cond_logits, uncond_logits = all_logits.split(B, dim=0) # [B, K, T, card]
|
359 |
-
logits = uncond_logits + (cond_logits - uncond_logits) * cfg_coef
|
360 |
-
else:
|
361 |
-
logits = all_logits
|
362 |
-
|
363 |
-
logits = logits.permute(0, 1, 3, 2) # [B, K, card, T]
|
364 |
-
logits = logits[..., -1] # [B x K x card]
|
365 |
-
|
366 |
-
# Apply softmax for sampling if temp > 0. Else, do greedy sampling to avoid zero division error.
|
367 |
-
if use_sampling and temp > 0.0:
|
368 |
-
probs = torch.softmax(logits / temp, dim=-1)
|
369 |
-
if top_p > 0.0:
|
370 |
-
next_token = utils.sample_top_p(probs, p=top_p)
|
371 |
-
elif top_k > 0:
|
372 |
-
next_token = utils.sample_top_k(probs, k=top_k)
|
373 |
-
else:
|
374 |
-
next_token = utils.multinomial(probs, num_samples=1)
|
375 |
-
else:
|
376 |
-
next_token = torch.argmax(logits, dim=-1, keepdim=True)
|
377 |
-
|
378 |
-
return next_token
|
379 |
-
|
380 |
-
@torch.no_grad()
|
381 |
-
def generate(self,
|
382 |
-
prompt: tp.Optional[torch.Tensor] = None,
|
383 |
-
conditions: tp.List[ConditioningAttributes] = [],
|
384 |
-
num_samples: tp.Optional[int] = None,
|
385 |
-
max_gen_len: int = 256,
|
386 |
-
use_sampling: bool = True,
|
387 |
-
temp: float = 1.0,
|
388 |
-
top_k: int = 250,
|
389 |
-
top_p: float = 0.0,
|
390 |
-
cfg_coef: tp.Optional[float] = None,
|
391 |
-
two_step_cfg: bool = False,
|
392 |
-
remove_prompts: bool = False,
|
393 |
-
check: bool = False,
|
394 |
-
callback: tp.Optional[tp.Callable[[int, int], None]] = None) -> torch.Tensor:
|
395 |
-
"""Generate tokens sampling from the model given a prompt or unconditionally. Generation can
|
396 |
-
be perform in a greedy fashion or using sampling with top K and top P strategies.
|
397 |
-
|
398 |
-
Args:
|
399 |
-
prompt (Optional[torch.Tensor]): Prompt tokens of shape [B, K, T].
|
400 |
-
conditions_tensors (Dict[str, torch.Tensor]): Set of conditions or None.
|
401 |
-
num_samples (int or None): Number of samples to generate when no prompt and no conditions are given.
|
402 |
-
max_gen_len (int): Maximum generation length.
|
403 |
-
use_sampling (bool): Whether to use a sampling strategy or not.
|
404 |
-
temp (float): Sampling temperature.
|
405 |
-
top_k (int): K for "top-k" sampling.
|
406 |
-
top_p (float): P for "top-p" sampling.
|
407 |
-
remove_prompts (bool): Whether to remove prompts from generation or not.
|
408 |
-
Returns:
|
409 |
-
torch.Tensor: Generated tokens.
|
410 |
-
"""
|
411 |
-
assert not self.training, "generation shouldn't be used in training mode."
|
412 |
-
first_param = next(iter(self.parameters()))
|
413 |
-
device = first_param.device
|
414 |
-
|
415 |
-
# Checking all input shapes are consistents.
|
416 |
-
possible_num_samples = []
|
417 |
-
if num_samples is not None:
|
418 |
-
possible_num_samples.append(num_samples)
|
419 |
-
elif prompt is not None:
|
420 |
-
possible_num_samples.append(prompt.shape[0])
|
421 |
-
elif conditions:
|
422 |
-
possible_num_samples.append(len(conditions))
|
423 |
-
else:
|
424 |
-
possible_num_samples.append(1)
|
425 |
-
assert [x == possible_num_samples[0] for x in possible_num_samples], "Inconsitent inputs shapes"
|
426 |
-
num_samples = possible_num_samples[0]
|
427 |
-
|
428 |
-
# below we create set of conditions: one conditional and one unconditional
|
429 |
-
# to do that we merge the regular condition together with the null condition
|
430 |
-
# we then do 1 forward pass instead of 2.
|
431 |
-
# the reason for that is two-fold:
|
432 |
-
# 1. it is about x2 faster than doing 2 forward passes
|
433 |
-
# 2. avoid the streaming API treating the 2 passes as part of different time steps
|
434 |
-
# We also support doing two different passes, in particular to ensure that
|
435 |
-
# the padding structure is exactly the same between train anf test.
|
436 |
-
# With a batch size of 1, this can be slower though.
|
437 |
-
cfg_conditions: CFGConditions
|
438 |
-
two_step_cfg = self.two_step_cfg if two_step_cfg is None else two_step_cfg
|
439 |
-
if conditions:
|
440 |
-
null_conditions = ClassifierFreeGuidanceDropout(p=1.0)(conditions)
|
441 |
-
if two_step_cfg:
|
442 |
-
cfg_conditions = (
|
443 |
-
self.condition_provider(self.condition_provider.tokenize(conditions)),
|
444 |
-
self.condition_provider(self.condition_provider.tokenize(null_conditions)),
|
445 |
-
)
|
446 |
-
else:
|
447 |
-
conditions = conditions + null_conditions
|
448 |
-
tokenized = self.condition_provider.tokenize(conditions)
|
449 |
-
cfg_conditions = self.condition_provider(tokenized)
|
450 |
-
else:
|
451 |
-
cfg_conditions = {}
|
452 |
-
|
453 |
-
if prompt is None:
|
454 |
-
assert num_samples > 0
|
455 |
-
prompt = torch.zeros((num_samples, self.num_codebooks, 0), dtype=torch.long, device=device)
|
456 |
-
|
457 |
-
B, K, T = prompt.shape
|
458 |
-
start_offset = T
|
459 |
-
assert start_offset < max_gen_len
|
460 |
-
|
461 |
-
pattern = self.pattern_provider.get_pattern(max_gen_len)
|
462 |
-
# this token is used as default value for codes that are not generated yet
|
463 |
-
unknown_token = -1
|
464 |
-
|
465 |
-
# we generate codes up to the max_gen_len that will be mapped to the pattern sequence
|
466 |
-
gen_codes = torch.full((B, K, max_gen_len), unknown_token, dtype=torch.long, device=device)
|
467 |
-
# filling the gen_codes with the prompt if needed
|
468 |
-
gen_codes[..., :start_offset] = prompt
|
469 |
-
# create the gen_sequence with proper interleaving from the pattern: [B, K, S]
|
470 |
-
gen_sequence, indexes, mask = pattern.build_pattern_sequence(gen_codes, self.special_token_id)
|
471 |
-
# retrieve the start_offset in the sequence:
|
472 |
-
# it is the first sequence step that contains the `start_offset` timestep
|
473 |
-
start_offset_sequence = pattern.get_first_step_with_timesteps(start_offset)
|
474 |
-
assert start_offset_sequence is not None
|
475 |
-
|
476 |
-
with self.streaming():
|
477 |
-
unconditional_state = self.get_streaming_state()
|
478 |
-
prev_offset = 0
|
479 |
-
gen_sequence_len = gen_sequence.shape[-1] # gen_sequence shape is [B, K, S]
|
480 |
-
for offset in range(start_offset_sequence, gen_sequence_len):
|
481 |
-
# get current sequence (note that the streaming API is providing the caching over previous offsets)
|
482 |
-
curr_sequence = gen_sequence[..., prev_offset:offset]
|
483 |
-
curr_mask = mask[None, ..., prev_offset:offset].expand(B, -1, -1)
|
484 |
-
if check:
|
485 |
-
# check coherence between mask and sequence
|
486 |
-
assert (curr_sequence == torch.where(curr_mask, curr_sequence, self.special_token_id)).all()
|
487 |
-
# should never happen as gen_sequence is filled progressively
|
488 |
-
assert not (curr_sequence == unknown_token).any()
|
489 |
-
# sample next token from the model, next token shape is [B, K, 1]
|
490 |
-
next_token = self._sample_next_token(
|
491 |
-
curr_sequence, cfg_conditions, unconditional_state, use_sampling, temp, top_k, top_p,
|
492 |
-
cfg_coef=cfg_coef)
|
493 |
-
# ensure the tokens that should be masked are properly set to special_token_id
|
494 |
-
# as the model never output special_token_id
|
495 |
-
valid_mask = mask[..., offset:offset+1].expand(B, -1, -1)
|
496 |
-
next_token[~valid_mask] = self.special_token_id
|
497 |
-
# ensure we don't overwrite prompt tokens, we only write over unknown tokens
|
498 |
-
# (then mask tokens should be left as is as well, which is correct)
|
499 |
-
gen_sequence[..., offset:offset+1] = torch.where(
|
500 |
-
gen_sequence[..., offset:offset+1] == unknown_token,
|
501 |
-
next_token, gen_sequence[..., offset:offset+1]
|
502 |
-
)
|
503 |
-
prev_offset = offset
|
504 |
-
if callback is not None:
|
505 |
-
callback(1 + offset - start_offset_sequence, gen_sequence_len - start_offset_sequence)
|
506 |
-
unconditional_state.clear()
|
507 |
-
|
508 |
-
# ensure sequence has been entirely filled
|
509 |
-
assert not (gen_sequence == unknown_token).any()
|
510 |
-
# ensure gen_sequence pattern and mask are matching
|
511 |
-
# which means the gen_sequence is valid according to the pattern
|
512 |
-
assert (
|
513 |
-
gen_sequence == torch.where(mask[None, ...].expand(B, -1, -1), gen_sequence, self.special_token_id)
|
514 |
-
).all()
|
515 |
-
# get back the codes, trimming the prompt if needed and cutting potentially incomplete timesteps
|
516 |
-
out_codes, out_indexes, out_mask = pattern.revert_pattern_sequence(gen_sequence, special_token=unknown_token)
|
517 |
-
|
518 |
-
# sanity checks over the returned codes and corresponding masks
|
519 |
-
assert (out_codes[..., :max_gen_len] != unknown_token).all()
|
520 |
-
assert (out_mask[..., :max_gen_len] == 1).all()
|
521 |
-
|
522 |
-
out_start_offset = start_offset if remove_prompts else 0
|
523 |
-
out_codes = out_codes[..., out_start_offset:max_gen_len]
|
524 |
-
|
525 |
-
# ensure the returned codes are all valid
|
526 |
-
assert (out_codes >= 0).all() and (out_codes <= self.card).all()
|
527 |
-
return out_codes
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/AgentVerse/agentVerse/ui/src/phaser3-rex-plugins/templates/ui/chart/GetChartDataset.js
DELETED
@@ -1,21 +0,0 @@
|
|
1 |
-
var GetChartDataset = function (datasetIndex) {
|
2 |
-
if (this.chart === undefined) {
|
3 |
-
return undefined;
|
4 |
-
}
|
5 |
-
|
6 |
-
if (typeof (datasetIndex) === 'string') {
|
7 |
-
var datasets = this.chart.data.datasets, dataset;
|
8 |
-
for (var i = 0, cnt = datasets.length; i < cnt; i++) {
|
9 |
-
dataset = datasets[i];
|
10 |
-
if (dataset.label === datasetIndex) {
|
11 |
-
return dataset;
|
12 |
-
}
|
13 |
-
}
|
14 |
-
} else {
|
15 |
-
return this.chart.data.datasets[datasetIndex];
|
16 |
-
}
|
17 |
-
|
18 |
-
return undefined;
|
19 |
-
}
|
20 |
-
|
21 |
-
export default GetChartDataset;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/AgentVerse/agentVerse/ui/src/phaser3-rex-plugins/templates/ui/gridsizer/ResetGrid.js
DELETED
@@ -1,77 +0,0 @@
|
|
1 |
-
import ArrayFill from '../../../plugins/utils/array/Fill.js';
|
2 |
-
|
3 |
-
const GetValue = Phaser.Utils.Objects.GetValue;
|
4 |
-
|
5 |
-
var ResetGrid = function (columnCount, rowCount, columnProportions, rowProportions, space) {
|
6 |
-
if (columnProportions === undefined) {
|
7 |
-
columnProportions = 0;
|
8 |
-
}
|
9 |
-
if (rowProportions === undefined) {
|
10 |
-
rowProportions = 0;
|
11 |
-
}
|
12 |
-
|
13 |
-
this.columnCount = columnCount;
|
14 |
-
this.rowCount = rowCount;
|
15 |
-
this.gridCount = columnCount * rowCount;
|
16 |
-
|
17 |
-
// children
|
18 |
-
if (this.sizerChildren === undefined) {
|
19 |
-
this.sizerChildren = [];
|
20 |
-
} else {
|
21 |
-
this.removeAll();
|
22 |
-
}
|
23 |
-
this.sizerChildren.length = columnCount * rowCount;
|
24 |
-
ArrayFill(this.sizerChildren, null);
|
25 |
-
|
26 |
-
// proportions
|
27 |
-
this.columnProportions = [];
|
28 |
-
this.columnProportions.length = columnCount;
|
29 |
-
if (typeof (columnProportions) === 'number') {
|
30 |
-
ArrayFill(this.columnProportions, columnProportions);
|
31 |
-
} else {
|
32 |
-
for (var i = 0; i < columnCount; i++) {
|
33 |
-
this.columnProportions[i] = columnProportions[i] || 0;
|
34 |
-
}
|
35 |
-
}
|
36 |
-
this.rowProportions = [];
|
37 |
-
this.rowProportions.length = rowCount;
|
38 |
-
if (typeof (rowProportions) === 'number') {
|
39 |
-
ArrayFill(this.rowProportions, rowProportions);
|
40 |
-
} else {
|
41 |
-
for (var i = 0; i < rowCount; i++) {
|
42 |
-
this.rowProportions[i] = rowProportions[i] || 0;
|
43 |
-
}
|
44 |
-
}
|
45 |
-
|
46 |
-
// width & height
|
47 |
-
this.columnWidth = [];
|
48 |
-
this.columnWidth.length = columnCount;
|
49 |
-
this.rowHeight = [];
|
50 |
-
this.rowHeight.length = rowCount;
|
51 |
-
|
52 |
-
// space
|
53 |
-
this.space.column = [];
|
54 |
-
this.space.column.length = columnCount - 1;
|
55 |
-
var columnSpace = GetValue(space, 'column', 0);
|
56 |
-
if (typeof (columnSpace) === 'number') {
|
57 |
-
ArrayFill(this.space.column, columnSpace);
|
58 |
-
} else {
|
59 |
-
for (var i = 0, cnt = this.space.column.length; i < cnt; i++) {
|
60 |
-
this.space.column[i] = columnSpace[i] || 0;
|
61 |
-
}
|
62 |
-
}
|
63 |
-
this.space.row = [];
|
64 |
-
this.space.row.length = rowCount - 1;
|
65 |
-
var rowSpace = GetValue(space, 'row', 0);
|
66 |
-
if (typeof (rowSpace) === 'number') {
|
67 |
-
ArrayFill(this.space.row, rowSpace);
|
68 |
-
} else {
|
69 |
-
for (var i = 0, cnt = this.space.row.length; i < cnt; i++) {
|
70 |
-
this.space.row[i] = rowSpace[i] || 0;
|
71 |
-
}
|
72 |
-
}
|
73 |
-
|
74 |
-
return this;
|
75 |
-
}
|
76 |
-
|
77 |
-
export default ResetGrid;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Aloento/9Nine-PITS/commons.py
DELETED
@@ -1,192 +0,0 @@
|
|
1 |
-
# from https://github.com/jaywalnut310/vits
|
2 |
-
import math
|
3 |
-
|
4 |
-
import torch
|
5 |
-
from torch.nn import functional as F
|
6 |
-
|
7 |
-
|
8 |
-
def init_weights(m, mean=0.0, std=0.01):
|
9 |
-
classname = m.__class__.__name__
|
10 |
-
if classname.find("Conv") != -1:
|
11 |
-
m.weight.data.normal_(mean, std)
|
12 |
-
|
13 |
-
|
14 |
-
def get_padding(kernel_size, dilation=1):
|
15 |
-
return int((kernel_size * dilation - dilation) / 2)
|
16 |
-
|
17 |
-
|
18 |
-
def convert_pad_shape(pad_shape):
|
19 |
-
l = pad_shape[::-1]
|
20 |
-
pad_shape = [item for sublist in l for item in sublist]
|
21 |
-
return pad_shape
|
22 |
-
|
23 |
-
|
24 |
-
def intersperse(lst, item):
|
25 |
-
result = [item] * (len(lst) * 2 + 1)
|
26 |
-
result[1::2] = lst
|
27 |
-
return result
|
28 |
-
|
29 |
-
|
30 |
-
def intersperse_with_language_id(text, lang, item):
|
31 |
-
n = len(text)
|
32 |
-
_text = [item] * (2 * n + 1)
|
33 |
-
_lang = [None] * (2 * n + 1)
|
34 |
-
_text[1::2] = text
|
35 |
-
_lang[1::2] = lang
|
36 |
-
_lang[::2] = lang + [lang[-1]]
|
37 |
-
|
38 |
-
return _text, _lang
|
39 |
-
|
40 |
-
|
41 |
-
def kl_divergence(m_p, logs_p, m_q, logs_q):
|
42 |
-
"""KL(P||Q)"""
|
43 |
-
kl = (logs_q - logs_p) - 0.5
|
44 |
-
kl += 0.5 * (torch.exp(2. * logs_p) + ((m_p - m_q) ** 2)) * torch.exp(-2. * logs_q)
|
45 |
-
return kl
|
46 |
-
|
47 |
-
|
48 |
-
def rand_gumbel(shape):
|
49 |
-
"""Sample from the Gumbel distribution, protect from overflows."""
|
50 |
-
uniform_samples = torch.rand(shape) * 0.99998 + 0.00001
|
51 |
-
return -torch.log(-torch.log(uniform_samples))
|
52 |
-
|
53 |
-
|
54 |
-
def rand_gumbel_like(x):
|
55 |
-
g = rand_gumbel(x.size()).to(dtype=x.dtype, device=x.device)
|
56 |
-
return g
|
57 |
-
|
58 |
-
|
59 |
-
def slice_segments(x, ids_str, segment_size=4):
|
60 |
-
ret = torch.zeros_like(x[:, :, :segment_size])
|
61 |
-
for i in range(x.size(0)):
|
62 |
-
idx_str = ids_str[i]
|
63 |
-
idx_end = idx_str + segment_size
|
64 |
-
ret[i] = x[i, :, idx_str:idx_end]
|
65 |
-
return ret
|
66 |
-
|
67 |
-
|
68 |
-
def rand_slice_segments(x, x_lengths=None, segment_size=4):
|
69 |
-
b, d, t = x.size()
|
70 |
-
if x_lengths is None:
|
71 |
-
x_lengths = t
|
72 |
-
ids_str_max = x_lengths - segment_size + 1
|
73 |
-
ids_str = (torch.rand([b]).to(device=x.device)
|
74 |
-
* ids_str_max).to(dtype=torch.long)
|
75 |
-
ids_str = torch.max(torch.zeros(ids_str.size()).to(ids_str.device), ids_str).to(dtype=torch.long)
|
76 |
-
ret = slice_segments(x, ids_str, segment_size)
|
77 |
-
return ret, ids_str
|
78 |
-
|
79 |
-
|
80 |
-
def rand_slice_segments_for_cat(x, x_lengths=None, segment_size=4):
|
81 |
-
b, d, t = x.size()
|
82 |
-
if x_lengths is None:
|
83 |
-
x_lengths = t
|
84 |
-
ids_str_max = x_lengths - segment_size + 1
|
85 |
-
ids_str = torch.rand([b // 2]).to(device=x.device)
|
86 |
-
ids_str = (torch.cat([ids_str, ids_str], dim=0)
|
87 |
-
* ids_str_max).to(dtype=torch.long)
|
88 |
-
ids_str = torch.max(torch.zeros(ids_str.size()).to(ids_str.device), ids_str).to(dtype=torch.long)
|
89 |
-
ret = slice_segments(x, ids_str, segment_size)
|
90 |
-
return ret, ids_str
|
91 |
-
|
92 |
-
|
93 |
-
def get_timing_signal_1d(
|
94 |
-
length, channels, min_timescale=1.0, max_timescale=1.0e4):
|
95 |
-
position = torch.arange(length, dtype=torch.float)
|
96 |
-
num_timescales = channels // 2
|
97 |
-
log_timescale_increment = (
|
98 |
-
math.log(float(max_timescale) / float(min_timescale)) / (num_timescales - 1)
|
99 |
-
)
|
100 |
-
inv_timescales = min_timescale * torch.exp(
|
101 |
-
torch.arange(num_timescales, dtype=torch.float) * -log_timescale_increment
|
102 |
-
)
|
103 |
-
scaled_time = position.unsqueeze(0) * inv_timescales.unsqueeze(1)
|
104 |
-
signal = torch.cat([torch.sin(scaled_time), torch.cos(scaled_time)], 0)
|
105 |
-
signal = F.pad(signal, [0, 0, 0, channels % 2])
|
106 |
-
signal = signal.view(1, channels, length)
|
107 |
-
return signal
|
108 |
-
|
109 |
-
|
110 |
-
def add_timing_signal_1d(x, min_timescale=1.0, max_timescale=1.0e4):
|
111 |
-
b, channels, length = x.size()
|
112 |
-
signal = get_timing_signal_1d(
|
113 |
-
length, channels, min_timescale, max_timescale
|
114 |
-
)
|
115 |
-
return x + signal.to(dtype=x.dtype, device=x.device)
|
116 |
-
|
117 |
-
|
118 |
-
def cat_timing_signal_1d(x, min_timescale=1.0, max_timescale=1.0e4, axis=1):
|
119 |
-
b, channels, length = x.size()
|
120 |
-
signal = get_timing_signal_1d(
|
121 |
-
length, channels, min_timescale, max_timescale
|
122 |
-
)
|
123 |
-
return torch.cat([x, signal.to(dtype=x.dtype, device=x.device)], axis)
|
124 |
-
|
125 |
-
|
126 |
-
def subsequent_mask(length):
|
127 |
-
mask = torch.tril(torch.ones(length, length)).unsqueeze(0).unsqueeze(0)
|
128 |
-
return mask
|
129 |
-
|
130 |
-
|
131 |
-
@torch.jit.script
|
132 |
-
def fused_add_tanh_sigmoid_multiply(input_a, input_b, n_channels):
|
133 |
-
n_channels_int = n_channels[0]
|
134 |
-
in_act = input_a + input_b
|
135 |
-
t_act = torch.tanh(in_act[:, :n_channels_int, :])
|
136 |
-
s_act = torch.sigmoid(in_act[:, n_channels_int:, :])
|
137 |
-
acts = t_act * s_act
|
138 |
-
return acts
|
139 |
-
|
140 |
-
|
141 |
-
def convert_pad_shape(pad_shape):
|
142 |
-
l = pad_shape[::-1]
|
143 |
-
pad_shape = [item for sublist in l for item in sublist]
|
144 |
-
return pad_shape
|
145 |
-
|
146 |
-
|
147 |
-
def shift_1d(x):
|
148 |
-
x = F.pad(x, convert_pad_shape([[0, 0], [0, 0], [1, 0]]))[:, :, :-1]
|
149 |
-
return x
|
150 |
-
|
151 |
-
|
152 |
-
def sequence_mask(length, max_length=None):
|
153 |
-
if max_length is None:
|
154 |
-
max_length = length.max()
|
155 |
-
x = torch.arange(max_length, dtype=length.dtype, device=length.device)
|
156 |
-
return x.unsqueeze(0) < length.unsqueeze(1)
|
157 |
-
|
158 |
-
|
159 |
-
def generate_path(duration, mask):
|
160 |
-
"""
|
161 |
-
duration: [b, 1, t_x]
|
162 |
-
mask: [b, 1, t_y, t_x]
|
163 |
-
"""
|
164 |
-
device = duration.device
|
165 |
-
|
166 |
-
b, _, t_y, t_x = mask.shape
|
167 |
-
cum_duration = torch.cumsum(duration, -1)
|
168 |
-
|
169 |
-
cum_duration_flat = cum_duration.view(b * t_x)
|
170 |
-
path = sequence_mask(cum_duration_flat, t_y).to(mask.dtype)
|
171 |
-
path = path.view(b, t_x, t_y)
|
172 |
-
path = path - F.pad(path, convert_pad_shape([[0, 0], [1, 0], [0, 0]]))[:, :-1]
|
173 |
-
path = path.unsqueeze(1).transpose(2, 3) * mask
|
174 |
-
return path
|
175 |
-
|
176 |
-
|
177 |
-
def clip_grad_value_(parameters, clip_value, norm_type=2):
|
178 |
-
if isinstance(parameters, torch.Tensor):
|
179 |
-
parameters = [parameters]
|
180 |
-
parameters = list(filter(lambda p: p.grad is not None, parameters))
|
181 |
-
norm_type = float(norm_type)
|
182 |
-
if clip_value is not None:
|
183 |
-
clip_value = float(clip_value)
|
184 |
-
|
185 |
-
total_norm = 0
|
186 |
-
for p in parameters:
|
187 |
-
param_norm = p.grad.data.norm(norm_type)
|
188 |
-
total_norm += param_norm.item() ** norm_type
|
189 |
-
if clip_value is not None:
|
190 |
-
p.grad.data.clamp_(min=-clip_value, max=clip_value)
|
191 |
-
total_norm = total_norm ** (1. / norm_type)
|
192 |
-
return total_norm
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Ame42/rwms/power_BI_module.py
DELETED
@@ -1,19 +0,0 @@
|
|
1 |
-
# 'dataset' holds the input data for this script
|
2 |
-
import pandas
|
3 |
-
from datastore import get_22_data, split_join
|
4 |
-
|
5 |
-
date_time_col = "Date Time (GMT+01:00)"
|
6 |
-
time_col = "Time (GMT+01:00)"
|
7 |
-
dur_col = "Daylight duration (SEC)"
|
8 |
-
id_col = "index"
|
9 |
-
|
10 |
-
|
11 |
-
data = get_22_data()
|
12 |
-
data.drop(axis=1, columns=["THP BLIND (PSI)"], inplace=True)
|
13 |
-
data.dropna(axis=0, inplace=True, how="any")
|
14 |
-
data.reset_index(inplace=True)
|
15 |
-
data.drop(axis=1, columns="level_0", inplace=True)
|
16 |
-
dummies = pandas.get_dummies(data["Well index"])
|
17 |
-
data = pandas.concat([data, dummies], axis=1).reindex(data.index)
|
18 |
-
data.drop(columns=["Well index", "index"], axis=1, inplace=True)
|
19 |
-
# data.to_csv("output/data.csv", index_label="id")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Andy1621/uniformer_image_detection/configs/ghm/retinanet_ghm_x101_32x4d_fpn_1x_coco.py
DELETED
@@ -1,13 +0,0 @@
|
|
1 |
-
_base_ = './retinanet_ghm_r50_fpn_1x_coco.py'
|
2 |
-
model = dict(
|
3 |
-
pretrained='open-mmlab://resnext101_32x4d',
|
4 |
-
backbone=dict(
|
5 |
-
type='ResNeXt',
|
6 |
-
depth=101,
|
7 |
-
groups=32,
|
8 |
-
base_width=4,
|
9 |
-
num_stages=4,
|
10 |
-
out_indices=(0, 1, 2, 3),
|
11 |
-
frozen_stages=1,
|
12 |
-
norm_cfg=dict(type='BN', requires_grad=True),
|
13 |
-
style='pytorch'))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Andy1621/uniformer_image_detection/configs/resnest/mask_rcnn_s50_fpn_syncbn-backbone+head_mstrain_1x_coco.py
DELETED
@@ -1,64 +0,0 @@
|
|
1 |
-
_base_ = '../mask_rcnn/mask_rcnn_r50_fpn_1x_coco.py'
|
2 |
-
norm_cfg = dict(type='SyncBN', requires_grad=True)
|
3 |
-
model = dict(
|
4 |
-
pretrained='open-mmlab://resnest50',
|
5 |
-
backbone=dict(
|
6 |
-
type='ResNeSt',
|
7 |
-
stem_channels=64,
|
8 |
-
depth=50,
|
9 |
-
radix=2,
|
10 |
-
reduction_factor=4,
|
11 |
-
avg_down_stride=True,
|
12 |
-
num_stages=4,
|
13 |
-
out_indices=(0, 1, 2, 3),
|
14 |
-
frozen_stages=1,
|
15 |
-
norm_cfg=norm_cfg,
|
16 |
-
norm_eval=False,
|
17 |
-
style='pytorch'),
|
18 |
-
roi_head=dict(
|
19 |
-
bbox_head=dict(
|
20 |
-
type='Shared4Conv1FCBBoxHead',
|
21 |
-
conv_out_channels=256,
|
22 |
-
norm_cfg=norm_cfg),
|
23 |
-
mask_head=dict(norm_cfg=norm_cfg)))
|
24 |
-
# # use ResNeSt img_norm
|
25 |
-
img_norm_cfg = dict(
|
26 |
-
mean=[123.68, 116.779, 103.939], std=[58.393, 57.12, 57.375], to_rgb=True)
|
27 |
-
train_pipeline = [
|
28 |
-
dict(type='LoadImageFromFile'),
|
29 |
-
dict(
|
30 |
-
type='LoadAnnotations',
|
31 |
-
with_bbox=True,
|
32 |
-
with_mask=True,
|
33 |
-
poly2mask=False),
|
34 |
-
dict(
|
35 |
-
type='Resize',
|
36 |
-
img_scale=[(1333, 640), (1333, 672), (1333, 704), (1333, 736),
|
37 |
-
(1333, 768), (1333, 800)],
|
38 |
-
multiscale_mode='value',
|
39 |
-
keep_ratio=True),
|
40 |
-
dict(type='RandomFlip', flip_ratio=0.5),
|
41 |
-
dict(type='Normalize', **img_norm_cfg),
|
42 |
-
dict(type='Pad', size_divisor=32),
|
43 |
-
dict(type='DefaultFormatBundle'),
|
44 |
-
dict(type='Collect', keys=['img', 'gt_bboxes', 'gt_labels', 'gt_masks']),
|
45 |
-
]
|
46 |
-
test_pipeline = [
|
47 |
-
dict(type='LoadImageFromFile'),
|
48 |
-
dict(
|
49 |
-
type='MultiScaleFlipAug',
|
50 |
-
img_scale=(1333, 800),
|
51 |
-
flip=False,
|
52 |
-
transforms=[
|
53 |
-
dict(type='Resize', keep_ratio=True),
|
54 |
-
dict(type='RandomFlip'),
|
55 |
-
dict(type='Normalize', **img_norm_cfg),
|
56 |
-
dict(type='Pad', size_divisor=32),
|
57 |
-
dict(type='ImageToTensor', keys=['img']),
|
58 |
-
dict(type='Collect', keys=['img']),
|
59 |
-
])
|
60 |
-
]
|
61 |
-
data = dict(
|
62 |
-
train=dict(pipeline=train_pipeline),
|
63 |
-
val=dict(pipeline=test_pipeline),
|
64 |
-
test=dict(pipeline=test_pipeline))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Andy1621/uniformer_image_segmentation/configs/danet/danet_r101-d8_512x512_160k_ade20k.py
DELETED
@@ -1,2 +0,0 @@
|
|
1 |
-
_base_ = './danet_r50-d8_512x512_160k_ade20k.py'
|
2 |
-
model = dict(pretrained='open-mmlab://resnet101_v1c', backbone=dict(depth=101))
|
|
|
|
|
|
spaces/Anew1007/extras/Dockerfile
DELETED
@@ -1,21 +0,0 @@
|
|
1 |
-
FROM python:3.11
|
2 |
-
|
3 |
-
WORKDIR /app
|
4 |
-
|
5 |
-
COPY requirements-complete.txt .
|
6 |
-
RUN pip install -r requirements-complete.txt
|
7 |
-
|
8 |
-
RUN mkdir /.cache && chmod -R 777 /.cache
|
9 |
-
RUN mkdir .chroma && chmod -R 777 .chroma
|
10 |
-
|
11 |
-
COPY . .
|
12 |
-
|
13 |
-
|
14 |
-
RUN chmod -R 777 /app
|
15 |
-
|
16 |
-
RUN --mount=type=secret,id=password,mode=0444,required=true \
|
17 |
-
cat /run/secrets/password > /test
|
18 |
-
|
19 |
-
EXPOSE 7860
|
20 |
-
|
21 |
-
CMD ["python", "server.py", "--cpu", "--enable-modules=caption,summarize,classify,silero-tts,edge-tts,chromadb"]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/AnishKumbhar/ChatBot/text-generation-webui-main/js/save_files.js
DELETED
@@ -1,40 +0,0 @@
|
|
1 |
-
// Functions for downloading JSON files
|
2 |
-
function getCurrentTimestamp() {
|
3 |
-
const now = new Date();
|
4 |
-
const timezoneOffset = now.getTimezoneOffset() * 60000; // Convert to milliseconds
|
5 |
-
const localTime = new Date(now.getTime() - timezoneOffset);
|
6 |
-
const formattedTimestamp = localTime.toISOString().replace(/[-:]/g, "").slice(0, 15);
|
7 |
-
return formattedTimestamp;
|
8 |
-
}
|
9 |
-
|
10 |
-
function saveFile(contents, filename) {
|
11 |
-
const element = document.createElement("a");
|
12 |
-
element.setAttribute("href", "data:text/plain;charset=utf-8," + encodeURIComponent(contents));
|
13 |
-
element.setAttribute("download", filename);
|
14 |
-
element.style.display = "none";
|
15 |
-
document.body.appendChild(element);
|
16 |
-
element.click();
|
17 |
-
document.body.removeChild(element);
|
18 |
-
}
|
19 |
-
|
20 |
-
function saveHistory(history, character, mode) {
|
21 |
-
let path = null;
|
22 |
-
|
23 |
-
if (["chat", "chat-instruct"].includes(mode) && character && character.trim() !== "") {
|
24 |
-
path = `history_${character}_${getCurrentTimestamp()}.json`;
|
25 |
-
} else {
|
26 |
-
try {
|
27 |
-
path = `history_${mode}_${getCurrentTimestamp()}.json`;
|
28 |
-
} catch (error) {
|
29 |
-
path = `history_${getCurrentTimestamp()}.json`;
|
30 |
-
}
|
31 |
-
}
|
32 |
-
saveFile(history, path);
|
33 |
-
}
|
34 |
-
|
35 |
-
function saveSession(session) {
|
36 |
-
let path = null;
|
37 |
-
|
38 |
-
path = `session_${getCurrentTimestamp()}.json`;
|
39 |
-
saveFile(session, path);
|
40 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Apex-X/Tm/app.py
DELETED
@@ -1,69 +0,0 @@
|
|
1 |
-
# -* coding:UTF-8 -*
|
2 |
-
# !/usr/bin/env python
|
3 |
-
import numpy as np
|
4 |
-
import gradio as gr
|
5 |
-
import roop.globals
|
6 |
-
from roop.core import (
|
7 |
-
start,
|
8 |
-
decode_execution_providers,
|
9 |
-
suggest_max_memory,
|
10 |
-
suggest_execution_threads,
|
11 |
-
)
|
12 |
-
from roop.processors.frame.core import get_frame_processors_modules
|
13 |
-
from roop.utilities import normalize_output_path
|
14 |
-
import os
|
15 |
-
from PIL import Image
|
16 |
-
|
17 |
-
|
18 |
-
def swap_face(source_file, target_file):
|
19 |
-
|
20 |
-
source_path = "input.jpg"
|
21 |
-
target_path = "target.jpg"
|
22 |
-
|
23 |
-
source_image = Image.fromarray(source_file)
|
24 |
-
source_image.save(source_path)
|
25 |
-
target_image = Image.fromarray(target_file)
|
26 |
-
target_image.save(target_path)
|
27 |
-
|
28 |
-
print("source_path: ", source_path)
|
29 |
-
print("target_path: ", target_path)
|
30 |
-
|
31 |
-
roop.globals.source_path = source_path
|
32 |
-
roop.globals.target_path = target_path
|
33 |
-
output_path = "output.jpg"
|
34 |
-
roop.globals.output_path = normalize_output_path(
|
35 |
-
roop.globals.source_path, roop.globals.target_path, output_path
|
36 |
-
)
|
37 |
-
roop.globals.frame_processors = ["face_swapper"]
|
38 |
-
roop.globals.headless = True
|
39 |
-
roop.globals.keep_fps = True
|
40 |
-
roop.globals.keep_audio = True
|
41 |
-
roop.globals.keep_frames = False
|
42 |
-
roop.globals.many_faces = False
|
43 |
-
roop.globals.video_encoder = "libx264"
|
44 |
-
roop.globals.video_quality = 18
|
45 |
-
roop.globals.max_memory = suggest_max_memory()
|
46 |
-
roop.globals.execution_providers = decode_execution_providers(["cpu"])
|
47 |
-
roop.globals.execution_threads = suggest_execution_threads()
|
48 |
-
|
49 |
-
print(
|
50 |
-
"start process",
|
51 |
-
roop.globals.source_path,
|
52 |
-
roop.globals.target_path,
|
53 |
-
roop.globals.output_path,
|
54 |
-
)
|
55 |
-
|
56 |
-
for frame_processor in get_frame_processors_modules(
|
57 |
-
roop.globals.frame_processors
|
58 |
-
):
|
59 |
-
if not frame_processor.pre_check():
|
60 |
-
return
|
61 |
-
|
62 |
-
start()
|
63 |
-
return output_path
|
64 |
-
|
65 |
-
|
66 |
-
app = gr.Interface(
|
67 |
-
fn=swap_face, inputs=[gr.Image(), gr.Image()], outputs="image"
|
68 |
-
)
|
69 |
-
app.launch()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Arnx/MusicGenXvAKN/tests/modules/test_lstm.py
DELETED
@@ -1,32 +0,0 @@
|
|
1 |
-
# Copyright (c) Meta Platforms, Inc. and affiliates.
|
2 |
-
# All rights reserved.
|
3 |
-
#
|
4 |
-
# This source code is licensed under the license found in the
|
5 |
-
# LICENSE file in the root directory of this source tree.
|
6 |
-
|
7 |
-
import random
|
8 |
-
import torch
|
9 |
-
|
10 |
-
from audiocraft.modules.lstm import StreamableLSTM
|
11 |
-
|
12 |
-
|
13 |
-
class TestStreamableLSTM:
|
14 |
-
|
15 |
-
def test_lstm(self):
|
16 |
-
B, C, T = 4, 2, random.randint(1, 100)
|
17 |
-
|
18 |
-
lstm = StreamableLSTM(C, 3, skip=False)
|
19 |
-
x = torch.randn(B, C, T)
|
20 |
-
y = lstm(x)
|
21 |
-
|
22 |
-
print(y.shape)
|
23 |
-
assert y.shape == torch.Size([B, C, T])
|
24 |
-
|
25 |
-
def test_lstm_skip(self):
|
26 |
-
B, C, T = 4, 2, random.randint(1, 100)
|
27 |
-
|
28 |
-
lstm = StreamableLSTM(C, 3, skip=True)
|
29 |
-
x = torch.randn(B, C, T)
|
30 |
-
y = lstm(x)
|
31 |
-
|
32 |
-
assert y.shape == torch.Size([B, C, T])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Ataturk-Chatbot/HuggingFaceChat/venv/lib/python3.11/site-packages/pip/_vendor/rich/_palettes.py
DELETED
@@ -1,309 +0,0 @@
|
|
1 |
-
from .palette import Palette
|
2 |
-
|
3 |
-
|
4 |
-
# Taken from https://en.wikipedia.org/wiki/ANSI_escape_code (Windows 10 column)
|
5 |
-
WINDOWS_PALETTE = Palette(
|
6 |
-
[
|
7 |
-
(12, 12, 12),
|
8 |
-
(197, 15, 31),
|
9 |
-
(19, 161, 14),
|
10 |
-
(193, 156, 0),
|
11 |
-
(0, 55, 218),
|
12 |
-
(136, 23, 152),
|
13 |
-
(58, 150, 221),
|
14 |
-
(204, 204, 204),
|
15 |
-
(118, 118, 118),
|
16 |
-
(231, 72, 86),
|
17 |
-
(22, 198, 12),
|
18 |
-
(249, 241, 165),
|
19 |
-
(59, 120, 255),
|
20 |
-
(180, 0, 158),
|
21 |
-
(97, 214, 214),
|
22 |
-
(242, 242, 242),
|
23 |
-
]
|
24 |
-
)
|
25 |
-
|
26 |
-
# # The standard ansi colors (including bright variants)
|
27 |
-
STANDARD_PALETTE = Palette(
|
28 |
-
[
|
29 |
-
(0, 0, 0),
|
30 |
-
(170, 0, 0),
|
31 |
-
(0, 170, 0),
|
32 |
-
(170, 85, 0),
|
33 |
-
(0, 0, 170),
|
34 |
-
(170, 0, 170),
|
35 |
-
(0, 170, 170),
|
36 |
-
(170, 170, 170),
|
37 |
-
(85, 85, 85),
|
38 |
-
(255, 85, 85),
|
39 |
-
(85, 255, 85),
|
40 |
-
(255, 255, 85),
|
41 |
-
(85, 85, 255),
|
42 |
-
(255, 85, 255),
|
43 |
-
(85, 255, 255),
|
44 |
-
(255, 255, 255),
|
45 |
-
]
|
46 |
-
)
|
47 |
-
|
48 |
-
|
49 |
-
# The 256 color palette
|
50 |
-
EIGHT_BIT_PALETTE = Palette(
|
51 |
-
[
|
52 |
-
(0, 0, 0),
|
53 |
-
(128, 0, 0),
|
54 |
-
(0, 128, 0),
|
55 |
-
(128, 128, 0),
|
56 |
-
(0, 0, 128),
|
57 |
-
(128, 0, 128),
|
58 |
-
(0, 128, 128),
|
59 |
-
(192, 192, 192),
|
60 |
-
(128, 128, 128),
|
61 |
-
(255, 0, 0),
|
62 |
-
(0, 255, 0),
|
63 |
-
(255, 255, 0),
|
64 |
-
(0, 0, 255),
|
65 |
-
(255, 0, 255),
|
66 |
-
(0, 255, 255),
|
67 |
-
(255, 255, 255),
|
68 |
-
(0, 0, 0),
|
69 |
-
(0, 0, 95),
|
70 |
-
(0, 0, 135),
|
71 |
-
(0, 0, 175),
|
72 |
-
(0, 0, 215),
|
73 |
-
(0, 0, 255),
|
74 |
-
(0, 95, 0),
|
75 |
-
(0, 95, 95),
|
76 |
-
(0, 95, 135),
|
77 |
-
(0, 95, 175),
|
78 |
-
(0, 95, 215),
|
79 |
-
(0, 95, 255),
|
80 |
-
(0, 135, 0),
|
81 |
-
(0, 135, 95),
|
82 |
-
(0, 135, 135),
|
83 |
-
(0, 135, 175),
|
84 |
-
(0, 135, 215),
|
85 |
-
(0, 135, 255),
|
86 |
-
(0, 175, 0),
|
87 |
-
(0, 175, 95),
|
88 |
-
(0, 175, 135),
|
89 |
-
(0, 175, 175),
|
90 |
-
(0, 175, 215),
|
91 |
-
(0, 175, 255),
|
92 |
-
(0, 215, 0),
|
93 |
-
(0, 215, 95),
|
94 |
-
(0, 215, 135),
|
95 |
-
(0, 215, 175),
|
96 |
-
(0, 215, 215),
|
97 |
-
(0, 215, 255),
|
98 |
-
(0, 255, 0),
|
99 |
-
(0, 255, 95),
|
100 |
-
(0, 255, 135),
|
101 |
-
(0, 255, 175),
|
102 |
-
(0, 255, 215),
|
103 |
-
(0, 255, 255),
|
104 |
-
(95, 0, 0),
|
105 |
-
(95, 0, 95),
|
106 |
-
(95, 0, 135),
|
107 |
-
(95, 0, 175),
|
108 |
-
(95, 0, 215),
|
109 |
-
(95, 0, 255),
|
110 |
-
(95, 95, 0),
|
111 |
-
(95, 95, 95),
|
112 |
-
(95, 95, 135),
|
113 |
-
(95, 95, 175),
|
114 |
-
(95, 95, 215),
|
115 |
-
(95, 95, 255),
|
116 |
-
(95, 135, 0),
|
117 |
-
(95, 135, 95),
|
118 |
-
(95, 135, 135),
|
119 |
-
(95, 135, 175),
|
120 |
-
(95, 135, 215),
|
121 |
-
(95, 135, 255),
|
122 |
-
(95, 175, 0),
|
123 |
-
(95, 175, 95),
|
124 |
-
(95, 175, 135),
|
125 |
-
(95, 175, 175),
|
126 |
-
(95, 175, 215),
|
127 |
-
(95, 175, 255),
|
128 |
-
(95, 215, 0),
|
129 |
-
(95, 215, 95),
|
130 |
-
(95, 215, 135),
|
131 |
-
(95, 215, 175),
|
132 |
-
(95, 215, 215),
|
133 |
-
(95, 215, 255),
|
134 |
-
(95, 255, 0),
|
135 |
-
(95, 255, 95),
|
136 |
-
(95, 255, 135),
|
137 |
-
(95, 255, 175),
|
138 |
-
(95, 255, 215),
|
139 |
-
(95, 255, 255),
|
140 |
-
(135, 0, 0),
|
141 |
-
(135, 0, 95),
|
142 |
-
(135, 0, 135),
|
143 |
-
(135, 0, 175),
|
144 |
-
(135, 0, 215),
|
145 |
-
(135, 0, 255),
|
146 |
-
(135, 95, 0),
|
147 |
-
(135, 95, 95),
|
148 |
-
(135, 95, 135),
|
149 |
-
(135, 95, 175),
|
150 |
-
(135, 95, 215),
|
151 |
-
(135, 95, 255),
|
152 |
-
(135, 135, 0),
|
153 |
-
(135, 135, 95),
|
154 |
-
(135, 135, 135),
|
155 |
-
(135, 135, 175),
|
156 |
-
(135, 135, 215),
|
157 |
-
(135, 135, 255),
|
158 |
-
(135, 175, 0),
|
159 |
-
(135, 175, 95),
|
160 |
-
(135, 175, 135),
|
161 |
-
(135, 175, 175),
|
162 |
-
(135, 175, 215),
|
163 |
-
(135, 175, 255),
|
164 |
-
(135, 215, 0),
|
165 |
-
(135, 215, 95),
|
166 |
-
(135, 215, 135),
|
167 |
-
(135, 215, 175),
|
168 |
-
(135, 215, 215),
|
169 |
-
(135, 215, 255),
|
170 |
-
(135, 255, 0),
|
171 |
-
(135, 255, 95),
|
172 |
-
(135, 255, 135),
|
173 |
-
(135, 255, 175),
|
174 |
-
(135, 255, 215),
|
175 |
-
(135, 255, 255),
|
176 |
-
(175, 0, 0),
|
177 |
-
(175, 0, 95),
|
178 |
-
(175, 0, 135),
|
179 |
-
(175, 0, 175),
|
180 |
-
(175, 0, 215),
|
181 |
-
(175, 0, 255),
|
182 |
-
(175, 95, 0),
|
183 |
-
(175, 95, 95),
|
184 |
-
(175, 95, 135),
|
185 |
-
(175, 95, 175),
|
186 |
-
(175, 95, 215),
|
187 |
-
(175, 95, 255),
|
188 |
-
(175, 135, 0),
|
189 |
-
(175, 135, 95),
|
190 |
-
(175, 135, 135),
|
191 |
-
(175, 135, 175),
|
192 |
-
(175, 135, 215),
|
193 |
-
(175, 135, 255),
|
194 |
-
(175, 175, 0),
|
195 |
-
(175, 175, 95),
|
196 |
-
(175, 175, 135),
|
197 |
-
(175, 175, 175),
|
198 |
-
(175, 175, 215),
|
199 |
-
(175, 175, 255),
|
200 |
-
(175, 215, 0),
|
201 |
-
(175, 215, 95),
|
202 |
-
(175, 215, 135),
|
203 |
-
(175, 215, 175),
|
204 |
-
(175, 215, 215),
|
205 |
-
(175, 215, 255),
|
206 |
-
(175, 255, 0),
|
207 |
-
(175, 255, 95),
|
208 |
-
(175, 255, 135),
|
209 |
-
(175, 255, 175),
|
210 |
-
(175, 255, 215),
|
211 |
-
(175, 255, 255),
|
212 |
-
(215, 0, 0),
|
213 |
-
(215, 0, 95),
|
214 |
-
(215, 0, 135),
|
215 |
-
(215, 0, 175),
|
216 |
-
(215, 0, 215),
|
217 |
-
(215, 0, 255),
|
218 |
-
(215, 95, 0),
|
219 |
-
(215, 95, 95),
|
220 |
-
(215, 95, 135),
|
221 |
-
(215, 95, 175),
|
222 |
-
(215, 95, 215),
|
223 |
-
(215, 95, 255),
|
224 |
-
(215, 135, 0),
|
225 |
-
(215, 135, 95),
|
226 |
-
(215, 135, 135),
|
227 |
-
(215, 135, 175),
|
228 |
-
(215, 135, 215),
|
229 |
-
(215, 135, 255),
|
230 |
-
(215, 175, 0),
|
231 |
-
(215, 175, 95),
|
232 |
-
(215, 175, 135),
|
233 |
-
(215, 175, 175),
|
234 |
-
(215, 175, 215),
|
235 |
-
(215, 175, 255),
|
236 |
-
(215, 215, 0),
|
237 |
-
(215, 215, 95),
|
238 |
-
(215, 215, 135),
|
239 |
-
(215, 215, 175),
|
240 |
-
(215, 215, 215),
|
241 |
-
(215, 215, 255),
|
242 |
-
(215, 255, 0),
|
243 |
-
(215, 255, 95),
|
244 |
-
(215, 255, 135),
|
245 |
-
(215, 255, 175),
|
246 |
-
(215, 255, 215),
|
247 |
-
(215, 255, 255),
|
248 |
-
(255, 0, 0),
|
249 |
-
(255, 0, 95),
|
250 |
-
(255, 0, 135),
|
251 |
-
(255, 0, 175),
|
252 |
-
(255, 0, 215),
|
253 |
-
(255, 0, 255),
|
254 |
-
(255, 95, 0),
|
255 |
-
(255, 95, 95),
|
256 |
-
(255, 95, 135),
|
257 |
-
(255, 95, 175),
|
258 |
-
(255, 95, 215),
|
259 |
-
(255, 95, 255),
|
260 |
-
(255, 135, 0),
|
261 |
-
(255, 135, 95),
|
262 |
-
(255, 135, 135),
|
263 |
-
(255, 135, 175),
|
264 |
-
(255, 135, 215),
|
265 |
-
(255, 135, 255),
|
266 |
-
(255, 175, 0),
|
267 |
-
(255, 175, 95),
|
268 |
-
(255, 175, 135),
|
269 |
-
(255, 175, 175),
|
270 |
-
(255, 175, 215),
|
271 |
-
(255, 175, 255),
|
272 |
-
(255, 215, 0),
|
273 |
-
(255, 215, 95),
|
274 |
-
(255, 215, 135),
|
275 |
-
(255, 215, 175),
|
276 |
-
(255, 215, 215),
|
277 |
-
(255, 215, 255),
|
278 |
-
(255, 255, 0),
|
279 |
-
(255, 255, 95),
|
280 |
-
(255, 255, 135),
|
281 |
-
(255, 255, 175),
|
282 |
-
(255, 255, 215),
|
283 |
-
(255, 255, 255),
|
284 |
-
(8, 8, 8),
|
285 |
-
(18, 18, 18),
|
286 |
-
(28, 28, 28),
|
287 |
-
(38, 38, 38),
|
288 |
-
(48, 48, 48),
|
289 |
-
(58, 58, 58),
|
290 |
-
(68, 68, 68),
|
291 |
-
(78, 78, 78),
|
292 |
-
(88, 88, 88),
|
293 |
-
(98, 98, 98),
|
294 |
-
(108, 108, 108),
|
295 |
-
(118, 118, 118),
|
296 |
-
(128, 128, 128),
|
297 |
-
(138, 138, 138),
|
298 |
-
(148, 148, 148),
|
299 |
-
(158, 158, 158),
|
300 |
-
(168, 168, 168),
|
301 |
-
(178, 178, 178),
|
302 |
-
(188, 188, 188),
|
303 |
-
(198, 198, 198),
|
304 |
-
(208, 208, 208),
|
305 |
-
(218, 218, 218),
|
306 |
-
(228, 228, 228),
|
307 |
-
(238, 238, 238),
|
308 |
-
]
|
309 |
-
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Ataturk-Chatbot/HuggingFaceChat/venv/lib/python3.11/site-packages/pip/_vendor/rich/color.py
DELETED
@@ -1,622 +0,0 @@
|
|
1 |
-
import platform
|
2 |
-
import re
|
3 |
-
from colorsys import rgb_to_hls
|
4 |
-
from enum import IntEnum
|
5 |
-
from functools import lru_cache
|
6 |
-
from typing import TYPE_CHECKING, NamedTuple, Optional, Tuple
|
7 |
-
|
8 |
-
from ._palettes import EIGHT_BIT_PALETTE, STANDARD_PALETTE, WINDOWS_PALETTE
|
9 |
-
from .color_triplet import ColorTriplet
|
10 |
-
from .repr import Result, rich_repr
|
11 |
-
from .terminal_theme import DEFAULT_TERMINAL_THEME
|
12 |
-
|
13 |
-
if TYPE_CHECKING: # pragma: no cover
|
14 |
-
from .terminal_theme import TerminalTheme
|
15 |
-
from .text import Text
|
16 |
-
|
17 |
-
|
18 |
-
WINDOWS = platform.system() == "Windows"
|
19 |
-
|
20 |
-
|
21 |
-
class ColorSystem(IntEnum):
|
22 |
-
"""One of the 3 color system supported by terminals."""
|
23 |
-
|
24 |
-
STANDARD = 1
|
25 |
-
EIGHT_BIT = 2
|
26 |
-
TRUECOLOR = 3
|
27 |
-
WINDOWS = 4
|
28 |
-
|
29 |
-
def __repr__(self) -> str:
|
30 |
-
return f"ColorSystem.{self.name}"
|
31 |
-
|
32 |
-
def __str__(self) -> str:
|
33 |
-
return repr(self)
|
34 |
-
|
35 |
-
|
36 |
-
class ColorType(IntEnum):
|
37 |
-
"""Type of color stored in Color class."""
|
38 |
-
|
39 |
-
DEFAULT = 0
|
40 |
-
STANDARD = 1
|
41 |
-
EIGHT_BIT = 2
|
42 |
-
TRUECOLOR = 3
|
43 |
-
WINDOWS = 4
|
44 |
-
|
45 |
-
def __repr__(self) -> str:
|
46 |
-
return f"ColorType.{self.name}"
|
47 |
-
|
48 |
-
|
49 |
-
ANSI_COLOR_NAMES = {
|
50 |
-
"black": 0,
|
51 |
-
"red": 1,
|
52 |
-
"green": 2,
|
53 |
-
"yellow": 3,
|
54 |
-
"blue": 4,
|
55 |
-
"magenta": 5,
|
56 |
-
"cyan": 6,
|
57 |
-
"white": 7,
|
58 |
-
"bright_black": 8,
|
59 |
-
"bright_red": 9,
|
60 |
-
"bright_green": 10,
|
61 |
-
"bright_yellow": 11,
|
62 |
-
"bright_blue": 12,
|
63 |
-
"bright_magenta": 13,
|
64 |
-
"bright_cyan": 14,
|
65 |
-
"bright_white": 15,
|
66 |
-
"grey0": 16,
|
67 |
-
"gray0": 16,
|
68 |
-
"navy_blue": 17,
|
69 |
-
"dark_blue": 18,
|
70 |
-
"blue3": 20,
|
71 |
-
"blue1": 21,
|
72 |
-
"dark_green": 22,
|
73 |
-
"deep_sky_blue4": 25,
|
74 |
-
"dodger_blue3": 26,
|
75 |
-
"dodger_blue2": 27,
|
76 |
-
"green4": 28,
|
77 |
-
"spring_green4": 29,
|
78 |
-
"turquoise4": 30,
|
79 |
-
"deep_sky_blue3": 32,
|
80 |
-
"dodger_blue1": 33,
|
81 |
-
"green3": 40,
|
82 |
-
"spring_green3": 41,
|
83 |
-
"dark_cyan": 36,
|
84 |
-
"light_sea_green": 37,
|
85 |
-
"deep_sky_blue2": 38,
|
86 |
-
"deep_sky_blue1": 39,
|
87 |
-
"spring_green2": 47,
|
88 |
-
"cyan3": 43,
|
89 |
-
"dark_turquoise": 44,
|
90 |
-
"turquoise2": 45,
|
91 |
-
"green1": 46,
|
92 |
-
"spring_green1": 48,
|
93 |
-
"medium_spring_green": 49,
|
94 |
-
"cyan2": 50,
|
95 |
-
"cyan1": 51,
|
96 |
-
"dark_red": 88,
|
97 |
-
"deep_pink4": 125,
|
98 |
-
"purple4": 55,
|
99 |
-
"purple3": 56,
|
100 |
-
"blue_violet": 57,
|
101 |
-
"orange4": 94,
|
102 |
-
"grey37": 59,
|
103 |
-
"gray37": 59,
|
104 |
-
"medium_purple4": 60,
|
105 |
-
"slate_blue3": 62,
|
106 |
-
"royal_blue1": 63,
|
107 |
-
"chartreuse4": 64,
|
108 |
-
"dark_sea_green4": 71,
|
109 |
-
"pale_turquoise4": 66,
|
110 |
-
"steel_blue": 67,
|
111 |
-
"steel_blue3": 68,
|
112 |
-
"cornflower_blue": 69,
|
113 |
-
"chartreuse3": 76,
|
114 |
-
"cadet_blue": 73,
|
115 |
-
"sky_blue3": 74,
|
116 |
-
"steel_blue1": 81,
|
117 |
-
"pale_green3": 114,
|
118 |
-
"sea_green3": 78,
|
119 |
-
"aquamarine3": 79,
|
120 |
-
"medium_turquoise": 80,
|
121 |
-
"chartreuse2": 112,
|
122 |
-
"sea_green2": 83,
|
123 |
-
"sea_green1": 85,
|
124 |
-
"aquamarine1": 122,
|
125 |
-
"dark_slate_gray2": 87,
|
126 |
-
"dark_magenta": 91,
|
127 |
-
"dark_violet": 128,
|
128 |
-
"purple": 129,
|
129 |
-
"light_pink4": 95,
|
130 |
-
"plum4": 96,
|
131 |
-
"medium_purple3": 98,
|
132 |
-
"slate_blue1": 99,
|
133 |
-
"yellow4": 106,
|
134 |
-
"wheat4": 101,
|
135 |
-
"grey53": 102,
|
136 |
-
"gray53": 102,
|
137 |
-
"light_slate_grey": 103,
|
138 |
-
"light_slate_gray": 103,
|
139 |
-
"medium_purple": 104,
|
140 |
-
"light_slate_blue": 105,
|
141 |
-
"dark_olive_green3": 149,
|
142 |
-
"dark_sea_green": 108,
|
143 |
-
"light_sky_blue3": 110,
|
144 |
-
"sky_blue2": 111,
|
145 |
-
"dark_sea_green3": 150,
|
146 |
-
"dark_slate_gray3": 116,
|
147 |
-
"sky_blue1": 117,
|
148 |
-
"chartreuse1": 118,
|
149 |
-
"light_green": 120,
|
150 |
-
"pale_green1": 156,
|
151 |
-
"dark_slate_gray1": 123,
|
152 |
-
"red3": 160,
|
153 |
-
"medium_violet_red": 126,
|
154 |
-
"magenta3": 164,
|
155 |
-
"dark_orange3": 166,
|
156 |
-
"indian_red": 167,
|
157 |
-
"hot_pink3": 168,
|
158 |
-
"medium_orchid3": 133,
|
159 |
-
"medium_orchid": 134,
|
160 |
-
"medium_purple2": 140,
|
161 |
-
"dark_goldenrod": 136,
|
162 |
-
"light_salmon3": 173,
|
163 |
-
"rosy_brown": 138,
|
164 |
-
"grey63": 139,
|
165 |
-
"gray63": 139,
|
166 |
-
"medium_purple1": 141,
|
167 |
-
"gold3": 178,
|
168 |
-
"dark_khaki": 143,
|
169 |
-
"navajo_white3": 144,
|
170 |
-
"grey69": 145,
|
171 |
-
"gray69": 145,
|
172 |
-
"light_steel_blue3": 146,
|
173 |
-
"light_steel_blue": 147,
|
174 |
-
"yellow3": 184,
|
175 |
-
"dark_sea_green2": 157,
|
176 |
-
"light_cyan3": 152,
|
177 |
-
"light_sky_blue1": 153,
|
178 |
-
"green_yellow": 154,
|
179 |
-
"dark_olive_green2": 155,
|
180 |
-
"dark_sea_green1": 193,
|
181 |
-
"pale_turquoise1": 159,
|
182 |
-
"deep_pink3": 162,
|
183 |
-
"magenta2": 200,
|
184 |
-
"hot_pink2": 169,
|
185 |
-
"orchid": 170,
|
186 |
-
"medium_orchid1": 207,
|
187 |
-
"orange3": 172,
|
188 |
-
"light_pink3": 174,
|
189 |
-
"pink3": 175,
|
190 |
-
"plum3": 176,
|
191 |
-
"violet": 177,
|
192 |
-
"light_goldenrod3": 179,
|
193 |
-
"tan": 180,
|
194 |
-
"misty_rose3": 181,
|
195 |
-
"thistle3": 182,
|
196 |
-
"plum2": 183,
|
197 |
-
"khaki3": 185,
|
198 |
-
"light_goldenrod2": 222,
|
199 |
-
"light_yellow3": 187,
|
200 |
-
"grey84": 188,
|
201 |
-
"gray84": 188,
|
202 |
-
"light_steel_blue1": 189,
|
203 |
-
"yellow2": 190,
|
204 |
-
"dark_olive_green1": 192,
|
205 |
-
"honeydew2": 194,
|
206 |
-
"light_cyan1": 195,
|
207 |
-
"red1": 196,
|
208 |
-
"deep_pink2": 197,
|
209 |
-
"deep_pink1": 199,
|
210 |
-
"magenta1": 201,
|
211 |
-
"orange_red1": 202,
|
212 |
-
"indian_red1": 204,
|
213 |
-
"hot_pink": 206,
|
214 |
-
"dark_orange": 208,
|
215 |
-
"salmon1": 209,
|
216 |
-
"light_coral": 210,
|
217 |
-
"pale_violet_red1": 211,
|
218 |
-
"orchid2": 212,
|
219 |
-
"orchid1": 213,
|
220 |
-
"orange1": 214,
|
221 |
-
"sandy_brown": 215,
|
222 |
-
"light_salmon1": 216,
|
223 |
-
"light_pink1": 217,
|
224 |
-
"pink1": 218,
|
225 |
-
"plum1": 219,
|
226 |
-
"gold1": 220,
|
227 |
-
"navajo_white1": 223,
|
228 |
-
"misty_rose1": 224,
|
229 |
-
"thistle1": 225,
|
230 |
-
"yellow1": 226,
|
231 |
-
"light_goldenrod1": 227,
|
232 |
-
"khaki1": 228,
|
233 |
-
"wheat1": 229,
|
234 |
-
"cornsilk1": 230,
|
235 |
-
"grey100": 231,
|
236 |
-
"gray100": 231,
|
237 |
-
"grey3": 232,
|
238 |
-
"gray3": 232,
|
239 |
-
"grey7": 233,
|
240 |
-
"gray7": 233,
|
241 |
-
"grey11": 234,
|
242 |
-
"gray11": 234,
|
243 |
-
"grey15": 235,
|
244 |
-
"gray15": 235,
|
245 |
-
"grey19": 236,
|
246 |
-
"gray19": 236,
|
247 |
-
"grey23": 237,
|
248 |
-
"gray23": 237,
|
249 |
-
"grey27": 238,
|
250 |
-
"gray27": 238,
|
251 |
-
"grey30": 239,
|
252 |
-
"gray30": 239,
|
253 |
-
"grey35": 240,
|
254 |
-
"gray35": 240,
|
255 |
-
"grey39": 241,
|
256 |
-
"gray39": 241,
|
257 |
-
"grey42": 242,
|
258 |
-
"gray42": 242,
|
259 |
-
"grey46": 243,
|
260 |
-
"gray46": 243,
|
261 |
-
"grey50": 244,
|
262 |
-
"gray50": 244,
|
263 |
-
"grey54": 245,
|
264 |
-
"gray54": 245,
|
265 |
-
"grey58": 246,
|
266 |
-
"gray58": 246,
|
267 |
-
"grey62": 247,
|
268 |
-
"gray62": 247,
|
269 |
-
"grey66": 248,
|
270 |
-
"gray66": 248,
|
271 |
-
"grey70": 249,
|
272 |
-
"gray70": 249,
|
273 |
-
"grey74": 250,
|
274 |
-
"gray74": 250,
|
275 |
-
"grey78": 251,
|
276 |
-
"gray78": 251,
|
277 |
-
"grey82": 252,
|
278 |
-
"gray82": 252,
|
279 |
-
"grey85": 253,
|
280 |
-
"gray85": 253,
|
281 |
-
"grey89": 254,
|
282 |
-
"gray89": 254,
|
283 |
-
"grey93": 255,
|
284 |
-
"gray93": 255,
|
285 |
-
}
|
286 |
-
|
287 |
-
|
288 |
-
class ColorParseError(Exception):
|
289 |
-
"""The color could not be parsed."""
|
290 |
-
|
291 |
-
|
292 |
-
RE_COLOR = re.compile(
|
293 |
-
r"""^
|
294 |
-
\#([0-9a-f]{6})$|
|
295 |
-
color\(([0-9]{1,3})\)$|
|
296 |
-
rgb\(([\d\s,]+)\)$
|
297 |
-
""",
|
298 |
-
re.VERBOSE,
|
299 |
-
)
|
300 |
-
|
301 |
-
|
302 |
-
@rich_repr
|
303 |
-
class Color(NamedTuple):
|
304 |
-
"""Terminal color definition."""
|
305 |
-
|
306 |
-
name: str
|
307 |
-
"""The name of the color (typically the input to Color.parse)."""
|
308 |
-
type: ColorType
|
309 |
-
"""The type of the color."""
|
310 |
-
number: Optional[int] = None
|
311 |
-
"""The color number, if a standard color, or None."""
|
312 |
-
triplet: Optional[ColorTriplet] = None
|
313 |
-
"""A triplet of color components, if an RGB color."""
|
314 |
-
|
315 |
-
def __rich__(self) -> "Text":
|
316 |
-
"""Displays the actual color if Rich printed."""
|
317 |
-
from .style import Style
|
318 |
-
from .text import Text
|
319 |
-
|
320 |
-
return Text.assemble(
|
321 |
-
f"<color {self.name!r} ({self.type.name.lower()})",
|
322 |
-
("⬤", Style(color=self)),
|
323 |
-
" >",
|
324 |
-
)
|
325 |
-
|
326 |
-
def __rich_repr__(self) -> Result:
|
327 |
-
yield self.name
|
328 |
-
yield self.type
|
329 |
-
yield "number", self.number, None
|
330 |
-
yield "triplet", self.triplet, None
|
331 |
-
|
332 |
-
@property
|
333 |
-
def system(self) -> ColorSystem:
|
334 |
-
"""Get the native color system for this color."""
|
335 |
-
if self.type == ColorType.DEFAULT:
|
336 |
-
return ColorSystem.STANDARD
|
337 |
-
return ColorSystem(int(self.type))
|
338 |
-
|
339 |
-
@property
|
340 |
-
def is_system_defined(self) -> bool:
|
341 |
-
"""Check if the color is ultimately defined by the system."""
|
342 |
-
return self.system not in (ColorSystem.EIGHT_BIT, ColorSystem.TRUECOLOR)
|
343 |
-
|
344 |
-
@property
|
345 |
-
def is_default(self) -> bool:
|
346 |
-
"""Check if the color is a default color."""
|
347 |
-
return self.type == ColorType.DEFAULT
|
348 |
-
|
349 |
-
def get_truecolor(
|
350 |
-
self, theme: Optional["TerminalTheme"] = None, foreground: bool = True
|
351 |
-
) -> ColorTriplet:
|
352 |
-
"""Get an equivalent color triplet for this color.
|
353 |
-
|
354 |
-
Args:
|
355 |
-
theme (TerminalTheme, optional): Optional terminal theme, or None to use default. Defaults to None.
|
356 |
-
foreground (bool, optional): True for a foreground color, or False for background. Defaults to True.
|
357 |
-
|
358 |
-
Returns:
|
359 |
-
ColorTriplet: A color triplet containing RGB components.
|
360 |
-
"""
|
361 |
-
|
362 |
-
if theme is None:
|
363 |
-
theme = DEFAULT_TERMINAL_THEME
|
364 |
-
if self.type == ColorType.TRUECOLOR:
|
365 |
-
assert self.triplet is not None
|
366 |
-
return self.triplet
|
367 |
-
elif self.type == ColorType.EIGHT_BIT:
|
368 |
-
assert self.number is not None
|
369 |
-
return EIGHT_BIT_PALETTE[self.number]
|
370 |
-
elif self.type == ColorType.STANDARD:
|
371 |
-
assert self.number is not None
|
372 |
-
return theme.ansi_colors[self.number]
|
373 |
-
elif self.type == ColorType.WINDOWS:
|
374 |
-
assert self.number is not None
|
375 |
-
return WINDOWS_PALETTE[self.number]
|
376 |
-
else: # self.type == ColorType.DEFAULT:
|
377 |
-
assert self.number is None
|
378 |
-
return theme.foreground_color if foreground else theme.background_color
|
379 |
-
|
380 |
-
@classmethod
|
381 |
-
def from_ansi(cls, number: int) -> "Color":
|
382 |
-
"""Create a Color number from it's 8-bit ansi number.
|
383 |
-
|
384 |
-
Args:
|
385 |
-
number (int): A number between 0-255 inclusive.
|
386 |
-
|
387 |
-
Returns:
|
388 |
-
Color: A new Color instance.
|
389 |
-
"""
|
390 |
-
return cls(
|
391 |
-
name=f"color({number})",
|
392 |
-
type=(ColorType.STANDARD if number < 16 else ColorType.EIGHT_BIT),
|
393 |
-
number=number,
|
394 |
-
)
|
395 |
-
|
396 |
-
@classmethod
|
397 |
-
def from_triplet(cls, triplet: "ColorTriplet") -> "Color":
|
398 |
-
"""Create a truecolor RGB color from a triplet of values.
|
399 |
-
|
400 |
-
Args:
|
401 |
-
triplet (ColorTriplet): A color triplet containing red, green and blue components.
|
402 |
-
|
403 |
-
Returns:
|
404 |
-
Color: A new color object.
|
405 |
-
"""
|
406 |
-
return cls(name=triplet.hex, type=ColorType.TRUECOLOR, triplet=triplet)
|
407 |
-
|
408 |
-
@classmethod
|
409 |
-
def from_rgb(cls, red: float, green: float, blue: float) -> "Color":
|
410 |
-
"""Create a truecolor from three color components in the range(0->255).
|
411 |
-
|
412 |
-
Args:
|
413 |
-
red (float): Red component in range 0-255.
|
414 |
-
green (float): Green component in range 0-255.
|
415 |
-
blue (float): Blue component in range 0-255.
|
416 |
-
|
417 |
-
Returns:
|
418 |
-
Color: A new color object.
|
419 |
-
"""
|
420 |
-
return cls.from_triplet(ColorTriplet(int(red), int(green), int(blue)))
|
421 |
-
|
422 |
-
@classmethod
|
423 |
-
def default(cls) -> "Color":
|
424 |
-
"""Get a Color instance representing the default color.
|
425 |
-
|
426 |
-
Returns:
|
427 |
-
Color: Default color.
|
428 |
-
"""
|
429 |
-
return cls(name="default", type=ColorType.DEFAULT)
|
430 |
-
|
431 |
-
@classmethod
|
432 |
-
@lru_cache(maxsize=1024)
|
433 |
-
def parse(cls, color: str) -> "Color":
|
434 |
-
"""Parse a color definition."""
|
435 |
-
original_color = color
|
436 |
-
color = color.lower().strip()
|
437 |
-
|
438 |
-
if color == "default":
|
439 |
-
return cls(color, type=ColorType.DEFAULT)
|
440 |
-
|
441 |
-
color_number = ANSI_COLOR_NAMES.get(color)
|
442 |
-
if color_number is not None:
|
443 |
-
return cls(
|
444 |
-
color,
|
445 |
-
type=(ColorType.STANDARD if color_number < 16 else ColorType.EIGHT_BIT),
|
446 |
-
number=color_number,
|
447 |
-
)
|
448 |
-
|
449 |
-
color_match = RE_COLOR.match(color)
|
450 |
-
if color_match is None:
|
451 |
-
raise ColorParseError(f"{original_color!r} is not a valid color")
|
452 |
-
|
453 |
-
color_24, color_8, color_rgb = color_match.groups()
|
454 |
-
if color_24:
|
455 |
-
triplet = ColorTriplet(
|
456 |
-
int(color_24[0:2], 16), int(color_24[2:4], 16), int(color_24[4:6], 16)
|
457 |
-
)
|
458 |
-
return cls(color, ColorType.TRUECOLOR, triplet=triplet)
|
459 |
-
|
460 |
-
elif color_8:
|
461 |
-
number = int(color_8)
|
462 |
-
if number > 255:
|
463 |
-
raise ColorParseError(f"color number must be <= 255 in {color!r}")
|
464 |
-
return cls(
|
465 |
-
color,
|
466 |
-
type=(ColorType.STANDARD if number < 16 else ColorType.EIGHT_BIT),
|
467 |
-
number=number,
|
468 |
-
)
|
469 |
-
|
470 |
-
else: # color_rgb:
|
471 |
-
components = color_rgb.split(",")
|
472 |
-
if len(components) != 3:
|
473 |
-
raise ColorParseError(
|
474 |
-
f"expected three components in {original_color!r}"
|
475 |
-
)
|
476 |
-
red, green, blue = components
|
477 |
-
triplet = ColorTriplet(int(red), int(green), int(blue))
|
478 |
-
if not all(component <= 255 for component in triplet):
|
479 |
-
raise ColorParseError(
|
480 |
-
f"color components must be <= 255 in {original_color!r}"
|
481 |
-
)
|
482 |
-
return cls(color, ColorType.TRUECOLOR, triplet=triplet)
|
483 |
-
|
484 |
-
@lru_cache(maxsize=1024)
|
485 |
-
def get_ansi_codes(self, foreground: bool = True) -> Tuple[str, ...]:
|
486 |
-
"""Get the ANSI escape codes for this color."""
|
487 |
-
_type = self.type
|
488 |
-
if _type == ColorType.DEFAULT:
|
489 |
-
return ("39" if foreground else "49",)
|
490 |
-
|
491 |
-
elif _type == ColorType.WINDOWS:
|
492 |
-
number = self.number
|
493 |
-
assert number is not None
|
494 |
-
fore, back = (30, 40) if number < 8 else (82, 92)
|
495 |
-
return (str(fore + number if foreground else back + number),)
|
496 |
-
|
497 |
-
elif _type == ColorType.STANDARD:
|
498 |
-
number = self.number
|
499 |
-
assert number is not None
|
500 |
-
fore, back = (30, 40) if number < 8 else (82, 92)
|
501 |
-
return (str(fore + number if foreground else back + number),)
|
502 |
-
|
503 |
-
elif _type == ColorType.EIGHT_BIT:
|
504 |
-
assert self.number is not None
|
505 |
-
return ("38" if foreground else "48", "5", str(self.number))
|
506 |
-
|
507 |
-
else: # self.standard == ColorStandard.TRUECOLOR:
|
508 |
-
assert self.triplet is not None
|
509 |
-
red, green, blue = self.triplet
|
510 |
-
return ("38" if foreground else "48", "2", str(red), str(green), str(blue))
|
511 |
-
|
512 |
-
@lru_cache(maxsize=1024)
|
513 |
-
def downgrade(self, system: ColorSystem) -> "Color":
|
514 |
-
"""Downgrade a color system to a system with fewer colors."""
|
515 |
-
|
516 |
-
if self.type in (ColorType.DEFAULT, system):
|
517 |
-
return self
|
518 |
-
# Convert to 8-bit color from truecolor color
|
519 |
-
if system == ColorSystem.EIGHT_BIT and self.system == ColorSystem.TRUECOLOR:
|
520 |
-
assert self.triplet is not None
|
521 |
-
_h, l, s = rgb_to_hls(*self.triplet.normalized)
|
522 |
-
# If saturation is under 15% assume it is grayscale
|
523 |
-
if s < 0.15:
|
524 |
-
gray = round(l * 25.0)
|
525 |
-
if gray == 0:
|
526 |
-
color_number = 16
|
527 |
-
elif gray == 25:
|
528 |
-
color_number = 231
|
529 |
-
else:
|
530 |
-
color_number = 231 + gray
|
531 |
-
return Color(self.name, ColorType.EIGHT_BIT, number=color_number)
|
532 |
-
|
533 |
-
red, green, blue = self.triplet
|
534 |
-
six_red = red / 95 if red < 95 else 1 + (red - 95) / 40
|
535 |
-
six_green = green / 95 if green < 95 else 1 + (green - 95) / 40
|
536 |
-
six_blue = blue / 95 if blue < 95 else 1 + (blue - 95) / 40
|
537 |
-
|
538 |
-
color_number = (
|
539 |
-
16 + 36 * round(six_red) + 6 * round(six_green) + round(six_blue)
|
540 |
-
)
|
541 |
-
return Color(self.name, ColorType.EIGHT_BIT, number=color_number)
|
542 |
-
|
543 |
-
# Convert to standard from truecolor or 8-bit
|
544 |
-
elif system == ColorSystem.STANDARD:
|
545 |
-
if self.system == ColorSystem.TRUECOLOR:
|
546 |
-
assert self.triplet is not None
|
547 |
-
triplet = self.triplet
|
548 |
-
else: # self.system == ColorSystem.EIGHT_BIT
|
549 |
-
assert self.number is not None
|
550 |
-
triplet = ColorTriplet(*EIGHT_BIT_PALETTE[self.number])
|
551 |
-
|
552 |
-
color_number = STANDARD_PALETTE.match(triplet)
|
553 |
-
return Color(self.name, ColorType.STANDARD, number=color_number)
|
554 |
-
|
555 |
-
elif system == ColorSystem.WINDOWS:
|
556 |
-
if self.system == ColorSystem.TRUECOLOR:
|
557 |
-
assert self.triplet is not None
|
558 |
-
triplet = self.triplet
|
559 |
-
else: # self.system == ColorSystem.EIGHT_BIT
|
560 |
-
assert self.number is not None
|
561 |
-
if self.number < 16:
|
562 |
-
return Color(self.name, ColorType.WINDOWS, number=self.number)
|
563 |
-
triplet = ColorTriplet(*EIGHT_BIT_PALETTE[self.number])
|
564 |
-
|
565 |
-
color_number = WINDOWS_PALETTE.match(triplet)
|
566 |
-
return Color(self.name, ColorType.WINDOWS, number=color_number)
|
567 |
-
|
568 |
-
return self
|
569 |
-
|
570 |
-
|
571 |
-
def parse_rgb_hex(hex_color: str) -> ColorTriplet:
|
572 |
-
"""Parse six hex characters in to RGB triplet."""
|
573 |
-
assert len(hex_color) == 6, "must be 6 characters"
|
574 |
-
color = ColorTriplet(
|
575 |
-
int(hex_color[0:2], 16), int(hex_color[2:4], 16), int(hex_color[4:6], 16)
|
576 |
-
)
|
577 |
-
return color
|
578 |
-
|
579 |
-
|
580 |
-
def blend_rgb(
|
581 |
-
color1: ColorTriplet, color2: ColorTriplet, cross_fade: float = 0.5
|
582 |
-
) -> ColorTriplet:
|
583 |
-
"""Blend one RGB color in to another."""
|
584 |
-
r1, g1, b1 = color1
|
585 |
-
r2, g2, b2 = color2
|
586 |
-
new_color = ColorTriplet(
|
587 |
-
int(r1 + (r2 - r1) * cross_fade),
|
588 |
-
int(g1 + (g2 - g1) * cross_fade),
|
589 |
-
int(b1 + (b2 - b1) * cross_fade),
|
590 |
-
)
|
591 |
-
return new_color
|
592 |
-
|
593 |
-
|
594 |
-
if __name__ == "__main__": # pragma: no cover
|
595 |
-
|
596 |
-
from .console import Console
|
597 |
-
from .table import Table
|
598 |
-
from .text import Text
|
599 |
-
|
600 |
-
console = Console()
|
601 |
-
|
602 |
-
table = Table(show_footer=False, show_edge=True)
|
603 |
-
table.add_column("Color", width=10, overflow="ellipsis")
|
604 |
-
table.add_column("Number", justify="right", style="yellow")
|
605 |
-
table.add_column("Name", style="green")
|
606 |
-
table.add_column("Hex", style="blue")
|
607 |
-
table.add_column("RGB", style="magenta")
|
608 |
-
|
609 |
-
colors = sorted((v, k) for k, v in ANSI_COLOR_NAMES.items())
|
610 |
-
for color_number, name in colors:
|
611 |
-
if "grey" in name:
|
612 |
-
continue
|
613 |
-
color_cell = Text(" " * 10, style=f"on {name}")
|
614 |
-
if color_number < 16:
|
615 |
-
table.add_row(color_cell, f"{color_number}", Text(f'"{name}"'))
|
616 |
-
else:
|
617 |
-
color = EIGHT_BIT_PALETTE[color_number] # type: ignore[has-type]
|
618 |
-
table.add_row(
|
619 |
-
color_cell, str(color_number), Text(f'"{name}"'), color.hex, color.rgb
|
620 |
-
)
|
621 |
-
|
622 |
-
console.print(table)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Ataturk-Chatbot/HuggingFaceChat/venv/lib/python3.11/site-packages/setuptools/_distutils/command/check.py
DELETED
@@ -1,151 +0,0 @@
|
|
1 |
-
"""distutils.command.check
|
2 |
-
|
3 |
-
Implements the Distutils 'check' command.
|
4 |
-
"""
|
5 |
-
import contextlib
|
6 |
-
|
7 |
-
from distutils.core import Command
|
8 |
-
from distutils.errors import DistutilsSetupError
|
9 |
-
|
10 |
-
with contextlib.suppress(ImportError):
|
11 |
-
import docutils.utils
|
12 |
-
import docutils.parsers.rst
|
13 |
-
import docutils.frontend
|
14 |
-
import docutils.nodes
|
15 |
-
|
16 |
-
class SilentReporter(docutils.utils.Reporter):
|
17 |
-
def __init__(
|
18 |
-
self,
|
19 |
-
source,
|
20 |
-
report_level,
|
21 |
-
halt_level,
|
22 |
-
stream=None,
|
23 |
-
debug=0,
|
24 |
-
encoding='ascii',
|
25 |
-
error_handler='replace',
|
26 |
-
):
|
27 |
-
self.messages = []
|
28 |
-
super().__init__(
|
29 |
-
source, report_level, halt_level, stream, debug, encoding, error_handler
|
30 |
-
)
|
31 |
-
|
32 |
-
def system_message(self, level, message, *children, **kwargs):
|
33 |
-
self.messages.append((level, message, children, kwargs))
|
34 |
-
return docutils.nodes.system_message(
|
35 |
-
message, level=level, type=self.levels[level], *children, **kwargs
|
36 |
-
)
|
37 |
-
|
38 |
-
|
39 |
-
class check(Command):
|
40 |
-
"""This command checks the meta-data of the package."""
|
41 |
-
|
42 |
-
description = "perform some checks on the package"
|
43 |
-
user_options = [
|
44 |
-
('metadata', 'm', 'Verify meta-data'),
|
45 |
-
(
|
46 |
-
'restructuredtext',
|
47 |
-
'r',
|
48 |
-
(
|
49 |
-
'Checks if long string meta-data syntax '
|
50 |
-
'are reStructuredText-compliant'
|
51 |
-
),
|
52 |
-
),
|
53 |
-
('strict', 's', 'Will exit with an error if a check fails'),
|
54 |
-
]
|
55 |
-
|
56 |
-
boolean_options = ['metadata', 'restructuredtext', 'strict']
|
57 |
-
|
58 |
-
def initialize_options(self):
|
59 |
-
"""Sets default values for options."""
|
60 |
-
self.restructuredtext = 0
|
61 |
-
self.metadata = 1
|
62 |
-
self.strict = 0
|
63 |
-
self._warnings = 0
|
64 |
-
|
65 |
-
def finalize_options(self):
|
66 |
-
pass
|
67 |
-
|
68 |
-
def warn(self, msg):
|
69 |
-
"""Counts the number of warnings that occurs."""
|
70 |
-
self._warnings += 1
|
71 |
-
return Command.warn(self, msg)
|
72 |
-
|
73 |
-
def run(self):
|
74 |
-
"""Runs the command."""
|
75 |
-
# perform the various tests
|
76 |
-
if self.metadata:
|
77 |
-
self.check_metadata()
|
78 |
-
if self.restructuredtext:
|
79 |
-
if 'docutils' in globals():
|
80 |
-
try:
|
81 |
-
self.check_restructuredtext()
|
82 |
-
except TypeError as exc:
|
83 |
-
raise DistutilsSetupError(str(exc))
|
84 |
-
elif self.strict:
|
85 |
-
raise DistutilsSetupError('The docutils package is needed.')
|
86 |
-
|
87 |
-
# let's raise an error in strict mode, if we have at least
|
88 |
-
# one warning
|
89 |
-
if self.strict and self._warnings > 0:
|
90 |
-
raise DistutilsSetupError('Please correct your package.')
|
91 |
-
|
92 |
-
def check_metadata(self):
|
93 |
-
"""Ensures that all required elements of meta-data are supplied.
|
94 |
-
|
95 |
-
Required fields:
|
96 |
-
name, version
|
97 |
-
|
98 |
-
Warns if any are missing.
|
99 |
-
"""
|
100 |
-
metadata = self.distribution.metadata
|
101 |
-
|
102 |
-
missing = []
|
103 |
-
for attr in 'name', 'version':
|
104 |
-
if not getattr(metadata, attr, None):
|
105 |
-
missing.append(attr)
|
106 |
-
|
107 |
-
if missing:
|
108 |
-
self.warn("missing required meta-data: %s" % ', '.join(missing))
|
109 |
-
|
110 |
-
def check_restructuredtext(self):
|
111 |
-
"""Checks if the long string fields are reST-compliant."""
|
112 |
-
data = self.distribution.get_long_description()
|
113 |
-
for warning in self._check_rst_data(data):
|
114 |
-
line = warning[-1].get('line')
|
115 |
-
if line is None:
|
116 |
-
warning = warning[1]
|
117 |
-
else:
|
118 |
-
warning = '{} (line {})'.format(warning[1], line)
|
119 |
-
self.warn(warning)
|
120 |
-
|
121 |
-
def _check_rst_data(self, data):
|
122 |
-
"""Returns warnings when the provided data doesn't compile."""
|
123 |
-
# the include and csv_table directives need this to be a path
|
124 |
-
source_path = self.distribution.script_name or 'setup.py'
|
125 |
-
parser = docutils.parsers.rst.Parser()
|
126 |
-
settings = docutils.frontend.OptionParser(
|
127 |
-
components=(docutils.parsers.rst.Parser,)
|
128 |
-
).get_default_values()
|
129 |
-
settings.tab_width = 4
|
130 |
-
settings.pep_references = None
|
131 |
-
settings.rfc_references = None
|
132 |
-
reporter = SilentReporter(
|
133 |
-
source_path,
|
134 |
-
settings.report_level,
|
135 |
-
settings.halt_level,
|
136 |
-
stream=settings.warning_stream,
|
137 |
-
debug=settings.debug,
|
138 |
-
encoding=settings.error_encoding,
|
139 |
-
error_handler=settings.error_encoding_error_handler,
|
140 |
-
)
|
141 |
-
|
142 |
-
document = docutils.nodes.document(settings, reporter, source=source_path)
|
143 |
-
document.note_source(source_path, -1)
|
144 |
-
try:
|
145 |
-
parser.parse(data, document)
|
146 |
-
except AttributeError as e:
|
147 |
-
reporter.messages.append(
|
148 |
-
(-1, 'Could not finish the parsing: %s.' % e, '', {})
|
149 |
-
)
|
150 |
-
|
151 |
-
return reporter.messages
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Awiny/Image2Paragraph/models/grit_src/third_party/CenterNet2/detectron2/layers/wrappers.py
DELETED
@@ -1,132 +0,0 @@
|
|
1 |
-
# Copyright (c) Facebook, Inc. and its affiliates.
|
2 |
-
"""
|
3 |
-
Wrappers around on some nn functions, mainly to support empty tensors.
|
4 |
-
|
5 |
-
Ideally, add support directly in PyTorch to empty tensors in those functions.
|
6 |
-
|
7 |
-
These can be removed once https://github.com/pytorch/pytorch/issues/12013
|
8 |
-
is implemented
|
9 |
-
"""
|
10 |
-
|
11 |
-
from typing import List, Optional
|
12 |
-
import torch
|
13 |
-
from torch.nn import functional as F
|
14 |
-
|
15 |
-
|
16 |
-
def shapes_to_tensor(x: List[int], device: Optional[torch.device] = None) -> torch.Tensor:
|
17 |
-
"""
|
18 |
-
Turn a list of integer scalars or integer Tensor scalars into a vector,
|
19 |
-
in a way that's both traceable and scriptable.
|
20 |
-
|
21 |
-
In tracing, `x` should be a list of scalar Tensor, so the output can trace to the inputs.
|
22 |
-
In scripting or eager, `x` should be a list of int.
|
23 |
-
"""
|
24 |
-
if torch.jit.is_scripting():
|
25 |
-
return torch.as_tensor(x, device=device)
|
26 |
-
if torch.jit.is_tracing():
|
27 |
-
assert all(
|
28 |
-
[isinstance(t, torch.Tensor) for t in x]
|
29 |
-
), "Shape should be tensor during tracing!"
|
30 |
-
# as_tensor should not be used in tracing because it records a constant
|
31 |
-
ret = torch.stack(x)
|
32 |
-
if ret.device != device: # avoid recording a hard-coded device if not necessary
|
33 |
-
ret = ret.to(device=device)
|
34 |
-
return ret
|
35 |
-
return torch.as_tensor(x, device=device)
|
36 |
-
|
37 |
-
|
38 |
-
def cat(tensors: List[torch.Tensor], dim: int = 0):
|
39 |
-
"""
|
40 |
-
Efficient version of torch.cat that avoids a copy if there is only a single element in a list
|
41 |
-
"""
|
42 |
-
assert isinstance(tensors, (list, tuple))
|
43 |
-
if len(tensors) == 1:
|
44 |
-
return tensors[0]
|
45 |
-
return torch.cat(tensors, dim)
|
46 |
-
|
47 |
-
|
48 |
-
def cross_entropy(input, target, *, reduction="mean", **kwargs):
|
49 |
-
"""
|
50 |
-
Same as `torch.nn.functional.cross_entropy`, but returns 0 (instead of nan)
|
51 |
-
for empty inputs.
|
52 |
-
"""
|
53 |
-
if target.numel() == 0 and reduction == "mean":
|
54 |
-
return input.sum() * 0.0 # connect the gradient
|
55 |
-
return F.cross_entropy(input, target, reduction=reduction, **kwargs)
|
56 |
-
|
57 |
-
|
58 |
-
class _NewEmptyTensorOp(torch.autograd.Function):
|
59 |
-
@staticmethod
|
60 |
-
def forward(ctx, x, new_shape):
|
61 |
-
ctx.shape = x.shape
|
62 |
-
return x.new_empty(new_shape)
|
63 |
-
|
64 |
-
@staticmethod
|
65 |
-
def backward(ctx, grad):
|
66 |
-
shape = ctx.shape
|
67 |
-
return _NewEmptyTensorOp.apply(grad, shape), None
|
68 |
-
|
69 |
-
|
70 |
-
class Conv2d(torch.nn.Conv2d):
|
71 |
-
"""
|
72 |
-
A wrapper around :class:`torch.nn.Conv2d` to support empty inputs and more features.
|
73 |
-
"""
|
74 |
-
|
75 |
-
def __init__(self, *args, **kwargs):
|
76 |
-
"""
|
77 |
-
Extra keyword arguments supported in addition to those in `torch.nn.Conv2d`:
|
78 |
-
|
79 |
-
Args:
|
80 |
-
norm (nn.Module, optional): a normalization layer
|
81 |
-
activation (callable(Tensor) -> Tensor): a callable activation function
|
82 |
-
|
83 |
-
It assumes that norm layer is used before activation.
|
84 |
-
"""
|
85 |
-
norm = kwargs.pop("norm", None)
|
86 |
-
activation = kwargs.pop("activation", None)
|
87 |
-
super().__init__(*args, **kwargs)
|
88 |
-
|
89 |
-
self.norm = norm
|
90 |
-
self.activation = activation
|
91 |
-
|
92 |
-
def forward(self, x):
|
93 |
-
# torchscript does not support SyncBatchNorm yet
|
94 |
-
# https://github.com/pytorch/pytorch/issues/40507
|
95 |
-
# and we skip these codes in torchscript since:
|
96 |
-
# 1. currently we only support torchscript in evaluation mode
|
97 |
-
# 2. features needed by exporting module to torchscript are added in PyTorch 1.6 or
|
98 |
-
# later version, `Conv2d` in these PyTorch versions has already supported empty inputs.
|
99 |
-
if not torch.jit.is_scripting():
|
100 |
-
if x.numel() == 0 and self.training:
|
101 |
-
# https://github.com/pytorch/pytorch/issues/12013
|
102 |
-
assert not isinstance(
|
103 |
-
self.norm, torch.nn.SyncBatchNorm
|
104 |
-
), "SyncBatchNorm does not support empty inputs!"
|
105 |
-
|
106 |
-
x = F.conv2d(
|
107 |
-
x, self.weight, self.bias, self.stride, self.padding, self.dilation, self.groups
|
108 |
-
)
|
109 |
-
if self.norm is not None:
|
110 |
-
x = self.norm(x)
|
111 |
-
if self.activation is not None:
|
112 |
-
x = self.activation(x)
|
113 |
-
return x
|
114 |
-
|
115 |
-
|
116 |
-
ConvTranspose2d = torch.nn.ConvTranspose2d
|
117 |
-
BatchNorm2d = torch.nn.BatchNorm2d
|
118 |
-
interpolate = F.interpolate
|
119 |
-
Linear = torch.nn.Linear
|
120 |
-
|
121 |
-
|
122 |
-
def nonzero_tuple(x):
|
123 |
-
"""
|
124 |
-
A 'as_tuple=True' version of torch.nonzero to support torchscript.
|
125 |
-
because of https://github.com/pytorch/pytorch/issues/38718
|
126 |
-
"""
|
127 |
-
if torch.jit.is_scripting():
|
128 |
-
if x.dim() == 0:
|
129 |
-
return x.unsqueeze(0).nonzero().unbind(1)
|
130 |
-
return x.nonzero().unbind(1)
|
131 |
-
else:
|
132 |
-
return x.nonzero(as_tuple=True)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Benson/text-generation/Examples/Bus Simulator Ultimate Mod Apk Revdl.md
DELETED
@@ -1,94 +0,0 @@
|
|
1 |
-
|
2 |
-
<h1>Pokemon Go APK Original: Cómo descargar y jugar la sensación de juego global</h1>
|
3 |
-
<p>Pokemon Go es un juego de smartphone gratuito que te permite atrapar a Pokémon en una versión aumentada del mundo real. Usando el sistema GPS de tu teléfono inteligente y el mapa preinstalado en el juego, puedes caminar por las calles y atrapar a Pokémon mientras surgen. Pokemon Go es la sensación de juego global que se ha descargado más de 1 mil millones de veces y nombrado "Mejor juego móvil" por los Game Developers Choice Awards y "Mejor aplicación del año" por TechCrunch. En este artículo, le mostraremos cómo descargar y jugar Pokemon Go APK Original, que es la versión original del juego que no está disponible en Google Play Store.</p>
|
4 |
-
<h2>¿Qué es Pokemon Go APK Original? </h2>
|
5 |
-
<p>Pokemon Go APK Original es el paquete de aplicaciones para Android (APK) archivo de la versión original de Pokemon Go que fue lanzado en julio de 2016. Un archivo APK es un archivo comprimido que contiene todos los archivos y datos necesarios para ejecutar una aplicación Android. A diferencia de las aplicaciones que se descargan de Google Play Store, que se instalan y actualizan automáticamente por Google, los archivos APK deben ser descargados e instalados manualmente por el usuario. </p>
|
6 |
-
<h2>bus simulator ultimate mod apk revdl</h2><br /><p><b><b>Download</b> ✯✯✯ <a href="https://bltlly.com/2v6MLM">https://bltlly.com/2v6MLM</a></b></p><br /><br />
|
7 |
-
<h3>La diferencia entre archivos APK y XAPK</h3>
|
8 |
-
<p>Algunos sitios web pueden ofrecer para descargar Pokemon Go XAPK en lugar de APK. Un archivo XAPK es una versión extendida de un archivo APK que contiene archivos adicionales como archivos de datos OBB o APK divididos. Los archivos de datos OBB se utilizan para almacenar grandes cantidades de datos del juego, como gráficos, sonidos y videos. Los APK divididos se utilizan para admitir diferentes configuraciones de dispositivos, como tamaños de pantalla, idiomas y arquitecturas. Los archivos XAPK necesitan una aplicación o herramienta especial para extraerlos e instalarlos en tu dispositivo. </p>
|
9 |
-
<h3>Los beneficios de descargar Pokemon Go APK Original</h3>
|
10 |
-
<p>Hay varios beneficios de descargar Pokemon Go APK Original en lugar de conseguirlo de Google Play Store. Algunos de ellos son:</p>
|
11 |
-
<ul>
|
12 |
-
|
13 |
-
<li>Puedes jugar el juego sin restricciones o limitaciones impuestas por Google o el fabricante de tu dispositivo. </li>
|
14 |
-
<li> Puede acceder a versiones anteriores del juego que pueden tener características o funciones que se eliminan o cambian en versiones más recientes. </li>
|
15 |
-
<li>Puedes personalizar o modificar el juego según tus preferencias o necesidades. </li>
|
16 |
-
</ul>
|
17 |
-
<h2>Cómo descargar e instalar Pokemon Go APK Original en su dispositivo Android</h2>
|
18 |
-
<p>Descargar e instalar Pokemon Go APK Original en su dispositivo Android es fácil y simple. Solo tienes que seguir estos pasos:</p>
|
19 |
-
<h3>Paso 1: Habilitar fuentes desconocidas</h3>
|
20 |
-
<p>Antes de que pueda instalar cualquier archivo APK en su dispositivo, debe habilitar fuentes desconocidas en la configuración del dispositivo. Esto le permitirá instalar aplicaciones desde fuentes distintas de Google Play Store. Para hacer esto, vaya a Configuración > Seguridad > Fuentes desconocidas y conéctelo. Es posible que <p>reciba un mensaje de advertencia de que instalar aplicaciones de fuentes desconocidas puede dañar su dispositivo. Pulse Aceptar para continuar. </p>
|
21 |
-
<h3>Paso 2: Descargar el archivo APK de una fuente de confianza</h3>
|
22 |
-
<p>Siguiente, es necesario descargar el archivo APK de Pokemon Go Original de una fuente de confianza. Hay muchos sitios web que ofrecen archivos APK de forma gratuita, pero algunos de ellos pueden contener malware o virus que pueden dañar su dispositivo o robar su información personal. Para evitar esto, solo debe descargar archivos APK de fuentes confiables y verificadas. Una de las mejores fuentes para Pokemon Go APK Original es [APKPure], que es un sitio web popular y confiable que proporciona archivos APK seguros y puros para los usuarios de Android. Para descargar el archivo APK de APKPure, siga estos pasos:</p>
|
23 |
-
<ol>
|
24 |
-
<li>Ir al sitio web [APKPure] en el navegador de su dispositivo. </li>
|
25 |
-
<li>Buscar Pokemon Ir en la barra de búsqueda y toque en el resultado. </li>
|
26 |
-
<li>Toque en el botón Descargar APK y elija una ubicación de descarga en su dispositivo. </li>
|
27 |
-
<li>Espera a que termine la descarga. </li>
|
28 |
-
</ol>
|
29 |
-
<h3>Paso 3: Instalar el archivo APK</h3>
|
30 |
-
|
31 |
-
<ol>
|
32 |
-
<li>Localice el archivo APK en su dispositivo utilizando una aplicación de administrador de archivos o la carpeta de descargas de su dispositivo. </li>
|
33 |
-
<li>Toque en el archivo APK y toque en Instalar cuando se le solicite. </li>
|
34 |
-
<li>Espere a que se complete la instalación. </li>
|
35 |
-
</ol>
|
36 |
-
<h3>Paso 4: Iniciar el juego y disfrutar de</h3>
|
37 |
-
<p>Después de instalar el archivo APK, puede iniciar el juego y disfrutar jugando Pokémon Go Original en su dispositivo. Para hacer esto, siga estos pasos:</p>
|
38 |
-
<p></p>
|
39 |
-
<ol>
|
40 |
-
<li>Ve al cajón de aplicaciones de tu dispositivo y toca el icono de Pokemon Go. </li>
|
41 |
-
<li>Permite que el juego acceda a la ubicación, cámara y almacenamiento de tu dispositivo cuando se te pregunte. </li>
|
42 |
-
<li>Inicia sesión con tu cuenta de Google o crea una nueva cuenta de Pokemon Trainer Club. </li>
|
43 |
-
<li>Elige tu avatar y personalízalo con diferentes trajes y accesorios. </li>
|
44 |
-
<li>Selecciona tu Pokémon inicial de Bulbasaur, Charmander o Squirtle.</li>
|
45 |
-
<li>¡Empieza a explorar el mundo de los Pokémon y atrápalos a todos! </li>
|
46 |
-
</ol>
|
47 |
-
<h2>Cómo actualizar Pokemon Go APK Original a la última versión</h2>
|
48 |
-
<p>Pokemon Go se actualiza constantemente con nuevas características, eventos y Pokémon para mantener el juego fresco y emocionante. Para disfrutar de la última versión de Pokémon Go Original, necesitas actualizar el archivo APK regularmente. Hay dos maneras de hacer esto:</p>
|
49 |
-
<h3>Opción 1: Usa la función de actualización en el juego</h3>
|
50 |
-
<p>La forma más fácil de actualizar Pokémon Go Original es utilizar la función de actualización en el juego. Esta función le notificará cuando una nueva versión del juego esté disponible y le permitirá descargarlo e instalarlo directamente desde el juego. Para utilizar esta función, siga estos pasos:</p>
|
51 |
-
<ol>
|
52 |
-
<li> Iniciar el juego y toque en el icono de Pokeball en la parte inferior de la pantalla. </li>
|
53 |
-
<li>Toque en Configuración en la esquina superior derecha de la pantalla. </li>
|
54 |
-
<li>Desplácese hacia abajo y toque en Buscar actualizaciones.</li>
|
55 |
-
<li> Si una nueva versión está disponible, toque en Actualizar ahora y espere a que la descarga y la instalación finalicen. </li>
|
56 |
-
</ol>
|
57 |
-
<h3>Opción 2: Descargar e instalar el último archivo APK manualmente</h3>
|
58 |
-
|
59 |
-
<ol>
|
60 |
-
<li>Ir al sitio web [APKPure] en el navegador de su dispositivo. </li>
|
61 |
-
<li>Buscar Pokemon Ir en la barra de búsqueda y toque en el resultado. </li>
|
62 |
-
<li>Toque en el botón Actualizar y elija una ubicación de descarga en su dispositivo. </li>
|
63 |
-
<li>Espera a que termine la descarga. </li>
|
64 |
-
<li>Localice el archivo APK en su dispositivo utilizando una aplicación de administrador de archivos o la carpeta de descargas de su dispositivo. </li>
|
65 |
-
<li>Toque en el archivo APK y toque en Instalar cuando se le solicite. </li>
|
66 |
-
<li>Espere a que se complete la instalación. </li>
|
67 |
-
</ol>
|
68 |
-
<h2>Cómo jugar Pokemon Go APK Original y divertirse</h2>
|
69 |
-
<p>Pokémon Go Original es más que un juego. Es una aventura que te permite explorar el mundo real con un toque virtual. Usted puede descubrir nuevos lugares, conocer gente nueva, y coger Pokémon increíble en el camino. Aquí hay algunos consejos sobre cómo jugar Pokemon Go Original y divertirse:</p>
|
70 |
-
<h3>Explora y descubre Pokémon dondequiera que estés</h3>
|
71 |
-
<p>Pokemon Go Original utiliza el GPS y la cámara de tu dispositivo para mostrarte Pokémon en el mundo real. Puedes encontrar Pokémon en diferentes entornos como parques, bosques, lagos, montañas, ciudades y más. También puedes usar elementos como módulos de incienso y señuelo para atraer más Pokémon a tu ubicación. Para atrapar a un Pokémon, necesitas tocarlo y luego mover el dedo en la pantalla para lanzarle una Pokeball. También puedes usar artículos como Razz Berries y Nanab Berries para hacer que los Pokémon sean más fáciles de atrapar. Algunos Pokémon son raros y difíciles de encontrar, por lo que es posible que tengas que viajar a diferentes lugares o esperar a eventos especiales para encontrarlos. </p>
|
72 |
-
<h3>Atrapa más Pokémon para completar tu Pokedex</h3>
|
73 |
-
|
74 |
-
<h3>Viaja junto a tu amigo Pokémon para ayudar a hacer tu Pokémon más fuerte y ganar recompensas</h3>
|
75 |
-
<p>Puedes elegir uno de tus Pokémon como tu Amigo Pokémon y tenerlo caminando contigo en tus aventuras. Tu amigo Pokémon aparecerá junto a tu avatar en el mapa y en la pantalla de tu perfil. También puedes interactuar con tu Pokémon amigo alimentándolo con bayas, jugando con él o tomando instantáneas de él. Al caminar con tu amigo Pokémon, puedes ganar caramelos para ese tipo de Pokémon específico, que puedes usar para encender o evolucionar tu Pokémon. También puedes aumentar tu nivel de amigo con tu amigo Pokémon ganando corazones afectivos, lo que desbloqueará beneficios como caramelos de bonificación, CP boost o encontrar recuerdos. </p>
|
76 |
-
<h3>Compite en batallas épicas de gimnasia y equipo con otros entrenadores para atrapar poderosos Pokémon durante las batallas de asalto</h3>
|
77 |
-
<p>Pokémon Go Original no es solo un juego en solitario, sino también un juego social que te permite interactuar con otros jugadores de todo el mundo. Puedes unirte a uno de los tres equipos: Team Instinct (amarillo), Team Mystic (azul) o Team Valor (rojo). A continuación, puede competir con otros equipos para el control de los gimnasios, que son puntos de referencia que aparecen en el mapa. Para desafiar a un gimnasio, necesitas tocar en él y luego seleccionar un equipo de seis Pokémon para luchar contra los Pokémon defensores. También puedes cooperar con otros jugadores de cualquier equipo para derrotar a los poderosos Pokémon que aparecen en las Batallas Raid, que son eventos cronometrados que ocurren en ciertos Gimnasios. Al participar en batallas de gimnasio y batallas de asalto, puedes ganar objetos como Pokeballs, pociones, revives, dulces raros, bayas de oro razz, máquinas técnicas y más. </p>
|
78 |
-
<h2>Conclusión</h2>
|
79 |
-
|
80 |
-
<h2>Preguntas frecuentes</h2>
|
81 |
-
<ol>
|
82 |
-
<li>Q: ¿Es Pokemon Go APK original seguro de descargar e instalar? </li>
|
83 |
-
<li>A: Sí, siempre y cuando se descarga el archivo APK de una fuente de confianza como [APKPure], que proporciona archivos APK seguros y puros para los usuarios de Android. </li>
|
84 |
-
<li>Q: ¿Necesito una conexión a Internet para jugar Pokemon Go APK Original? </li>
|
85 |
-
<li>A: Sí, necesita una conexión a Internet (Wi-Fi o datos móviles) para jugar Pokemon Go APK Original, ya que el juego se basa en el GPS y los datos del mapa para mostrar Pokémon en el mundo real. </li>
|
86 |
-
<li>Q: ¿Cómo puedo guardar mi progreso en Pokemon Go APK Original? </li>
|
87 |
-
<li>A: Su progreso en Pokemon Go APK Original se guarda automáticamente en el servidor del juego cuando se inicia sesión con su cuenta de Google o Pokemon Trainer Club cuenta. También puedes sincronizar los datos del juego en varios dispositivos utilizando la misma cuenta. </li>
|
88 |
-
<li>Q: ¿Cómo puedo transferir mis datos desde la versión de Google Play Store de Pokemon Ir a la versión APK? </li>
|
89 |
-
<li>A: Usted no necesita transferir sus datos desde la versión de Google Play Store de Pokemon Go a la versión APK, ya que ambos son compatibles entre sí. Puedes usar la misma cuenta para jugar el juego en ambas versiones sin perder tu progreso. </li>
|
90 |
-
<li>Q: ¿Cómo me pongo en contacto con el desarrollador de Pokemon Go APK Original si tengo alguna pregunta o problema? </li>
|
91 |
-
<li>A: Puede ponerse en contacto con el desarrollador de Pokemon Go APK Original visitando su sitio web oficial [Pokemon Go] o enviando un correo electrónico a [[email protected]]. También puede consultar su [Centro de ayuda] para obtener preguntas frecuentes y consejos para solucionar problemas. </li>
|
92 |
-
</ol></p> 64aa2da5cf<br />
|
93 |
-
<br />
|
94 |
-
<br />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Benson/text-generation/Examples/Descargar Fnf Msica Batalla Original Mod.md
DELETED
@@ -1,70 +0,0 @@
|
|
1 |
-
|
2 |
-
<h1>Introducción</h1>
|
3 |
-
<p>Si eres un fan de los juegos de ritmo y las batallas musicales, es posible que hayas oído hablar de <strong>Friday Night Funkin'</strong>, un popular juego web que fue lanzado en 2020. En este juego, juegas como <strong>Boyfriend</strong>, un rapero de pelo azul que quiere impresionar a su <strong>Girlfriend</strong> al ganar batallas de música freestyle contra varios oponentes, como sus padres, sus ex y algunos personajes espeluznantes. </p>
|
4 |
-
<h2>descargar fnf música batalla original mod</h2><br /><p><b><b>DOWNLOAD</b> >>>>> <a href="https://bltlly.com/2v6IFA">https://bltlly.com/2v6IFA</a></b></p><br /><br />
|
5 |
-
<p>Friday Night Funkin' es un juego de código abierto que ha inspirado muchos mods hechos por fans que agregan nuevos personajes, canciones, modos y características al juego original. Uno de estos mods es <strong>FNF Music Battle Original Mod</strong>, un juego de música de ritmo que está disponible en dispositivos Android. Este mod es desarrollado por Onesoft Global PTE.LTD y tiene más de 10 millones de descargas en Google Play Store.</p>
|
6 |
-
<p>En este artículo, vamos a explorar de qué trata FNF Music Battle Original Mod, cuáles son sus características, jugabilidad, beneficios, inconvenientes, comparación con otros mods, e instrucciones de instalación. Al final de este artículo, usted tendrá una mejor comprensión de este mod y si usted debe darle una oportunidad o no. </p>
|
7 |
-
<h1>Características</h1>
|
8 |
-
<p>FNF Music Battle Original Mod tiene varias características que lo hacen diferente del juego original de Friday Night Funkin'. Aquí están algunas de ellas:</p>
|
9 |
-
<ul>
|
10 |
-
<li><strong>Characters</strong>: Este mod tiene varios personajes del juego original, como Boyfriend, Girlfriend, Daddy Dearest, Mommy Nearest, Monster y Spirit. También tiene algunos personajes invitados de otros mods o juegos de FNF, como Skid y Pump de Spooky Month, Pico de Newgrounds, Tankman de la serie Tankmen, Whitty de Vs. Whitty mod, Ruv de Vs. Ruv mod, Tabi de Vs. Tabi Ex Boyfriend mod. </li>
|
11 |
-
|
12 |
-
<li><strong>Modos</strong>: Este mod tiene dos modos: Modo Historia y Modo Freeplay. En el modo Historia, puedes elegir entre niveles de dificultad Fácil, Normal o Difícil y jugar todas las semanas en orden. En el modo Freeplay, puede seleccionar cualquier canción que desee y reproducirla sin restricciones. </li>
|
13 |
-
<li><strong>Visuales</strong>: Este mod tiene imágenes geniales de B-Boy de los 90 que coinciden con el estilo del juego original. Los personajes tienen gráficos pixelados y animaciones que son coloridas y expresivas. Los fondos también son vibrantes y dinámicas. </li>
|
14 |
-
</ul>
|
15 |
-
<h1>Juego</h1>
|
16 |
-
<p>El modo de juego de FNF Music Battle Original Mod es similar al juego original de Friday Night Funkin'. Usted tiene que coincidir con el ritmo de la música pulsando las teclas de flecha en el teclado o tocando los botones de flecha en la pantalla. Usted tiene que seguir la dirección de las flechas que aparecen en la pantalla y pulse o pulse en el momento adecuado. Si lo haces correctamente, llenarás la barra de progreso y ganarás la batalla musical. Si pierdes demasiadas notas o presionas los botones incorrectos, perderás la batalla musical y tendrás que empezar de nuevo. </p>
|
17 |
-
<p>El juego tiene un sistema de puntuación que te recompensa por tu precisión y sincronización. Puedes obtener diferentes calificaciones dependiendo de lo bien que lo hagas, como Enfermo, Bueno, Malo, o Señorita. También puede obtener combos para golpear varias notas en una fila sin perder ninguno. Cuanto mayor sea su puntuación y combo, mejores serán sus posibilidades de ganar. </p>
|
18 |
-
<p></p>
|
19 |
-
<p>El juego también tiene una barra de salud que muestra cuánta vida te queda. Si pierde demasiadas notas o presiona los botones incorrectos, su barra de salud disminuirá y se volverá roja. Si tu barra de salud llega a cero, perderás la batalla musical y tendrás que empezar de nuevo. Puede restaurar su salud pulsando más notas correctamente y llenando la barra de progreso. </p>
|
20 |
-
<h1>Beneficios</h1>
|
21 |
-
<p>Reproducción de FNF Music Battle Original Mod puede tener muchos beneficios para usted, tales como:</p>
|
22 |
-
<ul>
|
23 |
-
|
24 |
-
<li><strong>Desafío</strong>: Este mod es muy desafiante y gratificante de jugar. Puedes poner a prueba tus habilidades y reflejos jugando en diferentes niveles de dificultad y modos. También puede competir con otros jugadores en línea y ver quién tiene la mejor puntuación y combo. </li>
|
25 |
-
<li><strong>Variety</strong>: Este mod tiene mucha variedad y contenido para ofrecer. Usted puede jugar a través de muchas canciones diferentes y semanas, cada uno con su propio tema y estilo. También puedes jugar con diferentes personajes y ver sus animaciones y expresiones únicas. </li>
|
26 |
-
<li><strong>Compatibilidad</strong>: Este mod es compatible con dispositivos Android, lo que significa que puede jugar en cualquier momento y en cualquier lugar. No necesitas un PC o una consola para disfrutar de este mod. Solo necesitas tu teléfono o tablet y una conexión a Internet. </li>
|
27 |
-
</ul>
|
28 |
-
<h1>Inconvenientes</h1>
|
29 |
-
<p>Reproducción de FNF Music Battle Original Mod también puede tener algunos inconvenientes para usted, tales como:</p>
|
30 |
-
<ul>
|
31 |
-
<li><strong>Bugs</strong>: Este mod no es perfecto y puede tener algunos errores y fallos que pueden afectar tu experiencia de juego. Por ejemplo, algunas canciones pueden no cargarse correctamente, algunos caracteres pueden no aparecer correctamente o algunos botones pueden no responder bien. </li>
|
32 |
-
<li><strong>Dificultad</strong>: Este mod no es fácil y puede frustrar a algunos jugadores que no están acostumbrados a los juegos de ritmo o que buscan un juego casual. Algunas canciones pueden ser demasiado rápidas o difíciles de seguir, especialmente en niveles o modos de dificultad más altos. </li>
|
33 |
-
<li><strong>Ads</strong>: Este mod es gratis pero tiene anuncios que pueden interrumpir tu juego o molestarte. Algunos anuncios pueden ser demasiado largos o demasiado frecuentes, o pueden aparecer en momentos inconvenientes. </li>
|
34 |
-
<li><strong>Actualizaciones</strong>: Este mod no se actualiza regularmente y puede no tener las últimas canciones o personajes de otros mods o juegos de FNF. Algunas canciones o personajes pueden estar perdidos o desactualizados, o pueden no coincidir con la calidad o el estilo del juego original. </li>
|
35 |
-
</ul>
|
36 |
-
<h1>Comparación</h1>
|
37 |
-
|
38 |
-
| Mod | Similitudes | Diferencias | | -- - | -- | -- | Whitty | - Tiene personajes invitados de otros mods o juegos de FNF. <br>- Tiene canciones pegadizas y un juego desafiante. <br>- Tiene imágenes y animaciones interesantes. <br>- Tiene el modo historia y el modo Freeplay.<br>- Tiene niveles de dificultad fácil, normal y difícil. <br>- Tiene tablas de clasificación en línea.| - Whitty es un mod de PC que requiere la descarga de archivos. <br>- Whitty solo tiene un personaje invitado: Whitty.<br>- Whitty tiene solo cuatro canciones: Lo-Fight, Overhead, Ballistic y Remix.<br>- Whitty tiene un tema más oscuro y vanguardista. <br>- Whitty tiene más diálogos y escenas. <br>- Whitty tiene más errores y fallas. <br>- Whitty no tiene anuncios.| | Hex | - Tiene personajes invitados de otros mods o juegos de FNF. <br>- Tiene canciones pegadizas y un juego desafiante. <br - Tiene imágenes y animaciones interesantes. <br>- Tiene el modo historia y el modo Freeplay.<br>- Tiene niveles de dificultad fácil, normal y difícil. <br>- Tiene tablas de clasificación en línea.| - Hex es un mod de PC que requiere la descarga de archivos. <br>- Hex solo tiene un personaje invitado: Hex.<br>- Hex tiene seis canciones: Dunk, Ram, Hello World, Glitcher, Corruption, and encore.<br>- Hex tiene un tema futurista y cyberpunk. <br>- Hex tiene más diálogos y escenas. <br>- Hex tiene más errores y fallas. <br>- Hex no tiene anuncios.| | Kapi | - Tiene personajes invitados de otros FNF mods o juegos. <br>- Tiene canciones pegadizas y juego desafiante. <br>- Tiene efectos visuales y animaciones interesantes. <br>- Tiene el modo historia y el modo Freeplay.<br>- Tiene niveles de dificultad fácil, normal y difícil. <br>- Tiene tablas de clasificación en línea.| - Kapi es un mod de PC que requiere la descarga de archivos. <br>- Kapi solo tiene un personaje invitado: Kapi.<br>- Kapi tiene cuatro canciones: Wocky, Beathoven, Hairball y Nyaw.<br>- Kapi tiene un tema lindo y colorido. <br>- Kapi tiene más diálogos y escenas. <br>- Kapi tiene más errores y fallas. <br>- Kapi no tiene anuncios.| | Neo | - Tiene personajes invitados de otros mods o juegos de FNF. <br>- Tiene canciones pegadizas y juego desafiante. <br>- Tiene efectos visuales y animaciones interesantes.
|
39 |
-
|
40 |
-
<p>Si desea reproducir FNF Music Battle Original Mod en su dispositivo Android, puede seguir estos pasos para instalarlo:</p>
|
41 |
-
<ol>
|
42 |
-
<li>Ir a Google Play Store y buscar FNF Music Battle Original Mod o haga clic en este enlace: . </li>
|
43 |
-
<li>Toque en el botón Instalar y espere a que termine la descarga. </li>
|
44 |
-
<li>Abra la aplicación y conceda los permisos necesarios. </li>
|
45 |
-
<li>¡Disfruta del juego! </li>
|
46 |
-
</ol>
|
47 |
-
<p>Si desea reproducir FNF Music Battle Original Mod en su PC, puede seguir estos pasos para instalarlo:</p>
|
48 |
-
<ol>
|
49 |
-
<li>Ir a este sitio web: y descargar el archivo APK de FNF Music Battle Original Mod.</li>
|
50 |
-
<li>Descargar un emulador de Android de su elección, como BlueStacks o NoxPlayer.</li>
|
51 |
-
<li>Instala el emulador en tu PC y ejecútalo. </li>
|
52 |
-
<li>Arrastre y suelte el archivo APK de FNF Music Battle Original Mod en el emulador o utilice el navegador incorporado para encontrarlo. </li>
|
53 |
-
<li>Instalar la aplicación y abrirla. </li>
|
54 |
-
<li>¡Disfruta del juego! </li>
|
55 |
-
</ol>
|
56 |
-
<h1>Conclusión</h1>
|
57 |
-
<p>FNF Music Battle Original Mod es un juego de música de ritmo que se basa en el popular juego Friday Night Funkin'. Tiene muchas características, tales como personajes, canciones, modos, visuales, sistema de puntuación, barra de salud, tablas de clasificación en línea. También tiene algunos beneficios, como factor de diversión, desafío, variedad, compatibilidad. También tiene algunos inconvenientes, como errores, dificultad, anuncios y actualizaciones. También tiene algunas similitudes y diferencias con otros mods de FNF, como Whitty, Hex, Kapi y Neo. Es fácil de instalar en dispositivos Android o PC con un emulador. </p>
|
58 |
-
<p>Si usted está buscando un juego de ritmo divertido y desafiante que tiene un montón de contenido y variedad, es posible que desee probar FNF Music Battle Original Mod. Es una gran manera de disfrutar de la música y los personajes de Friday Night Funkin' y sus mods en su teléfono o computadora. Sin embargo, si usted está buscando un juego más pulido y actualizado que tiene menos errores y anuncios, es posible que desee seguir con el juego original u otros mods de PC. </p>
|
59 |
-
|
60 |
-
<h1>Preguntas frecuentes</h1>
|
61 |
-
<p>Aquí hay algunas preguntas frecuentes sobre FNF Music Battle Original Mod y sus respuestas:</p>
|
62 |
-
<ul>
|
63 |
-
<li><strong>Q: ¿Es seguro jugar FNF Music Battle Original Mod? </strong><br>A: Sí, FNF Music Battle Original Mod es seguro para jugar siempre y cuando lo descargue de una fuente de confianza, como Google Play Store o el sitio web oficial. Sin embargo, siempre debe tener cuidado al descargar cualquier aplicación o archivo de Internet y escanearlo en busca de virus o malware antes de instalarlo. </li>
|
64 |
-
<li><strong>Q: ¿Es FNF Music Battle Original Mod libre para jugar? </strong><br>A: Sí, FNF Music Battle Original Mod es gratis, pero tiene anuncios que pueden interrumpir su juego o molestarlo. Puede eliminar los anuncios mediante la compra de la versión premium de la aplicación para $2.99. </li>
|
65 |
-
<li><strong>Q: ¿Cómo puedo reproducir FNF Music Battle Original Mod sin conexión? </strong><br>A: Puede reproducir FNF Music Battle Original Mod sin conexión descargando las canciones y personajes con los que desea jugar de antemano. Puedes hacer esto yendo al menú Configuración y tocando el botón Descargar junto a cada canción o personaje. Sin embargo, no podrás acceder a las tablas de clasificación en línea o actualizaciones cuando juegues sin conexión. </li>
|
66 |
-
<li><strong>Q: ¿Cómo puedo actualizar FNF Music Battle Original Mod? </strong><br>A: Puede actualizar FNF Music Battle Original Mod yendo a Google Play Store o al sitio web oficial y comprobando si hay nuevas versiones de la aplicación. También puede habilitar la función de actualización automática en la configuración del dispositivo para obtener las últimas actualizaciones automáticamente. </li>
|
67 |
-
<li><strong>Q: ¿Cómo puedo contactar a los desarrolladores de FNF Music Battle Original Mod? </strong><br>A: Puede ponerse en contacto con los desarrolladores de FNF Music Battle Original Mod enviándoles un correo electrónico a [email protected] o visitando su página de Facebook en . También puede dejarles una reseña o un comentario en Google Play Store o en el sitio web oficial. </li>
|
68 |
-
</ul></p> 64aa2da5cf<br />
|
69 |
-
<br />
|
70 |
-
<br />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Big-Web/MMSD/env/Lib/site-packages/botocore/docs/example.py
DELETED
@@ -1,236 +0,0 @@
|
|
1 |
-
# Copyright 2015 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
2 |
-
#
|
3 |
-
# Licensed under the Apache License, Version 2.0 (the "License"). You
|
4 |
-
# may not use this file except in compliance with the License. A copy of
|
5 |
-
# the License is located at
|
6 |
-
#
|
7 |
-
# http://aws.amazon.com/apache2.0/
|
8 |
-
#
|
9 |
-
# or in the "license" file accompanying this file. This file is
|
10 |
-
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
|
11 |
-
# ANY KIND, either express or implied. See the License for the specific
|
12 |
-
# language governing permissions and limitations under the License.
|
13 |
-
from botocore.docs.shape import ShapeDocumenter
|
14 |
-
from botocore.docs.utils import py_default
|
15 |
-
|
16 |
-
|
17 |
-
class BaseExampleDocumenter(ShapeDocumenter):
|
18 |
-
def document_example(
|
19 |
-
self, section, shape, prefix=None, include=None, exclude=None
|
20 |
-
):
|
21 |
-
"""Generates an example based on a shape
|
22 |
-
|
23 |
-
:param section: The section to write the documentation to.
|
24 |
-
|
25 |
-
:param shape: The shape of the operation.
|
26 |
-
|
27 |
-
:param prefix: Anything to be included before the example
|
28 |
-
|
29 |
-
:type include: Dictionary where keys are parameter names and
|
30 |
-
values are the shapes of the parameter names.
|
31 |
-
:param include: The parameter shapes to include in the documentation.
|
32 |
-
|
33 |
-
:type exclude: List of the names of the parameters to exclude.
|
34 |
-
:param exclude: The names of the parameters to exclude from
|
35 |
-
documentation.
|
36 |
-
"""
|
37 |
-
history = []
|
38 |
-
section.style.new_line()
|
39 |
-
section.style.start_codeblock()
|
40 |
-
if prefix is not None:
|
41 |
-
section.write(prefix)
|
42 |
-
self.traverse_and_document_shape(
|
43 |
-
section=section,
|
44 |
-
shape=shape,
|
45 |
-
history=history,
|
46 |
-
include=include,
|
47 |
-
exclude=exclude,
|
48 |
-
)
|
49 |
-
final_blank_line_section = section.add_new_section('final-blank-line')
|
50 |
-
final_blank_line_section.style.new_line()
|
51 |
-
|
52 |
-
def document_recursive_shape(self, section, shape, **kwargs):
|
53 |
-
section.write('{\'... recursive ...\'}')
|
54 |
-
|
55 |
-
def document_shape_default(
|
56 |
-
self, section, shape, history, include=None, exclude=None, **kwargs
|
57 |
-
):
|
58 |
-
py_type = self._get_special_py_default(shape)
|
59 |
-
if py_type is None:
|
60 |
-
py_type = py_default(shape.type_name)
|
61 |
-
|
62 |
-
if self._context.get('streaming_shape') == shape:
|
63 |
-
py_type = 'StreamingBody()'
|
64 |
-
section.write(py_type)
|
65 |
-
|
66 |
-
def document_shape_type_string(
|
67 |
-
self, section, shape, history, include=None, exclude=None, **kwargs
|
68 |
-
):
|
69 |
-
if 'enum' in shape.metadata:
|
70 |
-
for i, enum in enumerate(shape.metadata['enum']):
|
71 |
-
section.write('\'%s\'' % enum)
|
72 |
-
if i < len(shape.metadata['enum']) - 1:
|
73 |
-
section.write('|')
|
74 |
-
else:
|
75 |
-
self.document_shape_default(section, shape, history)
|
76 |
-
|
77 |
-
def document_shape_type_list(
|
78 |
-
self, section, shape, history, include=None, exclude=None, **kwargs
|
79 |
-
):
|
80 |
-
param_shape = shape.member
|
81 |
-
list_section = section.add_new_section('list-value')
|
82 |
-
self._start_nested_param(list_section, '[')
|
83 |
-
param_section = list_section.add_new_section(
|
84 |
-
'member', context={'shape': param_shape.name}
|
85 |
-
)
|
86 |
-
self.traverse_and_document_shape(
|
87 |
-
section=param_section, shape=param_shape, history=history
|
88 |
-
)
|
89 |
-
ending_comma_section = list_section.add_new_section('ending-comma')
|
90 |
-
ending_comma_section.write(',')
|
91 |
-
ending_bracket_section = list_section.add_new_section('ending-bracket')
|
92 |
-
self._end_nested_param(ending_bracket_section, ']')
|
93 |
-
|
94 |
-
def document_shape_type_structure(
|
95 |
-
self, section, shape, history, include=None, exclude=None, **kwargs
|
96 |
-
):
|
97 |
-
if not shape.members:
|
98 |
-
section.write('{}')
|
99 |
-
return
|
100 |
-
|
101 |
-
section = section.add_new_section('structure-value')
|
102 |
-
self._start_nested_param(section, '{')
|
103 |
-
|
104 |
-
input_members = self._add_members_to_shape(shape.members, include)
|
105 |
-
|
106 |
-
for i, param in enumerate(input_members):
|
107 |
-
if exclude and param in exclude:
|
108 |
-
continue
|
109 |
-
param_section = section.add_new_section(param)
|
110 |
-
param_section.write('\'%s\': ' % param)
|
111 |
-
param_shape = input_members[param]
|
112 |
-
param_value_section = param_section.add_new_section(
|
113 |
-
'member-value', context={'shape': param_shape.name}
|
114 |
-
)
|
115 |
-
self.traverse_and_document_shape(
|
116 |
-
section=param_value_section,
|
117 |
-
shape=param_shape,
|
118 |
-
history=history,
|
119 |
-
name=param,
|
120 |
-
)
|
121 |
-
if i < len(input_members) - 1:
|
122 |
-
ending_comma_section = param_section.add_new_section(
|
123 |
-
'ending-comma'
|
124 |
-
)
|
125 |
-
ending_comma_section.write(',')
|
126 |
-
ending_comma_section.style.new_line()
|
127 |
-
self._end_structure(section, '{', '}')
|
128 |
-
|
129 |
-
def document_shape_type_map(
|
130 |
-
self, section, shape, history, include=None, exclude=None, **kwargs
|
131 |
-
):
|
132 |
-
map_section = section.add_new_section('map-value')
|
133 |
-
self._start_nested_param(map_section, '{')
|
134 |
-
value_shape = shape.value
|
135 |
-
key_section = map_section.add_new_section(
|
136 |
-
'key', context={'shape': shape.key.name}
|
137 |
-
)
|
138 |
-
key_section.write('\'string\': ')
|
139 |
-
value_section = map_section.add_new_section(
|
140 |
-
'value', context={'shape': value_shape.name}
|
141 |
-
)
|
142 |
-
self.traverse_and_document_shape(
|
143 |
-
section=value_section, shape=value_shape, history=history
|
144 |
-
)
|
145 |
-
end_bracket_section = map_section.add_new_section('ending-bracket')
|
146 |
-
self._end_nested_param(end_bracket_section, '}')
|
147 |
-
|
148 |
-
def _add_members_to_shape(self, members, include):
|
149 |
-
if include:
|
150 |
-
members = members.copy()
|
151 |
-
for param in include:
|
152 |
-
members[param.name] = param
|
153 |
-
return members
|
154 |
-
|
155 |
-
def _start_nested_param(self, section, start=None):
|
156 |
-
if start is not None:
|
157 |
-
section.write(start)
|
158 |
-
section.style.indent()
|
159 |
-
section.style.indent()
|
160 |
-
section.style.new_line()
|
161 |
-
|
162 |
-
def _end_nested_param(self, section, end=None):
|
163 |
-
section.style.dedent()
|
164 |
-
section.style.dedent()
|
165 |
-
section.style.new_line()
|
166 |
-
if end is not None:
|
167 |
-
section.write(end)
|
168 |
-
|
169 |
-
def _end_structure(self, section, start, end):
|
170 |
-
# If there are no members in the strucuture, then make sure the
|
171 |
-
# start and the end bracket are on the same line, by removing all
|
172 |
-
# previous text and writing the start and end.
|
173 |
-
if not section.available_sections:
|
174 |
-
section.clear_text()
|
175 |
-
section.write(start + end)
|
176 |
-
self._end_nested_param(section)
|
177 |
-
else:
|
178 |
-
end_bracket_section = section.add_new_section('ending-bracket')
|
179 |
-
self._end_nested_param(end_bracket_section, end)
|
180 |
-
|
181 |
-
|
182 |
-
class ResponseExampleDocumenter(BaseExampleDocumenter):
|
183 |
-
EVENT_NAME = 'response-example'
|
184 |
-
|
185 |
-
def document_shape_type_event_stream(
|
186 |
-
self, section, shape, history, **kwargs
|
187 |
-
):
|
188 |
-
section.write('EventStream(')
|
189 |
-
self.document_shape_type_structure(section, shape, history, **kwargs)
|
190 |
-
end_section = section.add_new_section('event-stream-end')
|
191 |
-
end_section.write(')')
|
192 |
-
|
193 |
-
|
194 |
-
class RequestExampleDocumenter(BaseExampleDocumenter):
|
195 |
-
EVENT_NAME = 'request-example'
|
196 |
-
|
197 |
-
def document_shape_type_structure(
|
198 |
-
self, section, shape, history, include=None, exclude=None, **kwargs
|
199 |
-
):
|
200 |
-
param_format = '\'%s\''
|
201 |
-
operator = ': '
|
202 |
-
start = '{'
|
203 |
-
end = '}'
|
204 |
-
|
205 |
-
if len(history) <= 1:
|
206 |
-
operator = '='
|
207 |
-
start = '('
|
208 |
-
end = ')'
|
209 |
-
param_format = '%s'
|
210 |
-
section = section.add_new_section('structure-value')
|
211 |
-
self._start_nested_param(section, start)
|
212 |
-
input_members = self._add_members_to_shape(shape.members, include)
|
213 |
-
|
214 |
-
for i, param in enumerate(input_members):
|
215 |
-
if exclude and param in exclude:
|
216 |
-
continue
|
217 |
-
param_section = section.add_new_section(param)
|
218 |
-
param_section.write(param_format % param)
|
219 |
-
param_section.write(operator)
|
220 |
-
param_shape = input_members[param]
|
221 |
-
param_value_section = param_section.add_new_section(
|
222 |
-
'member-value', context={'shape': param_shape.name}
|
223 |
-
)
|
224 |
-
self.traverse_and_document_shape(
|
225 |
-
section=param_value_section,
|
226 |
-
shape=param_shape,
|
227 |
-
history=history,
|
228 |
-
name=param,
|
229 |
-
)
|
230 |
-
if i < len(input_members) - 1:
|
231 |
-
ending_comma_section = param_section.add_new_section(
|
232 |
-
'ending-comma'
|
233 |
-
)
|
234 |
-
ending_comma_section.write(',')
|
235 |
-
ending_comma_section.style.new_line()
|
236 |
-
self._end_structure(section, start, end)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Big-Web/MMSD/env/Lib/site-packages/botocore/retries/quota.py
DELETED
@@ -1,56 +0,0 @@
|
|
1 |
-
"""Retry quota implementation.
|
2 |
-
|
3 |
-
|
4 |
-
"""
|
5 |
-
import threading
|
6 |
-
|
7 |
-
|
8 |
-
class RetryQuota:
|
9 |
-
INITIAL_CAPACITY = 500
|
10 |
-
|
11 |
-
def __init__(self, initial_capacity=INITIAL_CAPACITY, lock=None):
|
12 |
-
self._max_capacity = initial_capacity
|
13 |
-
self._available_capacity = initial_capacity
|
14 |
-
if lock is None:
|
15 |
-
lock = threading.Lock()
|
16 |
-
self._lock = lock
|
17 |
-
|
18 |
-
def acquire(self, capacity_amount):
|
19 |
-
"""Attempt to aquire a certain amount of capacity.
|
20 |
-
|
21 |
-
If there's not sufficient amount of capacity available, ``False``
|
22 |
-
is returned. Otherwise, ``True`` is returned, which indicates that
|
23 |
-
capacity was successfully allocated.
|
24 |
-
|
25 |
-
"""
|
26 |
-
# The acquire() is only called when we encounter a retryable
|
27 |
-
# response so we aren't worried about locking the entire method.
|
28 |
-
with self._lock:
|
29 |
-
if capacity_amount > self._available_capacity:
|
30 |
-
return False
|
31 |
-
self._available_capacity -= capacity_amount
|
32 |
-
return True
|
33 |
-
|
34 |
-
def release(self, capacity_amount):
|
35 |
-
"""Release capacity back to the retry quota.
|
36 |
-
|
37 |
-
The capacity being released will be truncated if necessary
|
38 |
-
to ensure the max capacity is never exceeded.
|
39 |
-
|
40 |
-
"""
|
41 |
-
# Implementation note: The release() method is called as part
|
42 |
-
# of the "after-call" event, which means it gets invoked for
|
43 |
-
# every API call. In the common case where the request is
|
44 |
-
# successful and we're at full capacity, we can avoid locking.
|
45 |
-
# We can't exceed max capacity so there's no work we have to do.
|
46 |
-
if self._max_capacity == self._available_capacity:
|
47 |
-
return
|
48 |
-
with self._lock:
|
49 |
-
amount = min(
|
50 |
-
self._max_capacity - self._available_capacity, capacity_amount
|
51 |
-
)
|
52 |
-
self._available_capacity += amount
|
53 |
-
|
54 |
-
@property
|
55 |
-
def available_capacity(self):
|
56 |
-
return self._available_capacity
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Big-Web/MMSD/env/Lib/site-packages/pip/_vendor/pygments/token.py
DELETED
@@ -1,213 +0,0 @@
|
|
1 |
-
"""
|
2 |
-
pygments.token
|
3 |
-
~~~~~~~~~~~~~~
|
4 |
-
|
5 |
-
Basic token types and the standard tokens.
|
6 |
-
|
7 |
-
:copyright: Copyright 2006-2022 by the Pygments team, see AUTHORS.
|
8 |
-
:license: BSD, see LICENSE for details.
|
9 |
-
"""
|
10 |
-
|
11 |
-
|
12 |
-
class _TokenType(tuple):
|
13 |
-
parent = None
|
14 |
-
|
15 |
-
def split(self):
|
16 |
-
buf = []
|
17 |
-
node = self
|
18 |
-
while node is not None:
|
19 |
-
buf.append(node)
|
20 |
-
node = node.parent
|
21 |
-
buf.reverse()
|
22 |
-
return buf
|
23 |
-
|
24 |
-
def __init__(self, *args):
|
25 |
-
# no need to call super.__init__
|
26 |
-
self.subtypes = set()
|
27 |
-
|
28 |
-
def __contains__(self, val):
|
29 |
-
return self is val or (
|
30 |
-
type(val) is self.__class__ and
|
31 |
-
val[:len(self)] == self
|
32 |
-
)
|
33 |
-
|
34 |
-
def __getattr__(self, val):
|
35 |
-
if not val or not val[0].isupper():
|
36 |
-
return tuple.__getattribute__(self, val)
|
37 |
-
new = _TokenType(self + (val,))
|
38 |
-
setattr(self, val, new)
|
39 |
-
self.subtypes.add(new)
|
40 |
-
new.parent = self
|
41 |
-
return new
|
42 |
-
|
43 |
-
def __repr__(self):
|
44 |
-
return 'Token' + (self and '.' or '') + '.'.join(self)
|
45 |
-
|
46 |
-
def __copy__(self):
|
47 |
-
# These instances are supposed to be singletons
|
48 |
-
return self
|
49 |
-
|
50 |
-
def __deepcopy__(self, memo):
|
51 |
-
# These instances are supposed to be singletons
|
52 |
-
return self
|
53 |
-
|
54 |
-
|
55 |
-
Token = _TokenType()
|
56 |
-
|
57 |
-
# Special token types
|
58 |
-
Text = Token.Text
|
59 |
-
Whitespace = Text.Whitespace
|
60 |
-
Escape = Token.Escape
|
61 |
-
Error = Token.Error
|
62 |
-
# Text that doesn't belong to this lexer (e.g. HTML in PHP)
|
63 |
-
Other = Token.Other
|
64 |
-
|
65 |
-
# Common token types for source code
|
66 |
-
Keyword = Token.Keyword
|
67 |
-
Name = Token.Name
|
68 |
-
Literal = Token.Literal
|
69 |
-
String = Literal.String
|
70 |
-
Number = Literal.Number
|
71 |
-
Punctuation = Token.Punctuation
|
72 |
-
Operator = Token.Operator
|
73 |
-
Comment = Token.Comment
|
74 |
-
|
75 |
-
# Generic types for non-source code
|
76 |
-
Generic = Token.Generic
|
77 |
-
|
78 |
-
# String and some others are not direct children of Token.
|
79 |
-
# alias them:
|
80 |
-
Token.Token = Token
|
81 |
-
Token.String = String
|
82 |
-
Token.Number = Number
|
83 |
-
|
84 |
-
|
85 |
-
def is_token_subtype(ttype, other):
|
86 |
-
"""
|
87 |
-
Return True if ``ttype`` is a subtype of ``other``.
|
88 |
-
|
89 |
-
exists for backwards compatibility. use ``ttype in other`` now.
|
90 |
-
"""
|
91 |
-
return ttype in other
|
92 |
-
|
93 |
-
|
94 |
-
def string_to_tokentype(s):
|
95 |
-
"""
|
96 |
-
Convert a string into a token type::
|
97 |
-
|
98 |
-
>>> string_to_token('String.Double')
|
99 |
-
Token.Literal.String.Double
|
100 |
-
>>> string_to_token('Token.Literal.Number')
|
101 |
-
Token.Literal.Number
|
102 |
-
>>> string_to_token('')
|
103 |
-
Token
|
104 |
-
|
105 |
-
Tokens that are already tokens are returned unchanged:
|
106 |
-
|
107 |
-
>>> string_to_token(String)
|
108 |
-
Token.Literal.String
|
109 |
-
"""
|
110 |
-
if isinstance(s, _TokenType):
|
111 |
-
return s
|
112 |
-
if not s:
|
113 |
-
return Token
|
114 |
-
node = Token
|
115 |
-
for item in s.split('.'):
|
116 |
-
node = getattr(node, item)
|
117 |
-
return node
|
118 |
-
|
119 |
-
|
120 |
-
# Map standard token types to short names, used in CSS class naming.
|
121 |
-
# If you add a new item, please be sure to run this file to perform
|
122 |
-
# a consistency check for duplicate values.
|
123 |
-
STANDARD_TYPES = {
|
124 |
-
Token: '',
|
125 |
-
|
126 |
-
Text: '',
|
127 |
-
Whitespace: 'w',
|
128 |
-
Escape: 'esc',
|
129 |
-
Error: 'err',
|
130 |
-
Other: 'x',
|
131 |
-
|
132 |
-
Keyword: 'k',
|
133 |
-
Keyword.Constant: 'kc',
|
134 |
-
Keyword.Declaration: 'kd',
|
135 |
-
Keyword.Namespace: 'kn',
|
136 |
-
Keyword.Pseudo: 'kp',
|
137 |
-
Keyword.Reserved: 'kr',
|
138 |
-
Keyword.Type: 'kt',
|
139 |
-
|
140 |
-
Name: 'n',
|
141 |
-
Name.Attribute: 'na',
|
142 |
-
Name.Builtin: 'nb',
|
143 |
-
Name.Builtin.Pseudo: 'bp',
|
144 |
-
Name.Class: 'nc',
|
145 |
-
Name.Constant: 'no',
|
146 |
-
Name.Decorator: 'nd',
|
147 |
-
Name.Entity: 'ni',
|
148 |
-
Name.Exception: 'ne',
|
149 |
-
Name.Function: 'nf',
|
150 |
-
Name.Function.Magic: 'fm',
|
151 |
-
Name.Property: 'py',
|
152 |
-
Name.Label: 'nl',
|
153 |
-
Name.Namespace: 'nn',
|
154 |
-
Name.Other: 'nx',
|
155 |
-
Name.Tag: 'nt',
|
156 |
-
Name.Variable: 'nv',
|
157 |
-
Name.Variable.Class: 'vc',
|
158 |
-
Name.Variable.Global: 'vg',
|
159 |
-
Name.Variable.Instance: 'vi',
|
160 |
-
Name.Variable.Magic: 'vm',
|
161 |
-
|
162 |
-
Literal: 'l',
|
163 |
-
Literal.Date: 'ld',
|
164 |
-
|
165 |
-
String: 's',
|
166 |
-
String.Affix: 'sa',
|
167 |
-
String.Backtick: 'sb',
|
168 |
-
String.Char: 'sc',
|
169 |
-
String.Delimiter: 'dl',
|
170 |
-
String.Doc: 'sd',
|
171 |
-
String.Double: 's2',
|
172 |
-
String.Escape: 'se',
|
173 |
-
String.Heredoc: 'sh',
|
174 |
-
String.Interpol: 'si',
|
175 |
-
String.Other: 'sx',
|
176 |
-
String.Regex: 'sr',
|
177 |
-
String.Single: 's1',
|
178 |
-
String.Symbol: 'ss',
|
179 |
-
|
180 |
-
Number: 'm',
|
181 |
-
Number.Bin: 'mb',
|
182 |
-
Number.Float: 'mf',
|
183 |
-
Number.Hex: 'mh',
|
184 |
-
Number.Integer: 'mi',
|
185 |
-
Number.Integer.Long: 'il',
|
186 |
-
Number.Oct: 'mo',
|
187 |
-
|
188 |
-
Operator: 'o',
|
189 |
-
Operator.Word: 'ow',
|
190 |
-
|
191 |
-
Punctuation: 'p',
|
192 |
-
Punctuation.Marker: 'pm',
|
193 |
-
|
194 |
-
Comment: 'c',
|
195 |
-
Comment.Hashbang: 'ch',
|
196 |
-
Comment.Multiline: 'cm',
|
197 |
-
Comment.Preproc: 'cp',
|
198 |
-
Comment.PreprocFile: 'cpf',
|
199 |
-
Comment.Single: 'c1',
|
200 |
-
Comment.Special: 'cs',
|
201 |
-
|
202 |
-
Generic: 'g',
|
203 |
-
Generic.Deleted: 'gd',
|
204 |
-
Generic.Emph: 'ge',
|
205 |
-
Generic.Error: 'gr',
|
206 |
-
Generic.Heading: 'gh',
|
207 |
-
Generic.Inserted: 'gi',
|
208 |
-
Generic.Output: 'go',
|
209 |
-
Generic.Prompt: 'gp',
|
210 |
-
Generic.Strong: 'gs',
|
211 |
-
Generic.Subheading: 'gu',
|
212 |
-
Generic.Traceback: 'gt',
|
213 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Big-Web/MMSD/env/Lib/site-packages/setuptools/sandbox.py
DELETED
@@ -1,530 +0,0 @@
|
|
1 |
-
import os
|
2 |
-
import sys
|
3 |
-
import tempfile
|
4 |
-
import operator
|
5 |
-
import functools
|
6 |
-
import itertools
|
7 |
-
import re
|
8 |
-
import contextlib
|
9 |
-
import pickle
|
10 |
-
import textwrap
|
11 |
-
import builtins
|
12 |
-
|
13 |
-
import pkg_resources
|
14 |
-
from distutils.errors import DistutilsError
|
15 |
-
from pkg_resources import working_set
|
16 |
-
|
17 |
-
if sys.platform.startswith('java'):
|
18 |
-
import org.python.modules.posix.PosixModule as _os
|
19 |
-
else:
|
20 |
-
_os = sys.modules[os.name]
|
21 |
-
try:
|
22 |
-
_file = file
|
23 |
-
except NameError:
|
24 |
-
_file = None
|
25 |
-
_open = open
|
26 |
-
|
27 |
-
|
28 |
-
__all__ = [
|
29 |
-
"AbstractSandbox",
|
30 |
-
"DirectorySandbox",
|
31 |
-
"SandboxViolation",
|
32 |
-
"run_setup",
|
33 |
-
]
|
34 |
-
|
35 |
-
|
36 |
-
def _execfile(filename, globals, locals=None):
|
37 |
-
"""
|
38 |
-
Python 3 implementation of execfile.
|
39 |
-
"""
|
40 |
-
mode = 'rb'
|
41 |
-
with open(filename, mode) as stream:
|
42 |
-
script = stream.read()
|
43 |
-
if locals is None:
|
44 |
-
locals = globals
|
45 |
-
code = compile(script, filename, 'exec')
|
46 |
-
exec(code, globals, locals)
|
47 |
-
|
48 |
-
|
49 |
-
@contextlib.contextmanager
|
50 |
-
def save_argv(repl=None):
|
51 |
-
saved = sys.argv[:]
|
52 |
-
if repl is not None:
|
53 |
-
sys.argv[:] = repl
|
54 |
-
try:
|
55 |
-
yield saved
|
56 |
-
finally:
|
57 |
-
sys.argv[:] = saved
|
58 |
-
|
59 |
-
|
60 |
-
@contextlib.contextmanager
|
61 |
-
def save_path():
|
62 |
-
saved = sys.path[:]
|
63 |
-
try:
|
64 |
-
yield saved
|
65 |
-
finally:
|
66 |
-
sys.path[:] = saved
|
67 |
-
|
68 |
-
|
69 |
-
@contextlib.contextmanager
|
70 |
-
def override_temp(replacement):
|
71 |
-
"""
|
72 |
-
Monkey-patch tempfile.tempdir with replacement, ensuring it exists
|
73 |
-
"""
|
74 |
-
os.makedirs(replacement, exist_ok=True)
|
75 |
-
|
76 |
-
saved = tempfile.tempdir
|
77 |
-
|
78 |
-
tempfile.tempdir = replacement
|
79 |
-
|
80 |
-
try:
|
81 |
-
yield
|
82 |
-
finally:
|
83 |
-
tempfile.tempdir = saved
|
84 |
-
|
85 |
-
|
86 |
-
@contextlib.contextmanager
|
87 |
-
def pushd(target):
|
88 |
-
saved = os.getcwd()
|
89 |
-
os.chdir(target)
|
90 |
-
try:
|
91 |
-
yield saved
|
92 |
-
finally:
|
93 |
-
os.chdir(saved)
|
94 |
-
|
95 |
-
|
96 |
-
class UnpickleableException(Exception):
|
97 |
-
"""
|
98 |
-
An exception representing another Exception that could not be pickled.
|
99 |
-
"""
|
100 |
-
|
101 |
-
@staticmethod
|
102 |
-
def dump(type, exc):
|
103 |
-
"""
|
104 |
-
Always return a dumped (pickled) type and exc. If exc can't be pickled,
|
105 |
-
wrap it in UnpickleableException first.
|
106 |
-
"""
|
107 |
-
try:
|
108 |
-
return pickle.dumps(type), pickle.dumps(exc)
|
109 |
-
except Exception:
|
110 |
-
# get UnpickleableException inside the sandbox
|
111 |
-
from setuptools.sandbox import UnpickleableException as cls
|
112 |
-
|
113 |
-
return cls.dump(cls, cls(repr(exc)))
|
114 |
-
|
115 |
-
|
116 |
-
class ExceptionSaver:
|
117 |
-
"""
|
118 |
-
A Context Manager that will save an exception, serialized, and restore it
|
119 |
-
later.
|
120 |
-
"""
|
121 |
-
|
122 |
-
def __enter__(self):
|
123 |
-
return self
|
124 |
-
|
125 |
-
def __exit__(self, type, exc, tb):
|
126 |
-
if not exc:
|
127 |
-
return
|
128 |
-
|
129 |
-
# dump the exception
|
130 |
-
self._saved = UnpickleableException.dump(type, exc)
|
131 |
-
self._tb = tb
|
132 |
-
|
133 |
-
# suppress the exception
|
134 |
-
return True
|
135 |
-
|
136 |
-
def resume(self):
|
137 |
-
"restore and re-raise any exception"
|
138 |
-
|
139 |
-
if '_saved' not in vars(self):
|
140 |
-
return
|
141 |
-
|
142 |
-
type, exc = map(pickle.loads, self._saved)
|
143 |
-
raise exc.with_traceback(self._tb)
|
144 |
-
|
145 |
-
|
146 |
-
@contextlib.contextmanager
|
147 |
-
def save_modules():
|
148 |
-
"""
|
149 |
-
Context in which imported modules are saved.
|
150 |
-
|
151 |
-
Translates exceptions internal to the context into the equivalent exception
|
152 |
-
outside the context.
|
153 |
-
"""
|
154 |
-
saved = sys.modules.copy()
|
155 |
-
with ExceptionSaver() as saved_exc:
|
156 |
-
yield saved
|
157 |
-
|
158 |
-
sys.modules.update(saved)
|
159 |
-
# remove any modules imported since
|
160 |
-
del_modules = (
|
161 |
-
mod_name
|
162 |
-
for mod_name in sys.modules
|
163 |
-
if mod_name not in saved
|
164 |
-
# exclude any encodings modules. See #285
|
165 |
-
and not mod_name.startswith('encodings.')
|
166 |
-
)
|
167 |
-
_clear_modules(del_modules)
|
168 |
-
|
169 |
-
saved_exc.resume()
|
170 |
-
|
171 |
-
|
172 |
-
def _clear_modules(module_names):
|
173 |
-
for mod_name in list(module_names):
|
174 |
-
del sys.modules[mod_name]
|
175 |
-
|
176 |
-
|
177 |
-
@contextlib.contextmanager
|
178 |
-
def save_pkg_resources_state():
|
179 |
-
saved = pkg_resources.__getstate__()
|
180 |
-
try:
|
181 |
-
yield saved
|
182 |
-
finally:
|
183 |
-
pkg_resources.__setstate__(saved)
|
184 |
-
|
185 |
-
|
186 |
-
@contextlib.contextmanager
|
187 |
-
def setup_context(setup_dir):
|
188 |
-
temp_dir = os.path.join(setup_dir, 'temp')
|
189 |
-
with save_pkg_resources_state():
|
190 |
-
with save_modules():
|
191 |
-
with save_path():
|
192 |
-
hide_setuptools()
|
193 |
-
with save_argv():
|
194 |
-
with override_temp(temp_dir):
|
195 |
-
with pushd(setup_dir):
|
196 |
-
# ensure setuptools commands are available
|
197 |
-
__import__('setuptools')
|
198 |
-
yield
|
199 |
-
|
200 |
-
|
201 |
-
_MODULES_TO_HIDE = {
|
202 |
-
'setuptools',
|
203 |
-
'distutils',
|
204 |
-
'pkg_resources',
|
205 |
-
'Cython',
|
206 |
-
'_distutils_hack',
|
207 |
-
}
|
208 |
-
|
209 |
-
|
210 |
-
def _needs_hiding(mod_name):
|
211 |
-
"""
|
212 |
-
>>> _needs_hiding('setuptools')
|
213 |
-
True
|
214 |
-
>>> _needs_hiding('pkg_resources')
|
215 |
-
True
|
216 |
-
>>> _needs_hiding('setuptools_plugin')
|
217 |
-
False
|
218 |
-
>>> _needs_hiding('setuptools.__init__')
|
219 |
-
True
|
220 |
-
>>> _needs_hiding('distutils')
|
221 |
-
True
|
222 |
-
>>> _needs_hiding('os')
|
223 |
-
False
|
224 |
-
>>> _needs_hiding('Cython')
|
225 |
-
True
|
226 |
-
"""
|
227 |
-
base_module = mod_name.split('.', 1)[0]
|
228 |
-
return base_module in _MODULES_TO_HIDE
|
229 |
-
|
230 |
-
|
231 |
-
def hide_setuptools():
|
232 |
-
"""
|
233 |
-
Remove references to setuptools' modules from sys.modules to allow the
|
234 |
-
invocation to import the most appropriate setuptools. This technique is
|
235 |
-
necessary to avoid issues such as #315 where setuptools upgrading itself
|
236 |
-
would fail to find a function declared in the metadata.
|
237 |
-
"""
|
238 |
-
_distutils_hack = sys.modules.get('_distutils_hack', None)
|
239 |
-
if _distutils_hack is not None:
|
240 |
-
_distutils_hack.remove_shim()
|
241 |
-
|
242 |
-
modules = filter(_needs_hiding, sys.modules)
|
243 |
-
_clear_modules(modules)
|
244 |
-
|
245 |
-
|
246 |
-
def run_setup(setup_script, args):
|
247 |
-
"""Run a distutils setup script, sandboxed in its directory"""
|
248 |
-
setup_dir = os.path.abspath(os.path.dirname(setup_script))
|
249 |
-
with setup_context(setup_dir):
|
250 |
-
try:
|
251 |
-
sys.argv[:] = [setup_script] + list(args)
|
252 |
-
sys.path.insert(0, setup_dir)
|
253 |
-
# reset to include setup dir, w/clean callback list
|
254 |
-
working_set.__init__()
|
255 |
-
working_set.callbacks.append(lambda dist: dist.activate())
|
256 |
-
|
257 |
-
with DirectorySandbox(setup_dir):
|
258 |
-
ns = dict(__file__=setup_script, __name__='__main__')
|
259 |
-
_execfile(setup_script, ns)
|
260 |
-
except SystemExit as v:
|
261 |
-
if v.args and v.args[0]:
|
262 |
-
raise
|
263 |
-
# Normal exit, just return
|
264 |
-
|
265 |
-
|
266 |
-
class AbstractSandbox:
|
267 |
-
"""Wrap 'os' module and 'open()' builtin for virtualizing setup scripts"""
|
268 |
-
|
269 |
-
_active = False
|
270 |
-
|
271 |
-
def __init__(self):
|
272 |
-
self._attrs = [
|
273 |
-
name
|
274 |
-
for name in dir(_os)
|
275 |
-
if not name.startswith('_') and hasattr(self, name)
|
276 |
-
]
|
277 |
-
|
278 |
-
def _copy(self, source):
|
279 |
-
for name in self._attrs:
|
280 |
-
setattr(os, name, getattr(source, name))
|
281 |
-
|
282 |
-
def __enter__(self):
|
283 |
-
self._copy(self)
|
284 |
-
if _file:
|
285 |
-
builtins.file = self._file
|
286 |
-
builtins.open = self._open
|
287 |
-
self._active = True
|
288 |
-
|
289 |
-
def __exit__(self, exc_type, exc_value, traceback):
|
290 |
-
self._active = False
|
291 |
-
if _file:
|
292 |
-
builtins.file = _file
|
293 |
-
builtins.open = _open
|
294 |
-
self._copy(_os)
|
295 |
-
|
296 |
-
def run(self, func):
|
297 |
-
"""Run 'func' under os sandboxing"""
|
298 |
-
with self:
|
299 |
-
return func()
|
300 |
-
|
301 |
-
def _mk_dual_path_wrapper(name):
|
302 |
-
original = getattr(_os, name)
|
303 |
-
|
304 |
-
def wrap(self, src, dst, *args, **kw):
|
305 |
-
if self._active:
|
306 |
-
src, dst = self._remap_pair(name, src, dst, *args, **kw)
|
307 |
-
return original(src, dst, *args, **kw)
|
308 |
-
|
309 |
-
return wrap
|
310 |
-
|
311 |
-
for name in ["rename", "link", "symlink"]:
|
312 |
-
if hasattr(_os, name):
|
313 |
-
locals()[name] = _mk_dual_path_wrapper(name)
|
314 |
-
|
315 |
-
def _mk_single_path_wrapper(name, original=None):
|
316 |
-
original = original or getattr(_os, name)
|
317 |
-
|
318 |
-
def wrap(self, path, *args, **kw):
|
319 |
-
if self._active:
|
320 |
-
path = self._remap_input(name, path, *args, **kw)
|
321 |
-
return original(path, *args, **kw)
|
322 |
-
|
323 |
-
return wrap
|
324 |
-
|
325 |
-
if _file:
|
326 |
-
_file = _mk_single_path_wrapper('file', _file)
|
327 |
-
_open = _mk_single_path_wrapper('open', _open)
|
328 |
-
for name in [
|
329 |
-
"stat",
|
330 |
-
"listdir",
|
331 |
-
"chdir",
|
332 |
-
"open",
|
333 |
-
"chmod",
|
334 |
-
"chown",
|
335 |
-
"mkdir",
|
336 |
-
"remove",
|
337 |
-
"unlink",
|
338 |
-
"rmdir",
|
339 |
-
"utime",
|
340 |
-
"lchown",
|
341 |
-
"chroot",
|
342 |
-
"lstat",
|
343 |
-
"startfile",
|
344 |
-
"mkfifo",
|
345 |
-
"mknod",
|
346 |
-
"pathconf",
|
347 |
-
"access",
|
348 |
-
]:
|
349 |
-
if hasattr(_os, name):
|
350 |
-
locals()[name] = _mk_single_path_wrapper(name)
|
351 |
-
|
352 |
-
def _mk_single_with_return(name):
|
353 |
-
original = getattr(_os, name)
|
354 |
-
|
355 |
-
def wrap(self, path, *args, **kw):
|
356 |
-
if self._active:
|
357 |
-
path = self._remap_input(name, path, *args, **kw)
|
358 |
-
return self._remap_output(name, original(path, *args, **kw))
|
359 |
-
return original(path, *args, **kw)
|
360 |
-
|
361 |
-
return wrap
|
362 |
-
|
363 |
-
for name in ['readlink', 'tempnam']:
|
364 |
-
if hasattr(_os, name):
|
365 |
-
locals()[name] = _mk_single_with_return(name)
|
366 |
-
|
367 |
-
def _mk_query(name):
|
368 |
-
original = getattr(_os, name)
|
369 |
-
|
370 |
-
def wrap(self, *args, **kw):
|
371 |
-
retval = original(*args, **kw)
|
372 |
-
if self._active:
|
373 |
-
return self._remap_output(name, retval)
|
374 |
-
return retval
|
375 |
-
|
376 |
-
return wrap
|
377 |
-
|
378 |
-
for name in ['getcwd', 'tmpnam']:
|
379 |
-
if hasattr(_os, name):
|
380 |
-
locals()[name] = _mk_query(name)
|
381 |
-
|
382 |
-
def _validate_path(self, path):
|
383 |
-
"""Called to remap or validate any path, whether input or output"""
|
384 |
-
return path
|
385 |
-
|
386 |
-
def _remap_input(self, operation, path, *args, **kw):
|
387 |
-
"""Called for path inputs"""
|
388 |
-
return self._validate_path(path)
|
389 |
-
|
390 |
-
def _remap_output(self, operation, path):
|
391 |
-
"""Called for path outputs"""
|
392 |
-
return self._validate_path(path)
|
393 |
-
|
394 |
-
def _remap_pair(self, operation, src, dst, *args, **kw):
|
395 |
-
"""Called for path pairs like rename, link, and symlink operations"""
|
396 |
-
return (
|
397 |
-
self._remap_input(operation + '-from', src, *args, **kw),
|
398 |
-
self._remap_input(operation + '-to', dst, *args, **kw),
|
399 |
-
)
|
400 |
-
|
401 |
-
|
402 |
-
if hasattr(os, 'devnull'):
|
403 |
-
_EXCEPTIONS = [os.devnull]
|
404 |
-
else:
|
405 |
-
_EXCEPTIONS = []
|
406 |
-
|
407 |
-
|
408 |
-
class DirectorySandbox(AbstractSandbox):
|
409 |
-
"""Restrict operations to a single subdirectory - pseudo-chroot"""
|
410 |
-
|
411 |
-
write_ops = dict.fromkeys(
|
412 |
-
[
|
413 |
-
"open",
|
414 |
-
"chmod",
|
415 |
-
"chown",
|
416 |
-
"mkdir",
|
417 |
-
"remove",
|
418 |
-
"unlink",
|
419 |
-
"rmdir",
|
420 |
-
"utime",
|
421 |
-
"lchown",
|
422 |
-
"chroot",
|
423 |
-
"mkfifo",
|
424 |
-
"mknod",
|
425 |
-
"tempnam",
|
426 |
-
]
|
427 |
-
)
|
428 |
-
|
429 |
-
_exception_patterns = []
|
430 |
-
"exempt writing to paths that match the pattern"
|
431 |
-
|
432 |
-
def __init__(self, sandbox, exceptions=_EXCEPTIONS):
|
433 |
-
self._sandbox = os.path.normcase(os.path.realpath(sandbox))
|
434 |
-
self._prefix = os.path.join(self._sandbox, '')
|
435 |
-
self._exceptions = [
|
436 |
-
os.path.normcase(os.path.realpath(path)) for path in exceptions
|
437 |
-
]
|
438 |
-
AbstractSandbox.__init__(self)
|
439 |
-
|
440 |
-
def _violation(self, operation, *args, **kw):
|
441 |
-
from setuptools.sandbox import SandboxViolation
|
442 |
-
|
443 |
-
raise SandboxViolation(operation, args, kw)
|
444 |
-
|
445 |
-
if _file:
|
446 |
-
|
447 |
-
def _file(self, path, mode='r', *args, **kw):
|
448 |
-
if mode not in ('r', 'rt', 'rb', 'rU', 'U') and not self._ok(path):
|
449 |
-
self._violation("file", path, mode, *args, **kw)
|
450 |
-
return _file(path, mode, *args, **kw)
|
451 |
-
|
452 |
-
def _open(self, path, mode='r', *args, **kw):
|
453 |
-
if mode not in ('r', 'rt', 'rb', 'rU', 'U') and not self._ok(path):
|
454 |
-
self._violation("open", path, mode, *args, **kw)
|
455 |
-
return _open(path, mode, *args, **kw)
|
456 |
-
|
457 |
-
def tmpnam(self):
|
458 |
-
self._violation("tmpnam")
|
459 |
-
|
460 |
-
def _ok(self, path):
|
461 |
-
active = self._active
|
462 |
-
try:
|
463 |
-
self._active = False
|
464 |
-
realpath = os.path.normcase(os.path.realpath(path))
|
465 |
-
return (
|
466 |
-
self._exempted(realpath)
|
467 |
-
or realpath == self._sandbox
|
468 |
-
or realpath.startswith(self._prefix)
|
469 |
-
)
|
470 |
-
finally:
|
471 |
-
self._active = active
|
472 |
-
|
473 |
-
def _exempted(self, filepath):
|
474 |
-
start_matches = (
|
475 |
-
filepath.startswith(exception) for exception in self._exceptions
|
476 |
-
)
|
477 |
-
pattern_matches = (
|
478 |
-
re.match(pattern, filepath) for pattern in self._exception_patterns
|
479 |
-
)
|
480 |
-
candidates = itertools.chain(start_matches, pattern_matches)
|
481 |
-
return any(candidates)
|
482 |
-
|
483 |
-
def _remap_input(self, operation, path, *args, **kw):
|
484 |
-
"""Called for path inputs"""
|
485 |
-
if operation in self.write_ops and not self._ok(path):
|
486 |
-
self._violation(operation, os.path.realpath(path), *args, **kw)
|
487 |
-
return path
|
488 |
-
|
489 |
-
def _remap_pair(self, operation, src, dst, *args, **kw):
|
490 |
-
"""Called for path pairs like rename, link, and symlink operations"""
|
491 |
-
if not self._ok(src) or not self._ok(dst):
|
492 |
-
self._violation(operation, src, dst, *args, **kw)
|
493 |
-
return (src, dst)
|
494 |
-
|
495 |
-
def open(self, file, flags, mode=0o777, *args, **kw):
|
496 |
-
"""Called for low-level os.open()"""
|
497 |
-
if flags & WRITE_FLAGS and not self._ok(file):
|
498 |
-
self._violation("os.open", file, flags, mode, *args, **kw)
|
499 |
-
return _os.open(file, flags, mode, *args, **kw)
|
500 |
-
|
501 |
-
|
502 |
-
WRITE_FLAGS = functools.reduce(
|
503 |
-
operator.or_,
|
504 |
-
[
|
505 |
-
getattr(_os, a, 0)
|
506 |
-
for a in "O_WRONLY O_RDWR O_APPEND O_CREAT O_TRUNC O_TEMPORARY".split()
|
507 |
-
],
|
508 |
-
)
|
509 |
-
|
510 |
-
|
511 |
-
class SandboxViolation(DistutilsError):
|
512 |
-
"""A setup script attempted to modify the filesystem outside the sandbox"""
|
513 |
-
|
514 |
-
tmpl = textwrap.dedent(
|
515 |
-
"""
|
516 |
-
SandboxViolation: {cmd}{args!r} {kwargs}
|
517 |
-
|
518 |
-
The package setup script has attempted to modify files on your system
|
519 |
-
that are not within the EasyInstall build area, and has been aborted.
|
520 |
-
|
521 |
-
This package cannot be safely installed by EasyInstall, and may not
|
522 |
-
support alternate installation locations even if you run its setup
|
523 |
-
script by hand. Please inform the package's author and the EasyInstall
|
524 |
-
maintainers to find out if a fix or workaround is available.
|
525 |
-
"""
|
526 |
-
).lstrip()
|
527 |
-
|
528 |
-
def __str__(self):
|
529 |
-
cmd, args, kwargs = self.args
|
530 |
-
return self.tmpl.format(**locals())
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/BridgeEight/internlm-20B-chat-w4-turbomind/README.md
DELETED
@@ -1,13 +0,0 @@
|
|
1 |
-
---
|
2 |
-
title: internlm-20b-chat-w4-turbomind
|
3 |
-
emoji: 🌍
|
4 |
-
colorFrom: yellow
|
5 |
-
colorTo: red
|
6 |
-
sdk: gradio
|
7 |
-
sdk_version: 3.44.3
|
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/CVPR/Dual-Key_Backdoor_Attacks/datagen/detectron2/MODEL_ZOO.md
DELETED
@@ -1,882 +0,0 @@
|
|
1 |
-
# Detectron2 Model Zoo and Baselines
|
2 |
-
|
3 |
-
## Introduction
|
4 |
-
|
5 |
-
This file documents a large collection of baselines trained
|
6 |
-
with detectron2 in Sep-Oct, 2019.
|
7 |
-
All numbers were obtained on [Big Basin](https://engineering.fb.com/data-center-engineering/introducing-big-basin-our-next-generation-ai-hardware/)
|
8 |
-
servers with 8 NVIDIA V100 GPUs & NVLink. The software in use were PyTorch 1.3, CUDA 9.2, cuDNN 7.4.2 or 7.6.3.
|
9 |
-
You can access these models from code using [detectron2.model_zoo](https://detectron2.readthedocs.io/modules/model_zoo.html) APIs.
|
10 |
-
|
11 |
-
In addition to these official baseline models, you can find more models in [projects/](projects/).
|
12 |
-
|
13 |
-
#### How to Read the Tables
|
14 |
-
* The "Name" column contains a link to the config file. Running `tools/train_net.py` with this config file
|
15 |
-
and 8 GPUs will reproduce the model.
|
16 |
-
* Training speed is averaged across the entire training.
|
17 |
-
We keep updating the speed with latest version of detectron2/pytorch/etc.,
|
18 |
-
so they might be different from the `metrics` file.
|
19 |
-
* Inference speed is measured by `tools/train_net.py --eval-only`, or [inference_on_dataset()](https://detectron2.readthedocs.io/modules/evaluation.html#detectron2.evaluation.inference_on_dataset),
|
20 |
-
with batch size 1 in detectron2 directly.
|
21 |
-
Measuring it with your own code will likely introduce other overhead.
|
22 |
-
Actual deployment in production should in general be faster than the given inference
|
23 |
-
speed due to more optimizations.
|
24 |
-
* The *model id* column is provided for ease of reference.
|
25 |
-
To check downloaded file integrity, any model on this page contains its md5 prefix in its file name.
|
26 |
-
* Training curves and other statistics can be found in `metrics` for each model.
|
27 |
-
|
28 |
-
#### Common Settings for COCO Models
|
29 |
-
* All COCO models were trained on `train2017` and evaluated on `val2017`.
|
30 |
-
* The default settings are __not directly comparable__ with Detectron's standard settings.
|
31 |
-
For example, our default training data augmentation uses scale jittering in addition to horizontal flipping.
|
32 |
-
|
33 |
-
To make fair comparisons with Detectron's settings, see
|
34 |
-
[Detectron1-Comparisons](configs/Detectron1-Comparisons/) for accuracy comparison,
|
35 |
-
and [benchmarks](https://detectron2.readthedocs.io/notes/benchmarks.html)
|
36 |
-
for speed comparison.
|
37 |
-
* For Faster/Mask R-CNN, we provide baselines based on __3 different backbone combinations__:
|
38 |
-
* __FPN__: Use a ResNet+FPN backbone with standard conv and FC heads for mask and box prediction,
|
39 |
-
respectively. It obtains the best
|
40 |
-
speed/accuracy tradeoff, but the other two are still useful for research.
|
41 |
-
* __C4__: Use a ResNet conv4 backbone with conv5 head. The original baseline in the Faster R-CNN paper.
|
42 |
-
* __DC5__ (Dilated-C5): Use a ResNet conv5 backbone with dilations in conv5, and standard conv and FC heads
|
43 |
-
for mask and box prediction, respectively.
|
44 |
-
This is used by the Deformable ConvNet paper.
|
45 |
-
* Most models are trained with the 3x schedule (~37 COCO epochs).
|
46 |
-
Although 1x models are heavily under-trained, we provide some ResNet-50 models with the 1x (~12 COCO epochs)
|
47 |
-
training schedule for comparison when doing quick research iteration.
|
48 |
-
|
49 |
-
#### ImageNet Pretrained Models
|
50 |
-
|
51 |
-
We provide backbone models pretrained on ImageNet-1k dataset.
|
52 |
-
These models have __different__ format from those provided in Detectron: we do not fuse BatchNorm into an affine layer.
|
53 |
-
* [R-50.pkl](https://dl.fbaipublicfiles.com/detectron2/ImageNetPretrained/MSRA/R-50.pkl): converted copy of [MSRA's original ResNet-50](https://github.com/KaimingHe/deep-residual-networks) model.
|
54 |
-
* [R-101.pkl](https://dl.fbaipublicfiles.com/detectron2/ImageNetPretrained/MSRA/R-101.pkl): converted copy of [MSRA's original ResNet-101](https://github.com/KaimingHe/deep-residual-networks) model.
|
55 |
-
* [X-101-32x8d.pkl](https://dl.fbaipublicfiles.com/detectron2/ImageNetPretrained/FAIR/X-101-32x8d.pkl): ResNeXt-101-32x8d model trained with Caffe2 at FB.
|
56 |
-
|
57 |
-
Pretrained models in Detectron's format can still be used. For example:
|
58 |
-
* [X-152-32x8d-IN5k.pkl](https://dl.fbaipublicfiles.com/detectron/ImageNetPretrained/25093814/X-152-32x8d-IN5k.pkl):
|
59 |
-
ResNeXt-152-32x8d model trained on ImageNet-5k with Caffe2 at FB (see ResNeXt paper for details on ImageNet-5k).
|
60 |
-
* [R-50-GN.pkl](https://dl.fbaipublicfiles.com/detectron/ImageNetPretrained/47261647/R-50-GN.pkl):
|
61 |
-
ResNet-50 with Group Normalization.
|
62 |
-
* [R-101-GN.pkl](https://dl.fbaipublicfiles.com/detectron/ImageNetPretrained/47592356/R-101-GN.pkl):
|
63 |
-
ResNet-101 with Group Normalization.
|
64 |
-
|
65 |
-
Torchvision's ResNet models can be used after converted by [this script](tools/convert-torchvision-to-d2.py).
|
66 |
-
|
67 |
-
#### License
|
68 |
-
|
69 |
-
All models available for download through this document are licensed under the
|
70 |
-
[Creative Commons Attribution-ShareAlike 3.0 license](https://creativecommons.org/licenses/by-sa/3.0/).
|
71 |
-
|
72 |
-
### COCO Object Detection Baselines
|
73 |
-
|
74 |
-
#### Faster R-CNN:
|
75 |
-
<!--
|
76 |
-
(fb only) To update the table in vim:
|
77 |
-
1. Remove the old table: d}
|
78 |
-
2. Copy the below command to the place of the table
|
79 |
-
3. :.!bash
|
80 |
-
|
81 |
-
./gen_html_table.py --config 'COCO-Detection/faster*50*'{1x,3x}'*' 'COCO-Detection/faster*101*' --name R50-C4 R50-DC5 R50-FPN R50-C4 R50-DC5 R50-FPN R101-C4 R101-DC5 R101-FPN X101-FPN --fields lr_sched train_speed inference_speed mem box_AP
|
82 |
-
-->
|
83 |
-
|
84 |
-
|
85 |
-
<table><tbody>
|
86 |
-
<!-- START TABLE -->
|
87 |
-
<!-- TABLE HEADER -->
|
88 |
-
<th valign="bottom">Name</th>
|
89 |
-
<th valign="bottom">lr<br/>sched</th>
|
90 |
-
<th valign="bottom">train<br/>time<br/>(s/iter)</th>
|
91 |
-
<th valign="bottom">inference<br/>time<br/>(s/im)</th>
|
92 |
-
<th valign="bottom">train<br/>mem<br/>(GB)</th>
|
93 |
-
<th valign="bottom">box<br/>AP</th>
|
94 |
-
<th valign="bottom">model id</th>
|
95 |
-
<th valign="bottom">download</th>
|
96 |
-
<!-- TABLE BODY -->
|
97 |
-
<!-- ROW: faster_rcnn_R_50_C4_1x -->
|
98 |
-
<tr><td align="left"><a href="configs/COCO-Detection/faster_rcnn_R_50_C4_1x.yaml">R50-C4</a></td>
|
99 |
-
<td align="center">1x</td>
|
100 |
-
<td align="center">0.551</td>
|
101 |
-
<td align="center">0.102</td>
|
102 |
-
<td align="center">4.8</td>
|
103 |
-
<td align="center">35.7</td>
|
104 |
-
<td align="center">137257644</td>
|
105 |
-
<td align="center"><a href="https://dl.fbaipublicfiles.com/detectron2/COCO-Detection/faster_rcnn_R_50_C4_1x/137257644/model_final_721ade.pkl">model</a> | <a href="https://dl.fbaipublicfiles.com/detectron2/COCO-Detection/faster_rcnn_R_50_C4_1x/137257644/metrics.json">metrics</a></td>
|
106 |
-
</tr>
|
107 |
-
<!-- ROW: faster_rcnn_R_50_DC5_1x -->
|
108 |
-
<tr><td align="left"><a href="configs/COCO-Detection/faster_rcnn_R_50_DC5_1x.yaml">R50-DC5</a></td>
|
109 |
-
<td align="center">1x</td>
|
110 |
-
<td align="center">0.380</td>
|
111 |
-
<td align="center">0.068</td>
|
112 |
-
<td align="center">5.0</td>
|
113 |
-
<td align="center">37.3</td>
|
114 |
-
<td align="center">137847829</td>
|
115 |
-
<td align="center"><a href="https://dl.fbaipublicfiles.com/detectron2/COCO-Detection/faster_rcnn_R_50_DC5_1x/137847829/model_final_51d356.pkl">model</a> | <a href="https://dl.fbaipublicfiles.com/detectron2/COCO-Detection/faster_rcnn_R_50_DC5_1x/137847829/metrics.json">metrics</a></td>
|
116 |
-
</tr>
|
117 |
-
<!-- ROW: faster_rcnn_R_50_FPN_1x -->
|
118 |
-
<tr><td align="left"><a href="configs/COCO-Detection/faster_rcnn_R_50_FPN_1x.yaml">R50-FPN</a></td>
|
119 |
-
<td align="center">1x</td>
|
120 |
-
<td align="center">0.210</td>
|
121 |
-
<td align="center">0.038</td>
|
122 |
-
<td align="center">3.0</td>
|
123 |
-
<td align="center">37.9</td>
|
124 |
-
<td align="center">137257794</td>
|
125 |
-
<td align="center"><a href="https://dl.fbaipublicfiles.com/detectron2/COCO-Detection/faster_rcnn_R_50_FPN_1x/137257794/model_final_b275ba.pkl">model</a> | <a href="https://dl.fbaipublicfiles.com/detectron2/COCO-Detection/faster_rcnn_R_50_FPN_1x/137257794/metrics.json">metrics</a></td>
|
126 |
-
</tr>
|
127 |
-
<!-- ROW: faster_rcnn_R_50_C4_3x -->
|
128 |
-
<tr><td align="left"><a href="configs/COCO-Detection/faster_rcnn_R_50_C4_3x.yaml">R50-C4</a></td>
|
129 |
-
<td align="center">3x</td>
|
130 |
-
<td align="center">0.543</td>
|
131 |
-
<td align="center">0.104</td>
|
132 |
-
<td align="center">4.8</td>
|
133 |
-
<td align="center">38.4</td>
|
134 |
-
<td align="center">137849393</td>
|
135 |
-
<td align="center"><a href="https://dl.fbaipublicfiles.com/detectron2/COCO-Detection/faster_rcnn_R_50_C4_3x/137849393/model_final_f97cb7.pkl">model</a> | <a href="https://dl.fbaipublicfiles.com/detectron2/COCO-Detection/faster_rcnn_R_50_C4_3x/137849393/metrics.json">metrics</a></td>
|
136 |
-
</tr>
|
137 |
-
<!-- ROW: faster_rcnn_R_50_DC5_3x -->
|
138 |
-
<tr><td align="left"><a href="configs/COCO-Detection/faster_rcnn_R_50_DC5_3x.yaml">R50-DC5</a></td>
|
139 |
-
<td align="center">3x</td>
|
140 |
-
<td align="center">0.378</td>
|
141 |
-
<td align="center">0.070</td>
|
142 |
-
<td align="center">5.0</td>
|
143 |
-
<td align="center">39.0</td>
|
144 |
-
<td align="center">137849425</td>
|
145 |
-
<td align="center"><a href="https://dl.fbaipublicfiles.com/detectron2/COCO-Detection/faster_rcnn_R_50_DC5_3x/137849425/model_final_68d202.pkl">model</a> | <a href="https://dl.fbaipublicfiles.com/detectron2/COCO-Detection/faster_rcnn_R_50_DC5_3x/137849425/metrics.json">metrics</a></td>
|
146 |
-
</tr>
|
147 |
-
<!-- ROW: faster_rcnn_R_50_FPN_3x -->
|
148 |
-
<tr><td align="left"><a href="configs/COCO-Detection/faster_rcnn_R_50_FPN_3x.yaml">R50-FPN</a></td>
|
149 |
-
<td align="center">3x</td>
|
150 |
-
<td align="center">0.209</td>
|
151 |
-
<td align="center">0.038</td>
|
152 |
-
<td align="center">3.0</td>
|
153 |
-
<td align="center">40.2</td>
|
154 |
-
<td align="center">137849458</td>
|
155 |
-
<td align="center"><a href="https://dl.fbaipublicfiles.com/detectron2/COCO-Detection/faster_rcnn_R_50_FPN_3x/137849458/model_final_280758.pkl">model</a> | <a href="https://dl.fbaipublicfiles.com/detectron2/COCO-Detection/faster_rcnn_R_50_FPN_3x/137849458/metrics.json">metrics</a></td>
|
156 |
-
</tr>
|
157 |
-
<!-- ROW: faster_rcnn_R_101_C4_3x -->
|
158 |
-
<tr><td align="left"><a href="configs/COCO-Detection/faster_rcnn_R_101_C4_3x.yaml">R101-C4</a></td>
|
159 |
-
<td align="center">3x</td>
|
160 |
-
<td align="center">0.619</td>
|
161 |
-
<td align="center">0.139</td>
|
162 |
-
<td align="center">5.9</td>
|
163 |
-
<td align="center">41.1</td>
|
164 |
-
<td align="center">138204752</td>
|
165 |
-
<td align="center"><a href="https://dl.fbaipublicfiles.com/detectron2/COCO-Detection/faster_rcnn_R_101_C4_3x/138204752/model_final_298dad.pkl">model</a> | <a href="https://dl.fbaipublicfiles.com/detectron2/COCO-Detection/faster_rcnn_R_101_C4_3x/138204752/metrics.json">metrics</a></td>
|
166 |
-
</tr>
|
167 |
-
<!-- ROW: faster_rcnn_R_101_DC5_3x -->
|
168 |
-
<tr><td align="left"><a href="configs/COCO-Detection/faster_rcnn_R_101_DC5_3x.yaml">R101-DC5</a></td>
|
169 |
-
<td align="center">3x</td>
|
170 |
-
<td align="center">0.452</td>
|
171 |
-
<td align="center">0.086</td>
|
172 |
-
<td align="center">6.1</td>
|
173 |
-
<td align="center">40.6</td>
|
174 |
-
<td align="center">138204841</td>
|
175 |
-
<td align="center"><a href="https://dl.fbaipublicfiles.com/detectron2/COCO-Detection/faster_rcnn_R_101_DC5_3x/138204841/model_final_3e0943.pkl">model</a> | <a href="https://dl.fbaipublicfiles.com/detectron2/COCO-Detection/faster_rcnn_R_101_DC5_3x/138204841/metrics.json">metrics</a></td>
|
176 |
-
</tr>
|
177 |
-
<!-- ROW: faster_rcnn_R_101_FPN_3x -->
|
178 |
-
<tr><td align="left"><a href="configs/COCO-Detection/faster_rcnn_R_101_FPN_3x.yaml">R101-FPN</a></td>
|
179 |
-
<td align="center">3x</td>
|
180 |
-
<td align="center">0.286</td>
|
181 |
-
<td align="center">0.051</td>
|
182 |
-
<td align="center">4.1</td>
|
183 |
-
<td align="center">42.0</td>
|
184 |
-
<td align="center">137851257</td>
|
185 |
-
<td align="center"><a href="https://dl.fbaipublicfiles.com/detectron2/COCO-Detection/faster_rcnn_R_101_FPN_3x/137851257/model_final_f6e8b1.pkl">model</a> | <a href="https://dl.fbaipublicfiles.com/detectron2/COCO-Detection/faster_rcnn_R_101_FPN_3x/137851257/metrics.json">metrics</a></td>
|
186 |
-
</tr>
|
187 |
-
<!-- ROW: faster_rcnn_X_101_32x8d_FPN_3x -->
|
188 |
-
<tr><td align="left"><a href="configs/COCO-Detection/faster_rcnn_X_101_32x8d_FPN_3x.yaml">X101-FPN</a></td>
|
189 |
-
<td align="center">3x</td>
|
190 |
-
<td align="center">0.638</td>
|
191 |
-
<td align="center">0.098</td>
|
192 |
-
<td align="center">6.7</td>
|
193 |
-
<td align="center">43.0</td>
|
194 |
-
<td align="center">139173657</td>
|
195 |
-
<td align="center"><a href="https://dl.fbaipublicfiles.com/detectron2/COCO-Detection/faster_rcnn_X_101_32x8d_FPN_3x/139173657/model_final_68b088.pkl">model</a> | <a href="https://dl.fbaipublicfiles.com/detectron2/COCO-Detection/faster_rcnn_X_101_32x8d_FPN_3x/139173657/metrics.json">metrics</a></td>
|
196 |
-
</tr>
|
197 |
-
</tbody></table>
|
198 |
-
|
199 |
-
#### RetinaNet:
|
200 |
-
<!--
|
201 |
-
./gen_html_table.py --config 'COCO-Detection/retina*50*' 'COCO-Detection/retina*101*' --name R50 R50 R101 --fields lr_sched train_speed inference_speed mem box_AP
|
202 |
-
-->
|
203 |
-
|
204 |
-
|
205 |
-
<table><tbody>
|
206 |
-
<!-- START TABLE -->
|
207 |
-
<!-- TABLE HEADER -->
|
208 |
-
<th valign="bottom">Name</th>
|
209 |
-
<th valign="bottom">lr<br/>sched</th>
|
210 |
-
<th valign="bottom">train<br/>time<br/>(s/iter)</th>
|
211 |
-
<th valign="bottom">inference<br/>time<br/>(s/im)</th>
|
212 |
-
<th valign="bottom">train<br/>mem<br/>(GB)</th>
|
213 |
-
<th valign="bottom">box<br/>AP</th>
|
214 |
-
<th valign="bottom">model id</th>
|
215 |
-
<th valign="bottom">download</th>
|
216 |
-
<!-- TABLE BODY -->
|
217 |
-
<!-- ROW: retinanet_R_50_FPN_1x -->
|
218 |
-
<tr><td align="left"><a href="configs/COCO-Detection/retinanet_R_50_FPN_1x.yaml">R50</a></td>
|
219 |
-
<td align="center">1x</td>
|
220 |
-
<td align="center">0.200</td>
|
221 |
-
<td align="center">0.055</td>
|
222 |
-
<td align="center">3.9</td>
|
223 |
-
<td align="center">36.5</td>
|
224 |
-
<td align="center">137593951</td>
|
225 |
-
<td align="center"><a href="https://dl.fbaipublicfiles.com/detectron2/COCO-Detection/retinanet_R_50_FPN_1x/137593951/model_final_b796dc.pkl">model</a> | <a href="https://dl.fbaipublicfiles.com/detectron2/COCO-Detection/retinanet_R_50_FPN_1x/137593951/metrics.json">metrics</a></td>
|
226 |
-
</tr>
|
227 |
-
<!-- ROW: retinanet_R_50_FPN_3x -->
|
228 |
-
<tr><td align="left"><a href="configs/COCO-Detection/retinanet_R_50_FPN_3x.yaml">R50</a></td>
|
229 |
-
<td align="center">3x</td>
|
230 |
-
<td align="center">0.201</td>
|
231 |
-
<td align="center">0.055</td>
|
232 |
-
<td align="center">3.9</td>
|
233 |
-
<td align="center">37.9</td>
|
234 |
-
<td align="center">137849486</td>
|
235 |
-
<td align="center"><a href="https://dl.fbaipublicfiles.com/detectron2/COCO-Detection/retinanet_R_50_FPN_3x/137849486/model_final_4cafe0.pkl">model</a> | <a href="https://dl.fbaipublicfiles.com/detectron2/COCO-Detection/retinanet_R_50_FPN_3x/137849486/metrics.json">metrics</a></td>
|
236 |
-
</tr>
|
237 |
-
<!-- ROW: retinanet_R_101_FPN_3x -->
|
238 |
-
<tr><td align="left"><a href="configs/COCO-Detection/retinanet_R_101_FPN_3x.yaml">R101</a></td>
|
239 |
-
<td align="center">3x</td>
|
240 |
-
<td align="center">0.280</td>
|
241 |
-
<td align="center">0.068</td>
|
242 |
-
<td align="center">5.1</td>
|
243 |
-
<td align="center">39.9</td>
|
244 |
-
<td align="center">138363263</td>
|
245 |
-
<td align="center"><a href="https://dl.fbaipublicfiles.com/detectron2/COCO-Detection/retinanet_R_101_FPN_3x/138363263/model_final_59f53c.pkl">model</a> | <a href="https://dl.fbaipublicfiles.com/detectron2/COCO-Detection/retinanet_R_101_FPN_3x/138363263/metrics.json">metrics</a></td>
|
246 |
-
</tr>
|
247 |
-
</tbody></table>
|
248 |
-
|
249 |
-
#### RPN & Fast R-CNN:
|
250 |
-
<!--
|
251 |
-
./gen_html_table.py --config 'COCO-Detection/rpn*' 'COCO-Detection/fast_rcnn*' --name "RPN R50-C4" "RPN R50-FPN" "Fast R-CNN R50-FPN" --fields lr_sched train_speed inference_speed mem box_AP prop_AR
|
252 |
-
-->
|
253 |
-
|
254 |
-
<table><tbody>
|
255 |
-
<!-- START TABLE -->
|
256 |
-
<!-- TABLE HEADER -->
|
257 |
-
<th valign="bottom">Name</th>
|
258 |
-
<th valign="bottom">lr<br/>sched</th>
|
259 |
-
<th valign="bottom">train<br/>time<br/>(s/iter)</th>
|
260 |
-
<th valign="bottom">inference<br/>time<br/>(s/im)</th>
|
261 |
-
<th valign="bottom">train<br/>mem<br/>(GB)</th>
|
262 |
-
<th valign="bottom">box<br/>AP</th>
|
263 |
-
<th valign="bottom">prop.<br/>AR</th>
|
264 |
-
<th valign="bottom">model id</th>
|
265 |
-
<th valign="bottom">download</th>
|
266 |
-
<!-- TABLE BODY -->
|
267 |
-
<!-- ROW: rpn_R_50_C4_1x -->
|
268 |
-
<tr><td align="left"><a href="configs/COCO-Detection/rpn_R_50_C4_1x.yaml">RPN R50-C4</a></td>
|
269 |
-
<td align="center">1x</td>
|
270 |
-
<td align="center">0.130</td>
|
271 |
-
<td align="center">0.034</td>
|
272 |
-
<td align="center">1.5</td>
|
273 |
-
<td align="center"></td>
|
274 |
-
<td align="center">51.6</td>
|
275 |
-
<td align="center">137258005</td>
|
276 |
-
<td align="center"><a href="https://dl.fbaipublicfiles.com/detectron2/COCO-Detection/rpn_R_50_C4_1x/137258005/model_final_450694.pkl">model</a> | <a href="https://dl.fbaipublicfiles.com/detectron2/COCO-Detection/rpn_R_50_C4_1x/137258005/metrics.json">metrics</a></td>
|
277 |
-
</tr>
|
278 |
-
<!-- ROW: rpn_R_50_FPN_1x -->
|
279 |
-
<tr><td align="left"><a href="configs/COCO-Detection/rpn_R_50_FPN_1x.yaml">RPN R50-FPN</a></td>
|
280 |
-
<td align="center">1x</td>
|
281 |
-
<td align="center">0.186</td>
|
282 |
-
<td align="center">0.032</td>
|
283 |
-
<td align="center">2.7</td>
|
284 |
-
<td align="center"></td>
|
285 |
-
<td align="center">58.0</td>
|
286 |
-
<td align="center">137258492</td>
|
287 |
-
<td align="center"><a href="https://dl.fbaipublicfiles.com/detectron2/COCO-Detection/rpn_R_50_FPN_1x/137258492/model_final_02ce48.pkl">model</a> | <a href="https://dl.fbaipublicfiles.com/detectron2/COCO-Detection/rpn_R_50_FPN_1x/137258492/metrics.json">metrics</a></td>
|
288 |
-
</tr>
|
289 |
-
<!-- ROW: fast_rcnn_R_50_FPN_1x -->
|
290 |
-
<tr><td align="left"><a href="configs/COCO-Detection/fast_rcnn_R_50_FPN_1x.yaml">Fast R-CNN R50-FPN</a></td>
|
291 |
-
<td align="center">1x</td>
|
292 |
-
<td align="center">0.140</td>
|
293 |
-
<td align="center">0.029</td>
|
294 |
-
<td align="center">2.6</td>
|
295 |
-
<td align="center">37.8</td>
|
296 |
-
<td align="center"></td>
|
297 |
-
<td align="center">137635226</td>
|
298 |
-
<td align="center"><a href="https://dl.fbaipublicfiles.com/detectron2/COCO-Detection/fast_rcnn_R_50_FPN_1x/137635226/model_final_e5f7ce.pkl">model</a> | <a href="https://dl.fbaipublicfiles.com/detectron2/COCO-Detection/fast_rcnn_R_50_FPN_1x/137635226/metrics.json">metrics</a></td>
|
299 |
-
</tr>
|
300 |
-
</tbody></table>
|
301 |
-
|
302 |
-
### COCO Instance Segmentation Baselines with Mask R-CNN
|
303 |
-
<!--
|
304 |
-
./gen_html_table.py --config 'COCO-InstanceSegmentation/mask*50*'{1x,3x}'*' 'COCO-InstanceSegmentation/mask*101*' --name R50-C4 R50-DC5 R50-FPN R50-C4 R50-DC5 R50-FPN R101-C4 R101-DC5 R101-FPN X101-FPN --fields lr_sched train_speed inference_speed mem box_AP mask_AP
|
305 |
-
-->
|
306 |
-
|
307 |
-
|
308 |
-
|
309 |
-
<table><tbody>
|
310 |
-
<!-- START TABLE -->
|
311 |
-
<!-- TABLE HEADER -->
|
312 |
-
<th valign="bottom">Name</th>
|
313 |
-
<th valign="bottom">lr<br/>sched</th>
|
314 |
-
<th valign="bottom">train<br/>time<br/>(s/iter)</th>
|
315 |
-
<th valign="bottom">inference<br/>time<br/>(s/im)</th>
|
316 |
-
<th valign="bottom">train<br/>mem<br/>(GB)</th>
|
317 |
-
<th valign="bottom">box<br/>AP</th>
|
318 |
-
<th valign="bottom">mask<br/>AP</th>
|
319 |
-
<th valign="bottom">model id</th>
|
320 |
-
<th valign="bottom">download</th>
|
321 |
-
<!-- TABLE BODY -->
|
322 |
-
<!-- ROW: mask_rcnn_R_50_C4_1x -->
|
323 |
-
<tr><td align="left"><a href="configs/COCO-InstanceSegmentation/mask_rcnn_R_50_C4_1x.yaml">R50-C4</a></td>
|
324 |
-
<td align="center">1x</td>
|
325 |
-
<td align="center">0.584</td>
|
326 |
-
<td align="center">0.110</td>
|
327 |
-
<td align="center">5.2</td>
|
328 |
-
<td align="center">36.8</td>
|
329 |
-
<td align="center">32.2</td>
|
330 |
-
<td align="center">137259246</td>
|
331 |
-
<td align="center"><a href="https://dl.fbaipublicfiles.com/detectron2/COCO-InstanceSegmentation/mask_rcnn_R_50_C4_1x/137259246/model_final_9243eb.pkl">model</a> | <a href="https://dl.fbaipublicfiles.com/detectron2/COCO-InstanceSegmentation/mask_rcnn_R_50_C4_1x/137259246/metrics.json">metrics</a></td>
|
332 |
-
</tr>
|
333 |
-
<!-- ROW: mask_rcnn_R_50_DC5_1x -->
|
334 |
-
<tr><td align="left"><a href="configs/COCO-InstanceSegmentation/mask_rcnn_R_50_DC5_1x.yaml">R50-DC5</a></td>
|
335 |
-
<td align="center">1x</td>
|
336 |
-
<td align="center">0.471</td>
|
337 |
-
<td align="center">0.076</td>
|
338 |
-
<td align="center">6.5</td>
|
339 |
-
<td align="center">38.3</td>
|
340 |
-
<td align="center">34.2</td>
|
341 |
-
<td align="center">137260150</td>
|
342 |
-
<td align="center"><a href="https://dl.fbaipublicfiles.com/detectron2/COCO-InstanceSegmentation/mask_rcnn_R_50_DC5_1x/137260150/model_final_4f86c3.pkl">model</a> | <a href="https://dl.fbaipublicfiles.com/detectron2/COCO-InstanceSegmentation/mask_rcnn_R_50_DC5_1x/137260150/metrics.json">metrics</a></td>
|
343 |
-
</tr>
|
344 |
-
<!-- ROW: mask_rcnn_R_50_FPN_1x -->
|
345 |
-
<tr><td align="left"><a href="configs/COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_1x.yaml">R50-FPN</a></td>
|
346 |
-
<td align="center">1x</td>
|
347 |
-
<td align="center">0.261</td>
|
348 |
-
<td align="center">0.043</td>
|
349 |
-
<td align="center">3.4</td>
|
350 |
-
<td align="center">38.6</td>
|
351 |
-
<td align="center">35.2</td>
|
352 |
-
<td align="center">137260431</td>
|
353 |
-
<td align="center"><a href="https://dl.fbaipublicfiles.com/detectron2/COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_1x/137260431/model_final_a54504.pkl">model</a> | <a href="https://dl.fbaipublicfiles.com/detectron2/COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_1x/137260431/metrics.json">metrics</a></td>
|
354 |
-
</tr>
|
355 |
-
<!-- ROW: mask_rcnn_R_50_C4_3x -->
|
356 |
-
<tr><td align="left"><a href="configs/COCO-InstanceSegmentation/mask_rcnn_R_50_C4_3x.yaml">R50-C4</a></td>
|
357 |
-
<td align="center">3x</td>
|
358 |
-
<td align="center">0.575</td>
|
359 |
-
<td align="center">0.111</td>
|
360 |
-
<td align="center">5.2</td>
|
361 |
-
<td align="center">39.8</td>
|
362 |
-
<td align="center">34.4</td>
|
363 |
-
<td align="center">137849525</td>
|
364 |
-
<td align="center"><a href="https://dl.fbaipublicfiles.com/detectron2/COCO-InstanceSegmentation/mask_rcnn_R_50_C4_3x/137849525/model_final_4ce675.pkl">model</a> | <a href="https://dl.fbaipublicfiles.com/detectron2/COCO-InstanceSegmentation/mask_rcnn_R_50_C4_3x/137849525/metrics.json">metrics</a></td>
|
365 |
-
</tr>
|
366 |
-
<!-- ROW: mask_rcnn_R_50_DC5_3x -->
|
367 |
-
<tr><td align="left"><a href="configs/COCO-InstanceSegmentation/mask_rcnn_R_50_DC5_3x.yaml">R50-DC5</a></td>
|
368 |
-
<td align="center">3x</td>
|
369 |
-
<td align="center">0.470</td>
|
370 |
-
<td align="center">0.076</td>
|
371 |
-
<td align="center">6.5</td>
|
372 |
-
<td align="center">40.0</td>
|
373 |
-
<td align="center">35.9</td>
|
374 |
-
<td align="center">137849551</td>
|
375 |
-
<td align="center"><a href="https://dl.fbaipublicfiles.com/detectron2/COCO-InstanceSegmentation/mask_rcnn_R_50_DC5_3x/137849551/model_final_84107b.pkl">model</a> | <a href="https://dl.fbaipublicfiles.com/detectron2/COCO-InstanceSegmentation/mask_rcnn_R_50_DC5_3x/137849551/metrics.json">metrics</a></td>
|
376 |
-
</tr>
|
377 |
-
<!-- ROW: mask_rcnn_R_50_FPN_3x -->
|
378 |
-
<tr><td align="left"><a href="configs/COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_3x.yaml">R50-FPN</a></td>
|
379 |
-
<td align="center">3x</td>
|
380 |
-
<td align="center">0.261</td>
|
381 |
-
<td align="center">0.043</td>
|
382 |
-
<td align="center">3.4</td>
|
383 |
-
<td align="center">41.0</td>
|
384 |
-
<td align="center">37.2</td>
|
385 |
-
<td align="center">137849600</td>
|
386 |
-
<td align="center"><a href="https://dl.fbaipublicfiles.com/detectron2/COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_3x/137849600/model_final_f10217.pkl">model</a> | <a href="https://dl.fbaipublicfiles.com/detectron2/COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_3x/137849600/metrics.json">metrics</a></td>
|
387 |
-
</tr>
|
388 |
-
<!-- ROW: mask_rcnn_R_101_C4_3x -->
|
389 |
-
<tr><td align="left"><a href="configs/COCO-InstanceSegmentation/mask_rcnn_R_101_C4_3x.yaml">R101-C4</a></td>
|
390 |
-
<td align="center">3x</td>
|
391 |
-
<td align="center">0.652</td>
|
392 |
-
<td align="center">0.145</td>
|
393 |
-
<td align="center">6.3</td>
|
394 |
-
<td align="center">42.6</td>
|
395 |
-
<td align="center">36.7</td>
|
396 |
-
<td align="center">138363239</td>
|
397 |
-
<td align="center"><a href="https://dl.fbaipublicfiles.com/detectron2/COCO-InstanceSegmentation/mask_rcnn_R_101_C4_3x/138363239/model_final_a2914c.pkl">model</a> | <a href="https://dl.fbaipublicfiles.com/detectron2/COCO-InstanceSegmentation/mask_rcnn_R_101_C4_3x/138363239/metrics.json">metrics</a></td>
|
398 |
-
</tr>
|
399 |
-
<!-- ROW: mask_rcnn_R_101_DC5_3x -->
|
400 |
-
<tr><td align="left"><a href="configs/COCO-InstanceSegmentation/mask_rcnn_R_101_DC5_3x.yaml">R101-DC5</a></td>
|
401 |
-
<td align="center">3x</td>
|
402 |
-
<td align="center">0.545</td>
|
403 |
-
<td align="center">0.092</td>
|
404 |
-
<td align="center">7.6</td>
|
405 |
-
<td align="center">41.9</td>
|
406 |
-
<td align="center">37.3</td>
|
407 |
-
<td align="center">138363294</td>
|
408 |
-
<td align="center"><a href="https://dl.fbaipublicfiles.com/detectron2/COCO-InstanceSegmentation/mask_rcnn_R_101_DC5_3x/138363294/model_final_0464b7.pkl">model</a> | <a href="https://dl.fbaipublicfiles.com/detectron2/COCO-InstanceSegmentation/mask_rcnn_R_101_DC5_3x/138363294/metrics.json">metrics</a></td>
|
409 |
-
</tr>
|
410 |
-
<!-- ROW: mask_rcnn_R_101_FPN_3x -->
|
411 |
-
<tr><td align="left"><a href="configs/COCO-InstanceSegmentation/mask_rcnn_R_101_FPN_3x.yaml">R101-FPN</a></td>
|
412 |
-
<td align="center">3x</td>
|
413 |
-
<td align="center">0.340</td>
|
414 |
-
<td align="center">0.056</td>
|
415 |
-
<td align="center">4.6</td>
|
416 |
-
<td align="center">42.9</td>
|
417 |
-
<td align="center">38.6</td>
|
418 |
-
<td align="center">138205316</td>
|
419 |
-
<td align="center"><a href="https://dl.fbaipublicfiles.com/detectron2/COCO-InstanceSegmentation/mask_rcnn_R_101_FPN_3x/138205316/model_final_a3ec72.pkl">model</a> | <a href="https://dl.fbaipublicfiles.com/detectron2/COCO-InstanceSegmentation/mask_rcnn_R_101_FPN_3x/138205316/metrics.json">metrics</a></td>
|
420 |
-
</tr>
|
421 |
-
<!-- ROW: mask_rcnn_X_101_32x8d_FPN_3x -->
|
422 |
-
<tr><td align="left"><a href="configs/COCO-InstanceSegmentation/mask_rcnn_X_101_32x8d_FPN_3x.yaml">X101-FPN</a></td>
|
423 |
-
<td align="center">3x</td>
|
424 |
-
<td align="center">0.690</td>
|
425 |
-
<td align="center">0.103</td>
|
426 |
-
<td align="center">7.2</td>
|
427 |
-
<td align="center">44.3</td>
|
428 |
-
<td align="center">39.5</td>
|
429 |
-
<td align="center">139653917</td>
|
430 |
-
<td align="center"><a href="https://dl.fbaipublicfiles.com/detectron2/COCO-InstanceSegmentation/mask_rcnn_X_101_32x8d_FPN_3x/139653917/model_final_2d9806.pkl">model</a> | <a href="https://dl.fbaipublicfiles.com/detectron2/COCO-InstanceSegmentation/mask_rcnn_X_101_32x8d_FPN_3x/139653917/metrics.json">metrics</a></td>
|
431 |
-
</tr>
|
432 |
-
</tbody></table>
|
433 |
-
|
434 |
-
### COCO Person Keypoint Detection Baselines with Keypoint R-CNN
|
435 |
-
<!--
|
436 |
-
./gen_html_table.py --config 'COCO-Keypoints/*50*' 'COCO-Keypoints/*101*' --name R50-FPN R50-FPN R101-FPN X101-FPN --fields lr_sched train_speed inference_speed mem box_AP keypoint_AP
|
437 |
-
-->
|
438 |
-
|
439 |
-
|
440 |
-
<table><tbody>
|
441 |
-
<!-- START TABLE -->
|
442 |
-
<!-- TABLE HEADER -->
|
443 |
-
<th valign="bottom">Name</th>
|
444 |
-
<th valign="bottom">lr<br/>sched</th>
|
445 |
-
<th valign="bottom">train<br/>time<br/>(s/iter)</th>
|
446 |
-
<th valign="bottom">inference<br/>time<br/>(s/im)</th>
|
447 |
-
<th valign="bottom">train<br/>mem<br/>(GB)</th>
|
448 |
-
<th valign="bottom">box<br/>AP</th>
|
449 |
-
<th valign="bottom">kp.<br/>AP</th>
|
450 |
-
<th valign="bottom">model id</th>
|
451 |
-
<th valign="bottom">download</th>
|
452 |
-
<!-- TABLE BODY -->
|
453 |
-
<!-- ROW: keypoint_rcnn_R_50_FPN_1x -->
|
454 |
-
<tr><td align="left"><a href="configs/COCO-Keypoints/keypoint_rcnn_R_50_FPN_1x.yaml">R50-FPN</a></td>
|
455 |
-
<td align="center">1x</td>
|
456 |
-
<td align="center">0.315</td>
|
457 |
-
<td align="center">0.072</td>
|
458 |
-
<td align="center">5.0</td>
|
459 |
-
<td align="center">53.6</td>
|
460 |
-
<td align="center">64.0</td>
|
461 |
-
<td align="center">137261548</td>
|
462 |
-
<td align="center"><a href="https://dl.fbaipublicfiles.com/detectron2/COCO-Keypoints/keypoint_rcnn_R_50_FPN_1x/137261548/model_final_04e291.pkl">model</a> | <a href="https://dl.fbaipublicfiles.com/detectron2/COCO-Keypoints/keypoint_rcnn_R_50_FPN_1x/137261548/metrics.json">metrics</a></td>
|
463 |
-
</tr>
|
464 |
-
<!-- ROW: keypoint_rcnn_R_50_FPN_3x -->
|
465 |
-
<tr><td align="left"><a href="configs/COCO-Keypoints/keypoint_rcnn_R_50_FPN_3x.yaml">R50-FPN</a></td>
|
466 |
-
<td align="center">3x</td>
|
467 |
-
<td align="center">0.316</td>
|
468 |
-
<td align="center">0.066</td>
|
469 |
-
<td align="center">5.0</td>
|
470 |
-
<td align="center">55.4</td>
|
471 |
-
<td align="center">65.5</td>
|
472 |
-
<td align="center">137849621</td>
|
473 |
-
<td align="center"><a href="https://dl.fbaipublicfiles.com/detectron2/COCO-Keypoints/keypoint_rcnn_R_50_FPN_3x/137849621/model_final_a6e10b.pkl">model</a> | <a href="https://dl.fbaipublicfiles.com/detectron2/COCO-Keypoints/keypoint_rcnn_R_50_FPN_3x/137849621/metrics.json">metrics</a></td>
|
474 |
-
</tr>
|
475 |
-
<!-- ROW: keypoint_rcnn_R_101_FPN_3x -->
|
476 |
-
<tr><td align="left"><a href="configs/COCO-Keypoints/keypoint_rcnn_R_101_FPN_3x.yaml">R101-FPN</a></td>
|
477 |
-
<td align="center">3x</td>
|
478 |
-
<td align="center">0.390</td>
|
479 |
-
<td align="center">0.076</td>
|
480 |
-
<td align="center">6.1</td>
|
481 |
-
<td align="center">56.4</td>
|
482 |
-
<td align="center">66.1</td>
|
483 |
-
<td align="center">138363331</td>
|
484 |
-
<td align="center"><a href="https://dl.fbaipublicfiles.com/detectron2/COCO-Keypoints/keypoint_rcnn_R_101_FPN_3x/138363331/model_final_997cc7.pkl">model</a> | <a href="https://dl.fbaipublicfiles.com/detectron2/COCO-Keypoints/keypoint_rcnn_R_101_FPN_3x/138363331/metrics.json">metrics</a></td>
|
485 |
-
</tr>
|
486 |
-
<!-- ROW: keypoint_rcnn_X_101_32x8d_FPN_3x -->
|
487 |
-
<tr><td align="left"><a href="configs/COCO-Keypoints/keypoint_rcnn_X_101_32x8d_FPN_3x.yaml">X101-FPN</a></td>
|
488 |
-
<td align="center">3x</td>
|
489 |
-
<td align="center">0.738</td>
|
490 |
-
<td align="center">0.121</td>
|
491 |
-
<td align="center">8.7</td>
|
492 |
-
<td align="center">57.3</td>
|
493 |
-
<td align="center">66.0</td>
|
494 |
-
<td align="center">139686956</td>
|
495 |
-
<td align="center"><a href="https://dl.fbaipublicfiles.com/detectron2/COCO-Keypoints/keypoint_rcnn_X_101_32x8d_FPN_3x/139686956/model_final_5ad38f.pkl">model</a> | <a href="https://dl.fbaipublicfiles.com/detectron2/COCO-Keypoints/keypoint_rcnn_X_101_32x8d_FPN_3x/139686956/metrics.json">metrics</a></td>
|
496 |
-
</tr>
|
497 |
-
</tbody></table>
|
498 |
-
|
499 |
-
### COCO Panoptic Segmentation Baselines with Panoptic FPN
|
500 |
-
<!--
|
501 |
-
./gen_html_table.py --config 'COCO-PanopticSegmentation/*50*' 'COCO-PanopticSegmentation/*101*' --name R50-FPN R50-FPN R101-FPN --fields lr_sched train_speed inference_speed mem box_AP mask_AP PQ
|
502 |
-
-->
|
503 |
-
|
504 |
-
|
505 |
-
<table><tbody>
|
506 |
-
<!-- START TABLE -->
|
507 |
-
<!-- TABLE HEADER -->
|
508 |
-
<th valign="bottom">Name</th>
|
509 |
-
<th valign="bottom">lr<br/>sched</th>
|
510 |
-
<th valign="bottom">train<br/>time<br/>(s/iter)</th>
|
511 |
-
<th valign="bottom">inference<br/>time<br/>(s/im)</th>
|
512 |
-
<th valign="bottom">train<br/>mem<br/>(GB)</th>
|
513 |
-
<th valign="bottom">box<br/>AP</th>
|
514 |
-
<th valign="bottom">mask<br/>AP</th>
|
515 |
-
<th valign="bottom">PQ</th>
|
516 |
-
<th valign="bottom">model id</th>
|
517 |
-
<th valign="bottom">download</th>
|
518 |
-
<!-- TABLE BODY -->
|
519 |
-
<!-- ROW: panoptic_fpn_R_50_1x -->
|
520 |
-
<tr><td align="left"><a href="configs/COCO-PanopticSegmentation/panoptic_fpn_R_50_1x.yaml">R50-FPN</a></td>
|
521 |
-
<td align="center">1x</td>
|
522 |
-
<td align="center">0.304</td>
|
523 |
-
<td align="center">0.053</td>
|
524 |
-
<td align="center">4.8</td>
|
525 |
-
<td align="center">37.6</td>
|
526 |
-
<td align="center">34.7</td>
|
527 |
-
<td align="center">39.4</td>
|
528 |
-
<td align="center">139514544</td>
|
529 |
-
<td align="center"><a href="https://dl.fbaipublicfiles.com/detectron2/COCO-PanopticSegmentation/panoptic_fpn_R_50_1x/139514544/model_final_dbfeb4.pkl">model</a> | <a href="https://dl.fbaipublicfiles.com/detectron2/COCO-PanopticSegmentation/panoptic_fpn_R_50_1x/139514544/metrics.json">metrics</a></td>
|
530 |
-
</tr>
|
531 |
-
<!-- ROW: panoptic_fpn_R_50_3x -->
|
532 |
-
<tr><td align="left"><a href="configs/COCO-PanopticSegmentation/panoptic_fpn_R_50_3x.yaml">R50-FPN</a></td>
|
533 |
-
<td align="center">3x</td>
|
534 |
-
<td align="center">0.302</td>
|
535 |
-
<td align="center">0.053</td>
|
536 |
-
<td align="center">4.8</td>
|
537 |
-
<td align="center">40.0</td>
|
538 |
-
<td align="center">36.5</td>
|
539 |
-
<td align="center">41.5</td>
|
540 |
-
<td align="center">139514569</td>
|
541 |
-
<td align="center"><a href="https://dl.fbaipublicfiles.com/detectron2/COCO-PanopticSegmentation/panoptic_fpn_R_50_3x/139514569/model_final_c10459.pkl">model</a> | <a href="https://dl.fbaipublicfiles.com/detectron2/COCO-PanopticSegmentation/panoptic_fpn_R_50_3x/139514569/metrics.json">metrics</a></td>
|
542 |
-
</tr>
|
543 |
-
<!-- ROW: panoptic_fpn_R_101_3x -->
|
544 |
-
<tr><td align="left"><a href="configs/COCO-PanopticSegmentation/panoptic_fpn_R_101_3x.yaml">R101-FPN</a></td>
|
545 |
-
<td align="center">3x</td>
|
546 |
-
<td align="center">0.392</td>
|
547 |
-
<td align="center">0.066</td>
|
548 |
-
<td align="center">6.0</td>
|
549 |
-
<td align="center">42.4</td>
|
550 |
-
<td align="center">38.5</td>
|
551 |
-
<td align="center">43.0</td>
|
552 |
-
<td align="center">139514519</td>
|
553 |
-
<td align="center"><a href="https://dl.fbaipublicfiles.com/detectron2/COCO-PanopticSegmentation/panoptic_fpn_R_101_3x/139514519/model_final_cafdb1.pkl">model</a> | <a href="https://dl.fbaipublicfiles.com/detectron2/COCO-PanopticSegmentation/panoptic_fpn_R_101_3x/139514519/metrics.json">metrics</a></td>
|
554 |
-
</tr>
|
555 |
-
</tbody></table>
|
556 |
-
|
557 |
-
|
558 |
-
### LVIS Instance Segmentation Baselines with Mask R-CNN
|
559 |
-
|
560 |
-
Mask R-CNN baselines on the [LVIS dataset](https://lvisdataset.org), v0.5.
|
561 |
-
These baselines are described in Table 3(c) of the [LVIS paper](https://arxiv.org/abs/1908.03195).
|
562 |
-
|
563 |
-
NOTE: the 1x schedule here has the same amount of __iterations__ as the COCO 1x baselines.
|
564 |
-
They are roughly 24 epochs of LVISv0.5 data.
|
565 |
-
The final results of these configs have large variance across different runs.
|
566 |
-
|
567 |
-
<!--
|
568 |
-
./gen_html_table.py --config 'LVIS-InstanceSegmentation/mask*50*' 'LVIS-InstanceSegmentation/mask*101*' --name R50-FPN R101-FPN X101-FPN --fields lr_sched train_speed inference_speed mem box_AP mask_AP
|
569 |
-
-->
|
570 |
-
|
571 |
-
|
572 |
-
<table><tbody>
|
573 |
-
<!-- START TABLE -->
|
574 |
-
<!-- TABLE HEADER -->
|
575 |
-
<th valign="bottom">Name</th>
|
576 |
-
<th valign="bottom">lr<br/>sched</th>
|
577 |
-
<th valign="bottom">train<br/>time<br/>(s/iter)</th>
|
578 |
-
<th valign="bottom">inference<br/>time<br/>(s/im)</th>
|
579 |
-
<th valign="bottom">train<br/>mem<br/>(GB)</th>
|
580 |
-
<th valign="bottom">box<br/>AP</th>
|
581 |
-
<th valign="bottom">mask<br/>AP</th>
|
582 |
-
<th valign="bottom">model id</th>
|
583 |
-
<th valign="bottom">download</th>
|
584 |
-
<!-- TABLE BODY -->
|
585 |
-
<!-- ROW: mask_rcnn_R_50_FPN_1x -->
|
586 |
-
<tr><td align="left"><a href="configs/LVIS-InstanceSegmentation/mask_rcnn_R_50_FPN_1x.yaml">R50-FPN</a></td>
|
587 |
-
<td align="center">1x</td>
|
588 |
-
<td align="center">0.292</td>
|
589 |
-
<td align="center">0.107</td>
|
590 |
-
<td align="center">7.1</td>
|
591 |
-
<td align="center">23.6</td>
|
592 |
-
<td align="center">24.4</td>
|
593 |
-
<td align="center">144219072</td>
|
594 |
-
<td align="center"><a href="https://dl.fbaipublicfiles.com/detectron2/LVIS-InstanceSegmentation/mask_rcnn_R_50_FPN_1x/144219072/model_final_571f7c.pkl">model</a> | <a href="https://dl.fbaipublicfiles.com/detectron2/LVIS-InstanceSegmentation/mask_rcnn_R_50_FPN_1x/144219072/metrics.json">metrics</a></td>
|
595 |
-
</tr>
|
596 |
-
<!-- ROW: mask_rcnn_R_101_FPN_1x -->
|
597 |
-
<tr><td align="left"><a href="configs/LVIS-InstanceSegmentation/mask_rcnn_R_101_FPN_1x.yaml">R101-FPN</a></td>
|
598 |
-
<td align="center">1x</td>
|
599 |
-
<td align="center">0.371</td>
|
600 |
-
<td align="center">0.114</td>
|
601 |
-
<td align="center">7.8</td>
|
602 |
-
<td align="center">25.6</td>
|
603 |
-
<td align="center">25.9</td>
|
604 |
-
<td align="center">144219035</td>
|
605 |
-
<td align="center"><a href="https://dl.fbaipublicfiles.com/detectron2/LVIS-InstanceSegmentation/mask_rcnn_R_101_FPN_1x/144219035/model_final_824ab5.pkl">model</a> | <a href="https://dl.fbaipublicfiles.com/detectron2/LVIS-InstanceSegmentation/mask_rcnn_R_101_FPN_1x/144219035/metrics.json">metrics</a></td>
|
606 |
-
</tr>
|
607 |
-
<!-- ROW: mask_rcnn_X_101_32x8d_FPN_1x -->
|
608 |
-
<tr><td align="left"><a href="configs/LVIS-InstanceSegmentation/mask_rcnn_X_101_32x8d_FPN_1x.yaml">X101-FPN</a></td>
|
609 |
-
<td align="center">1x</td>
|
610 |
-
<td align="center">0.712</td>
|
611 |
-
<td align="center">0.151</td>
|
612 |
-
<td align="center">10.2</td>
|
613 |
-
<td align="center">26.7</td>
|
614 |
-
<td align="center">27.1</td>
|
615 |
-
<td align="center">144219108</td>
|
616 |
-
<td align="center"><a href="https://dl.fbaipublicfiles.com/detectron2/LVIS-InstanceSegmentation/mask_rcnn_X_101_32x8d_FPN_1x/144219108/model_final_5e3439.pkl">model</a> | <a href="https://dl.fbaipublicfiles.com/detectron2/LVIS-InstanceSegmentation/mask_rcnn_X_101_32x8d_FPN_1x/144219108/metrics.json">metrics</a></td>
|
617 |
-
</tr>
|
618 |
-
</tbody></table>
|
619 |
-
|
620 |
-
|
621 |
-
|
622 |
-
### Cityscapes & Pascal VOC Baselines
|
623 |
-
|
624 |
-
Simple baselines for
|
625 |
-
* Mask R-CNN on Cityscapes instance segmentation (initialized from COCO pre-training, then trained on Cityscapes fine annotations only)
|
626 |
-
* Faster R-CNN on PASCAL VOC object detection (trained on VOC 2007 train+val + VOC 2012 train+val, tested on VOC 2007 using 11-point interpolated AP)
|
627 |
-
|
628 |
-
<!--
|
629 |
-
./gen_html_table.py --config 'Cityscapes/*' 'PascalVOC-Detection/*' --name "R50-FPN, Cityscapes" "R50-C4, VOC" --fields train_speed inference_speed mem box_AP box_AP50 mask_AP
|
630 |
-
-->
|
631 |
-
|
632 |
-
|
633 |
-
<table><tbody>
|
634 |
-
<!-- START TABLE -->
|
635 |
-
<!-- TABLE HEADER -->
|
636 |
-
<th valign="bottom">Name</th>
|
637 |
-
<th valign="bottom">train<br/>time<br/>(s/iter)</th>
|
638 |
-
<th valign="bottom">inference<br/>time<br/>(s/im)</th>
|
639 |
-
<th valign="bottom">train<br/>mem<br/>(GB)</th>
|
640 |
-
<th valign="bottom">box<br/>AP</th>
|
641 |
-
<th valign="bottom">box<br/>AP50</th>
|
642 |
-
<th valign="bottom">mask<br/>AP</th>
|
643 |
-
<th valign="bottom">model id</th>
|
644 |
-
<th valign="bottom">download</th>
|
645 |
-
<!-- TABLE BODY -->
|
646 |
-
<!-- ROW: mask_rcnn_R_50_FPN -->
|
647 |
-
<tr><td align="left"><a href="configs/Cityscapes/mask_rcnn_R_50_FPN.yaml">R50-FPN, Cityscapes</a></td>
|
648 |
-
<td align="center">0.240</td>
|
649 |
-
<td align="center">0.078</td>
|
650 |
-
<td align="center">4.4</td>
|
651 |
-
<td align="center"></td>
|
652 |
-
<td align="center"></td>
|
653 |
-
<td align="center">36.5</td>
|
654 |
-
<td align="center">142423278</td>
|
655 |
-
<td align="center"><a href="https://dl.fbaipublicfiles.com/detectron2/Cityscapes/mask_rcnn_R_50_FPN/142423278/model_final_af9cf5.pkl">model</a> | <a href="https://dl.fbaipublicfiles.com/detectron2/Cityscapes/mask_rcnn_R_50_FPN/142423278/metrics.json">metrics</a></td>
|
656 |
-
</tr>
|
657 |
-
<!-- ROW: faster_rcnn_R_50_C4 -->
|
658 |
-
<tr><td align="left"><a href="configs/PascalVOC-Detection/faster_rcnn_R_50_C4.yaml">R50-C4, VOC</a></td>
|
659 |
-
<td align="center">0.537</td>
|
660 |
-
<td align="center">0.081</td>
|
661 |
-
<td align="center">4.8</td>
|
662 |
-
<td align="center">51.9</td>
|
663 |
-
<td align="center">80.3</td>
|
664 |
-
<td align="center"></td>
|
665 |
-
<td align="center">142202221</td>
|
666 |
-
<td align="center"><a href="https://dl.fbaipublicfiles.com/detectron2/PascalVOC-Detection/faster_rcnn_R_50_C4/142202221/model_final_b1acc2.pkl">model</a> | <a href="https://dl.fbaipublicfiles.com/detectron2/PascalVOC-Detection/faster_rcnn_R_50_C4/142202221/metrics.json">metrics</a></td>
|
667 |
-
</tr>
|
668 |
-
</tbody></table>
|
669 |
-
|
670 |
-
|
671 |
-
|
672 |
-
### Other Settings
|
673 |
-
|
674 |
-
Ablations for Deformable Conv and Cascade R-CNN:
|
675 |
-
|
676 |
-
<!--
|
677 |
-
./gen_html_table.py --config 'COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_1x.yaml' 'Misc/*R_50_FPN_1x_dconv*' 'Misc/cascade*1x.yaml' 'COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_3x.yaml' 'Misc/*R_50_FPN_3x_dconv*' 'Misc/cascade*3x.yaml' --name "Baseline R50-FPN" "Deformable Conv" "Cascade R-CNN" "Baseline R50-FPN" "Deformable Conv" "Cascade R-CNN" --fields lr_sched train_speed inference_speed mem box_AP mask_AP
|
678 |
-
-->
|
679 |
-
|
680 |
-
|
681 |
-
<table><tbody>
|
682 |
-
<!-- START TABLE -->
|
683 |
-
<!-- TABLE HEADER -->
|
684 |
-
<th valign="bottom">Name</th>
|
685 |
-
<th valign="bottom">lr<br/>sched</th>
|
686 |
-
<th valign="bottom">train<br/>time<br/>(s/iter)</th>
|
687 |
-
<th valign="bottom">inference<br/>time<br/>(s/im)</th>
|
688 |
-
<th valign="bottom">train<br/>mem<br/>(GB)</th>
|
689 |
-
<th valign="bottom">box<br/>AP</th>
|
690 |
-
<th valign="bottom">mask<br/>AP</th>
|
691 |
-
<th valign="bottom">model id</th>
|
692 |
-
<th valign="bottom">download</th>
|
693 |
-
<!-- TABLE BODY -->
|
694 |
-
<!-- ROW: mask_rcnn_R_50_FPN_1x -->
|
695 |
-
<tr><td align="left"><a href="configs/COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_1x.yaml">Baseline R50-FPN</a></td>
|
696 |
-
<td align="center">1x</td>
|
697 |
-
<td align="center">0.261</td>
|
698 |
-
<td align="center">0.043</td>
|
699 |
-
<td align="center">3.4</td>
|
700 |
-
<td align="center">38.6</td>
|
701 |
-
<td align="center">35.2</td>
|
702 |
-
<td align="center">137260431</td>
|
703 |
-
<td align="center"><a href="https://dl.fbaipublicfiles.com/detectron2/COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_1x/137260431/model_final_a54504.pkl">model</a> | <a href="https://dl.fbaipublicfiles.com/detectron2/COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_1x/137260431/metrics.json">metrics</a></td>
|
704 |
-
</tr>
|
705 |
-
<!-- ROW: mask_rcnn_R_50_FPN_1x_dconv_c3-c5 -->
|
706 |
-
<tr><td align="left"><a href="configs/Misc/mask_rcnn_R_50_FPN_1x_dconv_c3-c5.yaml">Deformable Conv</a></td>
|
707 |
-
<td align="center">1x</td>
|
708 |
-
<td align="center">0.342</td>
|
709 |
-
<td align="center">0.048</td>
|
710 |
-
<td align="center">3.5</td>
|
711 |
-
<td align="center">41.5</td>
|
712 |
-
<td align="center">37.5</td>
|
713 |
-
<td align="center">138602867</td>
|
714 |
-
<td align="center"><a href="https://dl.fbaipublicfiles.com/detectron2/Misc/mask_rcnn_R_50_FPN_1x_dconv_c3-c5/138602867/model_final_65c703.pkl">model</a> | <a href="https://dl.fbaipublicfiles.com/detectron2/Misc/mask_rcnn_R_50_FPN_1x_dconv_c3-c5/138602867/metrics.json">metrics</a></td>
|
715 |
-
</tr>
|
716 |
-
<!-- ROW: cascade_mask_rcnn_R_50_FPN_1x -->
|
717 |
-
<tr><td align="left"><a href="configs/Misc/cascade_mask_rcnn_R_50_FPN_1x.yaml">Cascade R-CNN</a></td>
|
718 |
-
<td align="center">1x</td>
|
719 |
-
<td align="center">0.317</td>
|
720 |
-
<td align="center">0.052</td>
|
721 |
-
<td align="center">4.0</td>
|
722 |
-
<td align="center">42.1</td>
|
723 |
-
<td align="center">36.4</td>
|
724 |
-
<td align="center">138602847</td>
|
725 |
-
<td align="center"><a href="https://dl.fbaipublicfiles.com/detectron2/Misc/cascade_mask_rcnn_R_50_FPN_1x/138602847/model_final_e9d89b.pkl">model</a> | <a href="https://dl.fbaipublicfiles.com/detectron2/Misc/cascade_mask_rcnn_R_50_FPN_1x/138602847/metrics.json">metrics</a></td>
|
726 |
-
</tr>
|
727 |
-
<!-- ROW: mask_rcnn_R_50_FPN_3x -->
|
728 |
-
<tr><td align="left"><a href="configs/COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_3x.yaml">Baseline R50-FPN</a></td>
|
729 |
-
<td align="center">3x</td>
|
730 |
-
<td align="center">0.261</td>
|
731 |
-
<td align="center">0.043</td>
|
732 |
-
<td align="center">3.4</td>
|
733 |
-
<td align="center">41.0</td>
|
734 |
-
<td align="center">37.2</td>
|
735 |
-
<td align="center">137849600</td>
|
736 |
-
<td align="center"><a href="https://dl.fbaipublicfiles.com/detectron2/COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_3x/137849600/model_final_f10217.pkl">model</a> | <a href="https://dl.fbaipublicfiles.com/detectron2/COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_3x/137849600/metrics.json">metrics</a></td>
|
737 |
-
</tr>
|
738 |
-
<!-- ROW: mask_rcnn_R_50_FPN_3x_dconv_c3-c5 -->
|
739 |
-
<tr><td align="left"><a href="configs/Misc/mask_rcnn_R_50_FPN_3x_dconv_c3-c5.yaml">Deformable Conv</a></td>
|
740 |
-
<td align="center">3x</td>
|
741 |
-
<td align="center">0.349</td>
|
742 |
-
<td align="center">0.047</td>
|
743 |
-
<td align="center">3.5</td>
|
744 |
-
<td align="center">42.7</td>
|
745 |
-
<td align="center">38.5</td>
|
746 |
-
<td align="center">144998336</td>
|
747 |
-
<td align="center"><a href="https://dl.fbaipublicfiles.com/detectron2/Misc/mask_rcnn_R_50_FPN_3x_dconv_c3-c5/144998336/model_final_821d0b.pkl">model</a> | <a href="https://dl.fbaipublicfiles.com/detectron2/Misc/mask_rcnn_R_50_FPN_3x_dconv_c3-c5/144998336/metrics.json">metrics</a></td>
|
748 |
-
</tr>
|
749 |
-
<!-- ROW: cascade_mask_rcnn_R_50_FPN_3x -->
|
750 |
-
<tr><td align="left"><a href="configs/Misc/cascade_mask_rcnn_R_50_FPN_3x.yaml">Cascade R-CNN</a></td>
|
751 |
-
<td align="center">3x</td>
|
752 |
-
<td align="center">0.328</td>
|
753 |
-
<td align="center">0.053</td>
|
754 |
-
<td align="center">4.0</td>
|
755 |
-
<td align="center">44.3</td>
|
756 |
-
<td align="center">38.5</td>
|
757 |
-
<td align="center">144998488</td>
|
758 |
-
<td align="center"><a href="https://dl.fbaipublicfiles.com/detectron2/Misc/cascade_mask_rcnn_R_50_FPN_3x/144998488/model_final_480dd8.pkl">model</a> | <a href="https://dl.fbaipublicfiles.com/detectron2/Misc/cascade_mask_rcnn_R_50_FPN_3x/144998488/metrics.json">metrics</a></td>
|
759 |
-
</tr>
|
760 |
-
</tbody></table>
|
761 |
-
|
762 |
-
|
763 |
-
Ablations for normalization methods:
|
764 |
-
(Note: The baseline uses `2fc` head while the others use `4conv1fc` head. According to the
|
765 |
-
[GroupNorm paper](https://arxiv.org/abs/1803.08494), the change in head does not improve the baseline by much)
|
766 |
-
<!--
|
767 |
-
./gen_html_table.py --config 'COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_3x.yaml' 'Misc/mask*50_FPN_3x_syncbn.yaml' 'Misc/mask*50_FPN_3x_gn.yaml' 'Misc/scratch*' --name "Baseline R50-FPN" "SyncBN" "GN" "GN (scratch)" --fields lr_sched train_speed inference_speed mem box_AP mask_AP
|
768 |
-
-->
|
769 |
-
|
770 |
-
|
771 |
-
<table><tbody>
|
772 |
-
<!-- START TABLE -->
|
773 |
-
<!-- TABLE HEADER -->
|
774 |
-
<th valign="bottom">Name</th>
|
775 |
-
<th valign="bottom">lr<br/>sched</th>
|
776 |
-
<th valign="bottom">train<br/>time<br/>(s/iter)</th>
|
777 |
-
<th valign="bottom">inference<br/>time<br/>(s/im)</th>
|
778 |
-
<th valign="bottom">train<br/>mem<br/>(GB)</th>
|
779 |
-
<th valign="bottom">box<br/>AP</th>
|
780 |
-
<th valign="bottom">mask<br/>AP</th>
|
781 |
-
<th valign="bottom">model id</th>
|
782 |
-
<th valign="bottom">download</th>
|
783 |
-
<!-- TABLE BODY -->
|
784 |
-
<!-- ROW: mask_rcnn_R_50_FPN_3x -->
|
785 |
-
<tr><td align="left"><a href="configs/COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_3x.yaml">Baseline R50-FPN</a></td>
|
786 |
-
<td align="center">3x</td>
|
787 |
-
<td align="center">0.261</td>
|
788 |
-
<td align="center">0.043</td>
|
789 |
-
<td align="center">3.4</td>
|
790 |
-
<td align="center">41.0</td>
|
791 |
-
<td align="center">37.2</td>
|
792 |
-
<td align="center">137849600</td>
|
793 |
-
<td align="center"><a href="https://dl.fbaipublicfiles.com/detectron2/COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_3x/137849600/model_final_f10217.pkl">model</a> | <a href="https://dl.fbaipublicfiles.com/detectron2/COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_3x/137849600/metrics.json">metrics</a></td>
|
794 |
-
</tr>
|
795 |
-
<!-- ROW: mask_rcnn_R_50_FPN_3x_syncbn -->
|
796 |
-
<tr><td align="left"><a href="configs/Misc/mask_rcnn_R_50_FPN_3x_syncbn.yaml">SyncBN</a></td>
|
797 |
-
<td align="center">3x</td>
|
798 |
-
<td align="center">0.412</td>
|
799 |
-
<td align="center">0.053</td>
|
800 |
-
<td align="center">5.5</td>
|
801 |
-
<td align="center">41.9</td>
|
802 |
-
<td align="center">37.8</td>
|
803 |
-
<td align="center">169527823</td>
|
804 |
-
<td align="center"><a href="https://dl.fbaipublicfiles.com/detectron2/Misc/mask_rcnn_R_50_FPN_3x_syncbn/169527823/model_final_3b3c51.pkl">model</a> | <a href="https://dl.fbaipublicfiles.com/detectron2/Misc/mask_rcnn_R_50_FPN_3x_syncbn/169527823/metrics.json">metrics</a></td>
|
805 |
-
</tr>
|
806 |
-
<!-- ROW: mask_rcnn_R_50_FPN_3x_gn -->
|
807 |
-
<tr><td align="left"><a href="configs/Misc/mask_rcnn_R_50_FPN_3x_gn.yaml">GN</a></td>
|
808 |
-
<td align="center">3x</td>
|
809 |
-
<td align="center">0.356</td>
|
810 |
-
<td align="center">0.069</td>
|
811 |
-
<td align="center">7.3</td>
|
812 |
-
<td align="center">42.6</td>
|
813 |
-
<td align="center">38.6</td>
|
814 |
-
<td align="center">138602888</td>
|
815 |
-
<td align="center"><a href="https://dl.fbaipublicfiles.com/detectron2/Misc/mask_rcnn_R_50_FPN_3x_gn/138602888/model_final_dc5d9e.pkl">model</a> | <a href="https://dl.fbaipublicfiles.com/detectron2/Misc/mask_rcnn_R_50_FPN_3x_gn/138602888/metrics.json">metrics</a></td>
|
816 |
-
</tr>
|
817 |
-
<!-- ROW: scratch_mask_rcnn_R_50_FPN_3x_gn -->
|
818 |
-
<tr><td align="left"><a href="configs/Misc/scratch_mask_rcnn_R_50_FPN_3x_gn.yaml">GN (scratch)</a></td>
|
819 |
-
<td align="center">3x</td>
|
820 |
-
<td align="center">0.400</td>
|
821 |
-
<td align="center">0.069</td>
|
822 |
-
<td align="center">9.8</td>
|
823 |
-
<td align="center">39.9</td>
|
824 |
-
<td align="center">36.6</td>
|
825 |
-
<td align="center">138602908</td>
|
826 |
-
<td align="center"><a href="https://dl.fbaipublicfiles.com/detectron2/Misc/scratch_mask_rcnn_R_50_FPN_3x_gn/138602908/model_final_01ca85.pkl">model</a> | <a href="https://dl.fbaipublicfiles.com/detectron2/Misc/scratch_mask_rcnn_R_50_FPN_3x_gn/138602908/metrics.json">metrics</a></td>
|
827 |
-
</tr>
|
828 |
-
</tbody></table>
|
829 |
-
|
830 |
-
|
831 |
-
|
832 |
-
A few very large models trained for a long time, for demo purposes:
|
833 |
-
|
834 |
-
<!--
|
835 |
-
./gen_html_table.py --config 'Misc/panoptic_*dconv*' 'Misc/cascade_*152*' --name "Panoptic FPN R101" "Mask R-CNN X152" --fields inference_speed mem box_AP mask_AP PQ
|
836 |
-
# manually add TTA results
|
837 |
-
-->
|
838 |
-
|
839 |
-
|
840 |
-
<table><tbody>
|
841 |
-
<!-- START TABLE -->
|
842 |
-
<!-- TABLE HEADER -->
|
843 |
-
<th valign="bottom">Name</th>
|
844 |
-
<th valign="bottom">inference<br/>time<br/>(s/im)</th>
|
845 |
-
<th valign="bottom">train<br/>mem<br/>(GB)</th>
|
846 |
-
<th valign="bottom">box<br/>AP</th>
|
847 |
-
<th valign="bottom">mask<br/>AP</th>
|
848 |
-
<th valign="bottom">PQ</th>
|
849 |
-
<th valign="bottom">model id</th>
|
850 |
-
<th valign="bottom">download</th>
|
851 |
-
<!-- TABLE BODY -->
|
852 |
-
<!-- ROW: panoptic_fpn_R_101_dconv_cascade_gn_3x -->
|
853 |
-
<tr><td align="left"><a href="configs/Misc/panoptic_fpn_R_101_dconv_cascade_gn_3x.yaml">Panoptic FPN R101</a></td>
|
854 |
-
<td align="center">0.107</td>
|
855 |
-
<td align="center">11.4</td>
|
856 |
-
<td align="center">47.4</td>
|
857 |
-
<td align="center">41.3</td>
|
858 |
-
<td align="center">46.1</td>
|
859 |
-
<td align="center">139797668</td>
|
860 |
-
<td align="center"><a href="https://dl.fbaipublicfiles.com/detectron2/Misc/panoptic_fpn_R_101_dconv_cascade_gn_3x/139797668/model_final_be35db.pkl">model</a> | <a href="https://dl.fbaipublicfiles.com/detectron2/Misc/panoptic_fpn_R_101_dconv_cascade_gn_3x/139797668/metrics.json">metrics</a></td>
|
861 |
-
</tr>
|
862 |
-
<!-- ROW: cascade_mask_rcnn_X_152_32x8d_FPN_IN5k_gn_dconv -->
|
863 |
-
<tr><td align="left"><a href="configs/Misc/cascade_mask_rcnn_X_152_32x8d_FPN_IN5k_gn_dconv.yaml">Mask R-CNN X152</a></td>
|
864 |
-
<td align="center">0.242</td>
|
865 |
-
<td align="center">15.1</td>
|
866 |
-
<td align="center">50.2</td>
|
867 |
-
<td align="center">44.0</td>
|
868 |
-
<td align="center"></td>
|
869 |
-
<td align="center">18131413</td>
|
870 |
-
<td align="center"><a href="https://dl.fbaipublicfiles.com/detectron2/Misc/cascade_mask_rcnn_X_152_32x8d_FPN_IN5k_gn_dconv/18131413/model_0039999_e76410.pkl">model</a> | <a href="https://dl.fbaipublicfiles.com/detectron2/Misc/cascade_mask_rcnn_X_152_32x8d_FPN_IN5k_gn_dconv/18131413/metrics.json">metrics</a></td>
|
871 |
-
</tr>
|
872 |
-
<!-- ROW: TTA cascade_mask_rcnn_X_152_32x8d_FPN_IN5k_gn_dconv -->
|
873 |
-
<tr><td align="left">above + test-time aug.</td>
|
874 |
-
<td align="center"></td>
|
875 |
-
<td align="center"></td>
|
876 |
-
<td align="center">51.9</td>
|
877 |
-
<td align="center">45.9</td>
|
878 |
-
<td align="center"></td>
|
879 |
-
<td align="center"></td>
|
880 |
-
<td align="center"></td>
|
881 |
-
</tr>
|
882 |
-
</tbody></table>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/CVPR/Dual-Key_Backdoor_Attacks/datagen/grid-feats-vqa/grid_feats/__init__.py
DELETED
@@ -1,8 +0,0 @@
|
|
1 |
-
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
|
2 |
-
from .config import add_attribute_config
|
3 |
-
from .build_loader import (
|
4 |
-
build_detection_train_loader_with_attributes,
|
5 |
-
build_detection_test_loader_with_attributes,
|
6 |
-
)
|
7 |
-
from .roi_heads import AttributeRes5ROIHeads, AttributeStandardROIHeads
|
8 |
-
from . import visual_genome
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/CVPR/LIVE/pybind11/tests/pybind11_cross_module_tests.cpp
DELETED
@@ -1,123 +0,0 @@
|
|
1 |
-
/*
|
2 |
-
tests/pybind11_cross_module_tests.cpp -- contains tests that require multiple modules
|
3 |
-
|
4 |
-
Copyright (c) 2017 Jason Rhinelander <[email protected]>
|
5 |
-
|
6 |
-
All rights reserved. Use of this source code is governed by a
|
7 |
-
BSD-style license that can be found in the LICENSE file.
|
8 |
-
*/
|
9 |
-
|
10 |
-
#include "pybind11_tests.h"
|
11 |
-
#include "local_bindings.h"
|
12 |
-
#include <pybind11/stl_bind.h>
|
13 |
-
#include <numeric>
|
14 |
-
|
15 |
-
PYBIND11_MODULE(pybind11_cross_module_tests, m) {
|
16 |
-
m.doc() = "pybind11 cross-module test module";
|
17 |
-
|
18 |
-
// test_local_bindings.py tests:
|
19 |
-
//
|
20 |
-
// Definitions here are tested by importing both this module and the
|
21 |
-
// relevant pybind11_tests submodule from a test_whatever.py
|
22 |
-
|
23 |
-
// test_load_external
|
24 |
-
bind_local<ExternalType1>(m, "ExternalType1", py::module_local());
|
25 |
-
bind_local<ExternalType2>(m, "ExternalType2", py::module_local());
|
26 |
-
|
27 |
-
// test_exceptions.py
|
28 |
-
m.def("raise_runtime_error", []() { PyErr_SetString(PyExc_RuntimeError, "My runtime error"); throw py::error_already_set(); });
|
29 |
-
m.def("raise_value_error", []() { PyErr_SetString(PyExc_ValueError, "My value error"); throw py::error_already_set(); });
|
30 |
-
m.def("throw_pybind_value_error", []() { throw py::value_error("pybind11 value error"); });
|
31 |
-
m.def("throw_pybind_type_error", []() { throw py::type_error("pybind11 type error"); });
|
32 |
-
m.def("throw_stop_iteration", []() { throw py::stop_iteration(); });
|
33 |
-
|
34 |
-
// test_local_bindings.py
|
35 |
-
// Local to both:
|
36 |
-
bind_local<LocalType, 1>(m, "LocalType", py::module_local())
|
37 |
-
.def("get2", [](LocalType &t) { return t.i + 2; })
|
38 |
-
;
|
39 |
-
|
40 |
-
// Can only be called with our python type:
|
41 |
-
m.def("local_value", [](LocalType &l) { return l.i; });
|
42 |
-
|
43 |
-
// test_nonlocal_failure
|
44 |
-
// This registration will fail (global registration when LocalFail is already registered
|
45 |
-
// globally in the main test module):
|
46 |
-
m.def("register_nonlocal", [m]() {
|
47 |
-
bind_local<NonLocalType, 0>(m, "NonLocalType");
|
48 |
-
});
|
49 |
-
|
50 |
-
// test_stl_bind_local
|
51 |
-
// stl_bind.h binders defaults to py::module_local if the types are local or converting:
|
52 |
-
py::bind_vector<LocalVec>(m, "LocalVec");
|
53 |
-
py::bind_map<LocalMap>(m, "LocalMap");
|
54 |
-
|
55 |
-
// test_stl_bind_global
|
56 |
-
// and global if the type (or one of the types, for the map) is global (so these will fail,
|
57 |
-
// assuming pybind11_tests is already loaded):
|
58 |
-
m.def("register_nonlocal_vec", [m]() {
|
59 |
-
py::bind_vector<NonLocalVec>(m, "NonLocalVec");
|
60 |
-
});
|
61 |
-
m.def("register_nonlocal_map", [m]() {
|
62 |
-
py::bind_map<NonLocalMap>(m, "NonLocalMap");
|
63 |
-
});
|
64 |
-
// The default can, however, be overridden to global using `py::module_local()` or
|
65 |
-
// `py::module_local(false)`.
|
66 |
-
// Explicitly made local:
|
67 |
-
py::bind_vector<NonLocalVec2>(m, "NonLocalVec2", py::module_local());
|
68 |
-
// Explicitly made global (and so will fail to bind):
|
69 |
-
m.def("register_nonlocal_map2", [m]() {
|
70 |
-
py::bind_map<NonLocalMap2>(m, "NonLocalMap2", py::module_local(false));
|
71 |
-
});
|
72 |
-
|
73 |
-
// test_mixed_local_global
|
74 |
-
// We try this both with the global type registered first and vice versa (the order shouldn't
|
75 |
-
// matter).
|
76 |
-
m.def("register_mixed_global_local", [m]() {
|
77 |
-
bind_local<MixedGlobalLocal, 200>(m, "MixedGlobalLocal", py::module_local());
|
78 |
-
});
|
79 |
-
m.def("register_mixed_local_global", [m]() {
|
80 |
-
bind_local<MixedLocalGlobal, 2000>(m, "MixedLocalGlobal", py::module_local(false));
|
81 |
-
});
|
82 |
-
m.def("get_mixed_gl", [](int i) { return MixedGlobalLocal(i); });
|
83 |
-
m.def("get_mixed_lg", [](int i) { return MixedLocalGlobal(i); });
|
84 |
-
|
85 |
-
// test_internal_locals_differ
|
86 |
-
m.def("local_cpp_types_addr", []() { return (uintptr_t) &py::detail::registered_local_types_cpp(); });
|
87 |
-
|
88 |
-
// test_stl_caster_vs_stl_bind
|
89 |
-
py::bind_vector<std::vector<int>>(m, "VectorInt");
|
90 |
-
|
91 |
-
m.def("load_vector_via_binding", [](std::vector<int> &v) {
|
92 |
-
return std::accumulate(v.begin(), v.end(), 0);
|
93 |
-
});
|
94 |
-
|
95 |
-
// test_cross_module_calls
|
96 |
-
m.def("return_self", [](LocalVec *v) { return v; });
|
97 |
-
m.def("return_copy", [](const LocalVec &v) { return LocalVec(v); });
|
98 |
-
|
99 |
-
class Dog : public pets::Pet { public: Dog(std::string name) : Pet(name) {}; };
|
100 |
-
py::class_<pets::Pet>(m, "Pet", py::module_local())
|
101 |
-
.def("name", &pets::Pet::name);
|
102 |
-
// Binding for local extending class:
|
103 |
-
py::class_<Dog, pets::Pet>(m, "Dog")
|
104 |
-
.def(py::init<std::string>());
|
105 |
-
m.def("pet_name", [](pets::Pet &p) { return p.name(); });
|
106 |
-
|
107 |
-
py::class_<MixGL>(m, "MixGL", py::module_local()).def(py::init<int>());
|
108 |
-
m.def("get_gl_value", [](MixGL &o) { return o.i + 100; });
|
109 |
-
|
110 |
-
py::class_<MixGL2>(m, "MixGL2", py::module_local()).def(py::init<int>());
|
111 |
-
|
112 |
-
// test_vector_bool
|
113 |
-
// We can't test both stl.h and stl_bind.h conversions of `std::vector<bool>` within
|
114 |
-
// the same module (it would be an ODR violation). Therefore `bind_vector` of `bool`
|
115 |
-
// is defined here and tested in `test_stl_binders.py`.
|
116 |
-
py::bind_vector<std::vector<bool>>(m, "VectorBool");
|
117 |
-
|
118 |
-
// test_missing_header_message
|
119 |
-
// The main module already includes stl.h, but we need to test the error message
|
120 |
-
// which appears when this header is missing.
|
121 |
-
m.def("missing_header_arg", [](std::vector<float>) { });
|
122 |
-
m.def("missing_header_return", []() { return std::vector<float>(); });
|
123 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/CVPR/LIVE/pybind11/tests/test_custom_type_casters.py
DELETED
@@ -1,90 +0,0 @@
|
|
1 |
-
# -*- coding: utf-8 -*-
|
2 |
-
import pytest
|
3 |
-
from pybind11_tests import custom_type_casters as m
|
4 |
-
|
5 |
-
|
6 |
-
def test_noconvert_args(msg):
|
7 |
-
a = m.ArgInspector()
|
8 |
-
assert msg(a.f("hi")) == """
|
9 |
-
loading ArgInspector1 argument WITH conversion allowed. Argument value = hi
|
10 |
-
"""
|
11 |
-
assert msg(a.g("this is a", "this is b")) == """
|
12 |
-
loading ArgInspector1 argument WITHOUT conversion allowed. Argument value = this is a
|
13 |
-
loading ArgInspector1 argument WITH conversion allowed. Argument value = this is b
|
14 |
-
13
|
15 |
-
loading ArgInspector2 argument WITH conversion allowed. Argument value = (default arg inspector 2)
|
16 |
-
""" # noqa: E501 line too long
|
17 |
-
assert msg(a.g("this is a", "this is b", 42)) == """
|
18 |
-
loading ArgInspector1 argument WITHOUT conversion allowed. Argument value = this is a
|
19 |
-
loading ArgInspector1 argument WITH conversion allowed. Argument value = this is b
|
20 |
-
42
|
21 |
-
loading ArgInspector2 argument WITH conversion allowed. Argument value = (default arg inspector 2)
|
22 |
-
""" # noqa: E501 line too long
|
23 |
-
assert msg(a.g("this is a", "this is b", 42, "this is d")) == """
|
24 |
-
loading ArgInspector1 argument WITHOUT conversion allowed. Argument value = this is a
|
25 |
-
loading ArgInspector1 argument WITH conversion allowed. Argument value = this is b
|
26 |
-
42
|
27 |
-
loading ArgInspector2 argument WITH conversion allowed. Argument value = this is d
|
28 |
-
"""
|
29 |
-
assert (a.h("arg 1") ==
|
30 |
-
"loading ArgInspector2 argument WITHOUT conversion allowed. Argument value = arg 1")
|
31 |
-
assert msg(m.arg_inspect_func("A1", "A2")) == """
|
32 |
-
loading ArgInspector2 argument WITH conversion allowed. Argument value = A1
|
33 |
-
loading ArgInspector1 argument WITHOUT conversion allowed. Argument value = A2
|
34 |
-
"""
|
35 |
-
|
36 |
-
assert m.floats_preferred(4) == 2.0
|
37 |
-
assert m.floats_only(4.0) == 2.0
|
38 |
-
with pytest.raises(TypeError) as excinfo:
|
39 |
-
m.floats_only(4)
|
40 |
-
assert msg(excinfo.value) == """
|
41 |
-
floats_only(): incompatible function arguments. The following argument types are supported:
|
42 |
-
1. (f: float) -> float
|
43 |
-
|
44 |
-
Invoked with: 4
|
45 |
-
"""
|
46 |
-
|
47 |
-
assert m.ints_preferred(4) == 2
|
48 |
-
assert m.ints_preferred(True) == 0
|
49 |
-
with pytest.raises(TypeError) as excinfo:
|
50 |
-
m.ints_preferred(4.0)
|
51 |
-
assert msg(excinfo.value) == """
|
52 |
-
ints_preferred(): incompatible function arguments. The following argument types are supported:
|
53 |
-
1. (i: int) -> int
|
54 |
-
|
55 |
-
Invoked with: 4.0
|
56 |
-
""" # noqa: E501 line too long
|
57 |
-
|
58 |
-
assert m.ints_only(4) == 2
|
59 |
-
with pytest.raises(TypeError) as excinfo:
|
60 |
-
m.ints_only(4.0)
|
61 |
-
assert msg(excinfo.value) == """
|
62 |
-
ints_only(): incompatible function arguments. The following argument types are supported:
|
63 |
-
1. (i: int) -> int
|
64 |
-
|
65 |
-
Invoked with: 4.0
|
66 |
-
"""
|
67 |
-
|
68 |
-
|
69 |
-
def test_custom_caster_destruction():
|
70 |
-
"""Tests that returning a pointer to a type that gets converted with a custom type caster gets
|
71 |
-
destroyed when the function has py::return_value_policy::take_ownership policy applied."""
|
72 |
-
|
73 |
-
cstats = m.destruction_tester_cstats()
|
74 |
-
# This one *doesn't* have take_ownership: the pointer should be used but not destroyed:
|
75 |
-
z = m.custom_caster_no_destroy()
|
76 |
-
assert cstats.alive() == 1 and cstats.default_constructions == 1
|
77 |
-
assert z
|
78 |
-
|
79 |
-
# take_ownership applied: this constructs a new object, casts it, then destroys it:
|
80 |
-
z = m.custom_caster_destroy()
|
81 |
-
assert z
|
82 |
-
assert cstats.default_constructions == 2
|
83 |
-
|
84 |
-
# Same, but with a const pointer return (which should *not* inhibit destruction):
|
85 |
-
z = m.custom_caster_destroy_const()
|
86 |
-
assert z
|
87 |
-
assert cstats.default_constructions == 3
|
88 |
-
|
89 |
-
# Make sure we still only have the original object (from ..._no_destroy()) alive:
|
90 |
-
assert cstats.alive() == 1
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/CVPR/WALT/mmdet/models/detectors/fsaf.py
DELETED
@@ -1,17 +0,0 @@
|
|
1 |
-
from ..builder import DETECTORS
|
2 |
-
from .single_stage import SingleStageDetector
|
3 |
-
|
4 |
-
|
5 |
-
@DETECTORS.register_module()
|
6 |
-
class FSAF(SingleStageDetector):
|
7 |
-
"""Implementation of `FSAF <https://arxiv.org/abs/1903.00621>`_"""
|
8 |
-
|
9 |
-
def __init__(self,
|
10 |
-
backbone,
|
11 |
-
neck,
|
12 |
-
bbox_head,
|
13 |
-
train_cfg=None,
|
14 |
-
test_cfg=None,
|
15 |
-
pretrained=None):
|
16 |
-
super(FSAF, self).__init__(backbone, neck, bbox_head, train_cfg,
|
17 |
-
test_cfg, pretrained)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/CVPR/regionclip-demo/detectron2/checkpoint/c2_model_loading.py
DELETED
@@ -1,407 +0,0 @@
|
|
1 |
-
# Copyright (c) Facebook, Inc. and its affiliates.
|
2 |
-
import copy
|
3 |
-
import logging
|
4 |
-
import re
|
5 |
-
from typing import Dict, List
|
6 |
-
import torch
|
7 |
-
from tabulate import tabulate
|
8 |
-
|
9 |
-
|
10 |
-
def convert_basic_c2_names(original_keys):
|
11 |
-
"""
|
12 |
-
Apply some basic name conversion to names in C2 weights.
|
13 |
-
It only deals with typical backbone models.
|
14 |
-
|
15 |
-
Args:
|
16 |
-
original_keys (list[str]):
|
17 |
-
Returns:
|
18 |
-
list[str]: The same number of strings matching those in original_keys.
|
19 |
-
"""
|
20 |
-
layer_keys = copy.deepcopy(original_keys)
|
21 |
-
layer_keys = [
|
22 |
-
{"pred_b": "linear_b", "pred_w": "linear_w"}.get(k, k) for k in layer_keys
|
23 |
-
] # some hard-coded mappings
|
24 |
-
|
25 |
-
layer_keys = [k.replace("_", ".") for k in layer_keys]
|
26 |
-
layer_keys = [re.sub("\\.b$", ".bias", k) for k in layer_keys]
|
27 |
-
layer_keys = [re.sub("\\.w$", ".weight", k) for k in layer_keys]
|
28 |
-
# Uniform both bn and gn names to "norm"
|
29 |
-
layer_keys = [re.sub("bn\\.s$", "norm.weight", k) for k in layer_keys]
|
30 |
-
layer_keys = [re.sub("bn\\.bias$", "norm.bias", k) for k in layer_keys]
|
31 |
-
layer_keys = [re.sub("bn\\.rm", "norm.running_mean", k) for k in layer_keys]
|
32 |
-
layer_keys = [re.sub("bn\\.running.mean$", "norm.running_mean", k) for k in layer_keys]
|
33 |
-
layer_keys = [re.sub("bn\\.riv$", "norm.running_var", k) for k in layer_keys]
|
34 |
-
layer_keys = [re.sub("bn\\.running.var$", "norm.running_var", k) for k in layer_keys]
|
35 |
-
layer_keys = [re.sub("bn\\.gamma$", "norm.weight", k) for k in layer_keys]
|
36 |
-
layer_keys = [re.sub("bn\\.beta$", "norm.bias", k) for k in layer_keys]
|
37 |
-
layer_keys = [re.sub("gn\\.s$", "norm.weight", k) for k in layer_keys]
|
38 |
-
layer_keys = [re.sub("gn\\.bias$", "norm.bias", k) for k in layer_keys]
|
39 |
-
|
40 |
-
# stem
|
41 |
-
layer_keys = [re.sub("^res\\.conv1\\.norm\\.", "conv1.norm.", k) for k in layer_keys]
|
42 |
-
# to avoid mis-matching with "conv1" in other components (e.g. detection head)
|
43 |
-
layer_keys = [re.sub("^conv1\\.", "stem.conv1.", k) for k in layer_keys]
|
44 |
-
|
45 |
-
# layer1-4 is used by torchvision, however we follow the C2 naming strategy (res2-5)
|
46 |
-
# layer_keys = [re.sub("^res2.", "layer1.", k) for k in layer_keys]
|
47 |
-
# layer_keys = [re.sub("^res3.", "layer2.", k) for k in layer_keys]
|
48 |
-
# layer_keys = [re.sub("^res4.", "layer3.", k) for k in layer_keys]
|
49 |
-
# layer_keys = [re.sub("^res5.", "layer4.", k) for k in layer_keys]
|
50 |
-
|
51 |
-
# blocks
|
52 |
-
layer_keys = [k.replace(".branch1.", ".shortcut.") for k in layer_keys]
|
53 |
-
layer_keys = [k.replace(".branch2a.", ".conv1.") for k in layer_keys]
|
54 |
-
layer_keys = [k.replace(".branch2b.", ".conv2.") for k in layer_keys]
|
55 |
-
layer_keys = [k.replace(".branch2c.", ".conv3.") for k in layer_keys]
|
56 |
-
|
57 |
-
# DensePose substitutions
|
58 |
-
layer_keys = [re.sub("^body.conv.fcn", "body_conv_fcn", k) for k in layer_keys]
|
59 |
-
layer_keys = [k.replace("AnnIndex.lowres", "ann_index_lowres") for k in layer_keys]
|
60 |
-
layer_keys = [k.replace("Index.UV.lowres", "index_uv_lowres") for k in layer_keys]
|
61 |
-
layer_keys = [k.replace("U.lowres", "u_lowres") for k in layer_keys]
|
62 |
-
layer_keys = [k.replace("V.lowres", "v_lowres") for k in layer_keys]
|
63 |
-
return layer_keys
|
64 |
-
|
65 |
-
|
66 |
-
def convert_c2_detectron_names(weights):
|
67 |
-
"""
|
68 |
-
Map Caffe2 Detectron weight names to Detectron2 names.
|
69 |
-
|
70 |
-
Args:
|
71 |
-
weights (dict): name -> tensor
|
72 |
-
|
73 |
-
Returns:
|
74 |
-
dict: detectron2 names -> tensor
|
75 |
-
dict: detectron2 names -> C2 names
|
76 |
-
"""
|
77 |
-
logger = logging.getLogger(__name__)
|
78 |
-
logger.info("Renaming Caffe2 weights ......")
|
79 |
-
original_keys = sorted(weights.keys())
|
80 |
-
layer_keys = copy.deepcopy(original_keys)
|
81 |
-
|
82 |
-
layer_keys = convert_basic_c2_names(layer_keys)
|
83 |
-
|
84 |
-
# --------------------------------------------------------------------------
|
85 |
-
# RPN hidden representation conv
|
86 |
-
# --------------------------------------------------------------------------
|
87 |
-
# FPN case
|
88 |
-
# In the C2 model, the RPN hidden layer conv is defined for FPN level 2 and then
|
89 |
-
# shared for all other levels, hence the appearance of "fpn2"
|
90 |
-
layer_keys = [
|
91 |
-
k.replace("conv.rpn.fpn2", "proposal_generator.rpn_head.conv") for k in layer_keys
|
92 |
-
]
|
93 |
-
# Non-FPN case
|
94 |
-
layer_keys = [k.replace("conv.rpn", "proposal_generator.rpn_head.conv") for k in layer_keys]
|
95 |
-
|
96 |
-
# --------------------------------------------------------------------------
|
97 |
-
# RPN box transformation conv
|
98 |
-
# --------------------------------------------------------------------------
|
99 |
-
# FPN case (see note above about "fpn2")
|
100 |
-
layer_keys = [
|
101 |
-
k.replace("rpn.bbox.pred.fpn2", "proposal_generator.rpn_head.anchor_deltas")
|
102 |
-
for k in layer_keys
|
103 |
-
]
|
104 |
-
layer_keys = [
|
105 |
-
k.replace("rpn.cls.logits.fpn2", "proposal_generator.rpn_head.objectness_logits")
|
106 |
-
for k in layer_keys
|
107 |
-
]
|
108 |
-
# Non-FPN case
|
109 |
-
layer_keys = [
|
110 |
-
k.replace("rpn.bbox.pred", "proposal_generator.rpn_head.anchor_deltas") for k in layer_keys
|
111 |
-
]
|
112 |
-
layer_keys = [
|
113 |
-
k.replace("rpn.cls.logits", "proposal_generator.rpn_head.objectness_logits")
|
114 |
-
for k in layer_keys
|
115 |
-
]
|
116 |
-
|
117 |
-
# --------------------------------------------------------------------------
|
118 |
-
# Fast R-CNN box head
|
119 |
-
# --------------------------------------------------------------------------
|
120 |
-
layer_keys = [re.sub("^bbox\\.pred", "bbox_pred", k) for k in layer_keys]
|
121 |
-
layer_keys = [re.sub("^cls\\.score", "cls_score", k) for k in layer_keys]
|
122 |
-
layer_keys = [re.sub("^fc6\\.", "box_head.fc1.", k) for k in layer_keys]
|
123 |
-
layer_keys = [re.sub("^fc7\\.", "box_head.fc2.", k) for k in layer_keys]
|
124 |
-
# 4conv1fc head tensor names: head_conv1_w, head_conv1_gn_s
|
125 |
-
layer_keys = [re.sub("^head\\.conv", "box_head.conv", k) for k in layer_keys]
|
126 |
-
|
127 |
-
# --------------------------------------------------------------------------
|
128 |
-
# FPN lateral and output convolutions
|
129 |
-
# --------------------------------------------------------------------------
|
130 |
-
def fpn_map(name):
|
131 |
-
"""
|
132 |
-
Look for keys with the following patterns:
|
133 |
-
1) Starts with "fpn.inner."
|
134 |
-
Example: "fpn.inner.res2.2.sum.lateral.weight"
|
135 |
-
Meaning: These are lateral pathway convolutions
|
136 |
-
2) Starts with "fpn.res"
|
137 |
-
Example: "fpn.res2.2.sum.weight"
|
138 |
-
Meaning: These are FPN output convolutions
|
139 |
-
"""
|
140 |
-
splits = name.split(".")
|
141 |
-
norm = ".norm" if "norm" in splits else ""
|
142 |
-
if name.startswith("fpn.inner."):
|
143 |
-
# splits example: ['fpn', 'inner', 'res2', '2', 'sum', 'lateral', 'weight']
|
144 |
-
stage = int(splits[2][len("res") :])
|
145 |
-
return "fpn_lateral{}{}.{}".format(stage, norm, splits[-1])
|
146 |
-
elif name.startswith("fpn.res"):
|
147 |
-
# splits example: ['fpn', 'res2', '2', 'sum', 'weight']
|
148 |
-
stage = int(splits[1][len("res") :])
|
149 |
-
return "fpn_output{}{}.{}".format(stage, norm, splits[-1])
|
150 |
-
return name
|
151 |
-
|
152 |
-
layer_keys = [fpn_map(k) for k in layer_keys]
|
153 |
-
|
154 |
-
# --------------------------------------------------------------------------
|
155 |
-
# Mask R-CNN mask head
|
156 |
-
# --------------------------------------------------------------------------
|
157 |
-
# roi_heads.StandardROIHeads case
|
158 |
-
layer_keys = [k.replace(".[mask].fcn", "mask_head.mask_fcn") for k in layer_keys]
|
159 |
-
layer_keys = [re.sub("^\\.mask\\.fcn", "mask_head.mask_fcn", k) for k in layer_keys]
|
160 |
-
layer_keys = [k.replace("mask.fcn.logits", "mask_head.predictor") for k in layer_keys]
|
161 |
-
# roi_heads.Res5ROIHeads case
|
162 |
-
layer_keys = [k.replace("conv5.mask", "mask_head.deconv") for k in layer_keys]
|
163 |
-
|
164 |
-
# --------------------------------------------------------------------------
|
165 |
-
# Keypoint R-CNN head
|
166 |
-
# --------------------------------------------------------------------------
|
167 |
-
# interestingly, the keypoint head convs have blob names that are simply "conv_fcnX"
|
168 |
-
layer_keys = [k.replace("conv.fcn", "roi_heads.keypoint_head.conv_fcn") for k in layer_keys]
|
169 |
-
layer_keys = [
|
170 |
-
k.replace("kps.score.lowres", "roi_heads.keypoint_head.score_lowres") for k in layer_keys
|
171 |
-
]
|
172 |
-
layer_keys = [k.replace("kps.score.", "roi_heads.keypoint_head.score.") for k in layer_keys]
|
173 |
-
|
174 |
-
# --------------------------------------------------------------------------
|
175 |
-
# Done with replacements
|
176 |
-
# --------------------------------------------------------------------------
|
177 |
-
assert len(set(layer_keys)) == len(layer_keys)
|
178 |
-
assert len(original_keys) == len(layer_keys)
|
179 |
-
|
180 |
-
new_weights = {}
|
181 |
-
new_keys_to_original_keys = {}
|
182 |
-
for orig, renamed in zip(original_keys, layer_keys):
|
183 |
-
new_keys_to_original_keys[renamed] = orig
|
184 |
-
if renamed.startswith("bbox_pred.") or renamed.startswith("mask_head.predictor."):
|
185 |
-
# remove the meaningless prediction weight for background class
|
186 |
-
new_start_idx = 4 if renamed.startswith("bbox_pred.") else 1
|
187 |
-
new_weights[renamed] = weights[orig][new_start_idx:]
|
188 |
-
logger.info(
|
189 |
-
"Remove prediction weight for background class in {}. The shape changes from "
|
190 |
-
"{} to {}.".format(
|
191 |
-
renamed, tuple(weights[orig].shape), tuple(new_weights[renamed].shape)
|
192 |
-
)
|
193 |
-
)
|
194 |
-
elif renamed.startswith("cls_score."):
|
195 |
-
# move weights of bg class from original index 0 to last index
|
196 |
-
logger.info(
|
197 |
-
"Move classification weights for background class in {} from index 0 to "
|
198 |
-
"index {}.".format(renamed, weights[orig].shape[0] - 1)
|
199 |
-
)
|
200 |
-
new_weights[renamed] = torch.cat([weights[orig][1:], weights[orig][:1]])
|
201 |
-
else:
|
202 |
-
new_weights[renamed] = weights[orig]
|
203 |
-
|
204 |
-
return new_weights, new_keys_to_original_keys
|
205 |
-
|
206 |
-
|
207 |
-
# Note the current matching is not symmetric.
|
208 |
-
# it assumes model_state_dict will have longer names.
|
209 |
-
def align_and_update_state_dicts(model_state_dict, ckpt_state_dict, c2_conversion=True):
|
210 |
-
"""
|
211 |
-
Match names between the two state-dict, and returns a new chkpt_state_dict with names
|
212 |
-
converted to match model_state_dict with heuristics. The returned dict can be later
|
213 |
-
loaded with fvcore checkpointer.
|
214 |
-
If `c2_conversion==True`, `ckpt_state_dict` is assumed to be a Caffe2
|
215 |
-
model and will be renamed at first.
|
216 |
-
|
217 |
-
Strategy: suppose that the models that we will create will have prefixes appended
|
218 |
-
to each of its keys, for example due to an extra level of nesting that the original
|
219 |
-
pre-trained weights from ImageNet won't contain. For example, model.state_dict()
|
220 |
-
might return backbone[0].body.res2.conv1.weight, while the pre-trained model contains
|
221 |
-
res2.conv1.weight. We thus want to match both parameters together.
|
222 |
-
For that, we look for each model weight, look among all loaded keys if there is one
|
223 |
-
that is a suffix of the current weight name, and use it if that's the case.
|
224 |
-
If multiple matches exist, take the one with longest size
|
225 |
-
of the corresponding name. For example, for the same model as before, the pretrained
|
226 |
-
weight file can contain both res2.conv1.weight, as well as conv1.weight. In this case,
|
227 |
-
we want to match backbone[0].body.conv1.weight to conv1.weight, and
|
228 |
-
backbone[0].body.res2.conv1.weight to res2.conv1.weight.
|
229 |
-
"""
|
230 |
-
model_keys = sorted(model_state_dict.keys())
|
231 |
-
if c2_conversion:
|
232 |
-
ckpt_state_dict, original_keys = convert_c2_detectron_names(ckpt_state_dict)
|
233 |
-
# original_keys: the name in the original dict (before renaming)
|
234 |
-
else:
|
235 |
-
original_keys = {x: x for x in ckpt_state_dict.keys()}
|
236 |
-
ckpt_keys = sorted(ckpt_state_dict.keys())
|
237 |
-
|
238 |
-
def match(a, b):
|
239 |
-
# Matched ckpt_key should be a complete (starts with '.') suffix.
|
240 |
-
# For example, roi_heads.mesh_head.whatever_conv1 does not match conv1,
|
241 |
-
# but matches whatever_conv1 or mesh_head.whatever_conv1.
|
242 |
-
return a == b or a.endswith("." + b)
|
243 |
-
|
244 |
-
# get a matrix of string matches, where each (i, j) entry correspond to the size of the
|
245 |
-
# ckpt_key string, if it matches
|
246 |
-
match_matrix = [len(j) if match(i, j) else 0 for i in model_keys for j in ckpt_keys]
|
247 |
-
match_matrix = torch.as_tensor(match_matrix).view(len(model_keys), len(ckpt_keys))
|
248 |
-
# use the matched one with longest size in case of multiple matches
|
249 |
-
max_match_size, idxs = match_matrix.max(1)
|
250 |
-
# remove indices that correspond to no-match
|
251 |
-
idxs[max_match_size == 0] = -1
|
252 |
-
|
253 |
-
logger = logging.getLogger(__name__)
|
254 |
-
# matched_pairs (matched checkpoint key --> matched model key)
|
255 |
-
matched_keys = {}
|
256 |
-
result_state_dict = {}
|
257 |
-
for idx_model, idx_ckpt in enumerate(idxs.tolist()):
|
258 |
-
if idx_ckpt == -1:
|
259 |
-
continue
|
260 |
-
key_model = model_keys[idx_model]
|
261 |
-
key_ckpt = ckpt_keys[idx_ckpt]
|
262 |
-
value_ckpt = ckpt_state_dict[key_ckpt]
|
263 |
-
shape_in_model = model_state_dict[key_model].shape
|
264 |
-
|
265 |
-
if shape_in_model != value_ckpt.shape:
|
266 |
-
logger.warning(
|
267 |
-
"Shape of {} in checkpoint is {}, while shape of {} in model is {}.".format(
|
268 |
-
key_ckpt, value_ckpt.shape, key_model, shape_in_model
|
269 |
-
)
|
270 |
-
)
|
271 |
-
logger.warning(
|
272 |
-
"{} will not be loaded. Please double check and see if this is desired.".format(
|
273 |
-
key_ckpt
|
274 |
-
)
|
275 |
-
)
|
276 |
-
continue
|
277 |
-
|
278 |
-
assert key_model not in result_state_dict
|
279 |
-
result_state_dict[key_model] = value_ckpt
|
280 |
-
if key_ckpt in matched_keys: # already added to matched_keys
|
281 |
-
logger.error(
|
282 |
-
"Ambiguity found for {} in checkpoint!"
|
283 |
-
"It matches at least two keys in the model ({} and {}).".format(
|
284 |
-
key_ckpt, key_model, matched_keys[key_ckpt]
|
285 |
-
)
|
286 |
-
)
|
287 |
-
raise ValueError("Cannot match one checkpoint key to multiple keys in the model.")
|
288 |
-
|
289 |
-
matched_keys[key_ckpt] = key_model
|
290 |
-
|
291 |
-
# logging:
|
292 |
-
matched_model_keys = sorted(matched_keys.values())
|
293 |
-
if len(matched_model_keys) == 0:
|
294 |
-
logger.warning("No weights in checkpoint matched with model.")
|
295 |
-
return ckpt_state_dict
|
296 |
-
common_prefix = _longest_common_prefix(matched_model_keys)
|
297 |
-
rev_matched_keys = {v: k for k, v in matched_keys.items()}
|
298 |
-
original_keys = {k: original_keys[rev_matched_keys[k]] for k in matched_model_keys}
|
299 |
-
|
300 |
-
model_key_groups = _group_keys_by_module(matched_model_keys, original_keys)
|
301 |
-
table = []
|
302 |
-
memo = set()
|
303 |
-
for key_model in matched_model_keys:
|
304 |
-
if key_model in memo:
|
305 |
-
continue
|
306 |
-
if key_model in model_key_groups:
|
307 |
-
group = model_key_groups[key_model]
|
308 |
-
memo |= set(group)
|
309 |
-
shapes = [tuple(model_state_dict[k].shape) for k in group]
|
310 |
-
table.append(
|
311 |
-
(
|
312 |
-
_longest_common_prefix([k[len(common_prefix) :] for k in group]) + "*",
|
313 |
-
_group_str([original_keys[k] for k in group]),
|
314 |
-
" ".join([str(x).replace(" ", "") for x in shapes]),
|
315 |
-
)
|
316 |
-
)
|
317 |
-
else:
|
318 |
-
key_checkpoint = original_keys[key_model]
|
319 |
-
shape = str(tuple(model_state_dict[key_model].shape))
|
320 |
-
table.append((key_model[len(common_prefix) :], key_checkpoint, shape))
|
321 |
-
table_str = tabulate(
|
322 |
-
table, tablefmt="pipe", headers=["Names in Model", "Names in Checkpoint", "Shapes"]
|
323 |
-
)
|
324 |
-
logger.info(
|
325 |
-
"Following weights matched with "
|
326 |
-
+ (f"submodule {common_prefix[:-1]}" if common_prefix else "model")
|
327 |
-
+ ":\n"
|
328 |
-
+ table_str
|
329 |
-
)
|
330 |
-
|
331 |
-
unmatched_ckpt_keys = [k for k in ckpt_keys if k not in set(matched_keys.keys())]
|
332 |
-
for k in unmatched_ckpt_keys:
|
333 |
-
result_state_dict[k] = ckpt_state_dict[k]
|
334 |
-
return result_state_dict
|
335 |
-
|
336 |
-
|
337 |
-
def _group_keys_by_module(keys: List[str], original_names: Dict[str, str]):
|
338 |
-
"""
|
339 |
-
Params in the same submodule are grouped together.
|
340 |
-
|
341 |
-
Args:
|
342 |
-
keys: names of all parameters
|
343 |
-
original_names: mapping from parameter name to their name in the checkpoint
|
344 |
-
|
345 |
-
Returns:
|
346 |
-
dict[name -> all other names in the same group]
|
347 |
-
"""
|
348 |
-
|
349 |
-
def _submodule_name(key):
|
350 |
-
pos = key.rfind(".")
|
351 |
-
if pos < 0:
|
352 |
-
return None
|
353 |
-
prefix = key[: pos + 1]
|
354 |
-
return prefix
|
355 |
-
|
356 |
-
all_submodules = [_submodule_name(k) for k in keys]
|
357 |
-
all_submodules = [x for x in all_submodules if x]
|
358 |
-
all_submodules = sorted(all_submodules, key=len)
|
359 |
-
|
360 |
-
ret = {}
|
361 |
-
for prefix in all_submodules:
|
362 |
-
group = [k for k in keys if k.startswith(prefix)]
|
363 |
-
if len(group) <= 1:
|
364 |
-
continue
|
365 |
-
original_name_lcp = _longest_common_prefix_str([original_names[k] for k in group])
|
366 |
-
if len(original_name_lcp) == 0:
|
367 |
-
# don't group weights if original names don't share prefix
|
368 |
-
continue
|
369 |
-
|
370 |
-
for k in group:
|
371 |
-
if k in ret:
|
372 |
-
continue
|
373 |
-
ret[k] = group
|
374 |
-
return ret
|
375 |
-
|
376 |
-
|
377 |
-
def _longest_common_prefix(names: List[str]) -> str:
|
378 |
-
"""
|
379 |
-
["abc.zfg", "abc.zef"] -> "abc."
|
380 |
-
"""
|
381 |
-
names = [n.split(".") for n in names]
|
382 |
-
m1, m2 = min(names), max(names)
|
383 |
-
ret = [a for a, b in zip(m1, m2) if a == b]
|
384 |
-
ret = ".".join(ret) + "." if len(ret) else ""
|
385 |
-
return ret
|
386 |
-
|
387 |
-
|
388 |
-
def _longest_common_prefix_str(names: List[str]) -> str:
|
389 |
-
m1, m2 = min(names), max(names)
|
390 |
-
lcp = [a for a, b in zip(m1, m2) if a == b]
|
391 |
-
lcp = "".join(lcp)
|
392 |
-
return lcp
|
393 |
-
|
394 |
-
|
395 |
-
def _group_str(names: List[str]) -> str:
|
396 |
-
"""
|
397 |
-
Turn "common1", "common2", "common3" into "common{1,2,3}"
|
398 |
-
"""
|
399 |
-
lcp = _longest_common_prefix_str(names)
|
400 |
-
rest = [x[len(lcp) :] for x in names]
|
401 |
-
rest = "{" + ",".join(rest) + "}"
|
402 |
-
ret = lcp + rest
|
403 |
-
|
404 |
-
# add some simplification for BN specifically
|
405 |
-
ret = ret.replace("bn_{beta,running_mean,running_var,gamma}", "bn_*")
|
406 |
-
ret = ret.replace("bn_beta,bn_running_mean,bn_running_var,bn_gamma", "bn_*")
|
407 |
-
return ret
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Caoyunkang/Segment-Any-Anomaly/SAM/segment_anything/modeling/image_encoder.py
DELETED
@@ -1,395 +0,0 @@
|
|
1 |
-
# Copyright (c) Meta Platforms, Inc. and affiliates.
|
2 |
-
# All rights reserved.
|
3 |
-
|
4 |
-
# This source code is licensed under the license found in the
|
5 |
-
# LICENSE file in the root directory of this source tree.
|
6 |
-
|
7 |
-
import torch
|
8 |
-
import torch.nn as nn
|
9 |
-
import torch.nn.functional as F
|
10 |
-
|
11 |
-
from typing import Optional, Tuple, Type
|
12 |
-
|
13 |
-
from .common import LayerNorm2d, MLPBlock
|
14 |
-
|
15 |
-
|
16 |
-
# This class and its supporting functions below lightly adapted from the ViTDet backbone available at: https://github.com/facebookresearch/detectron2/blob/main/detectron2/modeling/backbone/vit.py # noqa
|
17 |
-
class ImageEncoderViT(nn.Module):
|
18 |
-
def __init__(
|
19 |
-
self,
|
20 |
-
img_size: int = 1024,
|
21 |
-
patch_size: int = 16,
|
22 |
-
in_chans: int = 3,
|
23 |
-
embed_dim: int = 768,
|
24 |
-
depth: int = 12,
|
25 |
-
num_heads: int = 12,
|
26 |
-
mlp_ratio: float = 4.0,
|
27 |
-
out_chans: int = 256,
|
28 |
-
qkv_bias: bool = True,
|
29 |
-
norm_layer: Type[nn.Module] = nn.LayerNorm,
|
30 |
-
act_layer: Type[nn.Module] = nn.GELU,
|
31 |
-
use_abs_pos: bool = True,
|
32 |
-
use_rel_pos: bool = False,
|
33 |
-
rel_pos_zero_init: bool = True,
|
34 |
-
window_size: int = 0,
|
35 |
-
global_attn_indexes: Tuple[int, ...] = (),
|
36 |
-
) -> None:
|
37 |
-
"""
|
38 |
-
Args:
|
39 |
-
img_size (int): Input image size.
|
40 |
-
patch_size (int): Patch size.
|
41 |
-
in_chans (int): Number of input image channels.
|
42 |
-
embed_dim (int): Patch embedding dimension.
|
43 |
-
depth (int): Depth of ViT.
|
44 |
-
num_heads (int): Number of attention heads in each ViT block.
|
45 |
-
mlp_ratio (float): Ratio of mlp hidden dim to embedding dim.
|
46 |
-
qkv_bias (bool): If True, add a learnable bias to query, key, value.
|
47 |
-
norm_layer (nn.Module): Normalization layer.
|
48 |
-
act_layer (nn.Module): Activation layer.
|
49 |
-
use_abs_pos (bool): If True, use absolute positional embeddings.
|
50 |
-
use_rel_pos (bool): If True, add relative positional embeddings to the attention map.
|
51 |
-
rel_pos_zero_init (bool): If True, zero initialize relative positional parameters.
|
52 |
-
window_size (int): Window size for window attention blocks.
|
53 |
-
global_attn_indexes (list): Indexes for blocks using global attention.
|
54 |
-
"""
|
55 |
-
super().__init__()
|
56 |
-
self.img_size = img_size
|
57 |
-
|
58 |
-
self.patch_embed = PatchEmbed(
|
59 |
-
kernel_size=(patch_size, patch_size),
|
60 |
-
stride=(patch_size, patch_size),
|
61 |
-
in_chans=in_chans,
|
62 |
-
embed_dim=embed_dim,
|
63 |
-
)
|
64 |
-
|
65 |
-
self.pos_embed: Optional[nn.Parameter] = None
|
66 |
-
if use_abs_pos:
|
67 |
-
# Initialize absolute positional embedding with pretrain image size.
|
68 |
-
self.pos_embed = nn.Parameter(
|
69 |
-
torch.zeros(1, img_size // patch_size, img_size // patch_size, embed_dim)
|
70 |
-
)
|
71 |
-
|
72 |
-
self.blocks = nn.ModuleList()
|
73 |
-
for i in range(depth):
|
74 |
-
block = Block(
|
75 |
-
dim=embed_dim,
|
76 |
-
num_heads=num_heads,
|
77 |
-
mlp_ratio=mlp_ratio,
|
78 |
-
qkv_bias=qkv_bias,
|
79 |
-
norm_layer=norm_layer,
|
80 |
-
act_layer=act_layer,
|
81 |
-
use_rel_pos=use_rel_pos,
|
82 |
-
rel_pos_zero_init=rel_pos_zero_init,
|
83 |
-
window_size=window_size if i not in global_attn_indexes else 0,
|
84 |
-
input_size=(img_size // patch_size, img_size // patch_size),
|
85 |
-
)
|
86 |
-
self.blocks.append(block)
|
87 |
-
|
88 |
-
self.neck = nn.Sequential(
|
89 |
-
nn.Conv2d(
|
90 |
-
embed_dim,
|
91 |
-
out_chans,
|
92 |
-
kernel_size=1,
|
93 |
-
bias=False,
|
94 |
-
),
|
95 |
-
LayerNorm2d(out_chans),
|
96 |
-
nn.Conv2d(
|
97 |
-
out_chans,
|
98 |
-
out_chans,
|
99 |
-
kernel_size=3,
|
100 |
-
padding=1,
|
101 |
-
bias=False,
|
102 |
-
),
|
103 |
-
LayerNorm2d(out_chans),
|
104 |
-
)
|
105 |
-
|
106 |
-
def forward(self, x: torch.Tensor) -> torch.Tensor:
|
107 |
-
x = self.patch_embed(x)
|
108 |
-
if self.pos_embed is not None:
|
109 |
-
x = x + self.pos_embed
|
110 |
-
|
111 |
-
for blk in self.blocks:
|
112 |
-
x = blk(x)
|
113 |
-
|
114 |
-
x = self.neck(x.permute(0, 3, 1, 2))
|
115 |
-
|
116 |
-
return x
|
117 |
-
|
118 |
-
|
119 |
-
class Block(nn.Module):
|
120 |
-
"""Transformer blocks with support of window attention and residual propagation blocks"""
|
121 |
-
|
122 |
-
def __init__(
|
123 |
-
self,
|
124 |
-
dim: int,
|
125 |
-
num_heads: int,
|
126 |
-
mlp_ratio: float = 4.0,
|
127 |
-
qkv_bias: bool = True,
|
128 |
-
norm_layer: Type[nn.Module] = nn.LayerNorm,
|
129 |
-
act_layer: Type[nn.Module] = nn.GELU,
|
130 |
-
use_rel_pos: bool = False,
|
131 |
-
rel_pos_zero_init: bool = True,
|
132 |
-
window_size: int = 0,
|
133 |
-
input_size: Optional[Tuple[int, int]] = None,
|
134 |
-
) -> None:
|
135 |
-
"""
|
136 |
-
Args:
|
137 |
-
dim (int): Number of input channels.
|
138 |
-
num_heads (int): Number of attention heads in each ViT block.
|
139 |
-
mlp_ratio (float): Ratio of mlp hidden dim to embedding dim.
|
140 |
-
qkv_bias (bool): If True, add a learnable bias to query, key, value.
|
141 |
-
norm_layer (nn.Module): Normalization layer.
|
142 |
-
act_layer (nn.Module): Activation layer.
|
143 |
-
use_rel_pos (bool): If True, add relative positional embeddings to the attention map.
|
144 |
-
rel_pos_zero_init (bool): If True, zero initialize relative positional parameters.
|
145 |
-
window_size (int): Window size for window attention blocks. If it equals 0, then
|
146 |
-
use global attention.
|
147 |
-
input_size (int or None): Input resolution for calculating the relative positional
|
148 |
-
parameter size.
|
149 |
-
"""
|
150 |
-
super().__init__()
|
151 |
-
self.norm1 = norm_layer(dim)
|
152 |
-
self.attn = Attention(
|
153 |
-
dim,
|
154 |
-
num_heads=num_heads,
|
155 |
-
qkv_bias=qkv_bias,
|
156 |
-
use_rel_pos=use_rel_pos,
|
157 |
-
rel_pos_zero_init=rel_pos_zero_init,
|
158 |
-
input_size=input_size if window_size == 0 else (window_size, window_size),
|
159 |
-
)
|
160 |
-
|
161 |
-
self.norm2 = norm_layer(dim)
|
162 |
-
self.mlp = MLPBlock(embedding_dim=dim, mlp_dim=int(dim * mlp_ratio), act=act_layer)
|
163 |
-
|
164 |
-
self.window_size = window_size
|
165 |
-
|
166 |
-
def forward(self, x: torch.Tensor) -> torch.Tensor:
|
167 |
-
shortcut = x
|
168 |
-
x = self.norm1(x)
|
169 |
-
# Window partition
|
170 |
-
if self.window_size > 0:
|
171 |
-
H, W = x.shape[1], x.shape[2]
|
172 |
-
x, pad_hw = window_partition(x, self.window_size)
|
173 |
-
|
174 |
-
x = self.attn(x)
|
175 |
-
# Reverse window partition
|
176 |
-
if self.window_size > 0:
|
177 |
-
x = window_unpartition(x, self.window_size, pad_hw, (H, W))
|
178 |
-
|
179 |
-
x = shortcut + x
|
180 |
-
x = x + self.mlp(self.norm2(x))
|
181 |
-
|
182 |
-
return x
|
183 |
-
|
184 |
-
|
185 |
-
class Attention(nn.Module):
|
186 |
-
"""Multi-head Attention block with relative position embeddings."""
|
187 |
-
|
188 |
-
def __init__(
|
189 |
-
self,
|
190 |
-
dim: int,
|
191 |
-
num_heads: int = 8,
|
192 |
-
qkv_bias: bool = True,
|
193 |
-
use_rel_pos: bool = False,
|
194 |
-
rel_pos_zero_init: bool = True,
|
195 |
-
input_size: Optional[Tuple[int, int]] = None,
|
196 |
-
) -> None:
|
197 |
-
"""
|
198 |
-
Args:
|
199 |
-
dim (int): Number of input channels.
|
200 |
-
num_heads (int): Number of attention heads.
|
201 |
-
qkv_bias (bool: If True, add a learnable bias to query, key, value.
|
202 |
-
rel_pos (bool): If True, add relative positional embeddings to the attention map.
|
203 |
-
rel_pos_zero_init (bool): If True, zero initialize relative positional parameters.
|
204 |
-
input_size (int or None): Input resolution for calculating the relative positional
|
205 |
-
parameter size.
|
206 |
-
"""
|
207 |
-
super().__init__()
|
208 |
-
self.num_heads = num_heads
|
209 |
-
head_dim = dim // num_heads
|
210 |
-
self.scale = head_dim**-0.5
|
211 |
-
|
212 |
-
self.qkv = nn.Linear(dim, dim * 3, bias=qkv_bias)
|
213 |
-
self.proj = nn.Linear(dim, dim)
|
214 |
-
|
215 |
-
self.use_rel_pos = use_rel_pos
|
216 |
-
if self.use_rel_pos:
|
217 |
-
assert (
|
218 |
-
input_size is not None
|
219 |
-
), "Input size must be provided if using relative positional encoding."
|
220 |
-
# initialize relative positional embeddings
|
221 |
-
self.rel_pos_h = nn.Parameter(torch.zeros(2 * input_size[0] - 1, head_dim))
|
222 |
-
self.rel_pos_w = nn.Parameter(torch.zeros(2 * input_size[1] - 1, head_dim))
|
223 |
-
|
224 |
-
def forward(self, x: torch.Tensor) -> torch.Tensor:
|
225 |
-
B, H, W, _ = x.shape
|
226 |
-
# qkv with shape (3, B, nHead, H * W, C)
|
227 |
-
qkv = self.qkv(x).reshape(B, H * W, 3, self.num_heads, -1).permute(2, 0, 3, 1, 4)
|
228 |
-
# q, k, v with shape (B * nHead, H * W, C)
|
229 |
-
q, k, v = qkv.reshape(3, B * self.num_heads, H * W, -1).unbind(0)
|
230 |
-
|
231 |
-
attn = (q * self.scale) @ k.transpose(-2, -1)
|
232 |
-
|
233 |
-
if self.use_rel_pos:
|
234 |
-
attn = add_decomposed_rel_pos(attn, q, self.rel_pos_h, self.rel_pos_w, (H, W), (H, W))
|
235 |
-
|
236 |
-
attn = attn.softmax(dim=-1)
|
237 |
-
x = (attn @ v).view(B, self.num_heads, H, W, -1).permute(0, 2, 3, 1, 4).reshape(B, H, W, -1)
|
238 |
-
x = self.proj(x)
|
239 |
-
|
240 |
-
return x
|
241 |
-
|
242 |
-
|
243 |
-
def window_partition(x: torch.Tensor, window_size: int) -> Tuple[torch.Tensor, Tuple[int, int]]:
|
244 |
-
"""
|
245 |
-
Partition into non-overlapping windows with padding if needed.
|
246 |
-
Args:
|
247 |
-
x (tensor): input tokens with [B, H, W, C].
|
248 |
-
window_size (int): window size.
|
249 |
-
|
250 |
-
Returns:
|
251 |
-
windows: windows after partition with [B * num_windows, window_size, window_size, C].
|
252 |
-
(Hp, Wp): padded height and width before partition
|
253 |
-
"""
|
254 |
-
B, H, W, C = x.shape
|
255 |
-
|
256 |
-
pad_h = (window_size - H % window_size) % window_size
|
257 |
-
pad_w = (window_size - W % window_size) % window_size
|
258 |
-
if pad_h > 0 or pad_w > 0:
|
259 |
-
x = F.pad(x, (0, 0, 0, pad_w, 0, pad_h))
|
260 |
-
Hp, Wp = H + pad_h, W + pad_w
|
261 |
-
|
262 |
-
x = x.view(B, Hp // window_size, window_size, Wp // window_size, window_size, C)
|
263 |
-
windows = x.permute(0, 1, 3, 2, 4, 5).contiguous().view(-1, window_size, window_size, C)
|
264 |
-
return windows, (Hp, Wp)
|
265 |
-
|
266 |
-
|
267 |
-
def window_unpartition(
|
268 |
-
windows: torch.Tensor, window_size: int, pad_hw: Tuple[int, int], hw: Tuple[int, int]
|
269 |
-
) -> torch.Tensor:
|
270 |
-
"""
|
271 |
-
Window unpartition into original sequences and removing padding.
|
272 |
-
Args:
|
273 |
-
x (tensor): input tokens with [B * num_windows, window_size, window_size, C].
|
274 |
-
window_size (int): window size.
|
275 |
-
pad_hw (Tuple): padded height and width (Hp, Wp).
|
276 |
-
hw (Tuple): original height and width (H, W) before padding.
|
277 |
-
|
278 |
-
Returns:
|
279 |
-
x: unpartitioned sequences with [B, H, W, C].
|
280 |
-
"""
|
281 |
-
Hp, Wp = pad_hw
|
282 |
-
H, W = hw
|
283 |
-
B = windows.shape[0] // (Hp * Wp // window_size // window_size)
|
284 |
-
x = windows.view(B, Hp // window_size, Wp // window_size, window_size, window_size, -1)
|
285 |
-
x = x.permute(0, 1, 3, 2, 4, 5).contiguous().view(B, Hp, Wp, -1)
|
286 |
-
|
287 |
-
if Hp > H or Wp > W:
|
288 |
-
x = x[:, :H, :W, :].contiguous()
|
289 |
-
return x
|
290 |
-
|
291 |
-
|
292 |
-
def get_rel_pos(q_size: int, k_size: int, rel_pos: torch.Tensor) -> torch.Tensor:
|
293 |
-
"""
|
294 |
-
Get relative positional embeddings according to the relative positions of
|
295 |
-
query and key sizes.
|
296 |
-
Args:
|
297 |
-
q_size (int): size of query q.
|
298 |
-
k_size (int): size of key k.
|
299 |
-
rel_pos (Tensor): relative position embeddings (L, C).
|
300 |
-
|
301 |
-
Returns:
|
302 |
-
Extracted positional embeddings according to relative positions.
|
303 |
-
"""
|
304 |
-
max_rel_dist = int(2 * max(q_size, k_size) - 1)
|
305 |
-
# Interpolate rel pos if needed.
|
306 |
-
if rel_pos.shape[0] != max_rel_dist:
|
307 |
-
# Interpolate rel pos.
|
308 |
-
rel_pos_resized = F.interpolate(
|
309 |
-
rel_pos.reshape(1, rel_pos.shape[0], -1).permute(0, 2, 1),
|
310 |
-
size=max_rel_dist,
|
311 |
-
mode="linear",
|
312 |
-
)
|
313 |
-
rel_pos_resized = rel_pos_resized.reshape(-1, max_rel_dist).permute(1, 0)
|
314 |
-
else:
|
315 |
-
rel_pos_resized = rel_pos
|
316 |
-
|
317 |
-
# Scale the coords with short length if shapes for q and k are different.
|
318 |
-
q_coords = torch.arange(q_size)[:, None] * max(k_size / q_size, 1.0)
|
319 |
-
k_coords = torch.arange(k_size)[None, :] * max(q_size / k_size, 1.0)
|
320 |
-
relative_coords = (q_coords - k_coords) + (k_size - 1) * max(q_size / k_size, 1.0)
|
321 |
-
|
322 |
-
return rel_pos_resized[relative_coords.long()]
|
323 |
-
|
324 |
-
|
325 |
-
def add_decomposed_rel_pos(
|
326 |
-
attn: torch.Tensor,
|
327 |
-
q: torch.Tensor,
|
328 |
-
rel_pos_h: torch.Tensor,
|
329 |
-
rel_pos_w: torch.Tensor,
|
330 |
-
q_size: Tuple[int, int],
|
331 |
-
k_size: Tuple[int, int],
|
332 |
-
) -> torch.Tensor:
|
333 |
-
"""
|
334 |
-
Calculate decomposed Relative Positional Embeddings from :paper:`mvitv2`.
|
335 |
-
https://github.com/facebookresearch/mvit/blob/19786631e330df9f3622e5402b4a419a263a2c80/mvit/models/attention.py # noqa B950
|
336 |
-
Args:
|
337 |
-
attn (Tensor): attention map.
|
338 |
-
q (Tensor): query q in the attention layer with shape (B, q_h * q_w, C).
|
339 |
-
rel_pos_h (Tensor): relative position embeddings (Lh, C) for height axis.
|
340 |
-
rel_pos_w (Tensor): relative position embeddings (Lw, C) for width axis.
|
341 |
-
q_size (Tuple): spatial sequence size of query q with (q_h, q_w).
|
342 |
-
k_size (Tuple): spatial sequence size of key k with (k_h, k_w).
|
343 |
-
|
344 |
-
Returns:
|
345 |
-
attn (Tensor): attention map with added relative positional embeddings.
|
346 |
-
"""
|
347 |
-
q_h, q_w = q_size
|
348 |
-
k_h, k_w = k_size
|
349 |
-
Rh = get_rel_pos(q_h, k_h, rel_pos_h)
|
350 |
-
Rw = get_rel_pos(q_w, k_w, rel_pos_w)
|
351 |
-
|
352 |
-
B, _, dim = q.shape
|
353 |
-
r_q = q.reshape(B, q_h, q_w, dim)
|
354 |
-
rel_h = torch.einsum("bhwc,hkc->bhwk", r_q, Rh)
|
355 |
-
rel_w = torch.einsum("bhwc,wkc->bhwk", r_q, Rw)
|
356 |
-
|
357 |
-
attn = (
|
358 |
-
attn.view(B, q_h, q_w, k_h, k_w) + rel_h[:, :, :, :, None] + rel_w[:, :, :, None, :]
|
359 |
-
).view(B, q_h * q_w, k_h * k_w)
|
360 |
-
|
361 |
-
return attn
|
362 |
-
|
363 |
-
|
364 |
-
class PatchEmbed(nn.Module):
|
365 |
-
"""
|
366 |
-
Image to Patch Embedding.
|
367 |
-
"""
|
368 |
-
|
369 |
-
def __init__(
|
370 |
-
self,
|
371 |
-
kernel_size: Tuple[int, int] = (16, 16),
|
372 |
-
stride: Tuple[int, int] = (16, 16),
|
373 |
-
padding: Tuple[int, int] = (0, 0),
|
374 |
-
in_chans: int = 3,
|
375 |
-
embed_dim: int = 768,
|
376 |
-
) -> None:
|
377 |
-
"""
|
378 |
-
Args:
|
379 |
-
kernel_size (Tuple): kernel size of the projection layer.
|
380 |
-
stride (Tuple): stride of the projection layer.
|
381 |
-
padding (Tuple): padding size of the projection layer.
|
382 |
-
in_chans (int): Number of input image channels.
|
383 |
-
embed_dim (int): embed_dim (int): Patch embedding dimension.
|
384 |
-
"""
|
385 |
-
super().__init__()
|
386 |
-
|
387 |
-
self.proj = nn.Conv2d(
|
388 |
-
in_chans, embed_dim, kernel_size=kernel_size, stride=stride, padding=padding
|
389 |
-
)
|
390 |
-
|
391 |
-
def forward(self, x: torch.Tensor) -> torch.Tensor:
|
392 |
-
x = self.proj(x)
|
393 |
-
# B C H W -> B H W C
|
394 |
-
x = x.permute(0, 2, 3, 1)
|
395 |
-
return x
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/CikeyQI/meme-api/meme_generator/meme.py
DELETED
@@ -1,185 +0,0 @@
|
|
1 |
-
import copy
|
2 |
-
from argparse import ArgumentError, ArgumentParser
|
3 |
-
from contextvars import ContextVar
|
4 |
-
from dataclasses import dataclass, field
|
5 |
-
from io import BytesIO
|
6 |
-
from pathlib import Path
|
7 |
-
from typing import (
|
8 |
-
IO,
|
9 |
-
Any,
|
10 |
-
Awaitable,
|
11 |
-
Callable,
|
12 |
-
Dict,
|
13 |
-
List,
|
14 |
-
Literal,
|
15 |
-
Optional,
|
16 |
-
Type,
|
17 |
-
TypeVar,
|
18 |
-
Union,
|
19 |
-
cast,
|
20 |
-
)
|
21 |
-
|
22 |
-
from pil_utils import BuildImage
|
23 |
-
from pydantic import BaseModel, ValidationError
|
24 |
-
|
25 |
-
from .exception import (
|
26 |
-
ArgModelMismatch,
|
27 |
-
ArgParserExit,
|
28 |
-
ImageNumberMismatch,
|
29 |
-
OpenImageFailed,
|
30 |
-
ParserExit,
|
31 |
-
TextNumberMismatch,
|
32 |
-
TextOrNameNotEnough,
|
33 |
-
)
|
34 |
-
from .utils import is_coroutine_callable, random_image, random_text, run_sync
|
35 |
-
|
36 |
-
|
37 |
-
class UserInfo(BaseModel):
|
38 |
-
name: str = ""
|
39 |
-
gender: Literal["male", "female", "unknown"] = "unknown"
|
40 |
-
|
41 |
-
|
42 |
-
class MemeArgsModel(BaseModel):
|
43 |
-
user_infos: List[UserInfo] = []
|
44 |
-
|
45 |
-
|
46 |
-
ArgsModel = TypeVar("ArgsModel", bound=MemeArgsModel)
|
47 |
-
|
48 |
-
MemeFunction = Union[
|
49 |
-
Callable[[List[BuildImage], List[str], ArgsModel], BytesIO],
|
50 |
-
Callable[[List[BuildImage], List[str], ArgsModel], Awaitable[BytesIO]],
|
51 |
-
]
|
52 |
-
|
53 |
-
|
54 |
-
parser_message: ContextVar[str] = ContextVar("parser_message")
|
55 |
-
|
56 |
-
|
57 |
-
class MemeArgsParser(ArgumentParser):
|
58 |
-
"""`shell_like` 命令参数解析器,解析出错时不会退出程序。
|
59 |
-
|
60 |
-
用法:
|
61 |
-
用法与 `argparse.ArgumentParser` 相同,
|
62 |
-
参考文档: [argparse](https://docs.python.org/3/library/argparse.html)
|
63 |
-
"""
|
64 |
-
|
65 |
-
def _print_message(self, message: str, file: Optional[IO[str]] = None):
|
66 |
-
if (msg := parser_message.get(None)) is not None:
|
67 |
-
parser_message.set(msg + message)
|
68 |
-
else:
|
69 |
-
super()._print_message(message, file)
|
70 |
-
|
71 |
-
def exit(self, status: int = 0, message: Optional[str] = None):
|
72 |
-
if message:
|
73 |
-
self._print_message(message)
|
74 |
-
raise ParserExit(status=status, error_message=parser_message.get(None))
|
75 |
-
|
76 |
-
|
77 |
-
@dataclass
|
78 |
-
class MemeArgsType:
|
79 |
-
parser: MemeArgsParser
|
80 |
-
model: Type[MemeArgsModel]
|
81 |
-
instances: List[MemeArgsModel] = field(default_factory=list)
|
82 |
-
|
83 |
-
|
84 |
-
@dataclass
|
85 |
-
class MemeParamsType:
|
86 |
-
min_images: int = 0
|
87 |
-
max_images: int = 0
|
88 |
-
min_texts: int = 0
|
89 |
-
max_texts: int = 0
|
90 |
-
default_texts: List[str] = field(default_factory=list)
|
91 |
-
args_type: Optional[MemeArgsType] = None
|
92 |
-
|
93 |
-
|
94 |
-
@dataclass
|
95 |
-
class Meme:
|
96 |
-
key: str
|
97 |
-
function: MemeFunction
|
98 |
-
params_type: MemeParamsType
|
99 |
-
keywords: List[str] = field(default_factory=list)
|
100 |
-
patterns: List[str] = field(default_factory=list)
|
101 |
-
|
102 |
-
async def __call__(
|
103 |
-
self,
|
104 |
-
*,
|
105 |
-
images: Union[List[str], List[Path], List[bytes], List[BytesIO]] = [],
|
106 |
-
texts: List[str] = [],
|
107 |
-
args: Dict[str, Any] = {},
|
108 |
-
) -> BytesIO:
|
109 |
-
if not (
|
110 |
-
self.params_type.min_images <= len(images) <= self.params_type.max_images
|
111 |
-
):
|
112 |
-
raise ImageNumberMismatch(
|
113 |
-
self.key, self.params_type.min_images, self.params_type.max_images
|
114 |
-
)
|
115 |
-
|
116 |
-
if not (self.params_type.min_texts <= len(texts) <= self.params_type.max_texts):
|
117 |
-
raise TextNumberMismatch(
|
118 |
-
self.key, self.params_type.min_texts, self.params_type.max_texts
|
119 |
-
)
|
120 |
-
|
121 |
-
if args_type := self.params_type.args_type:
|
122 |
-
args_model = args_type.model
|
123 |
-
else:
|
124 |
-
args_model = MemeArgsModel
|
125 |
-
|
126 |
-
try:
|
127 |
-
model = args_model.parse_obj(args)
|
128 |
-
except ValidationError as e:
|
129 |
-
raise ArgModelMismatch(self.key, str(e))
|
130 |
-
|
131 |
-
imgs: List[BuildImage] = []
|
132 |
-
try:
|
133 |
-
for image in images:
|
134 |
-
if isinstance(image, bytes):
|
135 |
-
image = BytesIO(image)
|
136 |
-
imgs.append(BuildImage.open(image))
|
137 |
-
except Exception as e:
|
138 |
-
raise OpenImageFailed(str(e))
|
139 |
-
|
140 |
-
values = {"images": imgs, "texts": texts, "args": model}
|
141 |
-
|
142 |
-
if is_coroutine_callable(self.function):
|
143 |
-
return await cast(Callable[..., Awaitable[BytesIO]], self.function)(
|
144 |
-
**values
|
145 |
-
)
|
146 |
-
else:
|
147 |
-
return await run_sync(cast(Callable[..., BytesIO], self.function))(**values)
|
148 |
-
|
149 |
-
def parse_args(self, args: List[str] = []) -> Dict[str, Any]:
|
150 |
-
parser = (
|
151 |
-
copy.deepcopy(self.params_type.args_type.parser)
|
152 |
-
if self.params_type.args_type
|
153 |
-
else MemeArgsParser()
|
154 |
-
)
|
155 |
-
parser.add_argument("texts", nargs="*", default=[])
|
156 |
-
t = parser_message.set("")
|
157 |
-
try:
|
158 |
-
return vars(parser.parse_args(args))
|
159 |
-
except ArgumentError as e:
|
160 |
-
raise ArgParserExit(self.key, str(e))
|
161 |
-
except ParserExit as e:
|
162 |
-
raise ArgParserExit(self.key, e.error_message)
|
163 |
-
finally:
|
164 |
-
parser_message.reset(t)
|
165 |
-
|
166 |
-
async def generate_preview(self, *, args: Dict[str, Any] = {}) -> BytesIO:
|
167 |
-
default_images = [random_image() for _ in range(self.params_type.min_images)]
|
168 |
-
default_texts = (
|
169 |
-
self.params_type.default_texts.copy()
|
170 |
-
if (
|
171 |
-
self.params_type.min_texts
|
172 |
-
<= len(self.params_type.default_texts)
|
173 |
-
<= self.params_type.max_texts
|
174 |
-
)
|
175 |
-
else [random_text() for _ in range(self.params_type.min_texts)]
|
176 |
-
)
|
177 |
-
|
178 |
-
async def _generate_preview(images: List[BytesIO], texts: List[str]):
|
179 |
-
try:
|
180 |
-
return await self.__call__(images=images, texts=texts, args=args)
|
181 |
-
except TextOrNameNotEnough:
|
182 |
-
texts.append(random_text())
|
183 |
-
return await _generate_preview(images, texts)
|
184 |
-
|
185 |
-
return await _generate_preview(default_images, default_texts)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|