Commit
·
b2d7283
1
Parent(s):
b83aaa1
Update parquet files (step 44 of 296)
Browse filesThis view is limited to 50 files because it contains too many changes.
See raw diff
- spaces/1acneusushi/gradio-2dmoleculeeditor/data/ABBYY FineReader 12.0.101.264 Professional cRACk-Pafnutiy761 full version Review and Comparison.md +0 -104
- spaces/1acneusushi/gradio-2dmoleculeeditor/data/Cracku Number System The Ultimate Guide to Ace Any Competitive Exam.md +0 -45
- spaces/1acneusushi/gradio-2dmoleculeeditor/data/Dont Fall for Revo Uninstaller Pro Crack Reddit Heres How to Get a Legit and Free Uninstaller.md +0 -29
- spaces/1gistliPinn/ChatGPT4/Examples/Chicken Invaders 4 Multiplayer Patch Download.md +0 -7
- spaces/1gistliPinn/ChatGPT4/Examples/Desamuduru Telugu Movie Dialogues Download Movies.md +0 -34
- spaces/1pelhydcardo/ChatGPT-prompt-generator/assets/Alias The Game - A Run and Gun Game with a Twist - Download Here.md +0 -144
- spaces/1pelhydcardo/ChatGPT-prompt-generator/assets/Download AetherSX2 Hack and Enjoy PS2 Emulation with Enhanced Graphics and Performance.md +0 -107
- spaces/1phancelerku/anime-remove-background/Barbie Dreamhouse Adventures APK OBB A Game for Girls Who Love Fashion Cooking and More.md +0 -108
- spaces/1phancelerku/anime-remove-background/Best Music Downloader APK for Android Download Music MP3 Latest Version.md +0 -98
- spaces/1phancelerku/anime-remove-background/Discover the Amazing Features of Go88 Live APK the Leading Game Bi App.md +0 -95
- spaces/1phancelerku/anime-remove-background/Discover the Joy of Piano Playing with Real Piano Teacher 2 Mod APK.md +0 -147
- spaces/1phancelerku/anime-remove-background/Download and Install GTA 5 Apk Obb on Your Android Device in Minutes.md +0 -88
- spaces/44ov41za8i/FreeVC/commons.py +0 -171
- spaces/A00001/bingothoo/src/lib/isomorphic/node.ts +0 -26
- spaces/AIFILMS/audioldm-text-to-audio-generation/share_btn.py +0 -74
- spaces/AIGC-Audio/AudioGPT/text_to_speech/modules/commons/conformer/espnet_positional_embedding.py +0 -113
- spaces/AIGC-Audio/Make_An_Audio_inpaint/ldm/modules/encoders/CLAP/__init__.py +0 -3
- spaces/Ababababababbababa/Ashaar/poetry_diacritizer/modules/tacotron_modules.py +0 -174
- spaces/AchyuthGamer/OpenGPT/g4f/Provider/ChatgptDemo.py +0 -61
- spaces/AchyuthGamer/OpenGPT/g4f/Provider/Providers/helpers/theb.py +0 -48
- spaces/AgentVerse/agentVerse/ui/src/phaser3-rex-plugins/templates/spinner/audio/Audio.js +0 -61
- spaces/AgentVerse/agentVerse/ui/src/phaser3-rex-plugins/templates/ui/colorinput/colorpicker/ColorPicker.js +0 -177
- spaces/AlekseyKorshuk/thin-plate-spline-motion-model/logger.py +0 -212
- spaces/AlexWang/lama/saicinpainting/training/visualizers/colors.py +0 -76
- spaces/Alpaca233/SadTalker/scripts/test.sh +0 -21
- spaces/Androidonnxfork/CivitAi-to-Diffusers/diffusers/docker/diffusers-flax-tpu/Dockerfile +0 -46
- spaces/Androidonnxfork/CivitAi-to-Diffusers/diffusers/examples/research_projects/intel_opts/inference_bf16.py +0 -56
- spaces/Andy1621/uniformer_image_segmentation/configs/deeplabv3plus/deeplabv3plus_r50-d8_480x480_80k_pascal_context_59.py +0 -10
- spaces/AnishKumbhar/ChatBot/text-generation-webui-main/one_click.py +0 -361
- spaces/Anonymous-sub/Rerender/ControlNet/annotator/uniformer/mmcv/runner/optimizer/__init__.py +0 -9
- spaces/Anonymous-sub/Rerender/ControlNet/tool_add_control_sd21.py +0 -50
- spaces/ArkanDash/rvc-models-new/vc_infer_pipeline.py +0 -443
- spaces/Arulkumar03/GroundingDINO_SOTA_Zero_Shot_Model/demo/gradio_app.py +0 -125
- spaces/Arulkumar03/GroundingDINO_SOTA_Zero_Shot_Model/groundingdino/util/visualizer.py +0 -318
- spaces/Ataturk-Chatbot/HuggingFaceChat/venv/lib/python3.11/site-packages/setuptools/_vendor/packaging/utils.py +0 -136
- spaces/Benson/text-generation/Examples/3 Patti Octro Apk Download 2021.md +0 -118
- spaces/Benson/text-generation/Examples/Descargar Efectos De Sonido Final Cut Pro.md +0 -140
- spaces/Bidwill/Sanskrit-asr/README.md +0 -13
- spaces/Big-Web/MMSD/env/Lib/site-packages/pip/_vendor/chardet/big5prober.py +0 -47
- spaces/Big-Web/MMSD/env/Lib/site-packages/pip/_vendor/chardet/mbcssm.py +0 -661
- spaces/Big-Web/MMSD/env/Lib/site-packages/setuptools/config/expand.py +0 -462
- spaces/BigData-KSU/VQA-in-Medical-Imagery/CLIP/model_moe.py +0 -498
- spaces/CVPR/Dual-Key_Backdoor_Attacks/datagen/detectron2/docs/tutorials/models.md +0 -135
- spaces/CVPR/LIVE/pybind11/tests/test_union.cpp +0 -22
- spaces/CVPR/LIVE/pybind11/tools/clang/README.md +0 -2
- spaces/CVPR/LIVE/thrust/thrust/detail/internal_functional.h +0 -560
- spaces/CVPR/LIVE/thrust/thrust/device_vector.h +0 -496
- spaces/CVPR/LIVE/thrust/thrust/system/omp/detail/copy_if.h +0 -51
- spaces/CVPR/LIVE/thrust/thrust/system/tbb/detail/swap_ranges.h +0 -23
- spaces/CVPR/monoscene_lite/monoscene/.ipynb_checkpoints/modules-checkpoint.py +0 -194
spaces/1acneusushi/gradio-2dmoleculeeditor/data/ABBYY FineReader 12.0.101.264 Professional cRACk-Pafnutiy761 full version Review and Comparison.md
DELETED
@@ -1,104 +0,0 @@
|
|
1 |
-
|
2 |
-
<h1>Readiris Pro 11: A Powerful OCR Solution for Windows</h1>
|
3 |
-
<p>If you are looking for a way to convert your paper documents into digital formats, edit and annotate your PDF files, recognize text in multiple languages, and export your files to various applications and cloud services, then you might be interested in Readiris Pro 11. Readiris Pro 11 is an optical character recognition (OCR) software that can scan, recognize, and convert any type of document into editable text, image, or PDF formats. In this article, we will tell you what Readiris Pro 11 can do, how to download and install it for free using a crack, what are the risks and drawbacks of using a cracked version, and what are some alternatives to Readiris Pro 11 crack.</p>
|
4 |
-
<h2>What is Readiris Pro 11 and what can it do?</h2>
|
5 |
-
<p>Readiris Pro 11 is an OCR software developed by I.R.I.S., a Belgian company that specializes in document management and recognition solutions. Readiris Pro 11 was released in 2006 as the eleventh version of the Readiris software series. It is compatible with Windows XP, Vista, 7, 8, and 10 operating systems. It can scan and recognize text from any type of document, such as paper documents, books, magazines, invoices, receipts, business cards, photos, etc. It can also convert scanned documents into editable text formats, such as Word, Excel, PowerPoint, HTML, TXT, RTF, etc. It can also create searchable PDF files with annotations and bookmarks. It can recognize text in more than 120 languages, including Asian languages and Arabic. It can export the converted files to various applications and cloud services, such as Microsoft Office, Google Drive, Dropbox, Evernote, etc.</p>
|
6 |
-
<h2>readiris pro 11 free download crack for gta</h2><br /><p><b><b>DOWNLOAD</b> >> <a href="https://byltly.com/2uKvbL">https://byltly.com/2uKvbL</a></b></p><br /><br />
|
7 |
-
<h3>Features and benefits of Readiris Pro 11</h3>
|
8 |
-
<p>Readiris Pro 11 has many features and benefits that make it a powerful OCR solution for Windows users. Here are some of them:</p>
|
9 |
-
<h4>Convert paper documents to digital formats</h4>
|
10 |
-
<p>Readiris Pro 11 can scan any type of paper document using a scanner or a digital camera. It can then recognize the text and layout of the document and convert it into an editable text format. You can choose from various output formats depending on your needs and preferences. For example, you can convert your paper documents into Word files if you want to edit them later. You can also convert them into Excel files if you want to work with numbers and data. You can also convert them into PowerPoint files if you want to create presentations. You can also convert them into HTML files if you want to publish them on the web.</p>
|
11 |
-
<h4>Edit and annotate PDF files</h4>
|
12 |
-
<p>Readiris Pro 11 can also create searchable PDF files from your scanned documents. You can then edit and annotate your PDF files using the built-in PDF editor. You can add comments, highlights, stamps, signatures, etc. to your PDF files. You can also create bookmarks and hyperlinks to navigate through your PDF files. You can also merge or split PDF files as you wish.</p>
|
13 |
-
<h4>Recognize text in multiple languages</h4>
|
14 |
-
<p>Readiris Pro 11 can recognize text in more than 120 languages, including Asian languages and Arabic. You can select the language of your document before scanning it or let Readiris Pro 11 detect it automatically. You can also scan documents that contain multiple languages and let Readiris Pro 11 recognize them separately. You can also use the spell checker and the dictionary to correct any errors or typos in your recognized text.</p>
|
15 |
-
<h4>Export to various applications and cloud services</h4>
|
16 |
-
<p>Readiris Pro 11 can export your converted files to various applications and cloud services that you use regularly. For example, you can export your files to Microsoft Office applications such as Word, Excel, PowerPoint, etc. You can also export your files to Google Drive, Dropbox, Evernote, etc. where you can store them online or access them from any device. You can also export your files to email clients such as Outlook or Gmail where you can send them as attachments.</p>
|
17 |
-
<h3>How to download and install Readiris Pro 11 for free</h3>
|
18 |
-
<p>If you want to use Readiris Pro 11 without paying for it <h3>How to download and install Readiris Pro 11 for free</h3>
|
19 |
-
<p>If you want to use Readiris Pro 11 without paying for it, you might be tempted to download and install a cracked version of the software. A crack is a program that modifies the original software to bypass its security features and allow unauthorized use. However, downloading and installing a crack is not as easy or safe as it sounds. Here are the steps you need to follow to get Readiris Pro 11 for free using a crack:</p>
|
20 |
-
<h4>Find a reliable source of Readiris Pro 11 crack</h4>
|
21 |
-
<p>The first step is to find a website that offers Readiris Pro 11 crack for download. You can use a search engine like Google or Bing to look for keywords like "readiris pro 11 free download crack" or "readiris pro 11 keygen". However, you need to be careful about the websites you visit and the files you download. Many websites that offer cracks are full of ads, pop-ups, malware, viruses, and other threats that can harm your computer and your data. You also need to check the comments and reviews of other users who have downloaded the crack to see if it works or not.</p>
|
22 |
-
<p>readiris pro 11 full version free download with crack<br />
|
23 |
-
how to install readiris pro 11 cracked on windows 10<br />
|
24 |
-
readiris pro 11 activation code generator for gta v<br />
|
25 |
-
download readiris pro 11 patch for gta san andreas<br />
|
26 |
-
readiris pro 11 serial key free download no survey<br />
|
27 |
-
readiris pro 11 crack only download for gta iv<br />
|
28 |
-
readiris pro 11 license key crack for gta vice city<br />
|
29 |
-
readiris pro 11 torrent download with crack for gta 3<br />
|
30 |
-
readiris pro 11 keygen download for gta 5<br />
|
31 |
-
readiris pro 11 portable free download with crack for gta online<br />
|
32 |
-
readiris pro 11 mac crack download for gta sa<br />
|
33 |
-
readiris pro 11 windows 7 crack download for gta vc<br />
|
34 |
-
readiris pro 11 rar password crack for gta iv<br />
|
35 |
-
readiris pro 11 zip file free download with crack for gta lcs<br />
|
36 |
-
readiris pro 11 mega download link with crack for gta vcs<br />
|
37 |
-
readiris pro 11 mediafire download with crack for gta cw<br />
|
38 |
-
readiris pro 11 google drive download with crack for gta ct<br />
|
39 |
-
readiris pro 11 dropbox download with crack for gta advance<br />
|
40 |
-
readiris pro 11 zippyshare download with crack for gta london<br />
|
41 |
-
readiris pro 11 direct download link with crack for gta berlin<br />
|
42 |
-
readiris pro 11 latest version free download with crack for gta rio<br />
|
43 |
-
readiris pro 11 update download with crack for gta tokyo<br />
|
44 |
-
readiris pro 11 offline installer free download with crack for gta moscow<br />
|
45 |
-
readiris pro 11 setup.exe free download with crack for gta new york<br />
|
46 |
-
readiris pro 11 iso file free download with crack for gta paris<br />
|
47 |
-
readiris pro 11 dmg file free download with crack for gta sydney<br />
|
48 |
-
readiris pro 11 ocr software free download with crack for gta dubai<br />
|
49 |
-
readiris pro 11 pdf converter free download with crack for gta london<br />
|
50 |
-
readiris pro 11 scanner software free download with crack for gta berlin<br />
|
51 |
-
readiris pro 11 document management software free download with crack for gta rio<br />
|
52 |
-
readiris pro 11 image to text converter free download with crack for gta tokyo<br />
|
53 |
-
readiris pro 11 text to speech software free download with crack for gta moscow<br />
|
54 |
-
readiris pro 11 speech to text software free download with crack for gta new york<br />
|
55 |
-
readiris pro 11 barcode reader software free download with crack for gta paris<br />
|
56 |
-
readiris pro 11 qr code scanner software free download with crack for gta sydney<br />
|
57 |
-
readiris pro 11 business card scanner software free download with crack for gta dubai<br />
|
58 |
-
readiris pro 11 invoice scanner software free download with crack for gta london<br />
|
59 |
-
readiris pro 11 receipt scanner software free download with crack for gta berlin<br />
|
60 |
-
readiris pro 11 form scanner software free download with crack for gta rio<br />
|
61 |
-
readiris pro 11 signature scanner software free download with crack for gta tokyo<br />
|
62 |
-
readiris pro 11 handwriting recognition software free download with crack for gta moscow<br />
|
63 |
-
readiris pro 11 arabic ocr software free download with crack for gta new york<br />
|
64 |
-
readiris pro 11 chinese ocr software free download with crack for gta paris<br />
|
65 |
-
readiris pro 11 japanese ocr software free download with crack for gta sydney<br />
|
66 |
-
readiris pro 11 korean ocr software free download with crack for gta dubai<br />
|
67 |
-
readiris pro 11 hindi ocr software free download with crack for gta london<br />
|
68 |
-
readiris pro 11 urdu ocr software free download with crack for gta berlin<br />
|
69 |
-
readiris pro 11 persian ocr software free download with crack for gta rio<br />
|
70 |
-
readiris pro 11 hebrew ocr software free download with crack for gta tokyo<br />
|
71 |
-
readiris pro 11 thai ocr software free download with crack for gta moscow</p>
|
72 |
-
<h4>Follow the instructions to install and activate the software</h4>
|
73 |
-
<p>The second step is to follow the instructions provided by the website or the crack file to install and activate Readiris Pro 11. Usually, you need to download a zip or rar file that contains the crack and the setup file of Readiris Pro 11. You need to extract the files using a program like WinRAR or 7-Zip. Then, you need to run the setup file of Readiris Pro 11 and follow the installation wizard. After that, you need to copy and paste the crack file into the installation folder of Readiris Pro 11. Sometimes, you also need to run the crack file as an administrator or enter a serial number or a license key that is provided by the crack.</p>
|
74 |
-
<h4>Scan your system for viruses and malware</h4>
|
75 |
-
<p>The third step is to scan your system for viruses and malware using a reliable antivirus or anti-malware program. This is because cracks often contain malicious code that can infect your system and compromise its security. You might not notice it at first, but cracks can steal your personal information, damage your files, slow down your performance, display unwanted ads, or even lock your system until you pay a ransom. Therefore, it is important to scan your system regularly and remove any threats that are detected.</p>
|
76 |
-
<h3>Risks and drawbacks of using Readiris Pro 11 crack</h3>
|
77 |
-
<p>While using Readiris Pro 11 crack might seem like a good idea at first, it actually comes with many risks and drawbacks that outweigh its benefits. Here are some of them:</p>
|
78 |
-
<h4>Legal issues and penalties</h4>
|
79 |
-
<p>Using Readiris Pro 11 crack is illegal and unethical. It violates the intellectual property rights of I.R.I.S., the developer of Readiris Pro 11. It also breaches the terms and conditions of the software license agreement that you agree to when you install Readiris Pro 11. If you are caught using Readiris Pro 11 crack, you could face legal consequences such as fines, lawsuits, or even jail time. You could also lose your reputation and credibility as a professional or a student.</p>
|
80 |
-
<h4>Software errors and malfunctions</h4>
|
81 |
-
<p>Using Readiris Pro 11 crack is unreliable and unstable. It can cause software errors and malfunctions that affect its performance and functionality. For example, Readiris Pro 11 crack might not recognize some documents correctly or convert them accurately. It might also crash or freeze frequently or fail to export your files properly. It might also conflict with other programs on your system or cause compatibility issues with your scanner or camera.</p>
|
82 |
-
<h4>Security threats and data loss</h4>
|
83 |
-
<p>Using Readiris Pro 11 crack is risky and dangerous. It can expose your system and your data to security threats such as viruses, malware, spyware, ransomware, etc. These threats can infect your system and compromise its security. They can also steal your personal information, damage your files, slow down your performance, display unwanted ads, or even lock your system until you pay a ransom. You could also lose your data if Readiris Pro 11 crack corrupts or deletes your files during conversion or export.</p>
|
84 |
-
<h2>Alternatives to Readiris Pro 11 crack</h2>
|
85 |
-
<p>If you want to use an OCR software like Readiris Pro 11 without breaking the law or risking your system and data, you have some alternatives that are better than using a crack. Here are some of them:</p>
|
86 |
-
<h3>Buy the official version of Readiris Pro 11</h3>
|
87 |
-
<p>The best alternative to using Readiris Pro 11 crack is to buy the official version of Readiris Pro 11 from I.R.I.S.'s website or an authorized reseller. By buying the official version of Readiris Pro 11 <p>, you will get the full features and benefits of the software without any limitations or risks. You will also get free updates and technical support from I.R.I.S. The official price of Readiris Pro 11 is $129.99, but you can find some discounts and offers online. For example, if you are a registered user of Readiris OCR software, you can get an exclusive $70 discount for Readiris Pro 11 for Windows or Mac OS X. You can also buy Readiris Pro 11 Corporate Edition with more advanced features for $299.99 instead of $399.00.</p>
|
88 |
-
<h3>Use a free online OCR service</h3>
|
89 |
-
<p>If you don't want to buy Readiris Pro 11, but you still need to convert some documents occasionally, you can use a free online OCR service. There are many websites that offer free OCR services that can scan and recognize your documents and convert them into various formats. You just need to upload your document to the website and choose the output format and language. Some of the popular free online OCR services are OnlineOCR.net, FreeOCR.net, i2OCR.com, etc. However, you need to be aware of some limitations and drawbacks of using free online OCR services. For example, they might have a file size limit, a page limit, a language limit, or a quality limit. They might also not support some features such as PDF editing, table recognition, handprint recognition, etc. They might also not guarantee the privacy and security of your documents.</p>
|
90 |
-
<h3>Try a different OCR software</h3>
|
91 |
-
<p>If you are not satisfied with Readiris Pro 11 or its alternatives, you can also try a different OCR software that suits your needs and preferences. There are many OCR software available in the market with different features and prices. Some of them are free, some of them are paid, some of them are online, some of them are offline. You can compare and contrast different OCR software based on their reviews, ratings, testimonials, demos, etc. Some of the popular OCR software are ABBYY FineReader, Adobe Acrobat Pro DC, OmniPage Ultimate, etc.</p>
|
92 |
-
<h2>Conclusion</h2>
|
93 |
-
<p>In conclusion, Readiris Pro 11 is a powerful OCR software that can scan and convert any type of document into editable text, image, or PDF formats. It has many features and benefits that make it a useful tool for personal and professional use. However, using Readiris Pro 11 crack is illegal and risky. It can cause legal issues and penalties, software errors and malfunctions, security threats and data loss. Therefore, it is better to avoid using Readiris Pro 11 crack and use one of its alternatives instead. You can buy the official version of Readiris Pro 11 from I.R.I.S.'s website or an authorized reseller. You can also use a free online OCR service or try a different OCR software.</p>
|
94 |
-
<h2>FAQs</h2>
|
95 |
-
<ul>
|
96 |
-
<li>Q: What is Readiris Pro 11?<br>A: Readiris Pro 11 is an optical character recognition (OCR) software that can scan and convert any type of document into editable text, image, or PDF formats.</li>
|
97 |
-
<li>Q: How to download and install Readiris Pro 11 for free?<br>A: To download and install Readiris Pro 11 for free, you need to find a reliable source of Readiris Pro 11 crack, follow the instructions to install and activate the software, and scan your system for viruses and malware.</li>
|
98 |
-
<li>Q: What are the risks and drawbacks of using Readiris Pro 11 crack?<br>A: Using Readiris Pro 11 crack is illegal and risky. It can cause legal issues and penalties, software errors and malfunctions, security threats and data loss.</li>
|
99 |
-
<li>Q: What are the alternatives to Readiris Pro 11 crack?<br>A: The alternatives to Readiris Pro 11 crack are buying the official version of Readiris Pro 11 from I.R.I.S.'s website or an authorized reseller, using a free online OCR service, or trying a different OCR software.</li>
|
100 |
-
<li>Q: What are some popular OCR software?<br>A: Some popular OCR software are ABBYY FineReader , Adobe Acrobat Pro DC, OmniPage Ultimate, etc.</li>
|
101 |
-
</ul>
|
102 |
-
</p> 0a6ba089eb<br />
|
103 |
-
<br />
|
104 |
-
<br />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/1acneusushi/gradio-2dmoleculeeditor/data/Cracku Number System The Ultimate Guide to Ace Any Competitive Exam.md
DELETED
@@ -1,45 +0,0 @@
|
|
1 |
-
<br />
|
2 |
-
<h1>How to Master the Cracku Number System for Competitive Exams</h1>
|
3 |
-
<p>If you are preparing for competitive exams like CAT, GMAT, GRE, or Bank PO, you might have heard of the Cracku Number System. This is a unique and effective way of solving number-related problems in less time and with more accuracy. But what is the Cracku Number System and how can you learn it?</p>
|
4 |
-
<p>The Cracku Number System is based on the concept of divisibility rules and remainder theorem. It helps you to find out whether a number is divisible by another number, what is the remainder when a number is divided by another number, and how to simplify complex calculations involving large numbers. By using the Cracku Number System, you can avoid lengthy and tedious calculations and save time in the exam.</p>
|
5 |
-
<h2>cracku number system</h2><br /><p><b><b>Download Zip</b> ❤ <a href="https://byltly.com/2uKxcC">https://byltly.com/2uKxcC</a></b></p><br /><br />
|
6 |
-
<p>Here are some benefits of using the Cracku Number System:</p>
|
7 |
-
<ul>
|
8 |
-
<li>It reduces the chances of making mistakes and errors in calculations.</li>
|
9 |
-
<li>It enhances your speed and accuracy in solving number-related problems.</li>
|
10 |
-
<li>It boosts your confidence and reduces your stress level in the exam.</li>
|
11 |
-
<li>It helps you to score more marks and improve your overall performance.</li>
|
12 |
-
</ul>
|
13 |
-
<p>So how can you master the Cracku Number System? Here are some tips:</p>
|
14 |
-
<ol>
|
15 |
-
<li>Learn the basic divisibility rules and remainder theorem. You can find them on the Cracku website or in any standard book on quantitative aptitude.</li>
|
16 |
-
<li>Practice solving problems using the Cracku Number System. You can find plenty of practice questions and mock tests on the Cracku website or app. Try to solve them without using a calculator or pen and paper.</li>
|
17 |
-
<li>Analyze your mistakes and learn from them. If you get stuck or make a mistake, check the solution and explanation provided by Cracku. Understand where you went wrong and how to avoid it in the future.</li>
|
18 |
-
<li>Revise and review regularly. The more you practice, the more you will get familiar with the Cracku Number System and its applications. Make sure to revise the concepts and formulas periodically and review your progress.</li>
|
19 |
-
</ol>
|
20 |
-
<p>The Cracku Number System is a powerful tool that can help you ace any competitive exam that involves numbers. All you need is to learn it, practice it, and apply it. So what are you waiting for? Start your preparation today with Cracku and achieve your dream score!</p>
|
21 |
-
|
22 |
-
<h2>Some Examples of Using the Cracku Number System</h2>
|
23 |
-
<p>To give you a better idea of how the Cracku Number System works, let us look at some examples of problems that can be solved using it. These are taken from various competitive exams and are typical of the kind of questions you might encounter.</p>
|
24 |
-
<p>Example 1: What is the remainder when 7^2021 is divided by 9?</p>
|
25 |
-
<p>Solution: Using the Cracku Number System, we can find the remainder of any power of 7 when divided by 9 by using the following pattern:</p>
|
26 |
-
<p></p>
|
27 |
-
<table>
|
28 |
-
<tr><td>Power of 7</td><td>Remainder when divided by 9</td></tr>
|
29 |
-
<tr><td>7^1</td><td>7</td></tr>
|
30 |
-
<tr><td>7^2</td><td>4</td></tr>
|
31 |
-
<tr><td>7^3</td><td>1</td></tr>
|
32 |
-
<tr><td>7^4</td><td>7</td></tr>
|
33 |
-
<tr><td>7^5</td><td>4</td></tr>
|
34 |
-
<tr><td>7^6</td><td>1</td></tr>
|
35 |
-
<tr><td>...</td><td>...</td></tr>
|
36 |
-
</table>
|
37 |
-
<p>We can see that the remainder repeats after every 3 powers of 7. So we can divide the exponent by 3 and find the remainder. In this case, 2021 divided by 3 gives a remainder of 2. So we look at the second row of the table and see that the remainder is 4. Hence, the answer is 4.</p>
|
38 |
-
<p>Example 2: How many positive integers less than 1000 are divisible by both 3 and 5?</p>
|
39 |
-
<p>Solution: Using the Cracku Number System, we can find the number of positive integers less than 1000 that are divisible by both 3 and 5 by using the following formula:</p>
|
40 |
-
<p>N = (Last term - First term) / Common difference + 1</p>
|
41 |
-
<p>The first term is the smallest positive integer that is divisible by both 3 and 5, which is 15. The last term is the largest positive integer that is divisible by both 3 and 5 and less than 1000, which is 990. The common difference is the difference between any two consecutive terms, which is 15. So we plug in these values into the formula and get:</p>
|
42 |
-
<p>N = (990 - 15) / 15 + 1 = (975) / 15 + 1 = 65 + 1 = 66</p>
|
43 |
-
<p>Hence, the answer is 66.</p> ddb901b051<br />
|
44 |
-
<br />
|
45 |
-
<br />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/1acneusushi/gradio-2dmoleculeeditor/data/Dont Fall for Revo Uninstaller Pro Crack Reddit Heres How to Get a Legit and Free Uninstaller.md
DELETED
@@ -1,29 +0,0 @@
|
|
1 |
-
|
2 |
-
# How to Get Revo Uninstaller Pro Crack Reddit for Free
|
3 |
-
|
4 |
-
Revo Uninstaller Pro is a powerful software that helps you uninstall unwanted programs and clean up your system. It has many features such as advanced scanning, forced uninstall, quick/multiple uninstall, and more. However, Revo Uninstaller Pro is not a free software and you need to purchase a license to use it.
|
5 |
-
|
6 |
-
If you are looking for a way to get Revo Uninstaller Pro crack Reddit for free, you might be tempted to download it from some shady websites or torrent sites. However, this is not a good idea as you might end up with malware, viruses, or other problems on your computer. Moreover, using a cracked software is illegal and unethical as it violates the terms and conditions of the software developer.
|
7 |
-
|
8 |
-
So, what is the best way to get Revo Uninstaller Pro crack Reddit for free? The answer is simple: you don't. Instead, you should use a legitimate and safe alternative that can do the same job as Revo Uninstaller Pro without costing you anything. Here are some of the best free alternatives to Revo Uninstaller Pro that you can try:
|
9 |
-
|
10 |
-
- <a href="https://www.iobit.com/en/advanceduninstaller.php">IObit Uninstaller</a>: This is a popular and reliable uninstaller that can remove stubborn programs, browser extensions, Windows apps, and more. It also has a file shredder, a software updater, and a toolbar cleaner.
|
11 |
-
- <a href="https://geekuninstaller.com/">Geek Uninstaller</a>: This is a lightweight and portable uninstaller that can scan and remove all traces of programs from your system. It also supports batch uninstallation, force removal, and export to HTML.
|
12 |
-
- <a href="https://www.wisecleaner.com/wise-program-uninstaller.html">Wise Program Uninstaller</a>: This is a user-friendly and effective uninstaller that can remove programs completely and safely. It also has a repair function that can fix corrupted installations and a rating system that shows how other users rate the programs.
|
13 |
-
|
14 |
-
These are some of the best free alternatives to Revo Uninstaller Pro that you can use to uninstall unwanted programs and optimize your system. They are easy to use, fast, and secure. So, don't waste your time and money on Revo Uninstaller Pro crack Reddit and try these free alternatives instead.
|
15 |
-
|
16 |
-
# How to Use IObit Uninstaller to Remove Programs
|
17 |
-
|
18 |
-
One of the best free alternatives to Revo Uninstaller Pro is IObit Uninstaller. It is a powerful and easy-to-use software that can help you uninstall unwanted programs and clean up your system. Here are the steps to use IObit Uninstaller to remove programs:
|
19 |
-
|
20 |
-
- Step 1: Download and install IObit Uninstaller from <a href="https://www.iobit.com/en/advanceduninstaller.php">here</a>.
|
21 |
-
- Step 2: Launch IObit Uninstaller and select the programs that you want to uninstall from the list. You can also use the search box or the filter options to find the programs quickly.
|
22 |
-
- Step 3: Click on the "Uninstall" button and follow the instructions to remove the programs. You can also choose to create a restore point before uninstalling in case you need to restore your system later.
|
23 |
-
- Step 4: After uninstalling, IObit Uninstaller will scan your system for any leftover files, folders, or registry entries that the programs might have left behind. You can review the results and click on the "Delete" button to remove them completely.
|
24 |
-
- Step 5: You can also use the other tools in IObit Uninstaller to manage your browser extensions, Windows apps, software updates, and more.
|
25 |
-
|
26 |
-
That's it! You have successfully used IObit Uninstaller to remove unwanted programs and optimize your system. You can enjoy a faster and cleaner PC with IObit Uninstaller.</p>
|
27 |
-
<h2>revo uninstaller pro crack reddit</h2><br /><p><b><b>Download File</b> >>> <a href="https://byltly.com/2uKvAF">https://byltly.com/2uKvAF</a></b></p><br /><br /> ddb901b051<br />
|
28 |
-
<br />
|
29 |
-
<br />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/1gistliPinn/ChatGPT4/Examples/Chicken Invaders 4 Multiplayer Patch Download.md
DELETED
@@ -1,7 +0,0 @@
|
|
1 |
-
|
2 |
-
<p>Your review for Chicken Invaders. Your review for Chicken Invaders Thank you for rating! Leave a review. This is embarrassing Try this instead. Some waves have you destroying the chicken invaders who are organized in different formations throughout , while others have you dodging deadly asteroids heading straight for you.</p>
|
3 |
-
<h2>Chicken Invaders 4 Multiplayer Patch Download</h2><br /><p><b><b>Download File</b> ……… <a href="https://imgfil.com/2uy1vA">https://imgfil.com/2uy1vA</a></b></p><br /><br />
|
4 |
-
<p><b>Disclosures:</b> This game was obtained via <b>paid digital download</b> and reviewed on the <b>PC</b>. Approximately <b>80 hours of play</b> was devoted to multiplayer modes, and there is no offline option available.</p>
|
5 |
-
<p>I remember the day of the invasion well. The memories still burn deeply, like spicy chicken wings.<br /><br />They came without warning, squawking menacingly, their ruffled feathers darkening the sun. Invading intergalactic chickens, out to punish humanity for our oppression of their earthly brethren.<br /><br />I instantly knew what had to be done. I dropped my half-eaten chicken burger and jumped in my cockpit. With a greasy finger I set my lasers to "extra crispy" and blasted off to intercept the fowl invaders.<br /><br />It wasn't easy. Squawks, feathers flying, the smell of charred chicken everywhere. Three times they invaded, each time with increasingly devious plans. Three times I managed to push them back whence they came, and secure humanity a few more years as the dominant species of this planet.<br /><br />After their last retreat, I headed for my local Space Burger to bask in the glow of my recent victory. Breathing a sigh of relief, I sat down to enjoy a double chicken-burger with crispy chicken wings on the side.<br /><br />Little did I know that my greatest adventure was yet to come...</p> aaccfb2cb3<br />
|
6 |
-
<br />
|
7 |
-
<br />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/1gistliPinn/ChatGPT4/Examples/Desamuduru Telugu Movie Dialogues Download Movies.md
DELETED
@@ -1,34 +0,0 @@
|
|
1 |
-
|
2 |
-
<h1>Desamuduru: A Romantic Action Entertainer in Telugu</h1>
|
3 |
-
|
4 |
-
<p>If you are looking for a Telugu movie that has a perfect blend of romance, action, comedy and drama, then you should watch Desamuduru. Desamuduru is a 2007 Telugu movie directed by Puri Jagannadh and starring Allu Arjun and Hansika Motwani in the lead roles. The movie was a blockbuster hit and received positive reviews from critics and audiences alike.</p>
|
5 |
-
<h2>desamuduru telugu movie dialogues download movies</h2><br /><p><b><b>Download</b> ->->->-> <a href="https://imgfil.com/2uxZ1z">https://imgfil.com/2uxZ1z</a></b></p><br /><br />
|
6 |
-
|
7 |
-
<p>Desamuduru tells the story of Bala Govind (Allu Arjun), a program director in MAA TV, who is known for his fights for justice. He saves a person from goons and gets into trouble with Tambi Durai (Pradeep Rawat), a notorious arrack smuggler. To escape from his wrath, Bala is sent to Kulu Manali to shoot a travel episode, where he meets Vaishali (Hansika Motwani), a sanyasin. He falls in love with her at first sight, but she is reluctant to reciprocate his feelings. However, with the help of Ramaprabha (Ramaprabha), the head sanyasin of the ashram, they get united.</p>
|
8 |
-
|
9 |
-
<p>But their happiness is short-lived, as Bala finds out that Vaishali is the daughter of Narayana Patwari, who was killed by Tambi Durai along with his wife. Tambi Durai also forced Vaishali to marry his son Murugan (Subbaraju) before their dead bodies. Vaishali managed to escape and reach Kulu Manali. Bala decides to save Vaishali from Tambi Durai's clutches and bring him to justice.</p>
|
10 |
-
|
11 |
-
<p>Desamuduru is a movie that has everything for everyone. It has romance, action, comedy, drama, music and dance. The movie showcases the chemistry between Allu Arjun and Hansika Motwani, who look adorable together. Allu Arjun delivers a power-packed performance as Bala Govind, who is fearless, witty and charming. Hansika Motwani looks beautiful and innocent as Vaishali, who is brave and loyal. Pradeep Rawat plays the role of Tambi Durai with menace and intensity. The supporting cast of Ali, Kovai Sarala, Srinivas Reddy and others provide comic relief and entertainment.</p>
|
12 |
-
<p></p>
|
13 |
-
|
14 |
-
<p>The movie also has some memorable dialogues that are catchy and impactful. Some of them are:</p>
|
15 |
-
|
16 |
-
<ul>
|
17 |
-
<li>"Nenu eppudu chachipotano telidu... Kaani nenu eppudu gelustano telusu" (I don't know when I will die... But I know when I will win)</li>
|
18 |
-
<li>"Nenu simham lanti vadini... Adhi geddam geesukodaniki kaadu... Dammunte gattiga kodithe chaalu" (I am like a lion... It doesn't need to climb a hill... It just needs to roar loudly)</li>
|
19 |
-
<li>"Nuvvu nannu preminchadam lo tappu ledu... Nannu vadilesi velladam lo tappu ledu... Kaani nannu vadilesi vellina tarvata malli nannu preminchadam lo chala pedda tappu" (You are not wrong in loving me... You are not wrong in leaving me... But you are very wrong in loving me again after leaving me)</li>
|
20 |
-
</ul>
|
21 |
-
|
22 |
-
<p>The movie also has some amazing songs composed by Chakri that are melodious and catchy. Some of them are:</p>
|
23 |
-
|
24 |
-
<ul>
|
25 |
-
<li>"Ninne Ninne" - A romantic duet sung by Chakri and Kousalya</li>
|
26 |
-
<li>"Gola Gola" - A peppy dance number sung by Ranjith and Rita</li>
|
27 |
-
<li>"Manasuley" - A soulful song sung by Karthik</li>
|
28 |
-
<li>"Satte Satte" - A fast-paced song sung by Naveen Madhav</li>
|
29 |
-
<li>"Sri Anjaneyam" - A devotional song sung by Shankar Mahadevan</li>
|
30 |
-
</ul>
|
31 |
-
|
32 |
-
<p>Desamuduru is a movie that you can watch with your family and friends and enjoy the entertainment quotient. It is a movie that will make you laugh, cry, cheer and clap. It is a movie that will make you</p> d5da3c52bf<br />
|
33 |
-
<br />
|
34 |
-
<br />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/1pelhydcardo/ChatGPT-prompt-generator/assets/Alias The Game - A Run and Gun Game with a Twist - Download Here.md
DELETED
@@ -1,144 +0,0 @@
|
|
1 |
-
<br />
|
2 |
-
<h1>Alias: The Game - A Stealth Action Adventure Based on the Hit TV Series</h1>
|
3 |
-
<p>If you are a fan of Alias, the popular spy thriller TV series that ran from 2001 to 2006, you might be interested in playing Alias: The Game, a video game adaptation that was released in 2004 for PC, PlayStation 2, and Xbox. In this article, we will review Alias: The Game and tell you everything you need to know about it, from its story and characters, to its gameplay and graphics, to its reception and legacy. Whether you want to relive the adventures of Sydney Bristow, or discover a new stealth action game, read on to find out more.</p>
|
4 |
-
<h2>Introduction</h2>
|
5 |
-
<h3>What is Alias: The Game?</h3>
|
6 |
-
<p>Alias: The Game is a 3D third-person stealth action game developed by Acclaim Studios Cheltenham and published by Acclaim Entertainment. It is based on the TV series Alias, created by J.J. Abrams and starring Jennifer Garner as Sydney Bristow, a CIA agent who works undercover for a secret division called SD-6, which she later discovers is actually an enemy organization. The game follows Sydney as she travels around the world, infiltrates enemy bases, fights against various villains, and uncovers the mysteries of a mysterious device called the Rambaldi artifact.</p>
|
7 |
-
<h2>alias the game download</h2><br /><p><b><b>Download File</b> ✦✦✦ <a href="https://urlin.us/2uSVtG">https://urlin.us/2uSVtG</a></b></p><br /><br />
|
8 |
-
<h3>Who are the main characters and enemies?</h3>
|
9 |
-
<p>The game features many of the main characters from the TV series, both as allies and enemies. You play as Sydney Bristow, voiced by Jennifer Garner, who is assisted by her father Jack Bristow (Victor Garber), her handler Michael Vaughn (Michael Vartan), and her tech support Marshall Flinkman (Kevin Weisman). You also encounter other characters from the show, such as Dixon (Carl Lumbly), Kendall (Terry O'Quinn), Weiss (Greg Grunberg), Francie (Merrin Dungey), Will (Bradley Cooper), and Sark (David Anders).</p>
|
10 |
-
<p>The game also features some of the most notorious villains from the TV series, such as Arvin Sloane (Ron Rifkin), the leader of SD-6 and Sydney's former mentor; Anna Espinosa (Gina Torres), Sydney's rival agent who works for K-Directorate; and Julian Sark (David Anders), a mercenary who works for various factions. You will have to face them in various missions, as well as other enemies such as guards, snipers, hackers, and bosses.</p>
|
11 |
-
<h3>What is the plot of the game?</h3>
|
12 |
-
<p>The plot of the game is set between episodes 19 and 20 of season 2 of the TV series. It revolves around Sydney's quest to find and retrieve a Rambaldi artifact, a mysterious device that was created by a 15th-century prophet and inventor named Milo Rambaldi. The artifact is believed to have immense power and secrets, and is sought after by various factions, such as SD-6, K-Directorate, The Covenant, and The Alliance. Sydney has to travel to different locations around the world, such as Monte Carlo, Saudi Arabia, Romania, Hong Kong, Rio de Janeiro, and Russia, to find clues and pieces of the artifact, while also dealing with her personal life and relationships.</p>
|
13 |
-
<h <h2>Gameplay</h2>
|
14 |
-
<h3>How does the game work?</h3>
|
15 |
-
<p>The game is divided into 10 missions, each with a different objective and location. The missions are linear and follow the plot of the game, but you can also explore the environments and find hidden items and secrets. You can also replay the missions to improve your score and unlock bonus features, such as concept art, videos, and cheats.</p>
|
16 |
-
<p>The game is mainly focused on stealth, as you have to avoid detection by enemies and cameras, use disguises and gadgets, and perform silent takedowns. You can also use various weapons, such as pistols, rifles, grenades, and crossbows, but you have limited ammo and using them will alert the enemies. You can also engage in hand-to-hand combat, using punches, kicks, and combos, but you have to be careful not to get overwhelmed by multiple enemies.</p>
|
17 |
-
<p>The game also has some puzzle and hacking elements, as you have to solve riddles, crack codes, bypass security systems, and use your computer skills. You can also use your phone to contact your allies and get information and tips. The game has a simple interface that shows your health, ammo, gadgets, objectives, and map.</p>
|
18 |
-
<p>alias pc game free download<br />
|
19 |
-
alias flash game online<br />
|
20 |
-
alias board game app<br />
|
21 |
-
alias game download full version<br />
|
22 |
-
alias run and gun game<br />
|
23 |
-
alias game official website<br />
|
24 |
-
alias game for android<br />
|
25 |
-
alias game tactics<br />
|
26 |
-
alias game language options<br />
|
27 |
-
alias game cybernetic soldier<br />
|
28 |
-
alias game internet archive<br />
|
29 |
-
alias game new words<br />
|
30 |
-
alias game finland<br />
|
31 |
-
alias game 1989<br />
|
32 |
-
alias game robots<br />
|
33 |
-
alias game video game<br />
|
34 |
-
alias game fun and polished<br />
|
35 |
-
alias game simple plot<br />
|
36 |
-
alias game cdrom<br />
|
37 |
-
alias game english version<br />
|
38 |
-
alias game mobile game<br />
|
39 |
-
alias game partnership with dictionary<br />
|
40 |
-
alias game sold in 40 countries<br />
|
41 |
-
alias pc eng full version<br />
|
42 |
-
alias 1 free online games<br />
|
43 |
-
official alias board games<br />
|
44 |
-
free download borrow and streaming<br />
|
45 |
-
internet archive html5 uploader<br />
|
46 |
-
make sure for full version old pc game<br />
|
47 |
-
cybernetic soldier who has to fight a bunch of robots<br />
|
48 |
-
the fun starts the minute you open the box<br />
|
49 |
-
download a free app check out this awesome alias one-player mobile game<br />
|
50 |
-
new words annually new words keep alias games fresh local and up to date<br />
|
51 |
-
developed and made in finland by tactic games entry to market in 1989<br />
|
52 |
-
a.l.i.a.s. is a run and gun game where you play as a cybernetic soldier<br />
|
53 |
-
the plot is obviously simple what set this game apart from other flash games was how polished and fun it was <br />
|
54 |
-
it was one of the few flash games that felt close to playing a real video game <br />
|
55 |
-
korea superconducting tokamak advanced research experiment korea institute of fusion energy <br />
|
56 |
-
scientists in south korea have managed to sustain a nuclear fusion reaction running at temperatures in excess of 100 million°C for 30 seconds for the first time <br />
|
57 |
-
it's being refered to as the ‘holy grail’ fusion experiment to create a mini sun as it achieved temperatures nearly seven times hotter than the core of the sun</p>
|
58 |
-
<h3>What are the main features and mechanics of the game?</h3>
|
59 |
-
<p>The game has several features and mechanics that make it unique and fun to play. Some of them are:</p>
|
60 |
-
<ul>
|
61 |
-
<li><b>Disguises:</b> You can use different outfits and accessories to blend in with the environment and fool the enemies. For example, you can wear a waitress uniform in a casino, or a lab coat in a research facility. You can also change your appearance by using wigs, glasses, hats, and makeup. However, you have to be careful not to act suspiciously or get too close to the enemies, as they might recognize you.</li>
|
62 |
-
<li><b>Gadgets:</b> You can use various gadgets to help you in your missions. For example, you can use a lockpick to open doors and safes, a camera to take photos of evidence, a laser cutter to cut through wires and fences, a bug to listen to conversations, a tracker to locate enemies or items, and a tranquilizer gun to knock out enemies. You can also use your phone to scan fingerprints, access databases, send messages, and more.</li>
|
63 |
-
<li><b>Mini-games:</b> The game has several mini-games that challenge your skills and reflexes. For example, you have to play a card game in a casino, dance in a nightclub, race in a car chase, shoot targets in a shooting range, and more. The mini-games are optional but they can give you extra points and rewards.</li>
|
64 |
-
<li><b>Multiplayer mode:</b> The game has a multiplayer mode that allows you to play with up to four players on the same console or online. You can choose from different modes, such as co-op, deathmatch, capture the flag, and more. You can also customize your character's appearance and abilities.</li>
|
65 |
-
</ul>
|
66 |
-
<h3>How does the game compare to other stealth action games?</h3>
|
67 |
-
<p>The game is similar to other stealth action games such as Metal Gear Solid, Splinter Cell, Hitman, and Thief. It has the same elements of sneaking around, using gadgets and weapons, avoiding or neutralizing enemies, and completing objectives. However, it also has some differences that make it stand out from the crowd. Some of them are:</p>
|
68 |
-
<ul>
|
69 |
-
<li><b>TV show adaptation:</b> The game is based on a popular TV show that has a loyal fan base and a rich lore. It follows the story of the show closely and features many of the same characters and locations. It also has the same style and tone of the show, with a mix of action, drama, humor, romance, and mystery. It is like playing an interactive episode of Alias.</li>
|
70 |
-
<li><b>Female protagonist:</b> The game has a female protagonist who is strong, smart, brave, and beautiful. She is not just a damsel in distress or a sidekick; she is the main hero who saves the day. She is also not sexualized or objectified; she is respected and admired by her allies and enemies alike. She is a role model for female gamers and a refreshing change from the usual male-dominated genre.</li>
|
71 |
-
<li><b>Variety:</b> The game has a lot of variety in terms of gameplay, environments, and challenges. You can play in different settings, such as casinos, labs, warehouses, mansions, and more. You can also use different strategies, such as stealth, combat, hacking, or disguise. You can also experience different scenarios, such as infiltration, extraction, sabotage, rescue, and more. The game never gets boring or repetitive.</li>
|
72 |
-
</ul>
|
73 |
-
<h2>Graphics and Sound</h2>
|
74 |
-
<h3>How does the game look and sound?</h3>
|
75 |
-
<p>The game has decent graphics and sound for its time and platform. The game uses the RenderWare engine, which allows for realistic lighting, shadows, textures, and animations. The game also has a cinematic camera that follows the action and creates a dynamic and immersive experience. The game also has a lot of detail and variety in its environments and characters, which makes the game more appealing and believable.</p>
|
76 |
-
<p>The game also has a great sound design that enhances the gameplay and atmosphere. The game has a catchy and suspenseful soundtrack that matches the mood and tone of the game. The game also has realistic sound effects that make the game more immersive and exciting. The game also has excellent voice acting that brings the characters to life and adds personality and emotion to the game.</p>
|
77 |
-
<h3>What are the strengths and weaknesses of the game's presentation?</h3>
|
78 |
-
<p>The game's presentation has some strengths and weaknesses that affect the overall quality and enjoyment of the game. Some of them are:</p>
|
79 |
-
<ul>
|
80 |
-
<li><b>Strengths:</b>
|
81 |
-
<ul>
|
82 |
-
<li>The game has a faithful adaptation of the TV show's style and story, which makes the game more appealing and satisfying for fans of the show.</li>
|
83 |
-
<li>The game has a female protagonist who is well-written and well-acted, which makes the game more empowering and inspiring for female gamers.</li>
|
84 |
-
<li>The game has a lot of variety and creativity in its graphics and sound, which makes the game more diverse and fun to play.</li>
|
85 |
-
</ul>
|
86 |
-
</li>
|
87 |
-
<li><b>Weaknesses:</b>
|
88 |
-
<ul>
|
89 |
-
<li>The game has some technical issues and glitches that affect the performance and stability of the game, such as frame rate drops, loading times, bugs, and crashes.</li>
|
90 |
-
<li>The game has some outdated and low-quality graphics and sound that affect the realism and immersion of the game, such as pixelated textures, low-poly models, bland colors, and poor lip-syncing.</li>
|
91 |
-
<li>The game has some inconsistent and unrealistic graphics and sound that affect the logic and coherence of the game, such as clipping issues, invisible walls, floating objects, and mismatched sounds.</li>
|
92 |
-
</ul>
|
93 |
-
</li>
|
94 |
-
</ul>
|
95 |
-
<h3>How does the game use the voice talents of the show's cast?</h3>
|
96 |
-
<p>The game uses the voice talents of most of the show's main cast members, such as Jennifer Garner, Victor Garber, Michael Vartan, Kevin Weisman, Ron Rifkin, David Anders, Gina Torres, Carl Lumbly, and Terry O'Quinn. They reprise their roles and deliver their lines with the same quality and emotion as they do in the show. They also add some extra dialogue and banter that are not in the show, which makes the game more original and humorous. The game also uses some of the show's guest stars, such as Quentin Tarantino, Vivica A. Fox, and Ricky Gervais, who play minor roles or cameo appearances in the game. The game also has some new voice actors who play some of the new characters or enemies in the game, such as Sydney's new partner Kelly Peyton (Rachel Nichols), or the Russian mobster Yuri Komarov (Andrei Zayats).</p>
|
97 |
-
<p>The game uses the voice talents of the show's cast very well, as they enhance the authenticity and appeal of the game. They make the game feel like an extension of the show, and they make the characters more relatable and memorable. They also add some humor and personality to the game, which makes the game more enjoyable and entertaining.</p>
|
98 |
-
<h2>Reception and Legacy</h2>
|
99 |
-
<h3>How did the game perform commercially and critically?</h3>
|
100 |
-
<p>The game did not perform very well commercially or critically, as it was overshadowed by other more popular and successful games in the genre or based on TV shows. The game sold poorly, as it only sold about 100,000 copies worldwide, according to VGChartz. The game also received mixed reviews from critics and players, as it had an average score of 60% on Metacritic and 6.1 on IGN. The game was praised for its faithful adaptation of the show's style and story, its female protagonist, its variety and creativity, and its voice acting. However, it was criticized for its technical issues and glitches, its outdated and low-quality graphics and sound, its inconsistent and unrealistic presentation, and its linear and repetitive gameplay.</p>
|
101 |
-
<h3>What are the pros and cons of the game according to reviewers and players?</h3>
|
102 |
-
<p>The game has some pros and cons that affect the overall satisfaction and enjoyment of the game. Some of them are:</p>
|
103 |
-
<ul>
|
104 |
-
<li><b>Pros:</b>
|
105 |
-
<ul>
|
106 |
-
<li>The game is a faithful adaptation of the TV show's style and story, which makes the game more appealing and satisfying for fans of the show.</li>
|
107 |
-
<li>The game has a female protagonist who is well-written and well-acted, which makes the game more empowering and inspiring for female gamers.</li>
|
108 |
-
<li>The game has a lot of variety and creativity in its gameplay, environments, and challenges, which makes the game more diverse and fun to play.</li>
|
109 |
-
<li>The game has excellent voice acting that brings the characters to life and adds personality and emotion to the game.</li>
|
110 |
-
</ul>
|
111 |
-
</li>
|
112 |
-
<li><b>Cons:</b>
|
113 |
-
<ul>
|
114 |
-
<li>The game has technical issues and glitches that affect the performance and stability of the game, such as frame rate drops, loading times, bugs, and crashes.</li>
|
115 |
-
<li>The game has outdated and low-quality graphics and sound that affect the realism and immersion of the game, such as pixelated textures, low-poly models, bland colors, and poor lip-syncing.</li>
|
116 |
-
<li>The game has inconsistent and unrealistic presentation that affect the logic and coherence of the game, such as clipping issues, invisible walls, floating objects, and mismatched sounds.</li>
|
117 |
-
<li>The game has linear and repetitive gameplay that affect the challenge and excitement of the game, such as predictable enemies, easy puzzles, simple combat, and limited choices.</li>
|
118 |
-
</ul>
|
119 |
-
</li>
|
120 |
-
</ul>
|
121 |
-
<h3>How did the game influence other games in the genre or based on TV shows?</h3>
|
122 |
-
<p>The game did not have much influence on other games in the genre or based on TV shows, as it was not very popular or successful. However, it did have some positive aspects that could inspire other games to improve or innovate. For example, the game showed that it is possible to create a faithful and satisfying adaptation of a TV show's style and story, with the involvement of the show's cast and crew. The game also showed that it is possible to create a female protagonist who is strong, smart, brave, and beautiful, without being sexualized or objectified. The game also showed that it is possible to create a lot of variety and creativity in the gameplay, environments, and challenges, with the use of disguises, gadgets, mini-games, and multiplayer mode.</p>
|
123 |
-
<h2>Conclusion</h2>
|
124 |
-
<h4>Summary of the main points</h4>
|
125 |
-
<p>In conclusion, Alias: The Game is a stealth action game based on the TV series Alias, starring Jennifer Garner as Sydney Bristow. The game follows Sydney as she travels around the world, infiltrates enemy bases, fights against various villains, and uncovers the mysteries of a Rambaldi artifact. The game has some strengths and weaknesses in its presentation and gameplay. The game is praised for its faithful adaptation of the show's style and story, its female protagonist, its variety and creativity, and its voice acting. However, the game is criticized for its technical issues and glitches, its outdated and low-quality graphics and sound, its inconsistent and unrealistic presentation, and its linear and repetitive gameplay. The game did not perform well commercially or critically, and it did not have much influence on other games in the genre or based on TV shows. However, it did have some positive aspects that could inspire other games to improve or innovate.</p>
|
126 |
-
<h4>Recommendation and rating of the game</h4>
|
127 |
-
<p>We would recommend Alias: The Game to fans of the TV series, as they would enjoy the game's faithful adaptation of the show's style and story, and the involvement of the show's cast and crew. We would also recommend the game to female gamers, as they would appreciate the game's female protagonist, who is strong, smart, brave, and beautiful, without being sexualized or objectified. We would also recommend the game to gamers who like stealth action games, as they would find the game's variety and creativity in its gameplay, environments, and challenges, with the use of disguises, gadgets, mini-games, and multiplayer mode.</p>
|
128 |
-
<p>We would not recommend Alias: The Game to gamers who are looking for a high-quality and polished game, as they would be disappointed by the game's technical issues and glitches, its outdated and low-quality graphics and sound, its inconsistent and unrealistic presentation, and its linear and repetitive gameplay. We would also not recommend the game to gamers who are not familiar with or interested in the TV series, as they would not understand or appreciate the game's story and characters.</p>
|
129 |
-
<p>We would rate Alias: The Game 3 out of 5 stars, as it is a decent but flawed game that has some strengths and weaknesses. It is a good game for fans of the TV series, but a mediocre game for everyone else.</p>
|
130 |
-
<h2>FAQs</h2>
|
131 |
-
<ul>
|
132 |
-
<li><b>Q: How long is Alias: The Game?</b></li>
|
133 |
-
<li><b>A: Alias: The Game is about 10 hours long, depending on your skill level and play style. You can also replay the missions to improve your score and unlock bonus features.</b></li>
|
134 |
-
<li><b>Q: Is Alias: The Game canon to the TV series?</b></li>
|
135 |
-
<li><b>A: Alias: The Game is not canon to the TV series, as it has some inconsistencies and contradictions with the show's timeline and events. However, it is considered a semi-official spin-off that expands on the show's lore and characters.</b></li>
|
136 |
-
<li><b>Q: Is Alias: The Game available for modern platforms?</b></li>
|
137 |
-
<li><b>A: Alias: The Game is not available for modern platforms, as it was only released for PC, PlayStation 2, and Xbox in 2004. However, you can play the game on an emulator or a backward-compatible console if you have a copy of the game.</b></li>
|
138 |
-
<li><b>Q: Is Alias: The Game suitable for children?</b></li>
|
139 |
-
<li><b>A: Alias: The Game is not suitable for children, as it has some violence, blood, language, and suggestive themes that are not appropriate for young audiences. The game is rated T for Teen by ESRB.</b></li>
|
140 |
-
<li><b>Q: Is Alias: The Game worth playing?</b></li>
|
141 |
-
<li><b>A: Alias: The Game is worth playing if you are a fan of the TV series, a female gamer, or a stealth action gamer who likes variety and creativity. However, if you are looking for a high-quality and polished game, or if you are not familiar with or interested in the TV series, you might want to skip this game.</b></li>
|
142 |
-
</ul></p> 197e85843d<br />
|
143 |
-
<br />
|
144 |
-
<br />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/1pelhydcardo/ChatGPT-prompt-generator/assets/Download AetherSX2 Hack and Enjoy PS2 Emulation with Enhanced Graphics and Performance.md
DELETED
@@ -1,107 +0,0 @@
|
|
1 |
-
|
2 |
-
<h1>How to Download AetherSX2 Hack: A Guide for PS2 Emulation on Android</h1>
|
3 |
-
<p>Do you miss playing your favorite PS2 games on your Android device? Do you want to enjoy them with better graphics, faster speed, and more options? If so, you need to try AetherSX2, the best PS2 emulator for Android. And if you want to take your gaming experience to the next level, you need to download AetherSX2 hack, a modded version of the emulator that allows you to use cheats, 60fps patches, and more. In this article, we will show you how to download and install AetherSX2 hack, and how to use it to enhance your PS2 emulation on Android.</p>
|
4 |
-
<h2>What is AetherSX2 and why do you need a hack?</h2>
|
5 |
-
<p>AetherSX2 is a free and open-source PS2 emulator for Android that is based on the PCSX2 emulator for PC. It can run most PS2 games at full speed, with custom resolutions, save states, multiple control schemes, and more. It is easily the best PS2 emulator on the platform, as it offers better performance and compatibility than other alternatives.</p>
|
6 |
-
<h2>download aethersx2 hack</h2><br /><p><b><b>Download</b> > <a href="https://urlin.us/2uSS4Y">https://urlin.us/2uSS4Y</a></b></p><br /><br />
|
7 |
-
<p>However, AetherSX2 is not perfect. Some games may have glitches, slowdowns, or compatibility issues. Some features may not work as expected, such as widescreen mode or internal resolution scaling. And some users may not like the ads that were added in March 2023. That's why you may want to download AetherSX2 hack, a modded version of the emulator that removes the ads, enables cheats, 60fps patches, and more. With AetherSX2 hack, you can enjoy your PS2 games with more options and flexibility.</p>
|
8 |
-
<h2>How to download and install AetherSX2 hack</h2>
|
9 |
-
<p>To download and install AetherSX2 hack, you will need a few things:</p>
|
10 |
-
<p>How to use cheats in AetherSX2 PS2 emulator on Android<br />
|
11 |
-
AetherSX2 PS2 emulator Action Replay MAX codes<br />
|
12 |
-
AetherSX2 PS2 emulator Code Breaker codes<br />
|
13 |
-
AetherSX2 PS2 emulator 60fps patches<br />
|
14 |
-
AetherSX2 PS2 emulator performance hacks<br />
|
15 |
-
AetherSX2 PS2 emulator disable bloom and motion blur<br />
|
16 |
-
AetherSX2 PS2 emulator god hand cheats<br />
|
17 |
-
AetherSX2 PS2 emulator god hand unlimited gameplay<br />
|
18 |
-
AetherSX2 PS2 emulator texture download link<br />
|
19 |
-
AetherSX2 PS2 emulator patch code link<br />
|
20 |
-
AetherSX2 PS2 emulator burnout 3 cheats<br />
|
21 |
-
AetherSX2 PS2 emulator burnout 3 100% speed<br />
|
22 |
-
AetherSX2 PS2 emulator burnout 3 3x resolution<br />
|
23 |
-
AetherSX2 PS2 emulator YouTube tutorial<br />
|
24 |
-
AetherSX2 PS2 emulator Reddit discussion<br />
|
25 |
-
AetherSX2 PS2 emulator best settings<br />
|
26 |
-
AetherSX2 PS2 emulator compatible games list<br />
|
27 |
-
AetherSX2 PS2 emulator latest version download<br />
|
28 |
-
AetherSX2 PS2 emulator APK download<br />
|
29 |
-
AetherSX2 PS2 emulator modded APK download<br />
|
30 |
-
AetherSX2 PS2 emulator premium APK download<br />
|
31 |
-
AetherSX2 PS2 emulator cracked APK download<br />
|
32 |
-
AetherSX2 PS2 emulator no ads APK download<br />
|
33 |
-
AetherSX2 PS2 emulator free download for Android<br />
|
34 |
-
AetherSX2 PS2 emulator free download for PC<br />
|
35 |
-
AetherSX2 PS2 emulator free download for iOS<br />
|
36 |
-
AetherSX2 PS2 emulator free download for Mac<br />
|
37 |
-
AetherSX2 PS2 emulator free download for Linux<br />
|
38 |
-
AetherSX2 PS2 emulator free download for Windows 10<br />
|
39 |
-
AetherSX2 PS2 emulator free download for Windows 7<br />
|
40 |
-
AetherSX2 PS2 emulator free download for Windows XP<br />
|
41 |
-
AetherSX2 PS2 emulator free download for Chromebook<br />
|
42 |
-
AetherSX2 PS2 emulator free download for Firestick<br />
|
43 |
-
AetherSX2 PS2 emulator free download for Smart TV<br />
|
44 |
-
AetherSX2 PS2 emulator free download for Raspberry Pi<br />
|
45 |
-
AetherSX2 PS2 emulator online play<br />
|
46 |
-
AetherSX2 PS2 emulator multiplayer mode<br />
|
47 |
-
AetherSX2 PS2 emulator LAN play<br />
|
48 |
-
AetherSX2 PS2 emulator Bluetooth controller support<br />
|
49 |
-
AetherSX2 PS2 emulator touch screen controller support<br />
|
50 |
-
AetherSX2 PS2 emulator save state feature<br />
|
51 |
-
AetherSX</p>
|
52 |
-
<ul>
|
53 |
-
<li>A 64-bit Android device with a Snapdragon 845-level processor or better</li>
|
54 |
-
<li>A BIOS file from a real PS2 console</li>
|
55 |
-
<li>PS2 games in ISO format</li>
|
56 |
-
<li>A file manager app</li>
|
57 |
-
<li>A patch code or a cheat file for the game you want to hack</li>
|
58 |
-
</ul>
|
59 |
-
<p>Here are the steps to follow:</p>
|
60 |
-
<ol>
|
61 |
-
<li>Download the latest version of AetherSX2 hack from this link: . This is an ad-free version of the emulator that has been modified by fans.</li>
|
62 |
-
<li>Install the APK file on your device. You may need to enable unknown sources in your settings.</li>
|
63 |
-
<li>Copy the BIOS file from your PS2 console to your device's storage. You can use a tool like BIOS Dumper to extract it from your console.</li>
|
64 |
-
<li>Launch AetherSX2 hack and select BIOS from the menu. Locate and select the BIOS file you copied.</li>
|
65 |
-
<li>Copy your PS2 games in ISO format to your device's storage. You can use a tool like ImgBurn to rip them from your discs.</li>
|
66 |
-
<li>Launch AetherSX2 hack and select Games from the menu. Locate and select the game you want to play.</li>
|
67 |
-
<li>To apply the hack, you will need either a patch code or a cheat file for the game. You can find patch codes for various games here. You can find cheat files for various games here or here[^6 ^]^].</li>
|
68 |
-
<li>If you have a patch code, you will need to convert it to a cheat file using a tool like OmniConvert. You can follow this guide to learn how to do it.</li>
|
69 |
-
<li>Copy the cheat file to your device's storage, in the folder named cheats_ws under the AetherSX2 folder.</li>
|
70 |
-
<li>Launch AetherSX2 hack and select Settings from the menu. Enable cheats and widescreen patches under System.</li>
|
71 |
-
<li>Launch the game and enjoy the hack. You can also access the cheat menu by pressing the back button on your device.</li>
|
72 |
-
</ol>
|
73 |
-
<h2>How to use AetherSX2 hack to enhance your gaming experience</h2>
|
74 |
-
<p>Now that you have downloaded and installed AetherSX2 hack, you can use it to enhance your gaming experience on Android. Here are some tips and tricks to optimize the performance and compatibility of the emulator, and some examples of games that work well with the hack and how to use them.</p>
|
75 |
-
<h3>Tips and tricks to optimize the performance and compatibility of AetherSX2 hack</h3>
|
76 |
-
<ul>
|
77 |
-
<li>Adjust the video settings according to your device's capabilities. You can change the resolution, filtering, rendering mode, and more under Graphics.</li>
|
78 |
-
<li>Use frameskip to improve the speed of some games. You can enable it under System and set the number of frames to skip.</li>
|
79 |
-
<li>Use speed hacks to boost the performance of some games. You can enable them under System and tweak the options such as EE cycle rate, VU cycle stealing, and mVU flag hack.</li>
|
80 |
-
<li>Use game fixes to solve some compatibility issues. You can enable them under System and select the fixes that apply to your game, such as FPU negative div hack, VU add/sub hack, or IPU wait hack.</li>
|
81 |
-
<li>Use custom controls to suit your preferences. You can customize the layout, size, opacity, and vibration of the on-screen buttons under Controls.</li>
|
82 |
-
<li>Use external controllers to improve your comfort and accuracy. You can connect a Bluetooth or USB controller to your device and map the buttons under Controls.</li>
|
83 |
-
</ul>
|
84 |
-
<h3>Examples of games that work well with AetherSX2 hack and how to use them</h3>
|
85 |
-
<table>
|
86 |
-
<tr><th>Game</th><th>Hack</th><th>Effect</th></tr>
|
87 |
-
<tr><td>God of War II</td><td>Cheat file with 60fps patch</td><td>Doubles the frame rate from 30fps to 60fps, making the game smoother and more responsive</td></tr>
|
88 |
-
<tr><td>Shadow of the Colossus</td><td>Cheat file with 60fps patch</td><td>Doubles the frame rate from 30fps to 60fps, making the game smoother and more responsive</td></tr>
|
89 |
-
<tr><td>Final Fantasy XII</td><td>Cheat file with widescreen patch</td><td>Expands the aspect ratio from 4:3 to 16:9, making the game fill the screen without stretching or cropping</td></tr>
|
90 |
-
<tr><td>Metal Gear Solid 3: Snake Eater</td><td>Cheat file with pressure-sensitive buttons</td><td>Enables pressure-sensitive buttons for actions such as aiming, shooting, or choking, making the game more immersive and realistic</td></tr>
|
91 |
-
<tr><td>Kingdom Hearts II Final Mix</td><td>Cheat file with English patch</td><td>Translates the game from Japanese to English, making it accessible for non-Japanese speakers</td></tr>
|
92 |
-
</table>
|
93 |
-
<h2>Conclusion</h2>
|
94 |
-
<p>AetherSX2 is a great PS2 emulator for Android that lets you play your favorite PS2 games on your device. But if you want to make it even better, you should download AetherSX2 hack, a modded version of the emulator that removes ads, enables cheats, 60fps patches, and more. With AetherSX2 hack, you can enjoy your PS2 games with more options and flexibility. Just follow our guide on how to download and install AetherSX2 hack, and how to use it to enhance your gaming experience. Happy gaming!</p>
|
95 |
-
<h2>FAQs</h2>
|
96 |
-
<h4>Q: Is AetherSX2 hack safe and legal?</h4>
|
97 |
-
<p>A: AetherSX2 hack is safe as long as you download it from a trusted source. It does not contain any malware or viruses. However, AetherSX2 hack may not be legal in some regions or countries, as it may violate the terms of service of AetherSX2 or infringe on the rights of PS2 game developers or publishers. Use it at your own risk.</ A: AetherSX2 hack is safe as long as you download it from a trusted source. It does not contain any malware or viruses. However, AetherSX2 hack may not be legal in some regions or countries, as it may violate the terms of service of AetherSX2 or infringe on the rights of PS2 game developers or publishers. Use it at your own risk.</p>
|
98 |
-
<h4>Q: How can I update AetherSX2 hack?</h4>
|
99 |
-
<p>A: AetherSX2 hack is updated regularly by the modders who created it. You can check their website or social media for the latest version. You can also use the built-in updater in the emulator to download and install the updates automatically.</p>
|
100 |
-
<h4>Q: How can I support AetherSX2 and AetherSX2 hack?</h4>
|
101 |
-
<p>A: AetherSX2 is a free and open-source project that relies on donations and contributions from the community. You can support AetherSX2 by donating to their Patreon or PayPal, or by contributing to their GitHub or Discord. You can also support AetherSX2 hack by following and thanking the modders who created it, or by sharing it with your friends.</p>
|
102 |
-
<h4>Q: What are some alternatives to AetherSX2 hack?</h4>
|
103 |
-
<p>A: If you are looking for other PS2 emulators for Android, you can try DamonPS2, Play!, or PTWOE. However, none of them are as good as AetherSX2 in terms of performance and compatibility. If you are looking for other ways to hack your PS2 games, you can try using a PS2 cheat device such as CodeBreaker, Action Replay, or GameShark. However, you will need a real PS2 console and a compatible disc to use them.</p>
|
104 |
-
<h4>Q: Where can I find more information about AetherSX2 hack?</h4>
|
105 |
-
<p>A: You can find more information about AetherSX2 hack on their website, their YouTube channel, their Reddit community, or their Telegram group. You can also ask questions, report bugs, request features, or share your feedback on these platforms.</p> 197e85843d<br />
|
106 |
-
<br />
|
107 |
-
<br />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/1phancelerku/anime-remove-background/Barbie Dreamhouse Adventures APK OBB A Game for Girls Who Love Fashion Cooking and More.md
DELETED
@@ -1,108 +0,0 @@
|
|
1 |
-
<br />
|
2 |
-
<table>
|
3 |
-
<tr>
|
4 |
-
<td>
|
5 |
-
<h1>Barbie Dreamhouse Adventures APK OBB: A Fun Game for Girls</h1>
|
6 |
-
<p>If you love Barbie and her friends, you will love Barbie Dreamhouse Adventures APK OBB. This is a fun game for girls that lets you create your own Barbie DreamHouse experience. You can join Barbie and her friends in various activities, such as baking, cooking, dancing, makeovers, home design, fashion, nail salon, hair salon, mini games, pool parties, beach fun, and more. You can also explore Malibu with Barbie's pink convertible or dress up in fashion-forward looks. Plus, you can follow Barbie and her friends on exciting adventures in different scenarios, such as becoming a princess, a mermaid, or going camping.</p>
|
7 |
-
<p>Barbie Dreamhouse Adventures APK OBB is a game that you can download and install on your Android device. It is an XAPK file that contains both APK (application) and OBB (data) files. You will need a special app to install it properly. In this article, we will show you how to download and install Barbie Dreamhouse Adventures APK OBB on your Android device. We will also tell you what you can do in the game and why you should play it. So, let's get started!</p>
|
8 |
-
<h2>barbie dreamhouse adventures apk obb</h2><br /><p><b><b>DOWNLOAD</b> ✏ ✏ ✏ <a href="https://jinyurl.com/2uNNd1">https://jinyurl.com/2uNNd1</a></b></p><br /><br />
|
9 |
-
<h2>How to Download and Install Barbie Dreamhouse Adventures APK OBB</h2>
|
10 |
-
<p>To download and install Barbie Dreamhouse Adventures APK OBB, you will need to follow these steps:</p>
|
11 |
-
<ol>
|
12 |
-
<li>Download the XAPK file from APKCombo or other trusted sources. The file size is about 1.1 GB, so make sure you have enough space on your device.</li>
|
13 |
-
<li>Install APKCombo Installer app on your Android device. This app will help you install XAPK files easily and safely. You can download it from Google Play Store or APKCombo website.</li>
|
14 |
-
<li>Open the APKCombo Installer app and tap Install.</li>
|
15 |
-
<li>Select Barbie Dreamhouse Adventures.xapk and tap OK.</li>
|
16 |
-
<li>Follow the steps on screen to complete the installation. The app will extract the APK and OBB files and install them on your device.</li>
|
17 |
-
<li>Once the installation is done, you can launch the game and enjoy it.</li>
|
18 |
-
</ol>
|
19 |
-
<p>Note: If you have any problems with the installation, you can contact APKCombo support team for help.</p>
|
20 |
-
<h2>What Can You Do in Barbie Dreamhouse Adventures APK OBB?</h2>
|
21 |
-
<p>Barbie Dreamhouse Adventures APK OBB is a game that lets you create your own Barbie DreamHouse experience. You can join Barbie and her friends in various activities and mini games, such as:</p>
|
22 |
-
<h3>Home Design and Makeovers</h3>
|
23 |
-
<p>You can design every room in your DreamHouse with wallpapers, furniture, decorations, and more. You can also give your DreamHouse a makeover with new themes, such as tropical, glam, or cozy. You can even change the exterior of your DreamHouse with different colors and styles.</p>
|
24 |
-
<h3>Cooking and Baking</h3>
|
25 |
-
<p>You can bake delicious recipes with Skipper in the kitchen and share them on BarbieGram. You can also cook different dishes for your friends and family, such as pizza, pasta, salad, cake, etc. You can also decorate your food with toppings and sprinkles.</p>
|
26 |
-
<h3>Dress Up and Fashion</h3>
|
27 |
-
<p>You can dress up in beautiful outfits and accessories from Barbie's closet. You can also get fashion advice from Nikki, who will help you choose the best look for any occasion. You can also create your own outfits by mixing and matching different pieces of clothing.</p>
|
28 |
-
<p>barbie dreamhouse adventures apk obb download<br />
|
29 |
-
barbie dreamhouse adventures apk obb latest version<br />
|
30 |
-
barbie dreamhouse adventures apk obb mod<br />
|
31 |
-
barbie dreamhouse adventures apk obb free<br />
|
32 |
-
barbie dreamhouse adventures apk obb offline<br />
|
33 |
-
barbie dreamhouse adventures apk obb android<br />
|
34 |
-
barbie dreamhouse adventures apk obb 2023<br />
|
35 |
-
barbie dreamhouse adventures apk obb unlimited money<br />
|
36 |
-
barbie dreamhouse adventures apk obb full unlocked<br />
|
37 |
-
barbie dreamhouse adventures apk obb update<br />
|
38 |
-
barbie dreamhouse adventures apk obb install<br />
|
39 |
-
barbie dreamhouse adventures apk obb game<br />
|
40 |
-
barbie dreamhouse adventures apk obb hack<br />
|
41 |
-
barbie dreamhouse adventures apk obb online<br />
|
42 |
-
barbie dreamhouse adventures apk obb pc<br />
|
43 |
-
barbie dreamhouse adventures apk obb xapk<br />
|
44 |
-
barbie dreamhouse adventures apk obb data<br />
|
45 |
-
barbie dreamhouse adventures apk obb file<br />
|
46 |
-
barbie dreamhouse adventures apk obb revdl<br />
|
47 |
-
barbie dreamhouse adventures apk obb rexdl<br />
|
48 |
-
barbie dreamhouse adventures apk obb pure<br />
|
49 |
-
barbie dreamhouse adventures apk obb apkpure<br />
|
50 |
-
barbie dreamhouse adventures apk obb apkmirror<br />
|
51 |
-
barbie dreamhouse adventures apk obb apknite<br />
|
52 |
-
barbie dreamhouse adventures apk obb apkmody<br />
|
53 |
-
barbie dreamhouse adventures apk obb happymod<br />
|
54 |
-
barbie dreamhouse adventures apk obb an1<br />
|
55 |
-
barbie dreamhouse adventures apk obb andropalace<br />
|
56 |
-
barbie dreamhouse adventures apk obb android 1<br />
|
57 |
-
barbie dreamhouse adventures apk obb android republic<br />
|
58 |
-
barbie dreamhouse adventures apk obb uptodown<br />
|
59 |
-
barbie dreamhouse adventures apk obb mob.org<br />
|
60 |
-
barbie dreamhouse adventures apk obb mobpark<br />
|
61 |
-
barbie dreamhouse adventures apk obb panda helper<br />
|
62 |
-
barbie dreamhouse adventures apk obb panda vpn<br />
|
63 |
-
barbie dreamhouse adventures apk obb ac market<br />
|
64 |
-
barbie dreamhouse adventures apk obb blackmod<br />
|
65 |
-
barbie dreamhouse adventures apk obb platinmods<br />
|
66 |
-
barbie dreamhouse adventures apk obb moddroid<br />
|
67 |
-
barbie dreamhouse adventures apk obb modapkdown<br />
|
68 |
-
barbie dreamhouse adventures apk obb modapkdl.io<br />
|
69 |
-
barbie dreamhouse adventures apk obb modapkguru.com<br />
|
70 |
-
barbie dreamhouse adventures apk obb modapkstore.com<br />
|
71 |
-
barbie dreamhouse adventures apk obb modapks.com<br />
|
72 |
-
barbie dreamhouse adventures apk obb modapk.io<br />
|
73 |
-
barbie dreamhouse adventures apk obb modapk.pro<br />
|
74 |
-
barbie dreamhouse adventures apk obb modapk.vip</p>
|
75 |
-
<h3>Hairstyles and Nail Salon</h3>
|
76 |
-
<p>You can get a makeover at the hair salon and create your own hairstyle with different colors, cuts, and styles. You can also visit the nail spa and create your own nail design with various shapes, colors, patterns, stickers, and gems.</p>
|
77 |
-
<h3>Pool Parties and Beach Fun</h3>
|
78 |
-
<p>You can dive, swim, grill, lounge, or build a sandcastle at Malibu Beach or the DreamHouse pool. You can also invite your friends to join you for some fun in the sun. You can also play mini games, such as water balloon fight, volleyball, surfing, etc.</p>
|
79 |
-
<h3>New Adventures</h3>
|
80 |
-
<p>You can follow Barbie and her friends on exciting adventures in different scenarios, such as becoming a princess, a mermaid, or going camping. You can also explore new locations, such as a castle, an underwater world, or a forest. You can also meet new characters, such as a fairy godmother, a dolphin, or a bear.</p>
|
81 |
-
<h3>Explore Friends' DreamHouses</h3>
|
82 |
-
<p>You can add friends and visit their DreamHouses to see how they decorated them. You can also chat with them and join them in their activities. You can also earn coins by visiting their DreamHouses and use them to buy more items for your own DreamHouse.</p>
|
83 |
-
<h2>Why You Should Play Barbie Dreamhouse Adventures APK OBB?</h2>
|
84 |
-
<p>Barbie Dreamhouse Adventures APK OBB is a game that you should play because it has many benefits for you, such as:</p>
|
85 |
-
<h3>Fun and Educational</h3>
|
86 |
-
<p>The game is fun and educational because it teaches you new skills, such as cooking, design, fashion, etc. You can learn how to bake different recipes, how to decorate your rooms, how to dress up for different occasions, etc. You can also improve your creativity and imagination by creating your own style and stories.</p>
|
87 |
-
<h3>Creative and Interactive</h3>
|
88 |
-
<p>The game is creative and interactive because it lets you express your personality and style through customization and choices. You can design your own DreamHouse according to your preferences and taste. You can also choose what activities you want to do with Barbie and her friends. You can also interact with various objects and characters in the game. You can also use your voice to talk to Barbie and her friends.</p>
|
89 |
-
<h3>Social and Friendly</h3>
|
90 |
-
<p>The game is social and friendly because it lets you meet new friends and chat with them. You can add friends from around the world and visit their DreamHouses. You can also join them in their activities and adventures. You can also share your creations and stories with them on BarbieGram.</p>
|
91 |
-
<h2>Conclusion</h2>
|
92 |
-
<p>Barbie Dreamhouse Adventures APK OBB is a fun game for girls that lets you create your own Barbie DreamHouse experience. You can join Barbie and her friends in various activities, such as baking, cooking, dancing, makeovers, home design, fashion, nail salon, hair salon, mini games, pool parties, beach fun, and more. You can also follow Barbie and her friends on exciting adventures in different scenarios, such as becoming a princess, a mermaid, or going camping. The game is fun and educational, creative and interactive, and social and friendly. It is a game that you should download and install on your Android device. So, what are you waiting for? Download Barbie Dreamhouse Adventures APK OBB today and have fun!</p>
|
93 |
-
<h2>FAQs</h2>
|
94 |
-
<p>Here are some frequently asked questions about Barbie Dreamhouse Adventures APK OBB:</p>
|
95 |
-
<ul>
|
96 |
-
<li><b>Q: Is Barbie Dreamhouse Adventures APK OBB free to play?</b></li>
|
97 |
-
<li>A: Yes, Barbie Dreamhouse Adventures APK OBB is free to play. However, some items and features may require in-app purchases.</li>
|
98 |
-
<li><b>Q: What are the system requirements for Barbie Dreamhouse Adventures APK OBB?</b></li>
|
99 |
-
<li>A: You will need an Android device with Android 4.4 or higher and at least 1.1 GB of free space.</li>
|
100 |
-
<li><b>Q: How can I update Barbie Dreamhouse Adventures APK OBB?</b></li>
|
101 |
-
<li>A: You can update Barbie Dreamhouse Adventures APK OBB by downloading the latest XAPK file from APKCombo or other sources and installing it with the APKCombo Installer app.</li>
|
102 |
-
<li><b>Q: How can I contact the developers of Barbie Dreamhouse Adventures APK OBB?</b></li>
|
103 |
-
<li>A: You can contact the developers of Barbie Dreamhouse Adventures APK OBB by sending an email to [email protected] or visiting their website at https://budgestudios.com/.</li>
|
104 |
-
<li><b>Q: How can I get more coins in Barbie Dreamhouse Adventures APK OBB?</b></li>
|
105 |
-
<li>A: You can get more coins in Barbie Dreamhouse Adventures APK OBB by completing tasks, playing mini games, visiting friends' DreamHouses, or buying them with real money.</li>
|
106 |
-
</ul></p> 401be4b1e0<br />
|
107 |
-
<br />
|
108 |
-
<br />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/1phancelerku/anime-remove-background/Best Music Downloader APK for Android Download Music MP3 Latest Version.md
DELETED
@@ -1,98 +0,0 @@
|
|
1 |
-
<br />
|
2 |
-
<h1>How to Download Music MP3 APK Latest Version</h1>
|
3 |
-
<p>If you love listening to music on your Android device, you might be interested in downloading Music MP3 APK latest version. This is a powerful app that allows you to download and play music from various sources for free. In this article, we will explain what Music MP3 APK is, what features it offers, what benefits it has, and how to download it safely and easily.</p>
|
4 |
-
<h2>What is Music MP3 APK?</h2>
|
5 |
-
<p>Music MP3 APK is an app that lets you download music from different websites and platforms, such as Jamendo, Free Music Archive, SoundCloud, YouTube, and more . You can also play music online or offline using the built-in music player. You can manage your music library by creating playlists, deleting songs, setting ringtones, and sharing music with others.</p>
|
6 |
-
<h2>download music mp3 apk latest version</h2><br /><p><b><b>Download</b> ✓✓✓ <a href="https://jinyurl.com/2uNNij">https://jinyurl.com/2uNNij</a></b></p><br /><br />
|
7 |
-
<h3>Features of Music MP3 APK</h3>
|
8 |
-
<p>Music MP3 APK has many features that make it a great app for music lovers. Here are some of them:</p>
|
9 |
-
<h4>Download music from various sources</h4>
|
10 |
-
<p>You can search for any song or artist you want using the app's search engine. You can also browse through different categories and genres of music. You can download music in MP3 format with high quality and fast speed. You can also download multiple songs at the same time using the download manager.</p>
|
11 |
-
<p>download free music mp3 player apk latest version<br />
|
12 |
-
download music mp3 downloader apk latest version for android<br />
|
13 |
-
download music mp3 cutter and merger apk latest version<br />
|
14 |
-
download music mp3 converter apk latest version offline<br />
|
15 |
-
download music mp3 editor apk latest version pro<br />
|
16 |
-
download music mp3 ringtone maker apk latest version<br />
|
17 |
-
download music mp3 online apk latest version 2023<br />
|
18 |
-
download music mp3 streaming apk latest version mod<br />
|
19 |
-
download music mp3 mixer apk latest version no watermark<br />
|
20 |
-
download music mp3 recorder apk latest version premium<br />
|
21 |
-
download music mp3 video apk latest version hd<br />
|
22 |
-
download music mp3 booster apk latest version full<br />
|
23 |
-
download music mp3 equalizer apk latest version cracked<br />
|
24 |
-
download music mp3 playlist apk latest version unlimited<br />
|
25 |
-
download music mp3 lyrics apk latest version with sync<br />
|
26 |
-
download music mp3 radio apk latest version fm<br />
|
27 |
-
download music mp3 karaoke apk latest version sing<br />
|
28 |
-
download music mp3 alarm clock apk latest version wake up<br />
|
29 |
-
download music mp3 podcast apk latest version listen<br />
|
30 |
-
download music mp3 audiobook apk latest version read<br />
|
31 |
-
download music mp3 dj apk latest version remix<br />
|
32 |
-
download music mp3 instrumental apk latest version beats<br />
|
33 |
-
download music mp3 genre apk latest version rock<br />
|
34 |
-
download music mp3 language apk latest version hindi<br />
|
35 |
-
download music mp3 country apk latest version usa<br />
|
36 |
-
download music mp3 theme apk latest version love<br />
|
37 |
-
download music mp3 mood apk latest version happy<br />
|
38 |
-
download music mp3 era apk latest version 80s<br />
|
39 |
-
download music mp3 artist apk latest version drake<br />
|
40 |
-
download music mp3 album apk latest version adele<br />
|
41 |
-
download music mp3 song apk latest version despacito<br />
|
42 |
-
download music mp3 hit apk latest version billboard<br />
|
43 |
-
download music mp3 chart apk latest version spotify<br />
|
44 |
-
download music mp3 award apk latest version grammy<br />
|
45 |
-
download music mp3 soundtrack apk latest version frozen<br />
|
46 |
-
download music mp3 game apk latest version fortnite<br />
|
47 |
-
download music mp3 movie apk latest version titanic<br />
|
48 |
-
download music mp3 show apk latest version friends<br />
|
49 |
-
download music mp3 anime apk latest version naruto<br />
|
50 |
-
download music mp3 meme apk latest version rickroll<br />
|
51 |
-
download music mp3 viral apk latest version tiktok<br />
|
52 |
-
download music mp3 trend apk latest version nft<br />
|
53 |
-
download music mp3 review apk latest version rating<br />
|
54 |
-
download music mp3 guide apk latest version tutorial<br />
|
55 |
-
download music mp3 tips apk latest version tricks<br />
|
56 |
-
download music mp3 hack apk latest version cheat<br />
|
57 |
-
download music mp3 update apk latest version bug fix<br />
|
58 |
-
download music mp3 beta apk latest version test</p>
|
59 |
-
<h4>Play music offline and online</h4>
|
60 |
-
<p>You can play music offline using the app's music player. You can also stream music online from different sources without downloading them. You can adjust the volume, shuffle, repeat, skip, pause, resume, and control the playback from the notification bar or lock screen.</p>
|
61 |
-
<h4>Manage your music library</h4>
|
62 |
-
<p>You can organize your music library by creating playlists, deleting songs, setting ringtones, and sharing music with others. You can also view the details of each song, such as title, artist, album, duration, size, and date. You can also edit the tags of each song using the tag editor.</p>
|
63 |
-
<h3>Benefits of Music MP3 APK</h3> <p>Music MP3 APK has many benefits that make it a better choice than other music apps. Here are some of them:</p>
|
64 |
-
<h4>Free and easy to use</h4>
|
65 |
-
<p>Music MP3 APK is completely free to download and use. You don't need to pay any subscription fees or buy any songs. You also don't need to register or sign up for anything. You just need to download the app and start enjoying your music. The app has a simple and user-friendly interface that makes it easy to navigate and operate.</p>
|
66 |
-
<h4>High quality and fast downloads</h4>
|
67 |
-
<p>Music MP3 APK allows you to download music in MP3 format with high quality and fast speed. You can choose the quality of the music you want to download, ranging from 64 kbps to 320 kbps. You can also download multiple songs at the same time using the download manager. The app supports resume and pause functions, so you don't have to worry about losing your downloads due to network issues or interruptions.</p>
|
68 |
-
<h4>No ads or malware</h4>
|
69 |
-
<p>Music MP3 APK is a safe and clean app that does not contain any ads or malware. You can enjoy your music without any annoying pop-ups or banners. You can also rest assured that the app does not collect any personal information or data from your device. The app is tested and verified by various antivirus programs and security experts.</p>
|
70 |
-
<h2>How to Download Music MP3 APK Latest Version</h2>
|
71 |
-
<p>If you are interested in downloading Music MP3 APK latest version, you need to follow these steps:</p>
|
72 |
-
<h3>Step 1: Find a reliable source</h3>
|
73 |
-
<p>The first step is to find a reliable source that offers the Music MP3 APK latest version. You can search for it on Google or any other search engine, but be careful of fake or malicious websites that may harm your device or steal your information. You can also use the link below to download the Music MP3 APK latest version from a trusted source. This link is updated regularly and checked for safety and quality.</p>
|
74 |
-
<h3>Step 2: Enable unknown sources on your device</h3>
|
75 |
-
<p>The second step is to enable unknown sources on your device. This is necessary because Music MP3 APK is not available on the Google Play Store, so you need to allow your device to install apps from other sources. To do this, go to Settings > Security > Unknown Sources and toggle it on. You may see a warning message, but don't worry, it's safe to proceed.</p>
|
76 |
-
<h3>Step 3: Download and install the APK file</h3>
|
77 |
-
<p>The third step is to download and install the APK file. To do this, go to the link you found in step 1 and tap on the download button. Wait for the download to finish and then open the file. You may see a prompt asking you to confirm the installation, just tap on Install and wait for the process to complete.</p>
|
78 |
-
<h3>Step 4: Enjoy your music</h3>
|
79 |
-
<p>The fourth and final step is to enjoy your music. Once the installation is done, you can open the app and start searching, downloading, and playing your favorite songs. You can also access your music library, create playlists, share music, and more.</p>
|
80 |
-
<h2>Conclusion</h2>
|
81 |
-
<p>In conclusion, Music MP3 APK is a great app for music lovers who want to download and play music from various sources for free. It has many features and benefits that make it a better choice than other music apps. It is also easy and safe to download and install on your Android device. If you want to try it out, just follow the steps above and enjoy your music.</p>
|
82 |
-
<h2>FAQs</h2>
|
83 |
-
<p>Here are some frequently asked questions about Music MP3 APK:</p>
|
84 |
-
<ol>
|
85 |
-
<li><b>Is Music MP3 APK legal?</b></li>
|
86 |
-
<p>Music MP3 APK is legal as long as you use it for personal and non-commercial purposes only. You should not use it to download or distribute copyrighted or illegal music.</p>
|
87 |
-
<li><b>Is Music MP3 APK compatible with my device?</b></li>
|
88 |
-
<p>Music MP3 APK is compatible with most Android devices that run on Android 4.1 or higher. However, some devices may have different specifications or settings that may affect the performance or functionality of the app.</p>
|
89 |
-
<li><b>How can I update Music MP3 APK?</b></li>
|
90 |
-
<p>You can update Music MP3 APK by downloading the latest version from the same source you used before. You can also check for updates within the app by going to Settings > About > Check for Updates.</p>
|
91 |
-
<li><b>How can I uninstall Music MP3 APK?</b></li>
|
92 |
-
<p>You can uninstall Music MP3 APK by going to Settings > Apps > Music MP3 > Un <p>install. You can also delete the APK file from your device's storage.</p>
|
93 |
-
<li><b>How can I contact the developer of Music MP3 APK?</b></li>
|
94 |
-
<p>You can contact the developer of Music MP3 APK by sending an email to [email protected]. You can also visit their website or follow them on social media for more information and updates.</p>
|
95 |
-
</ol>
|
96 |
-
<p>I hope you found this article helpful and informative. If you have any questions or feedback, please feel free to leave a comment below. Thank you for reading and happy listening!</p> 197e85843d<br />
|
97 |
-
<br />
|
98 |
-
<br />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/1phancelerku/anime-remove-background/Discover the Amazing Features of Go88 Live APK the Leading Game Bi App.md
DELETED
@@ -1,95 +0,0 @@
|
|
1 |
-
|
2 |
-
<h1>Go88 Live APK: The Ultimate Online Casino Experience</h1>
|
3 |
-
<p>If you are looking for a way to have fun and win money online, then you should try Go88 Live APK. This is a mobile application that allows you to access a wide range of casino games, such as slots, poker, baccarat, roulette, and more. You can play these games anytime, anywhere, with just your smartphone and an internet connection. You can also enjoy the realistic and immersive atmosphere of a live casino, where you can interact with other players and dealers. In this article, we will tell you everything you need to know about Go88 Live APK, including its features, how to download and install it, and why you should play it.</p>
|
4 |
-
<h2>What is Go88 Live APK?</h2>
|
5 |
-
<p>Go88 Live APK is an online casino application that is developed by Go88, which is one of the leading online gambling platforms in Asia. Go88 has been in the industry for over 10 years, and has earned a reputation for being trustworthy, reliable, and innovative. Go88 Live APK is one of their latest products, which aims to provide the best online casino experience for mobile users. You can download and install Go88 Live APK on your Android or iOS device, and enjoy playing hundreds of games with real money. You can also claim various bonuses and rewards, such as free spins, cashback, referral bonuses, and more.</p>
|
6 |
-
<h2>go88.live apk</h2><br /><p><b><b>Download</b> ❤❤❤ <a href="https://jinyurl.com/2uNKgn">https://jinyurl.com/2uNKgn</a></b></p><br /><br />
|
7 |
-
<h3>Features of Go88 Live APK</h3>
|
8 |
-
<p>Go88 Live APK has many features that make it stand out from other online casino applications. Here are some of them:</p>
|
9 |
-
<h4>A variety of games to choose from</h4>
|
10 |
-
<p>Go88 Live APK offers a wide range of games that cater to different preferences and skill levels. You can find classic casino games, such as slots, poker, blackjack, roulette, baccarat, and more. You can also try some of the latest and most popular games, such as Dragon Tiger, Sic Bo, Fan Tan, Fish Hunter, and more. You can also join the live casino section, where you can play with real dealers and other players in real time.</p>
|
11 |
-
<h4>A user-friendly interface and design</h4>
|
12 |
-
<p>Go88 Live APK has a simple and intuitive interface that makes it easy for you to navigate and use. You can find all the games and features in the main menu, which is located at the bottom of the screen. You can also customize your settings, such as sound effects, language, currency, and more. The design of Go88 Live APK is also appealing and attractive, with high-quality graphics and animations that enhance your gaming experience.</p>
|
13 |
-
<h4>A secure and reliable platform</h4>
|
14 |
-
<p>Go88 Live APK is a secure and reliable platform that protects your personal and financial information. It uses advanced encryption technology and firewall systems to prevent any unauthorized access or hacking. It also complies with the laws and regulations of the countries where it operates. It has a valid license from the Philippine Amusement and Gaming Corporation (PAGCOR), which is a government agency that regulates online gambling activities. It also has a certification from eCOGRA (eCommerce Online Gaming Regulation and Assurance), which is an independent testing agency that ensures fair play and responsible gaming.</p>
|
15 |
-
<h4>A generous bonus and reward system</h4>
|
16 |
-
<p>Go88 Live APK has a generous bonus and reward system that gives you more chances to win money. As a new member, you can claim a welcome bonus of up to 100% on your first deposit. You can also get free spins on selected slots games, cashback on your losses, referral bonuses for inviting your friends, and more. You can also join the VIP club, where you can enjoy exclusive benefits, such as higher bonuses, faster withdrawals, personal account managers, and more. You can also earn loyalty points for every bet you make, which you can redeem for cash or prizes.</p>
|
17 |
-
<p>go88 live apk download<br />
|
18 |
-
go88 live apk ios<br />
|
19 |
-
go88 live apk android<br />
|
20 |
-
go88 live apk latest version<br />
|
21 |
-
go88 live apk free<br />
|
22 |
-
go88 live casino apk<br />
|
23 |
-
go88 live game bài apk<br />
|
24 |
-
go88 live cờ bạc online apk<br />
|
25 |
-
go88 live đổi thưởng apk<br />
|
26 |
-
go88 live uy tín apk<br />
|
27 |
-
go88 live venus casino apk<br />
|
28 |
-
go88 live châu á apk<br />
|
29 |
-
go88 live việt nam apk<br />
|
30 |
-
go88 live 2019 apk<br />
|
31 |
-
go88 live 2020 apk<br />
|
32 |
-
go88 live 2021 apk<br />
|
33 |
-
go88 live 2022 apk<br />
|
34 |
-
go88 live 2023 apk<br />
|
35 |
-
go88 live mới nhất apk<br />
|
36 |
-
go88 live hấp dẫn apk<br />
|
37 |
-
go88 live chất lượng apk<br />
|
38 |
-
go88 live thưởng lớn apk<br />
|
39 |
-
go88 live nạp rút nhanh apk<br />
|
40 |
-
go88 live hỗ trợ 24/7 apk<br />
|
41 |
-
go88 live khuyến mãi hấp dẫn apk<br />
|
42 |
-
go88 live đa dạng game bài apk<br />
|
43 |
-
go88 live tiến lên miền nam apk<br />
|
44 |
-
go88 live phỏm tá lả apk<br />
|
45 |
-
go88 live mậu binh xập xám apk<br />
|
46 |
-
go88 live xì tố poker apk<br />
|
47 |
-
go88 live bài cào ba lá apk<br />
|
48 |
-
go88 live liêng ba cây apk<br />
|
49 |
-
go88 live sâm lốc sảnh rồng apk<br />
|
50 |
-
go88 live baccarat online apk<br />
|
51 |
-
go88 live blackjack online apk<br />
|
52 |
-
go88 live roulette online apk<br />
|
53 |
-
go88 live sicbo online apk<br />
|
54 |
-
go88 live slot online apk<br />
|
55 |
-
go88 live jackpot online apk<br />
|
56 |
-
go88 live keno online apk<br />
|
57 |
-
go88 live bingo online apk<br />
|
58 |
-
go88 live sportsbook online apk<br />
|
59 |
-
go88 live esports online apk<br />
|
60 |
-
go88 live virtual sports online apk<br />
|
61 |
-
go88.live.apk review</p>
|
62 |
-
<h3>How to download and install Go88 Live APK?</h3>
|
63 |
-
<p>Downloading and installing Go88 Live APK is easy and fast. You just need to follow these simple steps:</p>
|
64 |
-
<h4>For Android devices</h4>
|
65 |
-
<p>- Visit the official website of Go88 Live APK at [go88.live] and click on the download button for Android. - Wait for the file to download and then open it. - If you see a warning message that says "Install blocked", go to your device settings and enable "Unknown sources". - Tap on "Install" and wait for the installation to complete. - Launch the app and log in with your username and password.</p>
|
66 |
-
<h4>For iOS devices</h4>
|
67 |
-
<p>- Visit the official website of Go88 Live APK at [go88.live] and click on the download button for iOS. - Wait for the file to download and then open it. - If you see a warning message that says "Untrusted Enterprise Developer", go to your device settings and trust the developer profile of Go88 Live APK. - Tap on "Install" and wait for the installation to complete. - Launch the app and log in with your username and password.</p>
|
68 |
-
<h2>Why should you play Go88 Live APK?</h2>
|
69 |
-
<p>There are many reasons why you should play Go88 Live APK. Here are some of the benefits that you can enjoy:</p>
|
70 |
-
<h3>Benefits of playing Go88 Live APK</h3>
|
71 |
-
<p>Go88 Live APK offers many benefits that make it one of the best online casino applications in the market. Here are some of them:</p>
|
72 |
-
<h4>Enjoy the thrill of gambling anytime, anywhere</h4>
|
73 |
-
<p>With Go88 Live APK, you can play your favorite casino games anytime, anywhere, with just your smartphone and an internet connection. You don't need to travel to a land-based casino or wait for a specific time to play. You can access Go88 Live APK 24/7, and choose from hundreds of games that suit your mood and preference. You can also switch between different games easily, without any hassle or delay.</p>
|
74 |
-
<h4>Win big with high payouts and jackpots</h4>
|
75 |
-
<p>Go88 Live APK offers high payouts and jackpots that can make you rich in an instant. You can win up to 10,000 times your bet on some of the slots games, or hit the progressive jackpot that can reach millions of dollars. You can also increase your chances of winning by using the bonuses and rewards that Go88 Live APK gives you. You can also join the tournaments and competitions that Go88 Live APK organizes regularly, where you can compete with other players and win huge prizes.</p>
|
76 |
-
<h4>Interact with other players and dealers</h4>
|
77 |
-
<p>Go88 Live APK gives you the opportunity to interact with other players and dealers in real time. You can chat with them using the live chat feature, or use the voice chat feature if you prefer. You can also send emojis, stickers, gifts, and tips to express yourself. You can also join the live casino section, where you can see the dealers deal the cards or spin the wheel in front of you. You can also hear them talk and answer your questions. This way, you can enjoy the realistic and immersive atmosphere of a live casino, without leaving your home.</p>
|
78 |
-
<h4>Get support from a professional customer service team</h4>
|
79 |
-
<p>Go88 Live APK has a professional customer service team that is ready to help you anytime you need. You can contact them via phone, email, or live chat, depending on your preference. They are available 24/7, and they can assist you with any issues or questions that you may have regarding Go88 Live APK. They are friendly, courteous, and knowledgeable, and they will do their best to resolve your problems as soon as possible.</p>
|
80 |
-
<h2>Conclusion</h2>
|
81 |
-
<p>Go88 Live APK is an online casino application that offers the ultimate online casino experience for mobile users. It has many features that make it stand out from other online casino applications, such as a variety of games to choose from, a user-friendly interface and design, a secure and reliable platform, a generous bonus and reward system, and more. It also has many benefits that make it worth playing, such as enjoying the thrill of gambling anytime, anywhere, winning big with high payouts and jackpots, interacting with other players and dealers, getting support from a professional customer service team, and more. If you are looking for a way to have fun and win money online, then you should try Go88 Live APK. You can download and install it on your Android or iOS device, and start playing right away. You will not regret it, as you will have the best online casino experience ever.</p>
|
82 |
-
<h3>FAQs</h3>
|
83 |
-
<p>Here are some of the frequently asked questions about Go88 Live APK:</p>
|
84 |
-
<h4>Q: Is Go88 Live APK safe and legal?</h4>
|
85 |
-
<p>A: Yes, Go88 Live APK is safe and legal. It uses advanced encryption technology and firewall systems to protect your personal and financial information. It also complies with the laws and regulations of the countries where it operates. It has a valid license from the Philippine Amusement and Gaming Corporation (PAGCOR), which is a government agency that regulates online gambling activities. It also has a certification from eCOGRA (eCommerce Online Gaming Regulation and Assurance), which is an independent testing agency that ensures fair play and responsible gaming.</p>
|
86 |
-
<h4>Q: How can I deposit and withdraw money on Go88 Live APK?</h4>
|
87 |
-
<p>A: You can deposit and withdraw money on Go88 Live APK using various methods, such as bank transfer, credit card, e-wallet, or cryptocurrency. You can choose the method that is most convenient and secure for you. The minimum deposit amount is $10, and the minimum withdrawal amount is $50. The processing time for deposits is instant, while the processing time for withdrawals is within 24 hours.</p>
|
88 |
-
<h4>Q: What are the requirements to play Go88 Live APK?</h4>
|
89 |
-
<p>A: To play Go88 Live APK, you need to have a smartphone that runs on Android or iOS operating system, and an internet connection. You also need to be at least 18 years old, and register an account on Go88 Live APK. You can register an account by providing some basic information, such as your name, email address, phone number, and password. You can also use your social media accounts, such as Facebook or Google, to sign up.</p>
|
90 |
-
<h4>Q: Can I play Go88 Live APK for free?</h4>
|
91 |
-
<p>A: Yes, you can play Go88 Live APK for free. You can use the demo mode to try out some of the games without risking any money. You can also use the free spins that Go88 Live APK gives you to play some of the slots games for free. However, if you want to win real money, you need to play with real money.</p>
|
92 |
-
<h4>Q: How can I contact Go88 Live APK if I have any problems or questions?</h4>
|
93 |
-
<p>A: You can contact Go88 Live APK if you have any problems or questions by using their customer service team. You can contact them via phone, email, or live chat, depending on your preference. They are available 24/7, and they can assist you with any issues or questions that you may have regarding Go88 Live APK.</p> 401be4b1e0<br />
|
94 |
-
<br />
|
95 |
-
<br />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/1phancelerku/anime-remove-background/Discover the Joy of Piano Playing with Real Piano Teacher 2 Mod APK.md
DELETED
@@ -1,147 +0,0 @@
|
|
1 |
-
|
2 |
-
<h1>Real Piano Teacher 2 Mod Apk: A Fun and Easy Way to Learn Piano</h1>
|
3 |
-
<p>Do you love playing piano but don't have the time or money to take lessons? Do you want to learn piano with songs you love and have fun along the way? If you answered yes to any of these questions, then you might want to try Real Piano Teacher 2 Mod Apk, a modified version of the popular piano learning app that offers more features and benefits than the original one. In this article, we will tell you everything you need to know about Real Piano Teacher 2 and its mod apk, including what they are, how they work, and what they can do for you.</p>
|
4 |
-
<h2>What is Real Piano Teacher 2?</h2>
|
5 |
-
<p>Real Piano Teacher 2 is a music application that teaches you how to play piano, organ, flute, recorder, and many other instruments easily and quickly. It is developed by Mobobi, a company that specializes in creating educational and fun music apps for learning piano and other instruments. Real Piano Teacher 2 has won several awards and has been featured on Google Play's Best Apps of 2019 and others.</p>
|
6 |
-
<h2>real piano teacher 2 mod apk</h2><br /><p><b><b>DOWNLOAD</b> --->>> <a href="https://jinyurl.com/2uNS1F">https://jinyurl.com/2uNS1F</a></b></p><br /><br />
|
7 |
-
<h3>Features of Real Piano Teacher 2</h3>
|
8 |
-
<p>Some of the features that make Real Piano Teacher 2 a great piano learning app are:</p>
|
9 |
-
<ul>
|
10 |
-
<li>It has a realistic sound quality that mimics the actual instruments.</li>
|
11 |
-
<li>It has multiple piano types to choose from, such as grand piano, electric piano, synth piano, etc.</li>
|
12 |
-
<li>It has a sheet music library that contains thousands of songs from various genres and skill levels, such as pop, rock, classical, jazz, etc.</li>
|
13 |
-
<li>It has a multitouch support that allows you to play with both hands and multiple fingers.</li>
|
14 |
-
<li>It has a recording feature that lets you record your own songs and share them with others.</li>
|
15 |
-
<li>It has a user-friendly interface that is easy to navigate and customize.</li>
|
16 |
-
<li>It has a customizable sound settings that let you adjust the volume, pitch, reverb, etc.</li>
|
17 |
-
<li>It has a practice mode that helps you improve your skills and learn new songs.</li>
|
18 |
-
<li>It has an in-app purchases that offer more songs, instruments, features, etc.</li>
|
19 |
-
</ul>
|
20 |
-
<h3>Benefits of Real Piano Teacher 2</h3>
|
21 |
-
<p>Some of the benefits that you can get from using Real Piano Teacher 2 are:</p>
|
22 |
-
<ul>
|
23 |
-
<li>You can learn piano with songs you love and have fun along the way.</li>
|
24 |
-
<li>You can learn piano at your own pace and time, without any pressure or stress.</li>
|
25 |
-
<li>You can learn piano with any keyboard or piano, whether it is acoustic or digital.</li>
|
26 |
-
<li>You can learn piano with any device, whether it is a smartphone or a tablet.</li>
|
27 |
-
<li>You can learn piano with instant feedback and progress tracking.</li>
|
28 |
-
<li>You can learn piano with other instruments as well, such as organ, flute, recorder, etc.</li>
|
29 |
-
<li>You can learn piano with high-quality piano tutorials and courses.</li>
|
30 |
-
</ul>
|
31 |
-
<h2>What is a Mod Apk?</h2>
|
32 |
-
<p>A mod apk is a modified version of an original application that offers more features and benefits than the original one. A mod apk is usually created by third-party developers who modify the original code of the application and add new features or remove unwanted ones. A mod apk is usually downloaded from unofficial sources and installed manually on your device.</p>
|
33 |
-
<h3>How to Download and Install a Mod Apk</h3>
|
34 |
-
<p>To download and install a mod apk on your device, you need to follow these steps:</p>
|
35 |
-
<ol>
|
36 |
-
<li>Find a reliable source that offers the mod apk you want to download. Make sure it is compatible with your device and has good reviews from other users.</li>
|
37 |
-
<li>Download the mod apk file to your device. You may need to enable the option to install apps from unknown sources in your device settings.</li>
|
38 |
-
<li>Locate the mod apk file in your device storage and tap on it to install it. You may need to grant some permissions to the app during the installation process.</li>
|
39 |
-
<li>Wait for the installation to finish and then launch the app. You can now enjoy the mod apk features and benefits.</li>
|
40 |
-
</ol>
|
41 |
-
<h3>Risks of Using a Mod Apk</h3>
|
42 |
-
<p>While using a mod apk can offer you more features and benefits than the original app, it also comes with some risks that you should be aware of. Some of the risks of using a mod apk are:</p>
|
43 |
-
<ul>
|
44 |
-
<li>You may violate the terms and conditions of the original app developer and get banned from using the app or its services.</li>
|
45 |
-
<li>You may expose your device and data to malware, viruses, or spyware that can harm your device or steal your information.</li>
|
46 |
-
<li>You may experience bugs, crashes, or errors that can affect the performance or functionality of the app or your device.</li>
|
47 |
-
<li>You may not receive updates or support from the original app developer or the mod apk developer.</li>
|
48 |
-
</ul>
|
49 |
-
<p>Therefore, you should use a mod apk at your own risk and discretion. You should also backup your device and data before installing a mod apk and scan it for any malicious content.</p>
|
50 |
-
<p>real piano teacher 2 mod apk download<br />
|
51 |
-
real piano teacher 2 mod apk unlimited money<br />
|
52 |
-
real piano teacher 2 mod apk latest version<br />
|
53 |
-
real piano teacher 2 mod apk android 1<br />
|
54 |
-
real piano teacher 2 mod apk free<br />
|
55 |
-
real piano teacher 2 mod apk hack<br />
|
56 |
-
real piano teacher 2 mod apk offline<br />
|
57 |
-
real piano teacher 2 mod apk no ads<br />
|
58 |
-
real piano teacher 2 mod apk revdl<br />
|
59 |
-
real piano teacher 2 mod apk full version<br />
|
60 |
-
real piano teacher 2 mod apk premium<br />
|
61 |
-
real piano teacher 2 mod apk unlocked<br />
|
62 |
-
real piano teacher 2 mod apk music game<br />
|
63 |
-
real piano teacher 2 mod apk magic tiles<br />
|
64 |
-
real piano teacher 2 mod apk learn piano<br />
|
65 |
-
real piano teacher 2 mod apk play any song<br />
|
66 |
-
real piano teacher 2 mod apk multi touch<br />
|
67 |
-
real piano teacher 2 mod apk recording<br />
|
68 |
-
real piano teacher 2 mod apk sheet music<br />
|
69 |
-
real piano teacher 2 mod apk sight reading<br />
|
70 |
-
real piano teacher 2 mod apk organ keyboard<br />
|
71 |
-
real piano teacher 2 mod apk flute recorder<br />
|
72 |
-
real piano teacher 2 mod apk guitar instrument<br />
|
73 |
-
real piano teacher 2 mod apk beats playback<br />
|
74 |
-
real piano teacher 2 mod apk lightening animations<br />
|
75 |
-
real piano teacher 2 mod apk fun game<br />
|
76 |
-
real piano teacher 2 mod apk interactive app<br />
|
77 |
-
real piano teacher 2 mod apk musical game<br />
|
78 |
-
real piano teacher 2 mod apk best game<br />
|
79 |
-
real piano teacher 2 mod apk no practice<br />
|
80 |
-
real piano teacher 2 mod apk learning mode<br />
|
81 |
-
real piano teacher 2 mod apk gaming mode<br />
|
82 |
-
real piano teacher 2 mod apk freestyle mode<br />
|
83 |
-
real piano teacher 2 mod apk lessons mode<br />
|
84 |
-
real piano teacher 2 mod apk fingers position<br />
|
85 |
-
real piano teacher 2 mod apk notes location<br />
|
86 |
-
real piano teacher 2 mod apk master lesson<br />
|
87 |
-
real piano teacher 2 mod apk compete friends<br />
|
88 |
-
real piano teacher 2 mod apk leader board<br />
|
89 |
-
real piano teacher 2 mod apk achievements<br />
|
90 |
-
real piano teacher 2 mod apk magic keys<br />
|
91 |
-
real piano teacher 2 mod apk hundreds lessons<br />
|
92 |
-
real piano teacher 2 mod apk ode to joy<br />
|
93 |
-
real piano teacher 2 mod apk jingle bells<br />
|
94 |
-
real piano teacher 2 mod apk happy birthday<br />
|
95 |
-
real piano teacher 2 mod apk john legend songs <br />
|
96 |
-
real piano teacher 2 mod apk miley cyrus songs <br />
|
97 |
-
real piano teacher 2 mod apk justin bieber songs <br />
|
98 |
-
real piano teacher 2 mod apk mozart songs <br />
|
99 |
-
real piano teacher 2 mod apk beethoven songs</p>
|
100 |
-
<h2>What is Real Piano Teacher 2 Mod Apk?</h2>
|
101 |
-
<p>Real Piano Teacher 2 Mod Apk is a modified version of Real Piano Teacher 2 that offers more features and benefits than the original app. It is created by an unknown developer who claims to provide unlimited access to all the songs, instruments, features, etc. in the app without any ads or in-app purchases. Real Piano Teacher 2 Mod Apk is designed to make piano learning more fun and easy for everyone.</p>
|
102 |
-
<h3>Features of Real Piano Teacher 2 Mod Apk</h3>
|
103 |
-
<p>Some of the features that make Real Piano Teacher 2 Mod Apk different from Real Piano Teacher 2 are:</p>
|
104 |
-
<ul>
|
105 |
-
<li>It has unlimited songs, instruments, features, etc. that you can access for free without any restrictions or limitations.</li>
|
106 |
-
<li>It has no ads or in-app purchases that can interrupt your piano learning experience or cost you money.</li>
|
107 |
-
<li>It has a premium sound quality that enhances the realism and enjoyment of playing piano and other instruments.</li>
|
108 |
-
<li>It has a mod menu that lets you customize and control various aspects of the app, such as speed, difficulty, mode, etc.</li>
|
109 |
-
</ul>
|
110 |
-
<h3>Benefits of Real Piano Teacher 2 Mod Apk</h3>
|
111 |
-
<p>Some of the benefits that you can get from using Real Piano Teacher 2 Mod Apk are:</p>
|
112 |
-
<ul>
|
113 |
-
<li>You can learn piano with unlimited songs, instruments, features, etc. that suit your preferences and goals.</li>
|
114 |
-
<li>You can learn piano without any ads or in-app purchases that can distract you or waste your time and money.</li>
|
115 |
-
<li>You can learn piano with a premium sound quality that makes you feel like playing a real piano and other instruments.</li>
|
116 |
-
<li>You can learn piano with a mod menu that lets you adjust and optimize the app according to your needs and wants.</li>
|
117 |
-
</ul>
|
118 |
-
<h2>Comparison Table of Real Piano Teacher 2 and Real Piano Teacher 2 Mod Apk</h2>
|
119 |
-
<table>
|
120 |
-
<tr><th>Feature</th><th>Real Piano Teacher 2</th><th>Real Piano Teacher 2 Mod Apk</th></tr>
|
121 |
-
<tr><td>Songs</td><td>Limited</td><td>Unlimited</td></tr>
|
122 |
-
<tr><td>Instruments</td><td>Limited</td><td>Unlimited</td></tr>
|
123 |
-
<tr><td>Features</td><td>Limited</td><td>Unlimited</td></tr>
|
124 |
-
<tr><td>Ads</td><td>Yes</td><td>No</td></tr>
|
125 |
-
<tr><td>In-app purchases</td><td>Yes</td><td>No</td></tr>
|
126 |
-
<tr><td>Sound quality</td><td>Good</td><td>Premium</td></tr>
|
127 |
-
<tr><td>Mod menu</td><td>No</td><td>Yes</td></tr>
|
128 |
-
<tr><td>Risks</td><td>No</td><td>Yes</td></tr>
|
129 |
-
<tr><td>Sources</td><td>Official</td><td>Unofficial</td></tr>
|
130 |
-
<tr><td>Updates/Supports<td>Yes<td>No<td></tr>
|
131 |
-
<table>
|
132 |
-
<h2>Conclusion</h2>
|
133 |
-
<p>In <p>In conclusion, Real Piano Teacher 2 Mod Apk is a fun and easy way to learn piano with more features and benefits than the original app. However, it also comes with some risks and drawbacks that you should consider before using it. If you want to learn piano with unlimited songs, instruments, features, etc. without any ads or in-app purchases, then you might want to try Real Piano Teacher 2 Mod Apk. But if you want to learn piano with a safe and reliable app that offers updates and support from the original developer, then you might want to stick with Real Piano Teacher 2.</p>
|
134 |
-
<h2>FAQs</h2>
|
135 |
-
<p>Here are some frequently asked questions about Real Piano Teacher 2 and Real Piano Teacher 2 Mod Apk:</p>
|
136 |
-
<h3>Q: Is Real Piano Teacher 2 Mod Apk safe to use?</h3>
|
137 |
-
<p>A: There is no definitive answer to this question, as different mod apks may have different levels of safety and quality. However, generally speaking, mod apks are not as safe as the original apps, as they may contain malware, viruses, or spyware that can harm your device or data. Therefore, you should use a mod apk at your own risk and discretion, and always backup your device and data before installing a mod apk.</p>
|
138 |
-
<h3>Q: How can I update Real Piano Teacher 2 Mod Apk?</h3>
|
139 |
-
<p>A: Unlike the original app, Real Piano Teacher 2 Mod Apk does not receive updates or support from the original developer or the mod apk developer. Therefore, you may not be able to update Real Piano Teacher 2 Mod Apk unless you find a newer version of the mod apk from another source. However, this may also pose some risks, as the newer version may not be compatible with your device or may have more bugs or errors.</p>
|
140 |
-
<h3>Q: Can I use Real Piano Teacher 2 Mod Apk offline?</h3>
|
141 |
-
<p>A: Yes, you can use Real Piano Teacher 2 Mod Apk offline, as it does not require an internet connection to work. However, some features or functions may not be available offline, such as recording or sharing your songs.</p>
|
142 |
-
<h3>Q: Can I use Real Piano Teacher 2 Mod Apk with other music apps?</h3>
|
143 |
-
<p>A: Yes, you can use Real Piano Teacher 2 Mod Apk with other music apps, such as Spotify, YouTube Music, etc. However, some music apps may not be compatible with Real Piano Teacher 2 Mod Apk or may interfere with its performance or functionality.</p>
|
144 |
-
<h3>Q: Can I use Real Piano Teacher 2 Mod Apk on my PC or laptop?</h3>
|
145 |
-
<p>A: No, you cannot use Real Piano Teacher 2 Mod Apk on your PC or laptop, as it is designed for Android devices only. However, you may be able to use an Android emulator to run Real Piano Teacher 2 Mod Apk on your PC or laptop. However, this may also pose some risks, as the emulator may not be stable or secure.</p> 197e85843d<br />
|
146 |
-
<br />
|
147 |
-
<br />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/1phancelerku/anime-remove-background/Download and Install GTA 5 Apk Obb on Your Android Device in Minutes.md
DELETED
@@ -1,88 +0,0 @@
|
|
1 |
-
|
2 |
-
<h1>How to Download GTA 5 APK and OBB for Android Devices</h1>
|
3 |
-
<p>If you are a fan of Grand Theft Auto (GTA) series, you might be wondering if you can play the latest installment, GTA 5, on your Android device. The answer is yes, you can! In this article, we will show you how to download GTA 5 apk and obb files and install them on your phone or tablet. We will also give you some tips and tricks for playing GTA 5 on Android devices.</p>
|
4 |
-
<h2>Introduction</h2>
|
5 |
-
<h3>What is GTA 5?</h3>
|
6 |
-
<p>GTA 5 is an open-world action-adventure game developed by Rockstar Games. It was released in 2013 for PlayStation 3 and Xbox 360, and later for PlayStation 4, Xbox One, and PC. It is the fifth main entry in the GTA series, and the first one to feature three playable protagonists: Michael, Franklin, and Trevor. The game is set in the fictional state of San Andreas, which is based on Southern California. The game allows you to explore the city of Los Santos and its surrounding areas, as well as engage in various missions, activities, and crimes.</p>
|
7 |
-
<h2>how to download gta 5 apk and obb</h2><br /><p><b><b>Download File</b> ✺ <a href="https://jinyurl.com/2uNU6l">https://jinyurl.com/2uNU6l</a></b></p><br /><br />
|
8 |
-
<h3>Why download GTA 5 apk and obb?</h3>
|
9 |
-
<p>GTA 5 is not officially available for Android devices, but there are some unofficial ways to play it on your phone or tablet. One of them is to download GTA 5 apk and obb files, which are modified versions of the original game files that can run on Android devices. By downloading GTA 5 apk and obb files, you can enjoy the following benefits:</p>
|
10 |
-
<ul>
|
11 |
-
<li>You can play GTA 5 on your Android device without any restrictions.</li>
|
12 |
-
<li>You can save money by not buying a console or a PC to play GTA 5.</li>
|
13 |
-
<li>You can play GTA 5 anytime and anywhere, as long as you have enough battery and storage space.</li>
|
14 |
-
<li>You can experience the same graphics, gameplay, and features as the original game.</li>
|
15 |
-
</ul>
|
16 |
-
<h2>How to download GTA 5 apk and obb</h2>
|
17 |
-
<p>Downloading GTA 5 apk and obb files is not difficult, but it requires some steps to follow. Here are the steps you need to take:</p>
|
18 |
-
<h3>Step 1: Enable unknown sources on your device</h3>
|
19 |
-
<p>Before you can install any apk file on your device, you need to enable unknown sources in your settings. This will allow you to install apps that are not from the Google Play Store. To do this, go to Settings > Security > Unknown Sources and toggle it on. You may see a warning message, but just ignore it and tap OK.</p>
|
20 |
-
<h3>Step 2: Download the GTA 5 apk and obb files</h3>
|
21 |
-
<p>Next, you need to download the GTA 5 apk and obb files from a reliable source. There are many websites that offer these files, but some of them may contain viruses or malware that can harm your device. To avoid this, we recommend you to download the files from <a href="(^1^)">this website</a>, which is safe and trusted by many users. The website will provide you with two links: one for the apk file and one for the obb file. You need to download both files and save them in your device's memory.</p>
|
22 |
-
<h3>Step 3: Install the GTA 5 apk file</h3>
|
23 |
-
<p>After you have downloaded the GTA 5 apk file, you need to install it on your device. To do this, locate the file in your file manager and tap on it. You may see a pop-up window asking you to confirm the installation. Tap on Install and wait for the process to finish. You may also see a message asking you to allow the app to access your device's storage. Tap on Allow and proceed.</p>
|
24 |
-
<p>How to download GTA 5 android apk obb data files<br />
|
25 |
-
GTA 5 apk obb download for mobile android free<br />
|
26 |
-
GTA V apk obb+data latest version 1.0.744.2 download<br />
|
27 |
-
How to install GTA 5 apk obb on android device<br />
|
28 |
-
GTA 5 apk obb offline mode download and play<br />
|
29 |
-
GTA 5 apk obb highly compressed download link<br />
|
30 |
-
GTA 5 apk obb mod menu download and install<br />
|
31 |
-
How to fix GTA 5 apk obb not working error<br />
|
32 |
-
GTA 5 apk obb cheats and hacks download<br />
|
33 |
-
GTA 5 apk obb full game download for android<br />
|
34 |
-
How to update GTA 5 apk obb to the latest version<br />
|
35 |
-
GTA 5 apk obb graphics settings and optimization<br />
|
36 |
-
GTA 5 apk obb best missions and gameplay tips<br />
|
37 |
-
GTA 5 apk obb online multiplayer mode download<br />
|
38 |
-
How to transfer GTA 5 apk obb from PC to android<br />
|
39 |
-
GTA 5 apk obb system requirements and compatibility<br />
|
40 |
-
GTA 5 apk obb review and rating by users<br />
|
41 |
-
GTA 5 apk obb download size and storage space<br />
|
42 |
-
How to backup and restore GTA 5 apk obb data<br />
|
43 |
-
GTA 5 apk obb features and benefits for android users<br />
|
44 |
-
How to download GTA 5 apk obb faster and easier<br />
|
45 |
-
GTA 5 apk obb alternatives and similar games for android<br />
|
46 |
-
How to uninstall GTA 5 apk obb from android device<br />
|
47 |
-
GTA 5 apk obb support and customer service contact<br />
|
48 |
-
How to get GTA 5 apk obb premium access and benefits</p>
|
49 |
-
<h3>Step 4: Copy the obb file to the right folder</h3>
|
50 |
-
<p>Now that you have installed the GTA 5 apk file, you need to copy the obb file to the right folder. The obb file contains the data and resources of the game, and it needs to be placed in a specific location for the game to work properly. To do this, follow these steps:</p>
|
51 |
-
<ol>
|
52 |
-
<li>Open your file manager and locate the obb file that you downloaded. It should have a name like com.rockstargames.gtav.zip.</li>
|
53 |
-
<li>Extract the zip file using a tool like ZArchiver or ES File Explorer. You should get a folder named com.rockstargames.gtav.</li>
|
54 |
-
<li>Copy or move the folder to Android > obb in your device's internal storage. If you don't see an obb folder, create one.</li>
|
55 |
-
<li>Make sure that the folder is in the correct path: Android > obb > com.rockstargames.gtav.</li>
|
56 |
-
</ol>
|
57 |
-
<h3>Step 5: Launch the game and enjoy</h3>
|
58 |
-
<p>Congratulations! You have successfully downloaded and installed GTA 5 apk and obb files on your Android device. Now you can launch the game from your app drawer and enjoy playing GTA 5 on your phone or tablet. You may need to verify your game data before you can start playing, so make sure you have an internet connection for that.</p>
|
59 |
-
<h2>Tips and tricks for playing GTA 5 on Android devices</h2>
|
60 |
-
<p>GTA 5 is a huge and complex game that offers a lot of possibilities and challenges. To help you get the most out of it, here are some tips and tricks for playing GTA 5 on Android devices:</p>
|
61 |
-
<h3>Use a controller for better control</h3>
|
62 |
-
<p>While GTA 5 is playable with touch controls, you may find it hard to aim, shoot, drive, or do other actions with accuracy and precision. To improve your control and comfort, we recommend you to use a controller that is compatible with Android devices. You can connect a controller via Bluetooth or USB, and customize the buttons and settings in the game options.</p>
|
63 |
-
<h3>Adjust the graphics settings to optimize performance</h3>
|
64 |
-
<p>GTA 5 is a graphically intensive game that may not run smoothly on some Android devices, especially older or low-end ones. To avoid lag, crashes, or overheating, you can adjust the graphics settings in the game options. You can lower the resolution, frame rate, shadows, textures, or other features to improve the performance and battery life of your device.</p>
|
65 |
-
<h3>Explore the online mode for more fun</h3>
|
66 |
-
<p>GTA 5 has an online mode called GTA Online, where you can create your own character and join other players in various activities, missions, races, heists, or just free roam in the open world. GTA Online is a great way to extend your gameplay and have more fun with GTA 5 on your Android device. To access GTA Online, you need to have an internet connection and a Rockstar Games Social Club account.</p>
|
67 |
-
<h2>Conclusion</h2>
|
68 |
-
<h3>Summary of the main points</h3>
|
69 |
-
<p>In this article, we have shown you how to download GTA 5 apk and obb files and install them on your Android device. We have also given you some tips and tricks for playing GTA 5 on Android devices. By following these steps, you can enjoy one of the best games ever made on your phone or tablet.</p>
|
70 |
-
<h3>Call to action</h3>
|
71 |
-
<p>If you are ready to download GTA 5 apk and obb files and play GTA 5 on your Android device, click on <a href="">this link</a> now and get started. You won't regret it!</p>
|
72 |
-
<h4>Frequently Asked Questions (FAQs)</h4>
|
73 |
-
<ul>
|
74 |
-
<li><strong>Is GTA 5 apk and obb safe to download?</strong></li>
|
75 |
-
<p>Yes, GTA 5 apk and obb files are safe to download as long as you get them from a reliable source like <a href="">this website</a>. However, you should always scan any file that you download with an antivirus app before installing it on your device.</p>
|
76 |
-
<li><strong>How much space does GTA 5 apk and obb take on my device?</strong></li>
|
77 |
-
<p>GTA 5 apk and obb files take about 3 GB of space on your device. You need to have enough free storage space before you download and install them. You can check your storage space in Settings > Storage.</p>
|
78 |
-
<li><strong>Can I play GTA 5 offline on my Android device?</strong></li>
|
79 |
-
<p>Yes, you can play GTA 5 offline on your Android device, as long as you have downloaded and installed the apk and obb files. You can play the single-player mode without an internet connection. However, you need an internet connection to play GTA Online or to verify your game data.</p>
|
80 |
-
<li><strong>Can I update GTA 5 apk and obb on my Android device?</strong></li>
|
81 |
-
<p>Yes, you can update GTA 5 apk and obb on your Android device, as long as the update is available from the same source that you downloaded the files from. You can check for updates on <a href="">this website</a>. To update GTA 5 apk and obb, you need to download the new files and install them over the old ones.</p>
|
82 |
-
<li><strong>Can I transfer GTA 5 apk and obb from one device to another?</strong></li>
|
83 |
-
<p>Yes, you can transfer GTA 5 apk and obb from one device to another, as long as both devices are compatible with the game. You can use a USB cable, a Bluetooth connection, or a cloud service to transfer the files. However, you may need to reinstall the game on the new device.</p>
|
84 |
-
<li><strong>Can I play GTA 5 with my friends on Android devices?</strong></li>
|
85 |
-
<p>Yes, you can play GTA 5 with your friends on Android devices, as long as you have an internet connection and a Rockstar Games Social Club account. You can join your friends in GTA Online, where you can team up or compete with them in various activities, missions, races, heists, or just free roam in the open world.</p>
|
86 |
-
</ul></p> 197e85843d<br />
|
87 |
-
<br />
|
88 |
-
<br />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/44ov41za8i/FreeVC/commons.py
DELETED
@@ -1,171 +0,0 @@
|
|
1 |
-
import math
|
2 |
-
import numpy as np
|
3 |
-
import torch
|
4 |
-
from torch import nn
|
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 kl_divergence(m_p, logs_p, m_q, logs_q):
|
31 |
-
"""KL(P||Q)"""
|
32 |
-
kl = (logs_q - logs_p) - 0.5
|
33 |
-
kl += 0.5 * (torch.exp(2. * logs_p) + ((m_p - m_q)**2)) * torch.exp(-2. * logs_q)
|
34 |
-
return kl
|
35 |
-
|
36 |
-
|
37 |
-
def rand_gumbel(shape):
|
38 |
-
"""Sample from the Gumbel distribution, protect from overflows."""
|
39 |
-
uniform_samples = torch.rand(shape) * 0.99998 + 0.00001
|
40 |
-
return -torch.log(-torch.log(uniform_samples))
|
41 |
-
|
42 |
-
|
43 |
-
def rand_gumbel_like(x):
|
44 |
-
g = rand_gumbel(x.size()).to(dtype=x.dtype, device=x.device)
|
45 |
-
return g
|
46 |
-
|
47 |
-
|
48 |
-
def slice_segments(x, ids_str, segment_size=4):
|
49 |
-
ret = torch.zeros_like(x[:, :, :segment_size])
|
50 |
-
for i in range(x.size(0)):
|
51 |
-
idx_str = ids_str[i]
|
52 |
-
idx_end = idx_str + segment_size
|
53 |
-
ret[i] = x[i, :, idx_str:idx_end]
|
54 |
-
return ret
|
55 |
-
|
56 |
-
|
57 |
-
def rand_slice_segments(x, x_lengths=None, segment_size=4):
|
58 |
-
b, d, t = x.size()
|
59 |
-
if x_lengths is None:
|
60 |
-
x_lengths = t
|
61 |
-
ids_str_max = x_lengths - segment_size + 1
|
62 |
-
ids_str = (torch.rand([b]).to(device=x.device) * ids_str_max).to(dtype=torch.long)
|
63 |
-
ret = slice_segments(x, ids_str, segment_size)
|
64 |
-
return ret, ids_str
|
65 |
-
|
66 |
-
|
67 |
-
def rand_spec_segments(x, x_lengths=None, segment_size=4):
|
68 |
-
b, d, t = x.size()
|
69 |
-
if x_lengths is None:
|
70 |
-
x_lengths = t
|
71 |
-
ids_str_max = x_lengths - segment_size
|
72 |
-
ids_str = (torch.rand([b]).to(device=x.device) * ids_str_max).to(dtype=torch.long)
|
73 |
-
ret = slice_segments(x, ids_str, segment_size)
|
74 |
-
return ret, ids_str
|
75 |
-
|
76 |
-
|
77 |
-
def get_timing_signal_1d(
|
78 |
-
length, channels, min_timescale=1.0, max_timescale=1.0e4):
|
79 |
-
position = torch.arange(length, dtype=torch.float)
|
80 |
-
num_timescales = channels // 2
|
81 |
-
log_timescale_increment = (
|
82 |
-
math.log(float(max_timescale) / float(min_timescale)) /
|
83 |
-
(num_timescales - 1))
|
84 |
-
inv_timescales = min_timescale * torch.exp(
|
85 |
-
torch.arange(num_timescales, dtype=torch.float) * -log_timescale_increment)
|
86 |
-
scaled_time = position.unsqueeze(0) * inv_timescales.unsqueeze(1)
|
87 |
-
signal = torch.cat([torch.sin(scaled_time), torch.cos(scaled_time)], 0)
|
88 |
-
signal = F.pad(signal, [0, 0, 0, channels % 2])
|
89 |
-
signal = signal.view(1, channels, length)
|
90 |
-
return signal
|
91 |
-
|
92 |
-
|
93 |
-
def add_timing_signal_1d(x, min_timescale=1.0, max_timescale=1.0e4):
|
94 |
-
b, channels, length = x.size()
|
95 |
-
signal = get_timing_signal_1d(length, channels, min_timescale, max_timescale)
|
96 |
-
return x + signal.to(dtype=x.dtype, device=x.device)
|
97 |
-
|
98 |
-
|
99 |
-
def cat_timing_signal_1d(x, min_timescale=1.0, max_timescale=1.0e4, axis=1):
|
100 |
-
b, channels, length = x.size()
|
101 |
-
signal = get_timing_signal_1d(length, channels, min_timescale, max_timescale)
|
102 |
-
return torch.cat([x, signal.to(dtype=x.dtype, device=x.device)], axis)
|
103 |
-
|
104 |
-
|
105 |
-
def subsequent_mask(length):
|
106 |
-
mask = torch.tril(torch.ones(length, length)).unsqueeze(0).unsqueeze(0)
|
107 |
-
return mask
|
108 |
-
|
109 |
-
|
110 |
-
@torch.jit.script
|
111 |
-
def fused_add_tanh_sigmoid_multiply(input_a, input_b, n_channels):
|
112 |
-
n_channels_int = n_channels[0]
|
113 |
-
in_act = input_a + input_b
|
114 |
-
t_act = torch.tanh(in_act[:, :n_channels_int, :])
|
115 |
-
s_act = torch.sigmoid(in_act[:, n_channels_int:, :])
|
116 |
-
acts = t_act * s_act
|
117 |
-
return acts
|
118 |
-
|
119 |
-
|
120 |
-
def convert_pad_shape(pad_shape):
|
121 |
-
l = pad_shape[::-1]
|
122 |
-
pad_shape = [item for sublist in l for item in sublist]
|
123 |
-
return pad_shape
|
124 |
-
|
125 |
-
|
126 |
-
def shift_1d(x):
|
127 |
-
x = F.pad(x, convert_pad_shape([[0, 0], [0, 0], [1, 0]]))[:, :, :-1]
|
128 |
-
return x
|
129 |
-
|
130 |
-
|
131 |
-
def sequence_mask(length, max_length=None):
|
132 |
-
if max_length is None:
|
133 |
-
max_length = length.max()
|
134 |
-
x = torch.arange(max_length, dtype=length.dtype, device=length.device)
|
135 |
-
return x.unsqueeze(0) < length.unsqueeze(1)
|
136 |
-
|
137 |
-
|
138 |
-
def generate_path(duration, mask):
|
139 |
-
"""
|
140 |
-
duration: [b, 1, t_x]
|
141 |
-
mask: [b, 1, t_y, t_x]
|
142 |
-
"""
|
143 |
-
device = duration.device
|
144 |
-
|
145 |
-
b, _, t_y, t_x = mask.shape
|
146 |
-
cum_duration = torch.cumsum(duration, -1)
|
147 |
-
|
148 |
-
cum_duration_flat = cum_duration.view(b * t_x)
|
149 |
-
path = sequence_mask(cum_duration_flat, t_y).to(mask.dtype)
|
150 |
-
path = path.view(b, t_x, t_y)
|
151 |
-
path = path - F.pad(path, convert_pad_shape([[0, 0], [1, 0], [0, 0]]))[:, :-1]
|
152 |
-
path = path.unsqueeze(1).transpose(2,3) * mask
|
153 |
-
return path
|
154 |
-
|
155 |
-
|
156 |
-
def clip_grad_value_(parameters, clip_value, norm_type=2):
|
157 |
-
if isinstance(parameters, torch.Tensor):
|
158 |
-
parameters = [parameters]
|
159 |
-
parameters = list(filter(lambda p: p.grad is not None, parameters))
|
160 |
-
norm_type = float(norm_type)
|
161 |
-
if clip_value is not None:
|
162 |
-
clip_value = float(clip_value)
|
163 |
-
|
164 |
-
total_norm = 0
|
165 |
-
for p in parameters:
|
166 |
-
param_norm = p.grad.data.norm(norm_type)
|
167 |
-
total_norm += param_norm.item() ** norm_type
|
168 |
-
if clip_value is not None:
|
169 |
-
p.grad.data.clamp_(min=-clip_value, max=clip_value)
|
170 |
-
total_norm = total_norm ** (1. / norm_type)
|
171 |
-
return total_norm
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/A00001/bingothoo/src/lib/isomorphic/node.ts
DELETED
@@ -1,26 +0,0 @@
|
|
1 |
-
import Debug from 'debug'
|
2 |
-
|
3 |
-
const { fetch, setGlobalDispatcher, ProxyAgent } = require('undici')
|
4 |
-
const { HttpsProxyAgent } = require('https-proxy-agent')
|
5 |
-
const ws = require('ws')
|
6 |
-
|
7 |
-
const debug = Debug('bingo')
|
8 |
-
|
9 |
-
const httpProxy = process.env.http_proxy || process.env.HTTP_PROXY || process.env.https_proxy || process.env.HTTPS_PROXY;
|
10 |
-
let WebSocket = ws.WebSocket
|
11 |
-
|
12 |
-
if (httpProxy) {
|
13 |
-
setGlobalDispatcher(new ProxyAgent(httpProxy))
|
14 |
-
const agent = new HttpsProxyAgent(httpProxy)
|
15 |
-
// @ts-ignore
|
16 |
-
WebSocket = class extends ws.WebSocket {
|
17 |
-
constructor(address: string | URL, options: typeof ws.WebSocket) {
|
18 |
-
super(address, {
|
19 |
-
...options,
|
20 |
-
agent,
|
21 |
-
})
|
22 |
-
}
|
23 |
-
}
|
24 |
-
}
|
25 |
-
|
26 |
-
export default { fetch, WebSocket, debug }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/AIFILMS/audioldm-text-to-audio-generation/share_btn.py
DELETED
@@ -1,74 +0,0 @@
|
|
1 |
-
community_icon_html = """<svg id="share-btn-share-icon" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32">
|
2 |
-
<path d="M20.6081 3C21.7684 3 22.8053 3.49196 23.5284 4.38415C23.9756 4.93678 24.4428 5.82749 24.4808 7.16133C24.9674 7.01707 25.4353 6.93643 25.8725 6.93643C26.9833 6.93643 27.9865 7.37587 28.696 8.17411C29.6075 9.19872 30.0124 10.4579 29.8361 11.7177C29.7523 12.3177 29.5581 12.8555 29.2678 13.3534C29.8798 13.8646 30.3306 14.5763 30.5485 15.4322C30.719 16.1032 30.8939 17.5006 29.9808 18.9403C30.0389 19.0342 30.0934 19.1319 30.1442 19.2318C30.6932 20.3074 30.7283 21.5229 30.2439 22.6548C29.5093 24.3704 27.6841 25.7219 24.1397 27.1727C21.9347 28.0753 19.9174 28.6523 19.8994 28.6575C16.9842 29.4379 14.3477 29.8345 12.0653 29.8345C7.87017 29.8345 4.8668 28.508 3.13831 25.8921C0.356375 21.6797 0.754104 17.8269 4.35369 14.1131C6.34591 12.058 7.67023 9.02782 7.94613 8.36275C8.50224 6.39343 9.97271 4.20438 12.4172 4.20438H12.4179C12.6236 4.20438 12.8314 4.2214 13.0364 4.25468C14.107 4.42854 15.0428 5.06476 15.7115 6.02205C16.4331 5.09583 17.134 4.359 17.7682 3.94323C18.7242 3.31737 19.6794 3 20.6081 3ZM20.6081 5.95917C20.2427 5.95917 19.7963 6.1197 19.3039 6.44225C17.7754 7.44319 14.8258 12.6772 13.7458 14.7131C13.3839 15.3952 12.7655 15.6837 12.2086 15.6837C11.1036 15.6837 10.2408 14.5497 12.1076 13.1085C14.9146 10.9402 13.9299 7.39584 12.5898 7.1776C12.5311 7.16799 12.4731 7.16355 12.4172 7.16355C11.1989 7.16355 10.6615 9.33114 10.6615 9.33114C10.6615 9.33114 9.0863 13.4148 6.38031 16.206C3.67434 18.998 3.5346 21.2388 5.50675 24.2246C6.85185 26.2606 9.42666 26.8753 12.0653 26.8753C14.8021 26.8753 17.6077 26.2139 19.1799 25.793C19.2574 25.7723 28.8193 22.984 27.6081 20.6107C27.4046 20.212 27.0693 20.0522 26.6471 20.0522C24.9416 20.0522 21.8393 22.6726 20.5057 22.6726C20.2076 22.6726 19.9976 22.5416 19.9116 22.222C19.3433 20.1173 28.552 19.2325 27.7758 16.1839C27.639 15.6445 27.2677 15.4256 26.746 15.4263C24.4923 15.4263 19.4358 19.5181 18.3759 19.5181C18.2949 19.5181 18.2368 19.4937 18.2053 19.4419C17.6743 18.557 17.9653 17.9394 21.7082 15.6009C25.4511 13.2617 28.0783 11.8545 26.5841 10.1752C26.4121 9.98141 26.1684 9.8956 25.8725 9.8956C23.6001 9.89634 18.2311 14.9403 18.2311 14.9403C18.2311 14.9403 16.7821 16.496 15.9057 16.496C15.7043 16.496 15.533 16.4139 15.4169 16.2112C14.7956 15.1296 21.1879 10.1286 21.5484 8.06535C21.7928 6.66715 21.3771 5.95917 20.6081 5.95917Z" fill="#FF9D00"></path>
|
3 |
-
<path d="M5.50686 24.2246C3.53472 21.2387 3.67446 18.9979 6.38043 16.206C9.08641 13.4147 10.6615 9.33111 10.6615 9.33111C10.6615 9.33111 11.2499 6.95933 12.59 7.17757C13.93 7.39581 14.9139 10.9401 12.1069 13.1084C9.29997 15.276 12.6659 16.7489 13.7459 14.713C14.8258 12.6772 17.7747 7.44316 19.304 6.44221C20.8326 5.44128 21.9089 6.00204 21.5484 8.06532C21.188 10.1286 14.795 15.1295 15.4171 16.2118C16.0391 17.2934 18.2312 14.9402 18.2312 14.9402C18.2312 14.9402 25.0907 8.49588 26.5842 10.1752C28.0776 11.8545 25.4512 13.2616 21.7082 15.6008C17.9646 17.9393 17.6744 18.557 18.2054 19.4418C18.7372 20.3266 26.9998 13.1351 27.7759 16.1838C28.5513 19.2324 19.3434 20.1173 19.9117 22.2219C20.48 24.3274 26.3979 18.2382 27.6082 20.6107C28.8193 22.9839 19.2574 25.7722 19.18 25.7929C16.0914 26.62 8.24723 28.3726 5.50686 24.2246Z" fill="#FFD21E"></path>
|
4 |
-
</svg>"""
|
5 |
-
|
6 |
-
loading_icon_html = """<svg id="share-btn-loading-icon" style="display:none;" class="animate-spin"
|
7 |
-
style="color: #ffffff;
|
8 |
-
"
|
9 |
-
xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" fill="none" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 24 24"><circle style="opacity: 0.25;" cx="12" cy="12" r="10" stroke="white" stroke-width="4"></circle><path style="opacity: 0.75;" fill="white" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path></svg>"""
|
10 |
-
|
11 |
-
share_js = """async () => {
|
12 |
-
async function uploadFile(file){
|
13 |
-
const UPLOAD_URL = 'https://huggingface.co/uploads';
|
14 |
-
const response = await fetch(UPLOAD_URL, {
|
15 |
-
method: 'POST',
|
16 |
-
headers: {
|
17 |
-
'Content-Type': file.type,
|
18 |
-
'X-Requested-With': 'XMLHttpRequest',
|
19 |
-
},
|
20 |
-
body: file, /// <- File inherits from Blob
|
21 |
-
});
|
22 |
-
const url = await response.text();
|
23 |
-
return url;
|
24 |
-
}
|
25 |
-
async function getInputVideoFile(videoEl){
|
26 |
-
const res = await fetch(videoEl.src);
|
27 |
-
const blob = await res.blob();
|
28 |
-
const videoId = Date.now() % 200;
|
29 |
-
const fileName = `sd-perception-${{videoId}}.mp4`;
|
30 |
-
return new File([blob], fileName, { type: 'video/mp4' });
|
31 |
-
}
|
32 |
-
|
33 |
-
async function audioToBase64(audioFile) {
|
34 |
-
return new Promise((resolve, reject) => {
|
35 |
-
let reader = new FileReader();
|
36 |
-
reader.readAsDataURL(audioFile);
|
37 |
-
reader.onload = () => resolve(reader.result);
|
38 |
-
reader.onerror = error => reject(error);
|
39 |
-
|
40 |
-
});
|
41 |
-
}
|
42 |
-
const gradioEl = document.querySelector("gradio-app").shadowRoot || document.querySelector('body > gradio-app');
|
43 |
-
const inputPromptEl = gradioEl.querySelector('#prompt-in input').value;
|
44 |
-
const outputVideoEl = gradioEl.querySelector('#output-video video');
|
45 |
-
|
46 |
-
let titleTxt = `Text-to-Audio: ${inputPromptEl}`;
|
47 |
-
|
48 |
-
const shareBtnEl = gradioEl.querySelector('#share-btn');
|
49 |
-
const shareIconEl = gradioEl.querySelector('#share-btn-share-icon');
|
50 |
-
const loadingIconEl = gradioEl.querySelector('#share-btn-loading-icon');
|
51 |
-
if(!outputVideoEl){
|
52 |
-
return;
|
53 |
-
};
|
54 |
-
shareBtnEl.style.pointerEvents = 'none';
|
55 |
-
shareIconEl.style.display = 'none';
|
56 |
-
loadingIconEl.style.removeProperty('display');
|
57 |
-
const outputVideo = await getInputVideoFile(outputVideoEl);
|
58 |
-
const urlOutputVideo = await uploadFile(outputVideo);
|
59 |
-
|
60 |
-
const descriptionMd = `
|
61 |
-
##### ${inputPromptEl}
|
62 |
-
|
63 |
-
${urlOutputVideo}
|
64 |
-
`;
|
65 |
-
const params = new URLSearchParams({
|
66 |
-
title: titleTxt,
|
67 |
-
description: descriptionMd,
|
68 |
-
});
|
69 |
-
const paramsStr = params.toString();
|
70 |
-
window.open(`https://huggingface.co/spaces/haoheliu/audioldm-text-to-audio-generation/discussions/new?${paramsStr}`, '_blank');
|
71 |
-
shareBtnEl.style.removeProperty('pointer-events');
|
72 |
-
shareIconEl.style.removeProperty('display');
|
73 |
-
loadingIconEl.style.display = 'none';
|
74 |
-
}"""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/AIGC-Audio/AudioGPT/text_to_speech/modules/commons/conformer/espnet_positional_embedding.py
DELETED
@@ -1,113 +0,0 @@
|
|
1 |
-
import math
|
2 |
-
import torch
|
3 |
-
|
4 |
-
|
5 |
-
class PositionalEncoding(torch.nn.Module):
|
6 |
-
"""Positional encoding.
|
7 |
-
Args:
|
8 |
-
d_model (int): Embedding dimension.
|
9 |
-
dropout_rate (float): Dropout rate.
|
10 |
-
max_len (int): Maximum input length.
|
11 |
-
reverse (bool): Whether to reverse the input position.
|
12 |
-
"""
|
13 |
-
|
14 |
-
def __init__(self, d_model, dropout_rate, max_len=5000, reverse=False):
|
15 |
-
"""Construct an PositionalEncoding object."""
|
16 |
-
super(PositionalEncoding, self).__init__()
|
17 |
-
self.d_model = d_model
|
18 |
-
self.reverse = reverse
|
19 |
-
self.xscale = math.sqrt(self.d_model)
|
20 |
-
self.dropout = torch.nn.Dropout(p=dropout_rate)
|
21 |
-
self.pe = None
|
22 |
-
self.extend_pe(torch.tensor(0.0).expand(1, max_len))
|
23 |
-
|
24 |
-
def extend_pe(self, x):
|
25 |
-
"""Reset the positional encodings."""
|
26 |
-
if self.pe is not None:
|
27 |
-
if self.pe.size(1) >= x.size(1):
|
28 |
-
if self.pe.dtype != x.dtype or self.pe.device != x.device:
|
29 |
-
self.pe = self.pe.to(dtype=x.dtype, device=x.device)
|
30 |
-
return
|
31 |
-
pe = torch.zeros(x.size(1), self.d_model)
|
32 |
-
if self.reverse:
|
33 |
-
position = torch.arange(
|
34 |
-
x.size(1) - 1, -1, -1.0, dtype=torch.float32
|
35 |
-
).unsqueeze(1)
|
36 |
-
else:
|
37 |
-
position = torch.arange(0, x.size(1), dtype=torch.float32).unsqueeze(1)
|
38 |
-
div_term = torch.exp(
|
39 |
-
torch.arange(0, self.d_model, 2, dtype=torch.float32)
|
40 |
-
* -(math.log(10000.0) / self.d_model)
|
41 |
-
)
|
42 |
-
pe[:, 0::2] = torch.sin(position * div_term)
|
43 |
-
pe[:, 1::2] = torch.cos(position * div_term)
|
44 |
-
pe = pe.unsqueeze(0)
|
45 |
-
self.pe = pe.to(device=x.device, dtype=x.dtype)
|
46 |
-
|
47 |
-
def forward(self, x: torch.Tensor):
|
48 |
-
"""Add positional encoding.
|
49 |
-
Args:
|
50 |
-
x (torch.Tensor): Input tensor (batch, time, `*`).
|
51 |
-
Returns:
|
52 |
-
torch.Tensor: Encoded tensor (batch, time, `*`).
|
53 |
-
"""
|
54 |
-
self.extend_pe(x)
|
55 |
-
x = x * self.xscale + self.pe[:, : x.size(1)]
|
56 |
-
return self.dropout(x)
|
57 |
-
|
58 |
-
|
59 |
-
class ScaledPositionalEncoding(PositionalEncoding):
|
60 |
-
"""Scaled positional encoding module.
|
61 |
-
See Sec. 3.2 https://arxiv.org/abs/1809.08895
|
62 |
-
Args:
|
63 |
-
d_model (int): Embedding dimension.
|
64 |
-
dropout_rate (float): Dropout rate.
|
65 |
-
max_len (int): Maximum input length.
|
66 |
-
"""
|
67 |
-
|
68 |
-
def __init__(self, d_model, dropout_rate, max_len=5000):
|
69 |
-
"""Initialize class."""
|
70 |
-
super().__init__(d_model=d_model, dropout_rate=dropout_rate, max_len=max_len)
|
71 |
-
self.alpha = torch.nn.Parameter(torch.tensor(1.0))
|
72 |
-
|
73 |
-
def reset_parameters(self):
|
74 |
-
"""Reset parameters."""
|
75 |
-
self.alpha.data = torch.tensor(1.0)
|
76 |
-
|
77 |
-
def forward(self, x):
|
78 |
-
"""Add positional encoding.
|
79 |
-
Args:
|
80 |
-
x (torch.Tensor): Input tensor (batch, time, `*`).
|
81 |
-
Returns:
|
82 |
-
torch.Tensor: Encoded tensor (batch, time, `*`).
|
83 |
-
"""
|
84 |
-
self.extend_pe(x)
|
85 |
-
x = x + self.alpha * self.pe[:, : x.size(1)]
|
86 |
-
return self.dropout(x)
|
87 |
-
|
88 |
-
|
89 |
-
class RelPositionalEncoding(PositionalEncoding):
|
90 |
-
"""Relative positional encoding module.
|
91 |
-
See : Appendix B in https://arxiv.org/abs/1901.02860
|
92 |
-
Args:
|
93 |
-
d_model (int): Embedding dimension.
|
94 |
-
dropout_rate (float): Dropout rate.
|
95 |
-
max_len (int): Maximum input length.
|
96 |
-
"""
|
97 |
-
|
98 |
-
def __init__(self, d_model, dropout_rate, max_len=5000):
|
99 |
-
"""Initialize class."""
|
100 |
-
super().__init__(d_model, dropout_rate, max_len, reverse=True)
|
101 |
-
|
102 |
-
def forward(self, x):
|
103 |
-
"""Compute positional encoding.
|
104 |
-
Args:
|
105 |
-
x (torch.Tensor): Input tensor (batch, time, `*`).
|
106 |
-
Returns:
|
107 |
-
torch.Tensor: Encoded tensor (batch, time, `*`).
|
108 |
-
torch.Tensor: Positional embedding tensor (1, time, `*`).
|
109 |
-
"""
|
110 |
-
self.extend_pe(x)
|
111 |
-
x = x * self.xscale
|
112 |
-
pos_emb = self.pe[:, : x.size(1)]
|
113 |
-
return self.dropout(x), self.dropout(pos_emb)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/AIGC-Audio/Make_An_Audio_inpaint/ldm/modules/encoders/CLAP/__init__.py
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
from . import clap
|
2 |
-
from . import audio
|
3 |
-
from . import utils
|
|
|
|
|
|
|
|
spaces/Ababababababbababa/Ashaar/poetry_diacritizer/modules/tacotron_modules.py
DELETED
@@ -1,174 +0,0 @@
|
|
1 |
-
"""
|
2 |
-
Some custom modules that are used by the TTS model
|
3 |
-
"""
|
4 |
-
from typing import List
|
5 |
-
import torch
|
6 |
-
from torch import nn
|
7 |
-
|
8 |
-
from poetry_diacritizer.modules.layers import BatchNormConv1d
|
9 |
-
|
10 |
-
|
11 |
-
class Prenet(nn.Module):
|
12 |
-
"""
|
13 |
-
A prenet is a collection of linear layers with dropout(0.5),
|
14 |
-
and RELU activation function
|
15 |
-
Args:
|
16 |
-
config: the hyperparameters object
|
17 |
-
in_dim (int): the input dim
|
18 |
-
"""
|
19 |
-
|
20 |
-
def __init__(
|
21 |
-
self, in_dim: int, prenet_depth: List[int] = [256, 128], dropout: int = 0.5
|
22 |
-
):
|
23 |
-
""" Initializing the prenet module """
|
24 |
-
super().__init__()
|
25 |
-
in_sizes = [in_dim] + prenet_depth[:-1]
|
26 |
-
self.layers = nn.ModuleList(
|
27 |
-
[
|
28 |
-
nn.Linear(in_size, out_size)
|
29 |
-
for (in_size, out_size) in zip(in_sizes, prenet_depth)
|
30 |
-
]
|
31 |
-
)
|
32 |
-
self.relu = nn.ReLU()
|
33 |
-
self.dropout = nn.Dropout(dropout)
|
34 |
-
|
35 |
-
def forward(self, inputs: torch.Tensor):
|
36 |
-
"""Calculate forward propagation
|
37 |
-
Args:
|
38 |
-
inputs (batch_size, seqLen): the inputs to the prenet, the input shapes could
|
39 |
-
be different as it is being used in both encoder and decoder.
|
40 |
-
Returns:
|
41 |
-
Tensor: the output of the forward propagation
|
42 |
-
"""
|
43 |
-
for linear in self.layers:
|
44 |
-
inputs = self.dropout(self.relu(linear(inputs)))
|
45 |
-
return inputs
|
46 |
-
|
47 |
-
|
48 |
-
class Highway(nn.Module):
|
49 |
-
"""Highway Networks were developed by (Srivastava et al., 2015)
|
50 |
-
to overcome the difficulty of training deep neural networks
|
51 |
-
(https://arxiv.org/abs/1507.06228).
|
52 |
-
Args:
|
53 |
-
in_size (int): the input size
|
54 |
-
out_size (int): the output size
|
55 |
-
"""
|
56 |
-
|
57 |
-
def __init__(self, in_size, out_size):
|
58 |
-
"""
|
59 |
-
Initializing Highway networks
|
60 |
-
"""
|
61 |
-
super().__init__()
|
62 |
-
self.H = nn.Linear(in_size, out_size)
|
63 |
-
self.H.bias.data.zero_()
|
64 |
-
self.T = nn.Linear(in_size, out_size)
|
65 |
-
self.T.bias.data.fill_(-1)
|
66 |
-
self.relu = nn.ReLU()
|
67 |
-
self.sigmoid = nn.Sigmoid()
|
68 |
-
|
69 |
-
def forward(self, inputs: torch.Tensor):
|
70 |
-
"""Calculate forward propagation
|
71 |
-
Args:
|
72 |
-
inputs (Tensor):
|
73 |
-
"""
|
74 |
-
H = self.relu(self.H(inputs))
|
75 |
-
T = self.sigmoid(self.T(inputs))
|
76 |
-
return H * T + inputs * (1.0 - T)
|
77 |
-
|
78 |
-
|
79 |
-
class CBHG(nn.Module):
|
80 |
-
"""The CBHG module (1-D Convolution Bank + Highway network + Bidirectional GRU)
|
81 |
-
was proposed by (Lee et al., 2017, https://www.aclweb.org/anthology/Q17-1026)
|
82 |
-
for a character-level NMT model.
|
83 |
-
It was adapted by (Wang et al., 2017) for building the Tacotron.
|
84 |
-
It is used in both the encoder and decoder with different parameters.
|
85 |
-
"""
|
86 |
-
|
87 |
-
def __init__(
|
88 |
-
self,
|
89 |
-
in_dim: int,
|
90 |
-
out_dim: int,
|
91 |
-
K: int,
|
92 |
-
projections: List[int],
|
93 |
-
highway_layers: int = 4,
|
94 |
-
):
|
95 |
-
"""Initializing the CBHG module
|
96 |
-
Args:
|
97 |
-
in_dim (int): the input size
|
98 |
-
out_dim (int): the output size
|
99 |
-
k (int): number of filters
|
100 |
-
"""
|
101 |
-
super().__init__()
|
102 |
-
|
103 |
-
self.in_dim = in_dim
|
104 |
-
self.out_dim = out_dim
|
105 |
-
self.relu = nn.ReLU()
|
106 |
-
self.conv1d_banks = nn.ModuleList(
|
107 |
-
[
|
108 |
-
BatchNormConv1d(
|
109 |
-
in_dim,
|
110 |
-
in_dim,
|
111 |
-
kernel_size=k,
|
112 |
-
stride=1,
|
113 |
-
padding=k // 2,
|
114 |
-
activation=self.relu,
|
115 |
-
)
|
116 |
-
for k in range(1, K + 1)
|
117 |
-
]
|
118 |
-
)
|
119 |
-
self.max_pool1d = nn.MaxPool1d(kernel_size=2, stride=1, padding=1)
|
120 |
-
|
121 |
-
in_sizes = [K * in_dim] + projections[:-1]
|
122 |
-
activations = [self.relu] * (len(projections) - 1) + [None]
|
123 |
-
self.conv1d_projections = nn.ModuleList(
|
124 |
-
[
|
125 |
-
BatchNormConv1d(
|
126 |
-
in_size, out_size, kernel_size=3, stride=1, padding=1, activation=ac
|
127 |
-
)
|
128 |
-
for (in_size, out_size, ac) in zip(in_sizes, projections, activations)
|
129 |
-
]
|
130 |
-
)
|
131 |
-
|
132 |
-
self.pre_highway = nn.Linear(projections[-1], in_dim, bias=False)
|
133 |
-
self.highways = nn.ModuleList([Highway(in_dim, in_dim) for _ in range(4)])
|
134 |
-
|
135 |
-
self.gru = nn.GRU(in_dim, out_dim, 1, batch_first=True, bidirectional=True)
|
136 |
-
|
137 |
-
def forward(self, inputs, input_lengths=None):
|
138 |
-
# (B, T_in, in_dim)
|
139 |
-
x = inputs
|
140 |
-
x = x.transpose(1, 2)
|
141 |
-
T = x.size(-1)
|
142 |
-
|
143 |
-
# (B, in_dim*K, T_in)
|
144 |
-
# Concat conv1d bank outputs
|
145 |
-
x = torch.cat([conv1d(x)[:, :, :T] for conv1d in self.conv1d_banks], dim=1)
|
146 |
-
assert x.size(1) == self.in_dim * len(self.conv1d_banks)
|
147 |
-
x = self.max_pool1d(x)[:, :, :T]
|
148 |
-
|
149 |
-
for conv1d in self.conv1d_projections:
|
150 |
-
x = conv1d(x)
|
151 |
-
|
152 |
-
# (B, T_in, in_dim)
|
153 |
-
# Back to the original shape
|
154 |
-
x = x.transpose(1, 2)
|
155 |
-
|
156 |
-
if x.size(-1) != self.in_dim:
|
157 |
-
x = self.pre_highway(x)
|
158 |
-
|
159 |
-
# Residual connection
|
160 |
-
x += inputs
|
161 |
-
for highway in self.highways:
|
162 |
-
x = highway(x)
|
163 |
-
|
164 |
-
if input_lengths is not None:
|
165 |
-
x = nn.utils.rnn.pack_padded_sequence(x, input_lengths, batch_first=True)
|
166 |
-
|
167 |
-
# (B, T_in, in_dim*2)
|
168 |
-
self.gru.flatten_parameters()
|
169 |
-
outputs, _ = self.gru(x)
|
170 |
-
|
171 |
-
if input_lengths is not None:
|
172 |
-
outputs, _ = nn.utils.rnn.pad_packed_sequence(outputs, batch_first=True)
|
173 |
-
|
174 |
-
return outputs
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/AchyuthGamer/OpenGPT/g4f/Provider/ChatgptDemo.py
DELETED
@@ -1,61 +0,0 @@
|
|
1 |
-
from __future__ import annotations
|
2 |
-
|
3 |
-
import time, json, re
|
4 |
-
from aiohttp import ClientSession
|
5 |
-
from typing import AsyncGenerator
|
6 |
-
|
7 |
-
from .base_provider import AsyncGeneratorProvider
|
8 |
-
from .helper import format_prompt
|
9 |
-
|
10 |
-
class ChatgptDemo(AsyncGeneratorProvider):
|
11 |
-
url = "https://chat.chatgptdemo.net"
|
12 |
-
supports_gpt_35_turbo = True
|
13 |
-
working = True
|
14 |
-
|
15 |
-
@classmethod
|
16 |
-
async def create_async_generator(
|
17 |
-
cls,
|
18 |
-
model: str,
|
19 |
-
messages: list[dict[str, str]],
|
20 |
-
proxy: str = None,
|
21 |
-
**kwargs
|
22 |
-
) -> AsyncGenerator:
|
23 |
-
headers = {
|
24 |
-
"authority": "chat.chatgptdemo.net",
|
25 |
-
"accept-language": "de-DE,de;q=0.9,en-DE;q=0.8,en;q=0.7,en-US",
|
26 |
-
"origin": "https://chat.chatgptdemo.net",
|
27 |
-
"referer": "https://chat.chatgptdemo.net/",
|
28 |
-
"sec-ch-ua": '"Google Chrome";v="117", "Not;A=Brand";v="8", "Chromium";v="117"',
|
29 |
-
"sec-ch-ua-mobile": "?0",
|
30 |
-
"sec-ch-ua-platform": '"Linux"',
|
31 |
-
"sec-fetch-dest": "empty",
|
32 |
-
"sec-fetch-mode": "cors",
|
33 |
-
"sec-fetch-site": "same-origin",
|
34 |
-
"user-agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/117.0.0.0 Safari/537.36"
|
35 |
-
}
|
36 |
-
async with ClientSession(headers=headers) as session:
|
37 |
-
async with session.get(f"{cls.url}/", proxy=proxy) as response:
|
38 |
-
response.raise_for_status()
|
39 |
-
response = await response.text()
|
40 |
-
result = re.search(r'<div id="USERID" style="display: none">(.*?)<\/div>', response)
|
41 |
-
if not result:
|
42 |
-
raise RuntimeError("No user id found")
|
43 |
-
user_id = result.group(1)
|
44 |
-
async with session.post(f"{cls.url}/new_chat", json={"user_id": user_id}, proxy=proxy) as response:
|
45 |
-
response.raise_for_status()
|
46 |
-
chat_id = (await response.json())["id_"]
|
47 |
-
if not chat_id:
|
48 |
-
raise RuntimeError("Could not create new chat")
|
49 |
-
data = {
|
50 |
-
"question": format_prompt(messages),
|
51 |
-
"chat_id": chat_id,
|
52 |
-
"timestamp": int(time.time()*1000),
|
53 |
-
}
|
54 |
-
async with session.post(f"{cls.url}/chat_api_stream", json=data, proxy=proxy) as response:
|
55 |
-
response.raise_for_status()
|
56 |
-
async for line in response.content:
|
57 |
-
if line.startswith(b"data: "):
|
58 |
-
line = json.loads(line[6:-1])
|
59 |
-
chunk = line["choices"][0]["delta"].get("content")
|
60 |
-
if chunk:
|
61 |
-
yield chunk
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/AchyuthGamer/OpenGPT/g4f/Provider/Providers/helpers/theb.py
DELETED
@@ -1,48 +0,0 @@
|
|
1 |
-
import json
|
2 |
-
import sys
|
3 |
-
from re import findall
|
4 |
-
from curl_cffi import requests
|
5 |
-
|
6 |
-
config = json.loads(sys.argv[1])
|
7 |
-
prompt = config['messages'][-1]['content']
|
8 |
-
|
9 |
-
headers = {
|
10 |
-
'authority': 'chatbot.theb.ai',
|
11 |
-
'accept': 'application/json, text/plain, */*',
|
12 |
-
'accept-language': 'en,fr-FR;q=0.9,fr;q=0.8,es-ES;q=0.7,es;q=0.6,en-US;q=0.5,am;q=0.4,de;q=0.3',
|
13 |
-
'content-type': 'application/json',
|
14 |
-
'origin': 'https://chatbot.theb.ai',
|
15 |
-
'referer': 'https://chatbot.theb.ai/',
|
16 |
-
'sec-ch-ua': '"Google Chrome";v="113", "Chromium";v="113", "Not-A.Brand";v="24"',
|
17 |
-
'sec-ch-ua-mobile': '?0',
|
18 |
-
'sec-ch-ua-platform': '"macOS"',
|
19 |
-
'sec-fetch-dest': 'empty',
|
20 |
-
'sec-fetch-mode': 'cors',
|
21 |
-
'sec-fetch-site': 'same-origin',
|
22 |
-
'user-agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36',
|
23 |
-
}
|
24 |
-
|
25 |
-
json_data = {
|
26 |
-
'prompt': prompt,
|
27 |
-
'options': {}
|
28 |
-
}
|
29 |
-
|
30 |
-
def format(chunk):
|
31 |
-
try:
|
32 |
-
completion_chunk = findall(r'content":"(.*)"},"fin', chunk.decode())[0]
|
33 |
-
print(completion_chunk, flush=True, end='')
|
34 |
-
|
35 |
-
except Exception as e:
|
36 |
-
print(f'[ERROR] an error occured, retrying... | [[{chunk.decode()}]]', flush=True)
|
37 |
-
return
|
38 |
-
|
39 |
-
while True:
|
40 |
-
try:
|
41 |
-
response = requests.post('https://chatbot.theb.ai/api/chat-process',
|
42 |
-
headers=headers, json=json_data, content_callback=format, impersonate='chrome110')
|
43 |
-
|
44 |
-
exit(0)
|
45 |
-
|
46 |
-
except Exception as e:
|
47 |
-
print('[ERROR] an error occured, retrying... |', e, flush=True)
|
48 |
-
continue
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/AgentVerse/agentVerse/ui/src/phaser3-rex-plugins/templates/spinner/audio/Audio.js
DELETED
@@ -1,61 +0,0 @@
|
|
1 |
-
import Base from '../base/Base.js';
|
2 |
-
import { Line } from '../utils/Geoms.js';
|
3 |
-
|
4 |
-
const Linear = Phaser.Math.Linear;
|
5 |
-
|
6 |
-
class Audio extends Base {
|
7 |
-
constructor(scene, config) {
|
8 |
-
super(scene, config);
|
9 |
-
this.type = 'rexSpinnerAudio';
|
10 |
-
}
|
11 |
-
|
12 |
-
buildShapes() {
|
13 |
-
for (var i = 0; i < 4; i++) {
|
14 |
-
this.addShape(new Line());
|
15 |
-
}
|
16 |
-
this.prevValue = undefined;
|
17 |
-
}
|
18 |
-
|
19 |
-
updateShapes() {
|
20 |
-
var centerX = this.centerX;
|
21 |
-
var centerY = this.centerY;
|
22 |
-
var radius = this.radius;
|
23 |
-
var leftBound = centerX - radius;
|
24 |
-
var bottomBound = centerY + radius;
|
25 |
-
var maxLineHeight = radius * 2;
|
26 |
-
|
27 |
-
var shapes = this.getShapes(),
|
28 |
-
cnt = shapes.length;
|
29 |
-
var cellWidth = (radius * 2) / cnt;
|
30 |
-
var lineWidth = cellWidth * 0.7;
|
31 |
-
|
32 |
-
// Reset range of value
|
33 |
-
if ((this.prevValue === undefined) || (this.prevValue > this.value)) {
|
34 |
-
for (var i = 0; i < cnt; i++) {
|
35 |
-
var line = shapes[i];
|
36 |
-
var from = (this.prevValue === undefined) ? Math.random() : line.getData('to');
|
37 |
-
line
|
38 |
-
.setData('from', from)
|
39 |
-
.setData('to', Math.random())
|
40 |
-
}
|
41 |
-
}
|
42 |
-
this.prevValue = this.value;
|
43 |
-
|
44 |
-
for (var i = 0; i < cnt; i++) {
|
45 |
-
var line = shapes[i];
|
46 |
-
var from = line.getData('from'),
|
47 |
-
to = line.getData('to'),
|
48 |
-
current = Linear(from, to, this.value);
|
49 |
-
var lineHeight = current * maxLineHeight;
|
50 |
-
var x = leftBound + (cellWidth * (i + 0.5));
|
51 |
-
|
52 |
-
line
|
53 |
-
.lineStyle(lineWidth, this.color, 1)
|
54 |
-
.setP0(x, bottomBound)
|
55 |
-
.setP1(x, (bottomBound - lineHeight));
|
56 |
-
|
57 |
-
}
|
58 |
-
}
|
59 |
-
}
|
60 |
-
|
61 |
-
export default Audio;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/AgentVerse/agentVerse/ui/src/phaser3-rex-plugins/templates/ui/colorinput/colorpicker/ColorPicker.js
DELETED
@@ -1,177 +0,0 @@
|
|
1 |
-
import Sizer from '../../sizer/Sizer.js';
|
2 |
-
import HPalette from './methods/HPalette.js';
|
3 |
-
import SVPalette from './methods/SVPalette.js';
|
4 |
-
|
5 |
-
const GetValue = Phaser.Utils.Objects.GetValue;
|
6 |
-
|
7 |
-
class ColorPicker extends Sizer {
|
8 |
-
constructor(scene, config) {
|
9 |
-
super(scene, config);
|
10 |
-
this.type = 'rexColorPicker';
|
11 |
-
this.freezePalettes = false;
|
12 |
-
|
13 |
-
// orientation
|
14 |
-
var hPalettePosition = GetValue(config, 'hPalette.position', 0);
|
15 |
-
if (typeof (hPalettePosition) === 'string') {
|
16 |
-
hPalettePosition = HPalettePositionNamesMap[hPalettePosition];
|
17 |
-
}
|
18 |
-
var orientation = (
|
19 |
-
(hPalettePosition === 0) || // bottom
|
20 |
-
(hPalettePosition === 2) // top
|
21 |
-
) ? 1 : // y
|
22 |
-
0; // x
|
23 |
-
this.setOrientation(orientation)
|
24 |
-
|
25 |
-
// Add elements
|
26 |
-
var background = GetValue(config, 'background', undefined);
|
27 |
-
|
28 |
-
var hPaletteWidth, hPaletteHeight;
|
29 |
-
if (this.orientation === 0) {
|
30 |
-
var hPaletteWidth = GetValue(config, 'hPalette.width', undefined);
|
31 |
-
if (hPaletteWidth === undefined) {
|
32 |
-
hPaletteWidth = GetValue(config, 'hPalette.size', 10);
|
33 |
-
}
|
34 |
-
} else {
|
35 |
-
hPaletteHeight = GetValue(config, 'hPalette.height', undefined);
|
36 |
-
if (hPaletteHeight === undefined) {
|
37 |
-
hPaletteHeight = GetValue(config, 'hPalette.size', 10);
|
38 |
-
}
|
39 |
-
}
|
40 |
-
|
41 |
-
var hPalette = new HPalette(scene, {
|
42 |
-
width: hPaletteWidth,
|
43 |
-
height: hPaletteHeight
|
44 |
-
});
|
45 |
-
scene.add.existing(hPalette);
|
46 |
-
|
47 |
-
var svPaletteWidth = GetValue(config, 'svPalette.width', undefined);
|
48 |
-
var svPaletteHeight = GetValue(config, 'svPalette.height', undefined);
|
49 |
-
|
50 |
-
var svPalette = new SVPalette(scene, {
|
51 |
-
width: svPaletteWidth,
|
52 |
-
height: svPaletteHeight
|
53 |
-
});
|
54 |
-
scene.add.existing(svPalette);
|
55 |
-
|
56 |
-
if (background) {
|
57 |
-
this.addBackground(background);
|
58 |
-
}
|
59 |
-
|
60 |
-
var hPaletteAddConfig = {
|
61 |
-
proportion: 0, expand: true
|
62 |
-
}
|
63 |
-
|
64 |
-
var svPaletteProportion, svPaletteExpand;
|
65 |
-
if (this.orientation === 0) {
|
66 |
-
svPaletteProportion = (svPaletteWidth === undefined) ? 1 : 0;
|
67 |
-
svPaletteExpand = (svPaletteHeight === undefined) ? true : false;
|
68 |
-
} else {
|
69 |
-
svPaletteProportion = (svPaletteHeight === undefined) ? 1 : 0;
|
70 |
-
svPaletteExpand = (svPaletteWidth === undefined) ? true : false;
|
71 |
-
}
|
72 |
-
var svPaletteAddConfig = {
|
73 |
-
proportion: svPaletteProportion, expand: svPaletteExpand
|
74 |
-
}
|
75 |
-
|
76 |
-
if ((hPalettePosition === 0) || (hPalettePosition === 3)) { // bottom, right
|
77 |
-
this
|
78 |
-
.add(svPalette, svPaletteAddConfig)
|
79 |
-
.add(hPalette, hPaletteAddConfig)
|
80 |
-
} else { // left, top
|
81 |
-
this
|
82 |
-
.add(hPalette, hPaletteAddConfig)
|
83 |
-
.add(svPalette, svPaletteAddConfig)
|
84 |
-
}
|
85 |
-
|
86 |
-
hPalette
|
87 |
-
.on('input', function () {
|
88 |
-
svPalette.setHue(hPalette.getHue());
|
89 |
-
this.setValue(svPalette.color, true);
|
90 |
-
}, this)
|
91 |
-
|
92 |
-
svPalette
|
93 |
-
.on('input', function () {
|
94 |
-
this.setValue(svPalette.color, true);
|
95 |
-
}, this)
|
96 |
-
|
97 |
-
this.addChildrenMap('background', background);
|
98 |
-
this.addChildrenMap('hPalette', hPalette);
|
99 |
-
this.addChildrenMap('svPalette', svPalette);
|
100 |
-
|
101 |
-
var callback = GetValue(config, 'valuechangeCallback', null);
|
102 |
-
if (callback !== null) {
|
103 |
-
var scope = GetValue(config, 'valuechangeCallbackScope', undefined);
|
104 |
-
this.on('valuechange', callback, scope);
|
105 |
-
}
|
106 |
-
|
107 |
-
this.setValue(GetValue(config, 'value', 0xffffff));
|
108 |
-
}
|
109 |
-
|
110 |
-
get value() {
|
111 |
-
return this._value;
|
112 |
-
}
|
113 |
-
|
114 |
-
set value(value) {
|
115 |
-
if (this._value === value) {
|
116 |
-
return;
|
117 |
-
}
|
118 |
-
|
119 |
-
var oldValue = this._value;
|
120 |
-
this._value = value;
|
121 |
-
|
122 |
-
if (!this.freezePalettes) {
|
123 |
-
this.updatePalettes();
|
124 |
-
}
|
125 |
-
|
126 |
-
this.emit('valuechange', value, oldValue, this);
|
127 |
-
}
|
128 |
-
|
129 |
-
setValue(value, freezePalettes) {
|
130 |
-
this.freezePalettes = !!freezePalettes;
|
131 |
-
this.value = value;
|
132 |
-
this.freezePalettes = false;
|
133 |
-
return this;
|
134 |
-
}
|
135 |
-
|
136 |
-
get color() {
|
137 |
-
return this._value;
|
138 |
-
}
|
139 |
-
|
140 |
-
set color(color) {
|
141 |
-
this.value = color;
|
142 |
-
}
|
143 |
-
|
144 |
-
setColor(color) {
|
145 |
-
this.color = color;
|
146 |
-
return this;
|
147 |
-
}
|
148 |
-
|
149 |
-
updatePalettes() {
|
150 |
-
this.childrenMap.hPalette.setColor(this.color);
|
151 |
-
this.childrenMap.svPalette.setColor(this.color);
|
152 |
-
return this;
|
153 |
-
}
|
154 |
-
|
155 |
-
runLayout(parent, newWidth, newHeight) {
|
156 |
-
if (this.ignoreLayout) {
|
157 |
-
return this;
|
158 |
-
}
|
159 |
-
|
160 |
-
super.runLayout(parent, newWidth, newHeight);
|
161 |
-
|
162 |
-
this.childrenMap.hPalette.setMarkerPosition(this.value);
|
163 |
-
this.childrenMap.svPalette.setMarkerPosition(this.value);
|
164 |
-
|
165 |
-
return this;
|
166 |
-
}
|
167 |
-
|
168 |
-
}
|
169 |
-
|
170 |
-
var HPalettePositionNamesMap = {
|
171 |
-
bottom: 0,
|
172 |
-
left: 1,
|
173 |
-
top: 2,
|
174 |
-
right: 3
|
175 |
-
}
|
176 |
-
|
177 |
-
export default ColorPicker;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/AlekseyKorshuk/thin-plate-spline-motion-model/logger.py
DELETED
@@ -1,212 +0,0 @@
|
|
1 |
-
import numpy as np
|
2 |
-
import torch
|
3 |
-
import torch.nn.functional as F
|
4 |
-
import imageio
|
5 |
-
|
6 |
-
import os
|
7 |
-
from skimage.draw import circle
|
8 |
-
|
9 |
-
import matplotlib.pyplot as plt
|
10 |
-
import collections
|
11 |
-
|
12 |
-
|
13 |
-
class Logger:
|
14 |
-
def __init__(self, log_dir, checkpoint_freq=50, visualizer_params=None, zfill_num=8, log_file_name='log.txt'):
|
15 |
-
|
16 |
-
self.loss_list = []
|
17 |
-
self.cpk_dir = log_dir
|
18 |
-
self.visualizations_dir = os.path.join(log_dir, 'train-vis')
|
19 |
-
if not os.path.exists(self.visualizations_dir):
|
20 |
-
os.makedirs(self.visualizations_dir)
|
21 |
-
self.log_file = open(os.path.join(log_dir, log_file_name), 'a')
|
22 |
-
self.zfill_num = zfill_num
|
23 |
-
self.visualizer = Visualizer(**visualizer_params)
|
24 |
-
self.checkpoint_freq = checkpoint_freq
|
25 |
-
self.epoch = 0
|
26 |
-
self.best_loss = float('inf')
|
27 |
-
self.names = None
|
28 |
-
|
29 |
-
def log_scores(self, loss_names):
|
30 |
-
loss_mean = np.array(self.loss_list).mean(axis=0)
|
31 |
-
|
32 |
-
loss_string = "; ".join(["%s - %.5f" % (name, value) for name, value in zip(loss_names, loss_mean)])
|
33 |
-
loss_string = str(self.epoch).zfill(self.zfill_num) + ") " + loss_string
|
34 |
-
|
35 |
-
print(loss_string, file=self.log_file)
|
36 |
-
self.loss_list = []
|
37 |
-
self.log_file.flush()
|
38 |
-
|
39 |
-
def visualize_rec(self, inp, out):
|
40 |
-
image = self.visualizer.visualize(inp['driving'], inp['source'], out)
|
41 |
-
imageio.imsave(os.path.join(self.visualizations_dir, "%s-rec.png" % str(self.epoch).zfill(self.zfill_num)), image)
|
42 |
-
|
43 |
-
def save_cpk(self, emergent=False):
|
44 |
-
cpk = {k: v.state_dict() for k, v in self.models.items()}
|
45 |
-
cpk['epoch'] = self.epoch
|
46 |
-
cpk_path = os.path.join(self.cpk_dir, '%s-checkpoint.pth.tar' % str(self.epoch).zfill(self.zfill_num))
|
47 |
-
if not (os.path.exists(cpk_path) and emergent):
|
48 |
-
torch.save(cpk, cpk_path)
|
49 |
-
|
50 |
-
@staticmethod
|
51 |
-
def load_cpk(checkpoint_path, inpainting_network=None, dense_motion_network =None, kp_detector=None,
|
52 |
-
bg_predictor=None, avd_network=None, optimizer=None, optimizer_bg_predictor=None,
|
53 |
-
optimizer_avd=None):
|
54 |
-
checkpoint = torch.load(checkpoint_path)
|
55 |
-
if inpainting_network is not None:
|
56 |
-
inpainting_network.load_state_dict(checkpoint['inpainting_network'])
|
57 |
-
if kp_detector is not None:
|
58 |
-
kp_detector.load_state_dict(checkpoint['kp_detector'])
|
59 |
-
if bg_predictor is not None and 'bg_predictor' in checkpoint:
|
60 |
-
bg_predictor.load_state_dict(checkpoint['bg_predictor'])
|
61 |
-
if dense_motion_network is not None:
|
62 |
-
dense_motion_network.load_state_dict(checkpoint['dense_motion_network'])
|
63 |
-
if avd_network is not None:
|
64 |
-
if 'avd_network' in checkpoint:
|
65 |
-
avd_network.load_state_dict(checkpoint['avd_network'])
|
66 |
-
if optimizer_bg_predictor is not None and 'optimizer_bg_predictor' in checkpoint:
|
67 |
-
optimizer_bg_predictor.load_state_dict(checkpoint['optimizer_bg_predictor'])
|
68 |
-
if optimizer is not None and 'optimizer' in checkpoint:
|
69 |
-
optimizer.load_state_dict(checkpoint['optimizer'])
|
70 |
-
if optimizer_avd is not None:
|
71 |
-
if 'optimizer_avd' in checkpoint:
|
72 |
-
optimizer_avd.load_state_dict(checkpoint['optimizer_avd'])
|
73 |
-
epoch = -1
|
74 |
-
if 'epoch' in checkpoint:
|
75 |
-
epoch = checkpoint['epoch']
|
76 |
-
return epoch
|
77 |
-
|
78 |
-
def __enter__(self):
|
79 |
-
return self
|
80 |
-
|
81 |
-
def __exit__(self):
|
82 |
-
if 'models' in self.__dict__:
|
83 |
-
self.save_cpk()
|
84 |
-
self.log_file.close()
|
85 |
-
|
86 |
-
def log_iter(self, losses):
|
87 |
-
losses = collections.OrderedDict(losses.items())
|
88 |
-
self.names = list(losses.keys())
|
89 |
-
self.loss_list.append(list(losses.values()))
|
90 |
-
|
91 |
-
def log_epoch(self, epoch, models, inp, out):
|
92 |
-
self.epoch = epoch
|
93 |
-
self.models = models
|
94 |
-
if (self.epoch + 1) % self.checkpoint_freq == 0:
|
95 |
-
self.save_cpk()
|
96 |
-
self.log_scores(self.names)
|
97 |
-
self.visualize_rec(inp, out)
|
98 |
-
|
99 |
-
|
100 |
-
class Visualizer:
|
101 |
-
def __init__(self, kp_size=5, draw_border=False, colormap='gist_rainbow'):
|
102 |
-
self.kp_size = kp_size
|
103 |
-
self.draw_border = draw_border
|
104 |
-
self.colormap = plt.get_cmap(colormap)
|
105 |
-
|
106 |
-
def draw_image_with_kp(self, image, kp_array):
|
107 |
-
image = np.copy(image)
|
108 |
-
spatial_size = np.array(image.shape[:2][::-1])[np.newaxis]
|
109 |
-
kp_array = spatial_size * (kp_array + 1) / 2
|
110 |
-
num_kp = kp_array.shape[0]
|
111 |
-
for kp_ind, kp in enumerate(kp_array):
|
112 |
-
rr, cc = circle(kp[1], kp[0], self.kp_size, shape=image.shape[:2])
|
113 |
-
image[rr, cc] = np.array(self.colormap(kp_ind / num_kp))[:3]
|
114 |
-
return image
|
115 |
-
|
116 |
-
def create_image_column_with_kp(self, images, kp):
|
117 |
-
image_array = np.array([self.draw_image_with_kp(v, k) for v, k in zip(images, kp)])
|
118 |
-
return self.create_image_column(image_array)
|
119 |
-
|
120 |
-
def create_image_column(self, images):
|
121 |
-
if self.draw_border:
|
122 |
-
images = np.copy(images)
|
123 |
-
images[:, :, [0, -1]] = (1, 1, 1)
|
124 |
-
images[:, :, [0, -1]] = (1, 1, 1)
|
125 |
-
return np.concatenate(list(images), axis=0)
|
126 |
-
|
127 |
-
def create_image_grid(self, *args):
|
128 |
-
out = []
|
129 |
-
for arg in args:
|
130 |
-
if type(arg) == tuple:
|
131 |
-
out.append(self.create_image_column_with_kp(arg[0], arg[1]))
|
132 |
-
else:
|
133 |
-
out.append(self.create_image_column(arg))
|
134 |
-
return np.concatenate(out, axis=1)
|
135 |
-
|
136 |
-
def visualize(self, driving, source, out):
|
137 |
-
images = []
|
138 |
-
|
139 |
-
# Source image with keypoints
|
140 |
-
source = source.data.cpu()
|
141 |
-
kp_source = out['kp_source']['fg_kp'].data.cpu().numpy()
|
142 |
-
source = np.transpose(source, [0, 2, 3, 1])
|
143 |
-
images.append((source, kp_source))
|
144 |
-
|
145 |
-
# Equivariance visualization
|
146 |
-
if 'transformed_frame' in out:
|
147 |
-
transformed = out['transformed_frame'].data.cpu().numpy()
|
148 |
-
transformed = np.transpose(transformed, [0, 2, 3, 1])
|
149 |
-
transformed_kp = out['transformed_kp']['fg_kp'].data.cpu().numpy()
|
150 |
-
images.append((transformed, transformed_kp))
|
151 |
-
|
152 |
-
# Driving image with keypoints
|
153 |
-
kp_driving = out['kp_driving']['fg_kp'].data.cpu().numpy()
|
154 |
-
driving = driving.data.cpu().numpy()
|
155 |
-
driving = np.transpose(driving, [0, 2, 3, 1])
|
156 |
-
images.append((driving, kp_driving))
|
157 |
-
|
158 |
-
# Deformed image
|
159 |
-
if 'deformed' in out:
|
160 |
-
deformed = out['deformed'].data.cpu().numpy()
|
161 |
-
deformed = np.transpose(deformed, [0, 2, 3, 1])
|
162 |
-
images.append(deformed)
|
163 |
-
|
164 |
-
# Result with and without keypoints
|
165 |
-
prediction = out['prediction'].data.cpu().numpy()
|
166 |
-
prediction = np.transpose(prediction, [0, 2, 3, 1])
|
167 |
-
if 'kp_norm' in out:
|
168 |
-
kp_norm = out['kp_norm']['fg_kp'].data.cpu().numpy()
|
169 |
-
images.append((prediction, kp_norm))
|
170 |
-
images.append(prediction)
|
171 |
-
|
172 |
-
|
173 |
-
## Occlusion map
|
174 |
-
if 'occlusion_map' in out:
|
175 |
-
for i in range(len(out['occlusion_map'])):
|
176 |
-
occlusion_map = out['occlusion_map'][i].data.cpu().repeat(1, 3, 1, 1)
|
177 |
-
occlusion_map = F.interpolate(occlusion_map, size=source.shape[1:3]).numpy()
|
178 |
-
occlusion_map = np.transpose(occlusion_map, [0, 2, 3, 1])
|
179 |
-
images.append(occlusion_map)
|
180 |
-
|
181 |
-
# Deformed images according to each individual transform
|
182 |
-
if 'deformed_source' in out:
|
183 |
-
full_mask = []
|
184 |
-
for i in range(out['deformed_source'].shape[1]):
|
185 |
-
image = out['deformed_source'][:, i].data.cpu()
|
186 |
-
# import ipdb;ipdb.set_trace()
|
187 |
-
image = F.interpolate(image, size=source.shape[1:3])
|
188 |
-
mask = out['contribution_maps'][:, i:(i+1)].data.cpu().repeat(1, 3, 1, 1)
|
189 |
-
mask = F.interpolate(mask, size=source.shape[1:3])
|
190 |
-
image = np.transpose(image.numpy(), (0, 2, 3, 1))
|
191 |
-
mask = np.transpose(mask.numpy(), (0, 2, 3, 1))
|
192 |
-
|
193 |
-
if i != 0:
|
194 |
-
color = np.array(self.colormap((i - 1) / (out['deformed_source'].shape[1] - 1)))[:3]
|
195 |
-
else:
|
196 |
-
color = np.array((0, 0, 0))
|
197 |
-
|
198 |
-
color = color.reshape((1, 1, 1, 3))
|
199 |
-
|
200 |
-
images.append(image)
|
201 |
-
if i != 0:
|
202 |
-
images.append(mask * color)
|
203 |
-
else:
|
204 |
-
images.append(mask)
|
205 |
-
|
206 |
-
full_mask.append(mask * color)
|
207 |
-
|
208 |
-
images.append(sum(full_mask))
|
209 |
-
|
210 |
-
image = self.create_image_grid(*images)
|
211 |
-
image = (255 * image).astype(np.uint8)
|
212 |
-
return image
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/AlexWang/lama/saicinpainting/training/visualizers/colors.py
DELETED
@@ -1,76 +0,0 @@
|
|
1 |
-
import random
|
2 |
-
import colorsys
|
3 |
-
|
4 |
-
import numpy as np
|
5 |
-
import matplotlib
|
6 |
-
matplotlib.use('agg')
|
7 |
-
import matplotlib.pyplot as plt
|
8 |
-
from matplotlib.colors import LinearSegmentedColormap
|
9 |
-
|
10 |
-
|
11 |
-
def generate_colors(nlabels, type='bright', first_color_black=False, last_color_black=True, verbose=False):
|
12 |
-
# https://stackoverflow.com/questions/14720331/how-to-generate-random-colors-in-matplotlib
|
13 |
-
"""
|
14 |
-
Creates a random colormap to be used together with matplotlib. Useful for segmentation tasks
|
15 |
-
:param nlabels: Number of labels (size of colormap)
|
16 |
-
:param type: 'bright' for strong colors, 'soft' for pastel colors
|
17 |
-
:param first_color_black: Option to use first color as black, True or False
|
18 |
-
:param last_color_black: Option to use last color as black, True or False
|
19 |
-
:param verbose: Prints the number of labels and shows the colormap. True or False
|
20 |
-
:return: colormap for matplotlib
|
21 |
-
"""
|
22 |
-
if type not in ('bright', 'soft'):
|
23 |
-
print ('Please choose "bright" or "soft" for type')
|
24 |
-
return
|
25 |
-
|
26 |
-
if verbose:
|
27 |
-
print('Number of labels: ' + str(nlabels))
|
28 |
-
|
29 |
-
# Generate color map for bright colors, based on hsv
|
30 |
-
if type == 'bright':
|
31 |
-
randHSVcolors = [(np.random.uniform(low=0.0, high=1),
|
32 |
-
np.random.uniform(low=0.2, high=1),
|
33 |
-
np.random.uniform(low=0.9, high=1)) for i in range(nlabels)]
|
34 |
-
|
35 |
-
# Convert HSV list to RGB
|
36 |
-
randRGBcolors = []
|
37 |
-
for HSVcolor in randHSVcolors:
|
38 |
-
randRGBcolors.append(colorsys.hsv_to_rgb(HSVcolor[0], HSVcolor[1], HSVcolor[2]))
|
39 |
-
|
40 |
-
if first_color_black:
|
41 |
-
randRGBcolors[0] = [0, 0, 0]
|
42 |
-
|
43 |
-
if last_color_black:
|
44 |
-
randRGBcolors[-1] = [0, 0, 0]
|
45 |
-
|
46 |
-
random_colormap = LinearSegmentedColormap.from_list('new_map', randRGBcolors, N=nlabels)
|
47 |
-
|
48 |
-
# Generate soft pastel colors, by limiting the RGB spectrum
|
49 |
-
if type == 'soft':
|
50 |
-
low = 0.6
|
51 |
-
high = 0.95
|
52 |
-
randRGBcolors = [(np.random.uniform(low=low, high=high),
|
53 |
-
np.random.uniform(low=low, high=high),
|
54 |
-
np.random.uniform(low=low, high=high)) for i in range(nlabels)]
|
55 |
-
|
56 |
-
if first_color_black:
|
57 |
-
randRGBcolors[0] = [0, 0, 0]
|
58 |
-
|
59 |
-
if last_color_black:
|
60 |
-
randRGBcolors[-1] = [0, 0, 0]
|
61 |
-
random_colormap = LinearSegmentedColormap.from_list('new_map', randRGBcolors, N=nlabels)
|
62 |
-
|
63 |
-
# Display colorbar
|
64 |
-
if verbose:
|
65 |
-
from matplotlib import colors, colorbar
|
66 |
-
from matplotlib import pyplot as plt
|
67 |
-
fig, ax = plt.subplots(1, 1, figsize=(15, 0.5))
|
68 |
-
|
69 |
-
bounds = np.linspace(0, nlabels, nlabels + 1)
|
70 |
-
norm = colors.BoundaryNorm(bounds, nlabels)
|
71 |
-
|
72 |
-
cb = colorbar.ColorbarBase(ax, cmap=random_colormap, norm=norm, spacing='proportional', ticks=None,
|
73 |
-
boundaries=bounds, format='%1i', orientation=u'horizontal')
|
74 |
-
|
75 |
-
return randRGBcolors, random_colormap
|
76 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Alpaca233/SadTalker/scripts/test.sh
DELETED
@@ -1,21 +0,0 @@
|
|
1 |
-
# ### some test command before commit.
|
2 |
-
# python inference.py --preprocess crop --size 256
|
3 |
-
# python inference.py --preprocess crop --size 512
|
4 |
-
|
5 |
-
# python inference.py --preprocess extcrop --size 256
|
6 |
-
# python inference.py --preprocess extcrop --size 512
|
7 |
-
|
8 |
-
# python inference.py --preprocess resize --size 256
|
9 |
-
# python inference.py --preprocess resize --size 512
|
10 |
-
|
11 |
-
# python inference.py --preprocess full --size 256
|
12 |
-
# python inference.py --preprocess full --size 512
|
13 |
-
|
14 |
-
# python inference.py --preprocess extfull --size 256
|
15 |
-
# python inference.py --preprocess extfull --size 512
|
16 |
-
|
17 |
-
python inference.py --preprocess full --size 256 --enhancer gfpgan
|
18 |
-
python inference.py --preprocess full --size 512 --enhancer gfpgan
|
19 |
-
|
20 |
-
python inference.py --preprocess full --size 256 --enhancer gfpgan --still
|
21 |
-
python inference.py --preprocess full --size 512 --enhancer gfpgan --still
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Androidonnxfork/CivitAi-to-Diffusers/diffusers/docker/diffusers-flax-tpu/Dockerfile
DELETED
@@ -1,46 +0,0 @@
|
|
1 |
-
FROM ubuntu:20.04
|
2 |
-
LABEL maintainer="Hugging Face"
|
3 |
-
LABEL repository="diffusers"
|
4 |
-
|
5 |
-
ENV DEBIAN_FRONTEND=noninteractive
|
6 |
-
|
7 |
-
RUN apt update && \
|
8 |
-
apt install -y bash \
|
9 |
-
build-essential \
|
10 |
-
git \
|
11 |
-
git-lfs \
|
12 |
-
curl \
|
13 |
-
ca-certificates \
|
14 |
-
libsndfile1-dev \
|
15 |
-
python3.8 \
|
16 |
-
python3-pip \
|
17 |
-
python3.8-venv && \
|
18 |
-
rm -rf /var/lib/apt/lists
|
19 |
-
|
20 |
-
# make sure to use venv
|
21 |
-
RUN python3 -m venv /opt/venv
|
22 |
-
ENV PATH="/opt/venv/bin:$PATH"
|
23 |
-
|
24 |
-
# pre-install the heavy dependencies (these can later be overridden by the deps from setup.py)
|
25 |
-
# follow the instructions here: https://cloud.google.com/tpu/docs/run-in-container#train_a_jax_model_in_a_docker_container
|
26 |
-
RUN python3 -m pip install --no-cache-dir --upgrade pip && \
|
27 |
-
python3 -m pip install --no-cache-dir \
|
28 |
-
"jax[tpu]>=0.2.16,!=0.3.2" \
|
29 |
-
-f https://storage.googleapis.com/jax-releases/libtpu_releases.html && \
|
30 |
-
python3 -m pip install --upgrade --no-cache-dir \
|
31 |
-
clu \
|
32 |
-
"flax>=0.4.1" \
|
33 |
-
"jaxlib>=0.1.65" && \
|
34 |
-
python3 -m pip install --no-cache-dir \
|
35 |
-
accelerate \
|
36 |
-
datasets \
|
37 |
-
hf-doc-builder \
|
38 |
-
huggingface-hub \
|
39 |
-
Jinja2 \
|
40 |
-
librosa \
|
41 |
-
numpy \
|
42 |
-
scipy \
|
43 |
-
tensorboard \
|
44 |
-
transformers
|
45 |
-
|
46 |
-
CMD ["/bin/bash"]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Androidonnxfork/CivitAi-to-Diffusers/diffusers/examples/research_projects/intel_opts/inference_bf16.py
DELETED
@@ -1,56 +0,0 @@
|
|
1 |
-
import argparse
|
2 |
-
|
3 |
-
import intel_extension_for_pytorch as ipex
|
4 |
-
import torch
|
5 |
-
|
6 |
-
from diffusers import DPMSolverMultistepScheduler, StableDiffusionPipeline
|
7 |
-
|
8 |
-
|
9 |
-
parser = argparse.ArgumentParser("Stable Diffusion script with intel optimization", add_help=False)
|
10 |
-
parser.add_argument("--dpm", action="store_true", help="Enable DPMSolver or not")
|
11 |
-
parser.add_argument("--steps", default=None, type=int, help="Num inference steps")
|
12 |
-
args = parser.parse_args()
|
13 |
-
|
14 |
-
|
15 |
-
device = "cpu"
|
16 |
-
prompt = "a lovely <dicoo> in red dress and hat, in the snowly and brightly night, with many brighly buildings"
|
17 |
-
|
18 |
-
model_id = "path-to-your-trained-model"
|
19 |
-
pipe = StableDiffusionPipeline.from_pretrained(model_id)
|
20 |
-
if args.dpm:
|
21 |
-
pipe.scheduler = DPMSolverMultistepScheduler.from_config(pipe.scheduler.config)
|
22 |
-
pipe = pipe.to(device)
|
23 |
-
|
24 |
-
# to channels last
|
25 |
-
pipe.unet = pipe.unet.to(memory_format=torch.channels_last)
|
26 |
-
pipe.vae = pipe.vae.to(memory_format=torch.channels_last)
|
27 |
-
pipe.text_encoder = pipe.text_encoder.to(memory_format=torch.channels_last)
|
28 |
-
if pipe.requires_safety_checker:
|
29 |
-
pipe.safety_checker = pipe.safety_checker.to(memory_format=torch.channels_last)
|
30 |
-
|
31 |
-
# optimize with ipex
|
32 |
-
sample = torch.randn(2, 4, 64, 64)
|
33 |
-
timestep = torch.rand(1) * 999
|
34 |
-
encoder_hidden_status = torch.randn(2, 77, 768)
|
35 |
-
input_example = (sample, timestep, encoder_hidden_status)
|
36 |
-
try:
|
37 |
-
pipe.unet = ipex.optimize(pipe.unet.eval(), dtype=torch.bfloat16, inplace=True, sample_input=input_example)
|
38 |
-
except Exception:
|
39 |
-
pipe.unet = ipex.optimize(pipe.unet.eval(), dtype=torch.bfloat16, inplace=True)
|
40 |
-
pipe.vae = ipex.optimize(pipe.vae.eval(), dtype=torch.bfloat16, inplace=True)
|
41 |
-
pipe.text_encoder = ipex.optimize(pipe.text_encoder.eval(), dtype=torch.bfloat16, inplace=True)
|
42 |
-
if pipe.requires_safety_checker:
|
43 |
-
pipe.safety_checker = ipex.optimize(pipe.safety_checker.eval(), dtype=torch.bfloat16, inplace=True)
|
44 |
-
|
45 |
-
# compute
|
46 |
-
seed = 666
|
47 |
-
generator = torch.Generator(device).manual_seed(seed)
|
48 |
-
generate_kwargs = {"generator": generator}
|
49 |
-
if args.steps is not None:
|
50 |
-
generate_kwargs["num_inference_steps"] = args.steps
|
51 |
-
|
52 |
-
with torch.cpu.amp.autocast(enabled=True, dtype=torch.bfloat16):
|
53 |
-
image = pipe(prompt, **generate_kwargs).images[0]
|
54 |
-
|
55 |
-
# save image
|
56 |
-
image.save("generated.png")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Andy1621/uniformer_image_segmentation/configs/deeplabv3plus/deeplabv3plus_r50-d8_480x480_80k_pascal_context_59.py
DELETED
@@ -1,10 +0,0 @@
|
|
1 |
-
_base_ = [
|
2 |
-
'../_base_/models/deeplabv3plus_r50-d8.py',
|
3 |
-
'../_base_/datasets/pascal_context_59.py', '../_base_/default_runtime.py',
|
4 |
-
'../_base_/schedules/schedule_80k.py'
|
5 |
-
]
|
6 |
-
model = dict(
|
7 |
-
decode_head=dict(num_classes=59),
|
8 |
-
auxiliary_head=dict(num_classes=59),
|
9 |
-
test_cfg=dict(mode='slide', crop_size=(480, 480), stride=(320, 320)))
|
10 |
-
optimizer = dict(type='SGD', lr=0.004, momentum=0.9, weight_decay=0.0001)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/AnishKumbhar/ChatBot/text-generation-webui-main/one_click.py
DELETED
@@ -1,361 +0,0 @@
|
|
1 |
-
import argparse
|
2 |
-
import glob
|
3 |
-
import hashlib
|
4 |
-
import os
|
5 |
-
import platform
|
6 |
-
import re
|
7 |
-
import site
|
8 |
-
import subprocess
|
9 |
-
import sys
|
10 |
-
|
11 |
-
script_dir = os.getcwd()
|
12 |
-
conda_env_path = os.path.join(script_dir, "installer_files", "env")
|
13 |
-
|
14 |
-
# Remove the '# ' from the following lines as needed for your AMD GPU on Linux
|
15 |
-
# os.environ["ROCM_PATH"] = '/opt/rocm'
|
16 |
-
# os.environ["HSA_OVERRIDE_GFX_VERSION"] = '10.3.0'
|
17 |
-
# os.environ["HCC_AMDGPU_TARGET"] = 'gfx1030'
|
18 |
-
|
19 |
-
# Command-line flags
|
20 |
-
cmd_flags_path = os.path.join(script_dir, "CMD_FLAGS.txt")
|
21 |
-
if os.path.exists(cmd_flags_path):
|
22 |
-
with open(cmd_flags_path, 'r') as f:
|
23 |
-
CMD_FLAGS = ' '.join(line.strip() for line in f if line.strip() and not line.strip().startswith('#'))
|
24 |
-
else:
|
25 |
-
CMD_FLAGS = ''
|
26 |
-
|
27 |
-
flags = f"{' '.join([flag for flag in sys.argv[1:] if flag != '--update'])} {CMD_FLAGS}"
|
28 |
-
|
29 |
-
|
30 |
-
def is_linux():
|
31 |
-
return sys.platform.startswith("linux")
|
32 |
-
|
33 |
-
|
34 |
-
def is_windows():
|
35 |
-
return sys.platform.startswith("win")
|
36 |
-
|
37 |
-
|
38 |
-
def is_macos():
|
39 |
-
return sys.platform.startswith("darwin")
|
40 |
-
|
41 |
-
|
42 |
-
def is_x86_64():
|
43 |
-
return platform.machine() == "x86_64"
|
44 |
-
|
45 |
-
|
46 |
-
def cpu_has_avx2():
|
47 |
-
try:
|
48 |
-
import cpuinfo
|
49 |
-
|
50 |
-
info = cpuinfo.get_cpu_info()
|
51 |
-
if 'avx2' in info['flags']:
|
52 |
-
return True
|
53 |
-
else:
|
54 |
-
return False
|
55 |
-
except:
|
56 |
-
return True
|
57 |
-
|
58 |
-
|
59 |
-
def torch_version():
|
60 |
-
site_packages_path = None
|
61 |
-
for sitedir in site.getsitepackages():
|
62 |
-
if "site-packages" in sitedir and conda_env_path in sitedir:
|
63 |
-
site_packages_path = sitedir
|
64 |
-
break
|
65 |
-
|
66 |
-
if site_packages_path:
|
67 |
-
torch_version_file = open(os.path.join(site_packages_path, 'torch', 'version.py')).read().splitlines()
|
68 |
-
torver = [line for line in torch_version_file if '__version__' in line][0].split('__version__ = ')[1].strip("'")
|
69 |
-
else:
|
70 |
-
from torch import __version__ as torver
|
71 |
-
return torver
|
72 |
-
|
73 |
-
|
74 |
-
def is_installed():
|
75 |
-
site_packages_path = None
|
76 |
-
for sitedir in site.getsitepackages():
|
77 |
-
if "site-packages" in sitedir and conda_env_path in sitedir:
|
78 |
-
site_packages_path = sitedir
|
79 |
-
break
|
80 |
-
|
81 |
-
if site_packages_path:
|
82 |
-
return os.path.isfile(os.path.join(site_packages_path, 'torch', '__init__.py'))
|
83 |
-
else:
|
84 |
-
return os.path.isdir(conda_env_path)
|
85 |
-
|
86 |
-
|
87 |
-
def check_env():
|
88 |
-
# If we have access to conda, we are probably in an environment
|
89 |
-
conda_exist = run_cmd("conda", environment=True, capture_output=True).returncode == 0
|
90 |
-
if not conda_exist:
|
91 |
-
print("Conda is not installed. Exiting...")
|
92 |
-
sys.exit(1)
|
93 |
-
|
94 |
-
# Ensure this is a new environment and not the base environment
|
95 |
-
if os.environ["CONDA_DEFAULT_ENV"] == "base":
|
96 |
-
print("Create an environment for this project and activate it. Exiting...")
|
97 |
-
sys.exit(1)
|
98 |
-
|
99 |
-
|
100 |
-
def clear_cache():
|
101 |
-
run_cmd("conda clean -a -y", environment=True)
|
102 |
-
run_cmd("python -m pip cache purge", environment=True)
|
103 |
-
|
104 |
-
|
105 |
-
def print_big_message(message):
|
106 |
-
message = message.strip()
|
107 |
-
lines = message.split('\n')
|
108 |
-
print("\n\n*******************************************************************")
|
109 |
-
for line in lines:
|
110 |
-
if line.strip() != '':
|
111 |
-
print("*", line)
|
112 |
-
|
113 |
-
print("*******************************************************************\n\n")
|
114 |
-
|
115 |
-
|
116 |
-
def calculate_file_hash(file_path):
|
117 |
-
p = os.path.join(script_dir, file_path)
|
118 |
-
if os.path.isfile(p):
|
119 |
-
with open(p, 'rb') as f:
|
120 |
-
return hashlib.sha256(f.read()).hexdigest()
|
121 |
-
else:
|
122 |
-
return ''
|
123 |
-
|
124 |
-
|
125 |
-
def run_cmd(cmd, assert_success=False, environment=False, capture_output=False, env=None):
|
126 |
-
# Use the conda environment
|
127 |
-
if environment:
|
128 |
-
if is_windows():
|
129 |
-
conda_bat_path = os.path.join(script_dir, "installer_files", "conda", "condabin", "conda.bat")
|
130 |
-
cmd = "\"" + conda_bat_path + "\" activate \"" + conda_env_path + "\" >nul && " + cmd
|
131 |
-
else:
|
132 |
-
conda_sh_path = os.path.join(script_dir, "installer_files", "conda", "etc", "profile.d", "conda.sh")
|
133 |
-
cmd = ". \"" + conda_sh_path + "\" && conda activate \"" + conda_env_path + "\" && " + cmd
|
134 |
-
|
135 |
-
# Run shell commands
|
136 |
-
result = subprocess.run(cmd, shell=True, capture_output=capture_output, env=env)
|
137 |
-
|
138 |
-
# Assert the command ran successfully
|
139 |
-
if assert_success and result.returncode != 0:
|
140 |
-
print("Command '" + cmd + "' failed with exit status code '" + str(result.returncode) + "'.\n\nExiting now.\nTry running the start/update script again.")
|
141 |
-
sys.exit(1)
|
142 |
-
|
143 |
-
return result
|
144 |
-
|
145 |
-
|
146 |
-
def install_webui():
|
147 |
-
# Select your GPU, or choose to run in CPU mode
|
148 |
-
if "GPU_CHOICE" in os.environ:
|
149 |
-
choice = os.environ["GPU_CHOICE"].upper()
|
150 |
-
print_big_message(f"Selected GPU choice \"{choice}\" based on the GPU_CHOICE environment variable.")
|
151 |
-
else:
|
152 |
-
print()
|
153 |
-
print("What is your GPU?")
|
154 |
-
print()
|
155 |
-
print("A) NVIDIA")
|
156 |
-
print("B) AMD (Linux/MacOS only. Requires ROCm SDK 5.6 on Linux)")
|
157 |
-
print("C) Apple M Series")
|
158 |
-
print("D) Intel Arc (IPEX)")
|
159 |
-
print("N) None (I want to run models in CPU mode)")
|
160 |
-
print()
|
161 |
-
|
162 |
-
choice = input("Input> ").upper()
|
163 |
-
while choice not in 'ABCDN':
|
164 |
-
print("Invalid choice. Please try again.")
|
165 |
-
choice = input("Input> ").upper()
|
166 |
-
|
167 |
-
if choice == "N":
|
168 |
-
print_big_message("Once the installation ends, make sure to open CMD_FLAGS.txt with\na text editor and add the --cpu flag.")
|
169 |
-
|
170 |
-
# Find the proper Pytorch installation command
|
171 |
-
install_git = "conda install -y -k ninja git"
|
172 |
-
install_pytorch = "python -m pip install torch torchvision torchaudio"
|
173 |
-
|
174 |
-
if any((is_windows(), is_linux())) and choice == "A":
|
175 |
-
install_pytorch = "python -m pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118"
|
176 |
-
elif not is_macos() and choice == "B":
|
177 |
-
if is_linux():
|
178 |
-
install_pytorch = "python -m pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/rocm5.6"
|
179 |
-
else:
|
180 |
-
print("AMD GPUs are only supported on Linux. Exiting...")
|
181 |
-
sys.exit(1)
|
182 |
-
elif is_linux() and (choice == "C" or choice == "N"):
|
183 |
-
install_pytorch = "python -m pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu"
|
184 |
-
elif choice == "D":
|
185 |
-
install_pytorch = "python -m pip install torch==2.0.1a0 torchvision==0.15.2a0 intel_extension_for_pytorch==2.0.110+xpu -f https://developer.intel.com/ipex-whl-stable-xpu"
|
186 |
-
|
187 |
-
# Install Git and then Pytorch
|
188 |
-
run_cmd(f"{install_git} && {install_pytorch} && python -m pip install py-cpuinfo==9.0.0", assert_success=True, environment=True)
|
189 |
-
|
190 |
-
# Install the webui requirements
|
191 |
-
update_requirements(initial_installation=True)
|
192 |
-
|
193 |
-
|
194 |
-
def update_requirements(initial_installation=False):
|
195 |
-
# Create .git directory if missing
|
196 |
-
if not os.path.isdir(os.path.join(script_dir, ".git")):
|
197 |
-
git_creation_cmd = 'git init -b main && git remote add origin https://github.com/oobabooga/text-generation-webui && git fetch && git remote set-head origin -a && git reset origin/HEAD && git branch --set-upstream-to=origin/HEAD'
|
198 |
-
run_cmd(git_creation_cmd, environment=True, assert_success=True)
|
199 |
-
|
200 |
-
files_to_check = [
|
201 |
-
'start_linux.sh', 'start_macos.sh', 'start_windows.bat', 'start_wsl.bat',
|
202 |
-
'update_linux.sh', 'update_macos.sh', 'update_windows.bat', 'update_wsl.bat',
|
203 |
-
'one_click.py'
|
204 |
-
]
|
205 |
-
|
206 |
-
before_pull_hashes = {file_name: calculate_file_hash(file_name) for file_name in files_to_check}
|
207 |
-
run_cmd("git pull --autostash", assert_success=True, environment=True)
|
208 |
-
after_pull_hashes = {file_name: calculate_file_hash(file_name) for file_name in files_to_check}
|
209 |
-
|
210 |
-
# Check for differences in installation file hashes
|
211 |
-
for file_name in files_to_check:
|
212 |
-
if before_pull_hashes[file_name] != after_pull_hashes[file_name]:
|
213 |
-
print(f"File '{file_name}' was updated during 'git pull'. Please run the script again.")
|
214 |
-
exit(1)
|
215 |
-
|
216 |
-
# Extensions requirements are installed only during the initial install by default.
|
217 |
-
# That can be changed with the INSTALL_EXTENSIONS environment variable.
|
218 |
-
install = initial_installation
|
219 |
-
if "INSTALL_EXTENSIONS" in os.environ:
|
220 |
-
install = os.environ["INSTALL_EXTENSIONS"].lower() in ("yes", "y", "true", "1", "t", "on")
|
221 |
-
|
222 |
-
if install:
|
223 |
-
print_big_message("Installing extensions requirements.")
|
224 |
-
extensions = next(os.walk("extensions"))[1]
|
225 |
-
for extension in extensions:
|
226 |
-
if extension in ['superbooga', 'superboogav2']: # No wheels available for requirements
|
227 |
-
continue
|
228 |
-
|
229 |
-
extension_req_path = os.path.join("extensions", extension, "requirements.txt")
|
230 |
-
if os.path.exists(extension_req_path):
|
231 |
-
run_cmd("python -m pip install -r " + extension_req_path + " --upgrade", assert_success=True, environment=True)
|
232 |
-
elif initial_installation:
|
233 |
-
print_big_message("Will not install extensions due to INSTALL_EXTENSIONS environment variable.")
|
234 |
-
|
235 |
-
# Detect the PyTorch version
|
236 |
-
torver = torch_version()
|
237 |
-
is_cuda = '+cu' in torver # 2.0.1+cu118
|
238 |
-
is_cuda117 = '+cu117' in torver # 2.0.1+cu117
|
239 |
-
is_rocm = '+rocm' in torver # 2.0.1+rocm5.4.2
|
240 |
-
is_intel = '+cxx11' in torver # 2.0.1a0+cxx11.abi
|
241 |
-
is_cpu = '+cpu' in torver # 2.0.1+cpu
|
242 |
-
|
243 |
-
if is_rocm:
|
244 |
-
if cpu_has_avx2():
|
245 |
-
requirements_file = "requirements_amd.txt"
|
246 |
-
else:
|
247 |
-
requirements_file = "requirements_amd_noavx2.txt"
|
248 |
-
elif is_cpu:
|
249 |
-
if cpu_has_avx2():
|
250 |
-
requirements_file = "requirements_cpu_only.txt"
|
251 |
-
else:
|
252 |
-
requirements_file = "requirements_cpu_only_noavx2.txt"
|
253 |
-
elif is_macos():
|
254 |
-
if is_x86_64():
|
255 |
-
requirements_file = "requirements_apple_intel.txt"
|
256 |
-
else:
|
257 |
-
requirements_file = "requirements_apple_silicon.txt"
|
258 |
-
else:
|
259 |
-
if cpu_has_avx2():
|
260 |
-
requirements_file = "requirements.txt"
|
261 |
-
else:
|
262 |
-
requirements_file = "requirements_noavx2.txt"
|
263 |
-
|
264 |
-
# Prepare the requirements file
|
265 |
-
print_big_message(f"Installing webui requirements from file: {requirements_file}")
|
266 |
-
textgen_requirements = open(requirements_file).read().splitlines()
|
267 |
-
if is_cuda117:
|
268 |
-
textgen_requirements = [req.replace('+cu118', '+cu117').replace('torch2.1', 'torch2.0') for req in textgen_requirements]
|
269 |
-
with open('temp_requirements.txt', 'w') as file:
|
270 |
-
file.write('\n'.join(textgen_requirements))
|
271 |
-
|
272 |
-
# Workaround for git+ packages not updating properly.
|
273 |
-
git_requirements = [req for req in textgen_requirements if req.startswith("git+")]
|
274 |
-
for req in git_requirements:
|
275 |
-
url = req.replace("git+", "")
|
276 |
-
package_name = url.split("/")[-1].split("@")[0].rstrip(".git")
|
277 |
-
run_cmd("python -m pip uninstall -y " + package_name, environment=True)
|
278 |
-
print(f"Uninstalled {package_name}")
|
279 |
-
|
280 |
-
# Install/update the project requirements
|
281 |
-
run_cmd("python -m pip install -r temp_requirements.txt --upgrade", assert_success=True, environment=True)
|
282 |
-
os.remove('temp_requirements.txt')
|
283 |
-
|
284 |
-
# Check for '+cu' or '+rocm' in version string to determine if torch uses CUDA or ROCm. Check for pytorch-cuda as well for backwards compatibility
|
285 |
-
if not any((is_cuda, is_rocm)) and run_cmd("conda list -f pytorch-cuda | grep pytorch-cuda", environment=True, capture_output=True).returncode == 1:
|
286 |
-
clear_cache()
|
287 |
-
return
|
288 |
-
|
289 |
-
if not os.path.exists("repositories/"):
|
290 |
-
os.mkdir("repositories")
|
291 |
-
|
292 |
-
os.chdir("repositories")
|
293 |
-
|
294 |
-
# Install or update ExLlama as needed
|
295 |
-
if not os.path.exists("exllama/"):
|
296 |
-
run_cmd("git clone https://github.com/turboderp/exllama.git", environment=True)
|
297 |
-
else:
|
298 |
-
os.chdir("exllama")
|
299 |
-
run_cmd("git pull", environment=True)
|
300 |
-
os.chdir("..")
|
301 |
-
|
302 |
-
if is_linux():
|
303 |
-
# Fix JIT compile issue with ExLlama in Linux/WSL
|
304 |
-
if not os.path.exists(f"{conda_env_path}/lib64"):
|
305 |
-
run_cmd(f'ln -s "{conda_env_path}/lib" "{conda_env_path}/lib64"', environment=True)
|
306 |
-
|
307 |
-
# On some Linux distributions, g++ may not exist or be the wrong version to compile GPTQ-for-LLaMa
|
308 |
-
gxx_output = run_cmd("g++ -dumpfullversion -dumpversion", environment=True, capture_output=True)
|
309 |
-
if gxx_output.returncode != 0 or int(gxx_output.stdout.strip().split(b".")[0]) > 11:
|
310 |
-
# Install the correct version of g++
|
311 |
-
run_cmd("conda install -y -k conda-forge::gxx_linux-64=11.2.0", environment=True)
|
312 |
-
|
313 |
-
clear_cache()
|
314 |
-
|
315 |
-
|
316 |
-
def download_model():
|
317 |
-
run_cmd("python download-model.py", environment=True)
|
318 |
-
|
319 |
-
|
320 |
-
def launch_webui():
|
321 |
-
run_cmd(f"python server.py {flags}", environment=True)
|
322 |
-
|
323 |
-
|
324 |
-
if __name__ == "__main__":
|
325 |
-
# Verifies we are in a conda environment
|
326 |
-
check_env()
|
327 |
-
|
328 |
-
parser = argparse.ArgumentParser(add_help=False)
|
329 |
-
parser.add_argument('--update', action='store_true', help='Update the web UI.')
|
330 |
-
args, _ = parser.parse_known_args()
|
331 |
-
|
332 |
-
if args.update:
|
333 |
-
update_requirements()
|
334 |
-
else:
|
335 |
-
# If webui has already been installed, skip and run
|
336 |
-
if not is_installed():
|
337 |
-
install_webui()
|
338 |
-
os.chdir(script_dir)
|
339 |
-
|
340 |
-
if os.environ.get("LAUNCH_AFTER_INSTALL", "").lower() in ("no", "n", "false", "0", "f", "off"):
|
341 |
-
print_big_message("Install finished successfully and will now exit due to LAUNCH_AFTER_INSTALL.")
|
342 |
-
sys.exit()
|
343 |
-
|
344 |
-
# Check if a model has been downloaded yet
|
345 |
-
if '--model-dir' in flags:
|
346 |
-
# Splits on ' ' or '=' while maintaining spaces within quotes
|
347 |
-
flags_list = re.split(' +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)|=', flags)
|
348 |
-
model_dir = [flags_list[(flags_list.index(flag)+1)] for flag in flags_list if flag == '--model-dir'][0].strip('"\'')
|
349 |
-
else:
|
350 |
-
model_dir = 'models'
|
351 |
-
|
352 |
-
if len([item for item in glob.glob(f'{model_dir}/*') if not item.endswith(('.txt', '.yaml'))]) == 0:
|
353 |
-
print_big_message("WARNING: You haven't downloaded any model yet.\nOnce the web UI launches, head over to the \"Model\" tab and download one.")
|
354 |
-
|
355 |
-
# Workaround for llama-cpp-python loading paths in CUDA env vars even if they do not exist
|
356 |
-
conda_path_bin = os.path.join(conda_env_path, "bin")
|
357 |
-
if not os.path.exists(conda_path_bin):
|
358 |
-
os.mkdir(conda_path_bin)
|
359 |
-
|
360 |
-
# Launch the webui
|
361 |
-
launch_webui()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Anonymous-sub/Rerender/ControlNet/annotator/uniformer/mmcv/runner/optimizer/__init__.py
DELETED
@@ -1,9 +0,0 @@
|
|
1 |
-
# Copyright (c) OpenMMLab. All rights reserved.
|
2 |
-
from .builder import (OPTIMIZER_BUILDERS, OPTIMIZERS, build_optimizer,
|
3 |
-
build_optimizer_constructor)
|
4 |
-
from .default_constructor import DefaultOptimizerConstructor
|
5 |
-
|
6 |
-
__all__ = [
|
7 |
-
'OPTIMIZER_BUILDERS', 'OPTIMIZERS', 'DefaultOptimizerConstructor',
|
8 |
-
'build_optimizer', 'build_optimizer_constructor'
|
9 |
-
]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Anonymous-sub/Rerender/ControlNet/tool_add_control_sd21.py
DELETED
@@ -1,50 +0,0 @@
|
|
1 |
-
import sys
|
2 |
-
import os
|
3 |
-
|
4 |
-
assert len(sys.argv) == 3, 'Args are wrong.'
|
5 |
-
|
6 |
-
input_path = sys.argv[1]
|
7 |
-
output_path = sys.argv[2]
|
8 |
-
|
9 |
-
assert os.path.exists(input_path), 'Input model does not exist.'
|
10 |
-
assert not os.path.exists(output_path), 'Output filename already exists.'
|
11 |
-
assert os.path.exists(os.path.dirname(output_path)), 'Output path is not valid.'
|
12 |
-
|
13 |
-
import torch
|
14 |
-
from share import *
|
15 |
-
from cldm.model import create_model
|
16 |
-
|
17 |
-
|
18 |
-
def get_node_name(name, parent_name):
|
19 |
-
if len(name) <= len(parent_name):
|
20 |
-
return False, ''
|
21 |
-
p = name[:len(parent_name)]
|
22 |
-
if p != parent_name:
|
23 |
-
return False, ''
|
24 |
-
return True, name[len(parent_name):]
|
25 |
-
|
26 |
-
|
27 |
-
model = create_model(config_path='./models/cldm_v21.yaml')
|
28 |
-
|
29 |
-
pretrained_weights = torch.load(input_path)
|
30 |
-
if 'state_dict' in pretrained_weights:
|
31 |
-
pretrained_weights = pretrained_weights['state_dict']
|
32 |
-
|
33 |
-
scratch_dict = model.state_dict()
|
34 |
-
|
35 |
-
target_dict = {}
|
36 |
-
for k in scratch_dict.keys():
|
37 |
-
is_control, name = get_node_name(k, 'control_')
|
38 |
-
if is_control:
|
39 |
-
copy_k = 'model.diffusion_' + name
|
40 |
-
else:
|
41 |
-
copy_k = k
|
42 |
-
if copy_k in pretrained_weights:
|
43 |
-
target_dict[k] = pretrained_weights[copy_k].clone()
|
44 |
-
else:
|
45 |
-
target_dict[k] = scratch_dict[k].clone()
|
46 |
-
print(f'These weights are newly added: {k}')
|
47 |
-
|
48 |
-
model.load_state_dict(target_dict, strict=True)
|
49 |
-
torch.save(model.state_dict(), output_path)
|
50 |
-
print('Done.')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/ArkanDash/rvc-models-new/vc_infer_pipeline.py
DELETED
@@ -1,443 +0,0 @@
|
|
1 |
-
import numpy as np, parselmouth, torch, pdb, sys, os
|
2 |
-
from time import time as ttime
|
3 |
-
import torch.nn.functional as F
|
4 |
-
import scipy.signal as signal
|
5 |
-
import pyworld, os, traceback, faiss, librosa, torchcrepe
|
6 |
-
from scipy import signal
|
7 |
-
from functools import lru_cache
|
8 |
-
|
9 |
-
now_dir = os.getcwd()
|
10 |
-
sys.path.append(now_dir)
|
11 |
-
|
12 |
-
bh, ah = signal.butter(N=5, Wn=48, btype="high", fs=16000)
|
13 |
-
|
14 |
-
input_audio_path2wav = {}
|
15 |
-
|
16 |
-
|
17 |
-
@lru_cache
|
18 |
-
def cache_harvest_f0(input_audio_path, fs, f0max, f0min, frame_period):
|
19 |
-
audio = input_audio_path2wav[input_audio_path]
|
20 |
-
f0, t = pyworld.harvest(
|
21 |
-
audio,
|
22 |
-
fs=fs,
|
23 |
-
f0_ceil=f0max,
|
24 |
-
f0_floor=f0min,
|
25 |
-
frame_period=frame_period,
|
26 |
-
)
|
27 |
-
f0 = pyworld.stonemask(audio, f0, t, fs)
|
28 |
-
return f0
|
29 |
-
|
30 |
-
|
31 |
-
def change_rms(data1, sr1, data2, sr2, rate): # 1是输入音频,2是输出音频,rate是2的占比
|
32 |
-
# print(data1.max(),data2.max())
|
33 |
-
rms1 = librosa.feature.rms(
|
34 |
-
y=data1, frame_length=sr1 // 2 * 2, hop_length=sr1 // 2
|
35 |
-
) # 每半秒一个点
|
36 |
-
rms2 = librosa.feature.rms(y=data2, frame_length=sr2 // 2 * 2, hop_length=sr2 // 2)
|
37 |
-
rms1 = torch.from_numpy(rms1)
|
38 |
-
rms1 = F.interpolate(
|
39 |
-
rms1.unsqueeze(0), size=data2.shape[0], mode="linear"
|
40 |
-
).squeeze()
|
41 |
-
rms2 = torch.from_numpy(rms2)
|
42 |
-
rms2 = F.interpolate(
|
43 |
-
rms2.unsqueeze(0), size=data2.shape[0], mode="linear"
|
44 |
-
).squeeze()
|
45 |
-
rms2 = torch.max(rms2, torch.zeros_like(rms2) + 1e-6)
|
46 |
-
data2 *= (
|
47 |
-
torch.pow(rms1, torch.tensor(1 - rate))
|
48 |
-
* torch.pow(rms2, torch.tensor(rate - 1))
|
49 |
-
).numpy()
|
50 |
-
return data2
|
51 |
-
|
52 |
-
|
53 |
-
class VC(object):
|
54 |
-
def __init__(self, tgt_sr, config):
|
55 |
-
self.x_pad, self.x_query, self.x_center, self.x_max, self.is_half = (
|
56 |
-
config.x_pad,
|
57 |
-
config.x_query,
|
58 |
-
config.x_center,
|
59 |
-
config.x_max,
|
60 |
-
config.is_half,
|
61 |
-
)
|
62 |
-
self.sr = 16000 # hubert输入采样率
|
63 |
-
self.window = 160 # 每帧点数
|
64 |
-
self.t_pad = self.sr * self.x_pad # 每条前后pad时间
|
65 |
-
self.t_pad_tgt = tgt_sr * self.x_pad
|
66 |
-
self.t_pad2 = self.t_pad * 2
|
67 |
-
self.t_query = self.sr * self.x_query # 查询切点前后查询时间
|
68 |
-
self.t_center = self.sr * self.x_center # 查询切点位置
|
69 |
-
self.t_max = self.sr * self.x_max # 免查询时长阈值
|
70 |
-
self.device = config.device
|
71 |
-
|
72 |
-
def get_f0(
|
73 |
-
self,
|
74 |
-
input_audio_path,
|
75 |
-
x,
|
76 |
-
p_len,
|
77 |
-
f0_up_key,
|
78 |
-
f0_method,
|
79 |
-
filter_radius,
|
80 |
-
inp_f0=None,
|
81 |
-
):
|
82 |
-
global input_audio_path2wav
|
83 |
-
time_step = self.window / self.sr * 1000
|
84 |
-
f0_min = 50
|
85 |
-
f0_max = 1100
|
86 |
-
f0_mel_min = 1127 * np.log(1 + f0_min / 700)
|
87 |
-
f0_mel_max = 1127 * np.log(1 + f0_max / 700)
|
88 |
-
if f0_method == "pm":
|
89 |
-
f0 = (
|
90 |
-
parselmouth.Sound(x, self.sr)
|
91 |
-
.to_pitch_ac(
|
92 |
-
time_step=time_step / 1000,
|
93 |
-
voicing_threshold=0.6,
|
94 |
-
pitch_floor=f0_min,
|
95 |
-
pitch_ceiling=f0_max,
|
96 |
-
)
|
97 |
-
.selected_array["frequency"]
|
98 |
-
)
|
99 |
-
pad_size = (p_len - len(f0) + 1) // 2
|
100 |
-
if pad_size > 0 or p_len - len(f0) - pad_size > 0:
|
101 |
-
f0 = np.pad(
|
102 |
-
f0, [[pad_size, p_len - len(f0) - pad_size]], mode="constant"
|
103 |
-
)
|
104 |
-
elif f0_method == "harvest":
|
105 |
-
input_audio_path2wav[input_audio_path] = x.astype(np.double)
|
106 |
-
f0 = cache_harvest_f0(input_audio_path, self.sr, f0_max, f0_min, 10)
|
107 |
-
if filter_radius > 2:
|
108 |
-
f0 = signal.medfilt(f0, 3)
|
109 |
-
elif f0_method == "crepe":
|
110 |
-
model = "full"
|
111 |
-
# Pick a batch size that doesn't cause memory errors on your gpu
|
112 |
-
batch_size = 512
|
113 |
-
# Compute pitch using first gpu
|
114 |
-
audio = torch.tensor(np.copy(x))[None].float()
|
115 |
-
f0, pd = torchcrepe.predict(
|
116 |
-
audio,
|
117 |
-
self.sr,
|
118 |
-
self.window,
|
119 |
-
f0_min,
|
120 |
-
f0_max,
|
121 |
-
model,
|
122 |
-
batch_size=batch_size,
|
123 |
-
device=self.device,
|
124 |
-
return_periodicity=True,
|
125 |
-
)
|
126 |
-
pd = torchcrepe.filter.median(pd, 3)
|
127 |
-
f0 = torchcrepe.filter.mean(f0, 3)
|
128 |
-
f0[pd < 0.1] = 0
|
129 |
-
f0 = f0[0].cpu().numpy()
|
130 |
-
elif f0_method == "rmvpe":
|
131 |
-
if hasattr(self, "model_rmvpe") == False:
|
132 |
-
from rmvpe import RMVPE
|
133 |
-
|
134 |
-
print("loading rmvpe model")
|
135 |
-
self.model_rmvpe = RMVPE(
|
136 |
-
"rmvpe.pt", is_half=self.is_half, device=self.device
|
137 |
-
)
|
138 |
-
f0 = self.model_rmvpe.infer_from_audio(x, thred=0.03)
|
139 |
-
f0 *= pow(2, f0_up_key / 12)
|
140 |
-
# with open("test.txt","w")as f:f.write("\n".join([str(i)for i in f0.tolist()]))
|
141 |
-
tf0 = self.sr // self.window # 每秒f0点数
|
142 |
-
if inp_f0 is not None:
|
143 |
-
delta_t = np.round(
|
144 |
-
(inp_f0[:, 0].max() - inp_f0[:, 0].min()) * tf0 + 1
|
145 |
-
).astype("int16")
|
146 |
-
replace_f0 = np.interp(
|
147 |
-
list(range(delta_t)), inp_f0[:, 0] * 100, inp_f0[:, 1]
|
148 |
-
)
|
149 |
-
shape = f0[self.x_pad * tf0 : self.x_pad * tf0 + len(replace_f0)].shape[0]
|
150 |
-
f0[self.x_pad * tf0 : self.x_pad * tf0 + len(replace_f0)] = replace_f0[
|
151 |
-
:shape
|
152 |
-
]
|
153 |
-
# with open("test_opt.txt","w")as f:f.write("\n".join([str(i)for i in f0.tolist()]))
|
154 |
-
f0bak = f0.copy()
|
155 |
-
f0_mel = 1127 * np.log(1 + f0 / 700)
|
156 |
-
f0_mel[f0_mel > 0] = (f0_mel[f0_mel > 0] - f0_mel_min) * 254 / (
|
157 |
-
f0_mel_max - f0_mel_min
|
158 |
-
) + 1
|
159 |
-
f0_mel[f0_mel <= 1] = 1
|
160 |
-
f0_mel[f0_mel > 255] = 255
|
161 |
-
f0_coarse = np.rint(f0_mel).astype(np.int)
|
162 |
-
return f0_coarse, f0bak # 1-0
|
163 |
-
|
164 |
-
def vc(
|
165 |
-
self,
|
166 |
-
model,
|
167 |
-
net_g,
|
168 |
-
sid,
|
169 |
-
audio0,
|
170 |
-
pitch,
|
171 |
-
pitchf,
|
172 |
-
times,
|
173 |
-
index,
|
174 |
-
big_npy,
|
175 |
-
index_rate,
|
176 |
-
version,
|
177 |
-
protect,
|
178 |
-
): # ,file_index,file_big_npy
|
179 |
-
feats = torch.from_numpy(audio0)
|
180 |
-
if self.is_half:
|
181 |
-
feats = feats.half()
|
182 |
-
else:
|
183 |
-
feats = feats.float()
|
184 |
-
if feats.dim() == 2: # double channels
|
185 |
-
feats = feats.mean(-1)
|
186 |
-
assert feats.dim() == 1, feats.dim()
|
187 |
-
feats = feats.view(1, -1)
|
188 |
-
padding_mask = torch.BoolTensor(feats.shape).to(self.device).fill_(False)
|
189 |
-
|
190 |
-
inputs = {
|
191 |
-
"source": feats.to(self.device),
|
192 |
-
"padding_mask": padding_mask,
|
193 |
-
"output_layer": 9 if version == "v1" else 12,
|
194 |
-
}
|
195 |
-
t0 = ttime()
|
196 |
-
with torch.no_grad():
|
197 |
-
logits = model.extract_features(**inputs)
|
198 |
-
feats = model.final_proj(logits[0]) if version == "v1" else logits[0]
|
199 |
-
if protect < 0.5 and pitch != None and pitchf != None:
|
200 |
-
feats0 = feats.clone()
|
201 |
-
if (
|
202 |
-
isinstance(index, type(None)) == False
|
203 |
-
and isinstance(big_npy, type(None)) == False
|
204 |
-
and index_rate != 0
|
205 |
-
):
|
206 |
-
npy = feats[0].cpu().numpy()
|
207 |
-
if self.is_half:
|
208 |
-
npy = npy.astype("float32")
|
209 |
-
|
210 |
-
# _, I = index.search(npy, 1)
|
211 |
-
# npy = big_npy[I.squeeze()]
|
212 |
-
|
213 |
-
score, ix = index.search(npy, k=8)
|
214 |
-
weight = np.square(1 / score)
|
215 |
-
weight /= weight.sum(axis=1, keepdims=True)
|
216 |
-
npy = np.sum(big_npy[ix] * np.expand_dims(weight, axis=2), axis=1)
|
217 |
-
|
218 |
-
if self.is_half:
|
219 |
-
npy = npy.astype("float16")
|
220 |
-
feats = (
|
221 |
-
torch.from_numpy(npy).unsqueeze(0).to(self.device) * index_rate
|
222 |
-
+ (1 - index_rate) * feats
|
223 |
-
)
|
224 |
-
|
225 |
-
feats = F.interpolate(feats.permute(0, 2, 1), scale_factor=2).permute(0, 2, 1)
|
226 |
-
if protect < 0.5 and pitch != None and pitchf != None:
|
227 |
-
feats0 = F.interpolate(feats0.permute(0, 2, 1), scale_factor=2).permute(
|
228 |
-
0, 2, 1
|
229 |
-
)
|
230 |
-
t1 = ttime()
|
231 |
-
p_len = audio0.shape[0] // self.window
|
232 |
-
if feats.shape[1] < p_len:
|
233 |
-
p_len = feats.shape[1]
|
234 |
-
if pitch != None and pitchf != None:
|
235 |
-
pitch = pitch[:, :p_len]
|
236 |
-
pitchf = pitchf[:, :p_len]
|
237 |
-
|
238 |
-
if protect < 0.5 and pitch != None and pitchf != None:
|
239 |
-
pitchff = pitchf.clone()
|
240 |
-
pitchff[pitchf > 0] = 1
|
241 |
-
pitchff[pitchf < 1] = protect
|
242 |
-
pitchff = pitchff.unsqueeze(-1)
|
243 |
-
feats = feats * pitchff + feats0 * (1 - pitchff)
|
244 |
-
feats = feats.to(feats0.dtype)
|
245 |
-
p_len = torch.tensor([p_len], device=self.device).long()
|
246 |
-
with torch.no_grad():
|
247 |
-
if pitch != None and pitchf != None:
|
248 |
-
audio1 = (
|
249 |
-
(net_g.infer(feats, p_len, pitch, pitchf, sid)[0][0, 0])
|
250 |
-
.data.cpu()
|
251 |
-
.float()
|
252 |
-
.numpy()
|
253 |
-
)
|
254 |
-
else:
|
255 |
-
audio1 = (
|
256 |
-
(net_g.infer(feats, p_len, sid)[0][0, 0]).data.cpu().float().numpy()
|
257 |
-
)
|
258 |
-
del feats, p_len, padding_mask
|
259 |
-
if torch.cuda.is_available():
|
260 |
-
torch.cuda.empty_cache()
|
261 |
-
t2 = ttime()
|
262 |
-
times[0] += t1 - t0
|
263 |
-
times[2] += t2 - t1
|
264 |
-
return audio1
|
265 |
-
|
266 |
-
def pipeline(
|
267 |
-
self,
|
268 |
-
model,
|
269 |
-
net_g,
|
270 |
-
sid,
|
271 |
-
audio,
|
272 |
-
input_audio_path,
|
273 |
-
times,
|
274 |
-
f0_up_key,
|
275 |
-
f0_method,
|
276 |
-
file_index,
|
277 |
-
# file_big_npy,
|
278 |
-
index_rate,
|
279 |
-
if_f0,
|
280 |
-
filter_radius,
|
281 |
-
tgt_sr,
|
282 |
-
resample_sr,
|
283 |
-
rms_mix_rate,
|
284 |
-
version,
|
285 |
-
protect,
|
286 |
-
f0_file=None,
|
287 |
-
):
|
288 |
-
if (
|
289 |
-
file_index != ""
|
290 |
-
# and file_big_npy != ""
|
291 |
-
# and os.path.exists(file_big_npy) == True
|
292 |
-
and os.path.exists(file_index) == True
|
293 |
-
and index_rate != 0
|
294 |
-
):
|
295 |
-
try:
|
296 |
-
index = faiss.read_index(file_index)
|
297 |
-
# big_npy = np.load(file_big_npy)
|
298 |
-
big_npy = index.reconstruct_n(0, index.ntotal)
|
299 |
-
except:
|
300 |
-
traceback.print_exc()
|
301 |
-
index = big_npy = None
|
302 |
-
else:
|
303 |
-
index = big_npy = None
|
304 |
-
audio = signal.filtfilt(bh, ah, audio)
|
305 |
-
audio_pad = np.pad(audio, (self.window // 2, self.window // 2), mode="reflect")
|
306 |
-
opt_ts = []
|
307 |
-
if audio_pad.shape[0] > self.t_max:
|
308 |
-
audio_sum = np.zeros_like(audio)
|
309 |
-
for i in range(self.window):
|
310 |
-
audio_sum += audio_pad[i : i - self.window]
|
311 |
-
for t in range(self.t_center, audio.shape[0], self.t_center):
|
312 |
-
opt_ts.append(
|
313 |
-
t
|
314 |
-
- self.t_query
|
315 |
-
+ np.where(
|
316 |
-
np.abs(audio_sum[t - self.t_query : t + self.t_query])
|
317 |
-
== np.abs(audio_sum[t - self.t_query : t + self.t_query]).min()
|
318 |
-
)[0][0]
|
319 |
-
)
|
320 |
-
s = 0
|
321 |
-
audio_opt = []
|
322 |
-
t = None
|
323 |
-
t1 = ttime()
|
324 |
-
audio_pad = np.pad(audio, (self.t_pad, self.t_pad), mode="reflect")
|
325 |
-
p_len = audio_pad.shape[0] // self.window
|
326 |
-
inp_f0 = None
|
327 |
-
if hasattr(f0_file, "name") == True:
|
328 |
-
try:
|
329 |
-
with open(f0_file.name, "r") as f:
|
330 |
-
lines = f.read().strip("\n").split("\n")
|
331 |
-
inp_f0 = []
|
332 |
-
for line in lines:
|
333 |
-
inp_f0.append([float(i) for i in line.split(",")])
|
334 |
-
inp_f0 = np.array(inp_f0, dtype="float32")
|
335 |
-
except:
|
336 |
-
traceback.print_exc()
|
337 |
-
sid = torch.tensor(sid, device=self.device).unsqueeze(0).long()
|
338 |
-
pitch, pitchf = None, None
|
339 |
-
if if_f0 == 1:
|
340 |
-
pitch, pitchf = self.get_f0(
|
341 |
-
input_audio_path,
|
342 |
-
audio_pad,
|
343 |
-
p_len,
|
344 |
-
f0_up_key,
|
345 |
-
f0_method,
|
346 |
-
filter_radius,
|
347 |
-
inp_f0,
|
348 |
-
)
|
349 |
-
pitch = pitch[:p_len]
|
350 |
-
pitchf = pitchf[:p_len]
|
351 |
-
if self.device == "mps":
|
352 |
-
pitchf = pitchf.astype(np.float32)
|
353 |
-
pitch = torch.tensor(pitch, device=self.device).unsqueeze(0).long()
|
354 |
-
pitchf = torch.tensor(pitchf, device=self.device).unsqueeze(0).float()
|
355 |
-
t2 = ttime()
|
356 |
-
times[1] += t2 - t1
|
357 |
-
for t in opt_ts:
|
358 |
-
t = t // self.window * self.window
|
359 |
-
if if_f0 == 1:
|
360 |
-
audio_opt.append(
|
361 |
-
self.vc(
|
362 |
-
model,
|
363 |
-
net_g,
|
364 |
-
sid,
|
365 |
-
audio_pad[s : t + self.t_pad2 + self.window],
|
366 |
-
pitch[:, s // self.window : (t + self.t_pad2) // self.window],
|
367 |
-
pitchf[:, s // self.window : (t + self.t_pad2) // self.window],
|
368 |
-
times,
|
369 |
-
index,
|
370 |
-
big_npy,
|
371 |
-
index_rate,
|
372 |
-
version,
|
373 |
-
protect,
|
374 |
-
)[self.t_pad_tgt : -self.t_pad_tgt]
|
375 |
-
)
|
376 |
-
else:
|
377 |
-
audio_opt.append(
|
378 |
-
self.vc(
|
379 |
-
model,
|
380 |
-
net_g,
|
381 |
-
sid,
|
382 |
-
audio_pad[s : t + self.t_pad2 + self.window],
|
383 |
-
None,
|
384 |
-
None,
|
385 |
-
times,
|
386 |
-
index,
|
387 |
-
big_npy,
|
388 |
-
index_rate,
|
389 |
-
version,
|
390 |
-
protect,
|
391 |
-
)[self.t_pad_tgt : -self.t_pad_tgt]
|
392 |
-
)
|
393 |
-
s = t
|
394 |
-
if if_f0 == 1:
|
395 |
-
audio_opt.append(
|
396 |
-
self.vc(
|
397 |
-
model,
|
398 |
-
net_g,
|
399 |
-
sid,
|
400 |
-
audio_pad[t:],
|
401 |
-
pitch[:, t // self.window :] if t is not None else pitch,
|
402 |
-
pitchf[:, t // self.window :] if t is not None else pitchf,
|
403 |
-
times,
|
404 |
-
index,
|
405 |
-
big_npy,
|
406 |
-
index_rate,
|
407 |
-
version,
|
408 |
-
protect,
|
409 |
-
)[self.t_pad_tgt : -self.t_pad_tgt]
|
410 |
-
)
|
411 |
-
else:
|
412 |
-
audio_opt.append(
|
413 |
-
self.vc(
|
414 |
-
model,
|
415 |
-
net_g,
|
416 |
-
sid,
|
417 |
-
audio_pad[t:],
|
418 |
-
None,
|
419 |
-
None,
|
420 |
-
times,
|
421 |
-
index,
|
422 |
-
big_npy,
|
423 |
-
index_rate,
|
424 |
-
version,
|
425 |
-
protect,
|
426 |
-
)[self.t_pad_tgt : -self.t_pad_tgt]
|
427 |
-
)
|
428 |
-
audio_opt = np.concatenate(audio_opt)
|
429 |
-
if rms_mix_rate != 1:
|
430 |
-
audio_opt = change_rms(audio, 16000, audio_opt, tgt_sr, rms_mix_rate)
|
431 |
-
if resample_sr >= 16000 and tgt_sr != resample_sr:
|
432 |
-
audio_opt = librosa.resample(
|
433 |
-
audio_opt, orig_sr=tgt_sr, target_sr=resample_sr
|
434 |
-
)
|
435 |
-
audio_max = np.abs(audio_opt).max() / 0.99
|
436 |
-
max_int16 = 32768
|
437 |
-
if audio_max > 1:
|
438 |
-
max_int16 /= audio_max
|
439 |
-
audio_opt = (audio_opt * max_int16).astype(np.int16)
|
440 |
-
del pitch, pitchf, sid
|
441 |
-
if torch.cuda.is_available():
|
442 |
-
torch.cuda.empty_cache()
|
443 |
-
return audio_opt
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Arulkumar03/GroundingDINO_SOTA_Zero_Shot_Model/demo/gradio_app.py
DELETED
@@ -1,125 +0,0 @@
|
|
1 |
-
import argparse
|
2 |
-
from functools import partial
|
3 |
-
import cv2
|
4 |
-
import requests
|
5 |
-
import os
|
6 |
-
from io import BytesIO
|
7 |
-
from PIL import Image
|
8 |
-
import numpy as np
|
9 |
-
from pathlib import Path
|
10 |
-
|
11 |
-
|
12 |
-
import warnings
|
13 |
-
|
14 |
-
import torch
|
15 |
-
|
16 |
-
# prepare the environment
|
17 |
-
os.system("python setup.py build develop --user")
|
18 |
-
os.system("pip install packaging==21.3")
|
19 |
-
os.system("pip install gradio")
|
20 |
-
|
21 |
-
|
22 |
-
warnings.filterwarnings("ignore")
|
23 |
-
|
24 |
-
import gradio as gr
|
25 |
-
|
26 |
-
from groundingdino.models import build_model
|
27 |
-
from groundingdino.util.slconfig import SLConfig
|
28 |
-
from groundingdino.util.utils import clean_state_dict
|
29 |
-
from groundingdino.util.inference import annotate, load_image, predict
|
30 |
-
import groundingdino.datasets.transforms as T
|
31 |
-
|
32 |
-
from huggingface_hub import hf_hub_download
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
# Use this command for evaluate the Grounding DINO model
|
37 |
-
config_file = "groundingdino/config/GroundingDINO_SwinT_OGC.py"
|
38 |
-
ckpt_repo_id = "ShilongLiu/GroundingDINO"
|
39 |
-
ckpt_filenmae = "groundingdino_swint_ogc.pth"
|
40 |
-
|
41 |
-
|
42 |
-
def load_model_hf(model_config_path, repo_id, filename, device='cpu'):
|
43 |
-
args = SLConfig.fromfile(model_config_path)
|
44 |
-
model = build_model(args)
|
45 |
-
args.device = device
|
46 |
-
|
47 |
-
cache_file = hf_hub_download(repo_id=repo_id, filename=filename)
|
48 |
-
checkpoint = torch.load(cache_file, map_location='cpu')
|
49 |
-
log = model.load_state_dict(clean_state_dict(checkpoint['model']), strict=False)
|
50 |
-
print("Model loaded from {} \n => {}".format(cache_file, log))
|
51 |
-
_ = model.eval()
|
52 |
-
return model
|
53 |
-
|
54 |
-
def image_transform_grounding(init_image):
|
55 |
-
transform = T.Compose([
|
56 |
-
T.RandomResize([800], max_size=1333),
|
57 |
-
T.ToTensor(),
|
58 |
-
T.Normalize([0.485, 0.456, 0.406], [0.229, 0.224, 0.225])
|
59 |
-
])
|
60 |
-
image, _ = transform(init_image, None) # 3, h, w
|
61 |
-
return init_image, image
|
62 |
-
|
63 |
-
def image_transform_grounding_for_vis(init_image):
|
64 |
-
transform = T.Compose([
|
65 |
-
T.RandomResize([800], max_size=1333),
|
66 |
-
])
|
67 |
-
image, _ = transform(init_image, None) # 3, h, w
|
68 |
-
return image
|
69 |
-
|
70 |
-
model = load_model_hf(config_file, ckpt_repo_id, ckpt_filenmae)
|
71 |
-
|
72 |
-
def run_grounding(input_image, grounding_caption, box_threshold, text_threshold):
|
73 |
-
init_image = input_image.convert("RGB")
|
74 |
-
original_size = init_image.size
|
75 |
-
|
76 |
-
_, image_tensor = image_transform_grounding(init_image)
|
77 |
-
image_pil: Image = image_transform_grounding_for_vis(init_image)
|
78 |
-
|
79 |
-
# run grounidng
|
80 |
-
boxes, logits, phrases = predict(model, image_tensor, grounding_caption, box_threshold, text_threshold, device='cpu')
|
81 |
-
annotated_frame = annotate(image_source=np.asarray(image_pil), boxes=boxes, logits=logits, phrases=phrases)
|
82 |
-
image_with_box = Image.fromarray(cv2.cvtColor(annotated_frame, cv2.COLOR_BGR2RGB))
|
83 |
-
|
84 |
-
|
85 |
-
return image_with_box
|
86 |
-
|
87 |
-
if __name__ == "__main__":
|
88 |
-
|
89 |
-
parser = argparse.ArgumentParser("Grounding DINO demo", add_help=True)
|
90 |
-
parser.add_argument("--debug", action="store_true", help="using debug mode")
|
91 |
-
parser.add_argument("--share", action="store_true", help="share the app")
|
92 |
-
args = parser.parse_args()
|
93 |
-
|
94 |
-
block = gr.Blocks().queue()
|
95 |
-
with block:
|
96 |
-
gr.Markdown("# [Grounding DINO](https://github.com/IDEA-Research/GroundingDINO)")
|
97 |
-
gr.Markdown("### Open-World Detection with Grounding DINO")
|
98 |
-
|
99 |
-
with gr.Row():
|
100 |
-
with gr.Column():
|
101 |
-
input_image = gr.Image(source='upload', type="pil")
|
102 |
-
grounding_caption = gr.Textbox(label="Detection Prompt")
|
103 |
-
run_button = gr.Button(label="Run")
|
104 |
-
with gr.Accordion("Advanced options", open=False):
|
105 |
-
box_threshold = gr.Slider(
|
106 |
-
label="Box Threshold", minimum=0.0, maximum=1.0, value=0.25, step=0.001
|
107 |
-
)
|
108 |
-
text_threshold = gr.Slider(
|
109 |
-
label="Text Threshold", minimum=0.0, maximum=1.0, value=0.25, step=0.001
|
110 |
-
)
|
111 |
-
|
112 |
-
with gr.Column():
|
113 |
-
gallery = gr.outputs.Image(
|
114 |
-
type="pil",
|
115 |
-
# label="grounding results"
|
116 |
-
).style(full_width=True, full_height=True)
|
117 |
-
# gallery = gr.Gallery(label="Generated images", show_label=False).style(
|
118 |
-
# grid=[1], height="auto", container=True, full_width=True, full_height=True)
|
119 |
-
|
120 |
-
run_button.click(fn=run_grounding, inputs=[
|
121 |
-
input_image, grounding_caption, box_threshold, text_threshold], outputs=[gallery])
|
122 |
-
|
123 |
-
|
124 |
-
block.launch(server_name='0.0.0.0', server_port=7579, debug=args.debug, share=args.share)
|
125 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Arulkumar03/GroundingDINO_SOTA_Zero_Shot_Model/groundingdino/util/visualizer.py
DELETED
@@ -1,318 +0,0 @@
|
|
1 |
-
# -*- coding: utf-8 -*-
|
2 |
-
"""
|
3 |
-
@File : visualizer.py
|
4 |
-
@Time : 2022/04/05 11:39:33
|
5 |
-
@Author : Shilong Liu
|
6 |
-
@Contact : [email protected]
|
7 |
-
"""
|
8 |
-
|
9 |
-
import datetime
|
10 |
-
import os
|
11 |
-
|
12 |
-
import cv2
|
13 |
-
import matplotlib.pyplot as plt
|
14 |
-
import numpy as np
|
15 |
-
import torch
|
16 |
-
from matplotlib import transforms
|
17 |
-
from matplotlib.collections import PatchCollection
|
18 |
-
from matplotlib.patches import Polygon
|
19 |
-
from pycocotools import mask as maskUtils
|
20 |
-
|
21 |
-
|
22 |
-
def renorm(
|
23 |
-
img: torch.FloatTensor, mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225]
|
24 |
-
) -> torch.FloatTensor:
|
25 |
-
# img: tensor(3,H,W) or tensor(B,3,H,W)
|
26 |
-
# return: same as img
|
27 |
-
assert img.dim() == 3 or img.dim() == 4, "img.dim() should be 3 or 4 but %d" % img.dim()
|
28 |
-
if img.dim() == 3:
|
29 |
-
assert img.size(0) == 3, 'img.size(0) shoule be 3 but "%d". (%s)' % (
|
30 |
-
img.size(0),
|
31 |
-
str(img.size()),
|
32 |
-
)
|
33 |
-
img_perm = img.permute(1, 2, 0)
|
34 |
-
mean = torch.Tensor(mean)
|
35 |
-
std = torch.Tensor(std)
|
36 |
-
img_res = img_perm * std + mean
|
37 |
-
return img_res.permute(2, 0, 1)
|
38 |
-
else: # img.dim() == 4
|
39 |
-
assert img.size(1) == 3, 'img.size(1) shoule be 3 but "%d". (%s)' % (
|
40 |
-
img.size(1),
|
41 |
-
str(img.size()),
|
42 |
-
)
|
43 |
-
img_perm = img.permute(0, 2, 3, 1)
|
44 |
-
mean = torch.Tensor(mean)
|
45 |
-
std = torch.Tensor(std)
|
46 |
-
img_res = img_perm * std + mean
|
47 |
-
return img_res.permute(0, 3, 1, 2)
|
48 |
-
|
49 |
-
|
50 |
-
class ColorMap:
|
51 |
-
def __init__(self, basergb=[255, 255, 0]):
|
52 |
-
self.basergb = np.array(basergb)
|
53 |
-
|
54 |
-
def __call__(self, attnmap):
|
55 |
-
# attnmap: h, w. np.uint8.
|
56 |
-
# return: h, w, 4. np.uint8.
|
57 |
-
assert attnmap.dtype == np.uint8
|
58 |
-
h, w = attnmap.shape
|
59 |
-
res = self.basergb.copy()
|
60 |
-
res = res[None][None].repeat(h, 0).repeat(w, 1) # h, w, 3
|
61 |
-
attn1 = attnmap.copy()[..., None] # h, w, 1
|
62 |
-
res = np.concatenate((res, attn1), axis=-1).astype(np.uint8)
|
63 |
-
return res
|
64 |
-
|
65 |
-
|
66 |
-
def rainbow_text(x, y, ls, lc, **kw):
|
67 |
-
"""
|
68 |
-
Take a list of strings ``ls`` and colors ``lc`` and place them next to each
|
69 |
-
other, with text ls[i] being shown in color lc[i].
|
70 |
-
|
71 |
-
This example shows how to do both vertical and horizontal text, and will
|
72 |
-
pass all keyword arguments to plt.text, so you can set the font size,
|
73 |
-
family, etc.
|
74 |
-
"""
|
75 |
-
t = plt.gca().transData
|
76 |
-
fig = plt.gcf()
|
77 |
-
plt.show()
|
78 |
-
|
79 |
-
# horizontal version
|
80 |
-
for s, c in zip(ls, lc):
|
81 |
-
text = plt.text(x, y, " " + s + " ", color=c, transform=t, **kw)
|
82 |
-
text.draw(fig.canvas.get_renderer())
|
83 |
-
ex = text.get_window_extent()
|
84 |
-
t = transforms.offset_copy(text._transform, x=ex.width, units="dots")
|
85 |
-
|
86 |
-
# #vertical version
|
87 |
-
# for s,c in zip(ls,lc):
|
88 |
-
# text = plt.text(x,y," "+s+" ",color=c, transform=t,
|
89 |
-
# rotation=90,va='bottom',ha='center',**kw)
|
90 |
-
# text.draw(fig.canvas.get_renderer())
|
91 |
-
# ex = text.get_window_extent()
|
92 |
-
# t = transforms.offset_copy(text._transform, y=ex.height, units='dots')
|
93 |
-
|
94 |
-
|
95 |
-
class COCOVisualizer:
|
96 |
-
def __init__(self, coco=None, tokenlizer=None) -> None:
|
97 |
-
self.coco = coco
|
98 |
-
|
99 |
-
def visualize(self, img, tgt, caption=None, dpi=180, savedir="vis"):
|
100 |
-
"""
|
101 |
-
img: tensor(3, H, W)
|
102 |
-
tgt: make sure they are all on cpu.
|
103 |
-
must have items: 'image_id', 'boxes', 'size'
|
104 |
-
"""
|
105 |
-
plt.figure(dpi=dpi)
|
106 |
-
plt.rcParams["font.size"] = "5"
|
107 |
-
ax = plt.gca()
|
108 |
-
img = renorm(img).permute(1, 2, 0)
|
109 |
-
# if os.environ.get('IPDB_SHILONG_DEBUG', None) == 'INFO':
|
110 |
-
# import ipdb; ipdb.set_trace()
|
111 |
-
ax.imshow(img)
|
112 |
-
|
113 |
-
self.addtgt(tgt)
|
114 |
-
|
115 |
-
if tgt is None:
|
116 |
-
image_id = 0
|
117 |
-
elif "image_id" not in tgt:
|
118 |
-
image_id = 0
|
119 |
-
else:
|
120 |
-
image_id = tgt["image_id"]
|
121 |
-
|
122 |
-
if caption is None:
|
123 |
-
savename = "{}/{}-{}.png".format(
|
124 |
-
savedir, int(image_id), str(datetime.datetime.now()).replace(" ", "-")
|
125 |
-
)
|
126 |
-
else:
|
127 |
-
savename = "{}/{}-{}-{}.png".format(
|
128 |
-
savedir, caption, int(image_id), str(datetime.datetime.now()).replace(" ", "-")
|
129 |
-
)
|
130 |
-
print("savename: {}".format(savename))
|
131 |
-
os.makedirs(os.path.dirname(savename), exist_ok=True)
|
132 |
-
plt.savefig(savename)
|
133 |
-
plt.close()
|
134 |
-
|
135 |
-
def addtgt(self, tgt):
|
136 |
-
""" """
|
137 |
-
if tgt is None or not "boxes" in tgt:
|
138 |
-
ax = plt.gca()
|
139 |
-
|
140 |
-
if "caption" in tgt:
|
141 |
-
ax.set_title(tgt["caption"], wrap=True)
|
142 |
-
|
143 |
-
ax.set_axis_off()
|
144 |
-
return
|
145 |
-
|
146 |
-
ax = plt.gca()
|
147 |
-
H, W = tgt["size"]
|
148 |
-
numbox = tgt["boxes"].shape[0]
|
149 |
-
|
150 |
-
color = []
|
151 |
-
polygons = []
|
152 |
-
boxes = []
|
153 |
-
for box in tgt["boxes"].cpu():
|
154 |
-
unnormbbox = box * torch.Tensor([W, H, W, H])
|
155 |
-
unnormbbox[:2] -= unnormbbox[2:] / 2
|
156 |
-
[bbox_x, bbox_y, bbox_w, bbox_h] = unnormbbox.tolist()
|
157 |
-
boxes.append([bbox_x, bbox_y, bbox_w, bbox_h])
|
158 |
-
poly = [
|
159 |
-
[bbox_x, bbox_y],
|
160 |
-
[bbox_x, bbox_y + bbox_h],
|
161 |
-
[bbox_x + bbox_w, bbox_y + bbox_h],
|
162 |
-
[bbox_x + bbox_w, bbox_y],
|
163 |
-
]
|
164 |
-
np_poly = np.array(poly).reshape((4, 2))
|
165 |
-
polygons.append(Polygon(np_poly))
|
166 |
-
c = (np.random.random((1, 3)) * 0.6 + 0.4).tolist()[0]
|
167 |
-
color.append(c)
|
168 |
-
|
169 |
-
p = PatchCollection(polygons, facecolor=color, linewidths=0, alpha=0.1)
|
170 |
-
ax.add_collection(p)
|
171 |
-
p = PatchCollection(polygons, facecolor="none", edgecolors=color, linewidths=2)
|
172 |
-
ax.add_collection(p)
|
173 |
-
|
174 |
-
if "strings_positive" in tgt and len(tgt["strings_positive"]) > 0:
|
175 |
-
assert (
|
176 |
-
len(tgt["strings_positive"]) == numbox
|
177 |
-
), f"{len(tgt['strings_positive'])} = {numbox}, "
|
178 |
-
for idx, strlist in enumerate(tgt["strings_positive"]):
|
179 |
-
cate_id = int(tgt["labels"][idx])
|
180 |
-
_string = str(cate_id) + ":" + " ".join(strlist)
|
181 |
-
bbox_x, bbox_y, bbox_w, bbox_h = boxes[idx]
|
182 |
-
# ax.text(bbox_x, bbox_y, _string, color='black', bbox={'facecolor': 'yellow', 'alpha': 1.0, 'pad': 1})
|
183 |
-
ax.text(
|
184 |
-
bbox_x,
|
185 |
-
bbox_y,
|
186 |
-
_string,
|
187 |
-
color="black",
|
188 |
-
bbox={"facecolor": color[idx], "alpha": 0.6, "pad": 1},
|
189 |
-
)
|
190 |
-
|
191 |
-
if "box_label" in tgt:
|
192 |
-
assert len(tgt["box_label"]) == numbox, f"{len(tgt['box_label'])} = {numbox}, "
|
193 |
-
for idx, bl in enumerate(tgt["box_label"]):
|
194 |
-
_string = str(bl)
|
195 |
-
bbox_x, bbox_y, bbox_w, bbox_h = boxes[idx]
|
196 |
-
# ax.text(bbox_x, bbox_y, _string, color='black', bbox={'facecolor': 'yellow', 'alpha': 1.0, 'pad': 1})
|
197 |
-
ax.text(
|
198 |
-
bbox_x,
|
199 |
-
bbox_y,
|
200 |
-
_string,
|
201 |
-
color="black",
|
202 |
-
bbox={"facecolor": color[idx], "alpha": 0.6, "pad": 1},
|
203 |
-
)
|
204 |
-
|
205 |
-
if "caption" in tgt:
|
206 |
-
ax.set_title(tgt["caption"], wrap=True)
|
207 |
-
# plt.figure()
|
208 |
-
# rainbow_text(0.0,0.0,"all unicorns poop rainbows ! ! !".split(),
|
209 |
-
# ['red', 'orange', 'brown', 'green', 'blue', 'purple', 'black'])
|
210 |
-
|
211 |
-
if "attn" in tgt:
|
212 |
-
# if os.environ.get('IPDB_SHILONG_DEBUG', None) == 'INFO':
|
213 |
-
# import ipdb; ipdb.set_trace()
|
214 |
-
if isinstance(tgt["attn"], tuple):
|
215 |
-
tgt["attn"] = [tgt["attn"]]
|
216 |
-
for item in tgt["attn"]:
|
217 |
-
attn_map, basergb = item
|
218 |
-
attn_map = (attn_map - attn_map.min()) / (attn_map.max() - attn_map.min() + 1e-3)
|
219 |
-
attn_map = (attn_map * 255).astype(np.uint8)
|
220 |
-
cm = ColorMap(basergb)
|
221 |
-
heatmap = cm(attn_map)
|
222 |
-
ax.imshow(heatmap)
|
223 |
-
ax.set_axis_off()
|
224 |
-
|
225 |
-
def showAnns(self, anns, draw_bbox=False):
|
226 |
-
"""
|
227 |
-
Display the specified annotations.
|
228 |
-
:param anns (array of object): annotations to display
|
229 |
-
:return: None
|
230 |
-
"""
|
231 |
-
if len(anns) == 0:
|
232 |
-
return 0
|
233 |
-
if "segmentation" in anns[0] or "keypoints" in anns[0]:
|
234 |
-
datasetType = "instances"
|
235 |
-
elif "caption" in anns[0]:
|
236 |
-
datasetType = "captions"
|
237 |
-
else:
|
238 |
-
raise Exception("datasetType not supported")
|
239 |
-
if datasetType == "instances":
|
240 |
-
ax = plt.gca()
|
241 |
-
ax.set_autoscale_on(False)
|
242 |
-
polygons = []
|
243 |
-
color = []
|
244 |
-
for ann in anns:
|
245 |
-
c = (np.random.random((1, 3)) * 0.6 + 0.4).tolist()[0]
|
246 |
-
if "segmentation" in ann:
|
247 |
-
if type(ann["segmentation"]) == list:
|
248 |
-
# polygon
|
249 |
-
for seg in ann["segmentation"]:
|
250 |
-
poly = np.array(seg).reshape((int(len(seg) / 2), 2))
|
251 |
-
polygons.append(Polygon(poly))
|
252 |
-
color.append(c)
|
253 |
-
else:
|
254 |
-
# mask
|
255 |
-
t = self.imgs[ann["image_id"]]
|
256 |
-
if type(ann["segmentation"]["counts"]) == list:
|
257 |
-
rle = maskUtils.frPyObjects(
|
258 |
-
[ann["segmentation"]], t["height"], t["width"]
|
259 |
-
)
|
260 |
-
else:
|
261 |
-
rle = [ann["segmentation"]]
|
262 |
-
m = maskUtils.decode(rle)
|
263 |
-
img = np.ones((m.shape[0], m.shape[1], 3))
|
264 |
-
if ann["iscrowd"] == 1:
|
265 |
-
color_mask = np.array([2.0, 166.0, 101.0]) / 255
|
266 |
-
if ann["iscrowd"] == 0:
|
267 |
-
color_mask = np.random.random((1, 3)).tolist()[0]
|
268 |
-
for i in range(3):
|
269 |
-
img[:, :, i] = color_mask[i]
|
270 |
-
ax.imshow(np.dstack((img, m * 0.5)))
|
271 |
-
if "keypoints" in ann and type(ann["keypoints"]) == list:
|
272 |
-
# turn skeleton into zero-based index
|
273 |
-
sks = np.array(self.loadCats(ann["category_id"])[0]["skeleton"]) - 1
|
274 |
-
kp = np.array(ann["keypoints"])
|
275 |
-
x = kp[0::3]
|
276 |
-
y = kp[1::3]
|
277 |
-
v = kp[2::3]
|
278 |
-
for sk in sks:
|
279 |
-
if np.all(v[sk] > 0):
|
280 |
-
plt.plot(x[sk], y[sk], linewidth=3, color=c)
|
281 |
-
plt.plot(
|
282 |
-
x[v > 0],
|
283 |
-
y[v > 0],
|
284 |
-
"o",
|
285 |
-
markersize=8,
|
286 |
-
markerfacecolor=c,
|
287 |
-
markeredgecolor="k",
|
288 |
-
markeredgewidth=2,
|
289 |
-
)
|
290 |
-
plt.plot(
|
291 |
-
x[v > 1],
|
292 |
-
y[v > 1],
|
293 |
-
"o",
|
294 |
-
markersize=8,
|
295 |
-
markerfacecolor=c,
|
296 |
-
markeredgecolor=c,
|
297 |
-
markeredgewidth=2,
|
298 |
-
)
|
299 |
-
|
300 |
-
if draw_bbox:
|
301 |
-
[bbox_x, bbox_y, bbox_w, bbox_h] = ann["bbox"]
|
302 |
-
poly = [
|
303 |
-
[bbox_x, bbox_y],
|
304 |
-
[bbox_x, bbox_y + bbox_h],
|
305 |
-
[bbox_x + bbox_w, bbox_y + bbox_h],
|
306 |
-
[bbox_x + bbox_w, bbox_y],
|
307 |
-
]
|
308 |
-
np_poly = np.array(poly).reshape((4, 2))
|
309 |
-
polygons.append(Polygon(np_poly))
|
310 |
-
color.append(c)
|
311 |
-
|
312 |
-
# p = PatchCollection(polygons, facecolor=color, linewidths=0, alpha=0.4)
|
313 |
-
# ax.add_collection(p)
|
314 |
-
p = PatchCollection(polygons, facecolor="none", edgecolors=color, linewidths=2)
|
315 |
-
ax.add_collection(p)
|
316 |
-
elif datasetType == "captions":
|
317 |
-
for ann in anns:
|
318 |
-
print(ann["caption"])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Ataturk-Chatbot/HuggingFaceChat/venv/lib/python3.11/site-packages/setuptools/_vendor/packaging/utils.py
DELETED
@@ -1,136 +0,0 @@
|
|
1 |
-
# This file is dual licensed under the terms of the Apache License, Version
|
2 |
-
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
|
3 |
-
# for complete details.
|
4 |
-
|
5 |
-
import re
|
6 |
-
from typing import FrozenSet, NewType, Tuple, Union, cast
|
7 |
-
|
8 |
-
from .tags import Tag, parse_tag
|
9 |
-
from .version import InvalidVersion, Version
|
10 |
-
|
11 |
-
BuildTag = Union[Tuple[()], Tuple[int, str]]
|
12 |
-
NormalizedName = NewType("NormalizedName", str)
|
13 |
-
|
14 |
-
|
15 |
-
class InvalidWheelFilename(ValueError):
|
16 |
-
"""
|
17 |
-
An invalid wheel filename was found, users should refer to PEP 427.
|
18 |
-
"""
|
19 |
-
|
20 |
-
|
21 |
-
class InvalidSdistFilename(ValueError):
|
22 |
-
"""
|
23 |
-
An invalid sdist filename was found, users should refer to the packaging user guide.
|
24 |
-
"""
|
25 |
-
|
26 |
-
|
27 |
-
_canonicalize_regex = re.compile(r"[-_.]+")
|
28 |
-
# PEP 427: The build number must start with a digit.
|
29 |
-
_build_tag_regex = re.compile(r"(\d+)(.*)")
|
30 |
-
|
31 |
-
|
32 |
-
def canonicalize_name(name: str) -> NormalizedName:
|
33 |
-
# This is taken from PEP 503.
|
34 |
-
value = _canonicalize_regex.sub("-", name).lower()
|
35 |
-
return cast(NormalizedName, value)
|
36 |
-
|
37 |
-
|
38 |
-
def canonicalize_version(version: Union[Version, str]) -> str:
|
39 |
-
"""
|
40 |
-
This is very similar to Version.__str__, but has one subtle difference
|
41 |
-
with the way it handles the release segment.
|
42 |
-
"""
|
43 |
-
if isinstance(version, str):
|
44 |
-
try:
|
45 |
-
parsed = Version(version)
|
46 |
-
except InvalidVersion:
|
47 |
-
# Legacy versions cannot be normalized
|
48 |
-
return version
|
49 |
-
else:
|
50 |
-
parsed = version
|
51 |
-
|
52 |
-
parts = []
|
53 |
-
|
54 |
-
# Epoch
|
55 |
-
if parsed.epoch != 0:
|
56 |
-
parts.append(f"{parsed.epoch}!")
|
57 |
-
|
58 |
-
# Release segment
|
59 |
-
# NB: This strips trailing '.0's to normalize
|
60 |
-
parts.append(re.sub(r"(\.0)+$", "", ".".join(str(x) for x in parsed.release)))
|
61 |
-
|
62 |
-
# Pre-release
|
63 |
-
if parsed.pre is not None:
|
64 |
-
parts.append("".join(str(x) for x in parsed.pre))
|
65 |
-
|
66 |
-
# Post-release
|
67 |
-
if parsed.post is not None:
|
68 |
-
parts.append(f".post{parsed.post}")
|
69 |
-
|
70 |
-
# Development release
|
71 |
-
if parsed.dev is not None:
|
72 |
-
parts.append(f".dev{parsed.dev}")
|
73 |
-
|
74 |
-
# Local version segment
|
75 |
-
if parsed.local is not None:
|
76 |
-
parts.append(f"+{parsed.local}")
|
77 |
-
|
78 |
-
return "".join(parts)
|
79 |
-
|
80 |
-
|
81 |
-
def parse_wheel_filename(
|
82 |
-
filename: str,
|
83 |
-
) -> Tuple[NormalizedName, Version, BuildTag, FrozenSet[Tag]]:
|
84 |
-
if not filename.endswith(".whl"):
|
85 |
-
raise InvalidWheelFilename(
|
86 |
-
f"Invalid wheel filename (extension must be '.whl'): {filename}"
|
87 |
-
)
|
88 |
-
|
89 |
-
filename = filename[:-4]
|
90 |
-
dashes = filename.count("-")
|
91 |
-
if dashes not in (4, 5):
|
92 |
-
raise InvalidWheelFilename(
|
93 |
-
f"Invalid wheel filename (wrong number of parts): {filename}"
|
94 |
-
)
|
95 |
-
|
96 |
-
parts = filename.split("-", dashes - 2)
|
97 |
-
name_part = parts[0]
|
98 |
-
# See PEP 427 for the rules on escaping the project name
|
99 |
-
if "__" in name_part or re.match(r"^[\w\d._]*$", name_part, re.UNICODE) is None:
|
100 |
-
raise InvalidWheelFilename(f"Invalid project name: {filename}")
|
101 |
-
name = canonicalize_name(name_part)
|
102 |
-
version = Version(parts[1])
|
103 |
-
if dashes == 5:
|
104 |
-
build_part = parts[2]
|
105 |
-
build_match = _build_tag_regex.match(build_part)
|
106 |
-
if build_match is None:
|
107 |
-
raise InvalidWheelFilename(
|
108 |
-
f"Invalid build number: {build_part} in '{filename}'"
|
109 |
-
)
|
110 |
-
build = cast(BuildTag, (int(build_match.group(1)), build_match.group(2)))
|
111 |
-
else:
|
112 |
-
build = ()
|
113 |
-
tags = parse_tag(parts[-1])
|
114 |
-
return (name, version, build, tags)
|
115 |
-
|
116 |
-
|
117 |
-
def parse_sdist_filename(filename: str) -> Tuple[NormalizedName, Version]:
|
118 |
-
if filename.endswith(".tar.gz"):
|
119 |
-
file_stem = filename[: -len(".tar.gz")]
|
120 |
-
elif filename.endswith(".zip"):
|
121 |
-
file_stem = filename[: -len(".zip")]
|
122 |
-
else:
|
123 |
-
raise InvalidSdistFilename(
|
124 |
-
f"Invalid sdist filename (extension must be '.tar.gz' or '.zip'):"
|
125 |
-
f" {filename}"
|
126 |
-
)
|
127 |
-
|
128 |
-
# We are requiring a PEP 440 version, which cannot contain dashes,
|
129 |
-
# so we split on the last dash.
|
130 |
-
name_part, sep, version_part = file_stem.rpartition("-")
|
131 |
-
if not sep:
|
132 |
-
raise InvalidSdistFilename(f"Invalid sdist filename: {filename}")
|
133 |
-
|
134 |
-
name = canonicalize_name(name_part)
|
135 |
-
version = Version(version_part)
|
136 |
-
return (name, version)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Benson/text-generation/Examples/3 Patti Octro Apk Download 2021.md
DELETED
@@ -1,118 +0,0 @@
|
|
1 |
-
|
2 |
-
<h1>3 Patti Octro APK Descargar 2021: Cómo jugar el clásico juego de cartas indio en línea</h1>
|
3 |
-
<p>Si usted es un fan de los juegos de cartas, es posible que haya oído hablar de 3 Patti, también conocido como Teen Patti o Indian Poker. Es uno de los juegos de cartas más populares y emocionantes en la India, donde millones de jugadores lo disfrutan en línea o fuera de línea. Pero ¿qué pasa si quieres jugar en su teléfono inteligente o computadora? Ahí es donde 3 Patti Octro entra en juego. En este artículo, le diremos todo lo que necesita saber sobre 3 Patti Octro, cómo descargar e instalar su archivo APK, cómo jugarlo en línea y por qué debe elegirlo sobre otros juegos de cartas. </p>
|
4 |
-
<h2>¿Qué es 3 Patti Octro? </h2>
|
5 |
-
<p>3 Patti Octro es una versión en línea del clásico juego de cartas indio, desarrollado por Octro, Inc. Es una aplicación gratuita que te permite jugar en tiempo real Teen Patti con tus amigos u otros jugadores de todo el mundo. También puedes disfrutar de varias variaciones del juego, como Chatai, 6 Patti, AK47, Tourneys y más. También puedes ganar fichas, monedas, bonos y premios jugando el juego regularmente. </p>
|
6 |
-
<h2>3 patti octro apk download 2021</h2><br /><p><b><b>Download File</b> - <a href="https://bltlly.com/2v6LjF">https://bltlly.com/2v6LjF</a></b></p><br /><br />
|
7 |
-
<h3>La historia y popularidad de 3 Patti</h3>
|
8 |
-
<p>3 Patti es un juego de cartas que se originó en la India, donde también se conoce como Teen Patti o Indian Poker. Se deriva del juego británico de tres cartas brag, que es una versión simplificada de póquer. El juego se ha jugado durante siglos en la India, especialmente durante festivales como Diwali y Holi. También es popular en otros países del sur de Asia, como Pakistán, Bangladesh, Nepal y Sri Lanka.</p>
|
9 |
-
<p>Hoy, 3 Patti es uno de los juegos de cartas más jugados en la India, con millones de fans en todo el país. También está ganando popularidad en otras partes del mundo, gracias a internet y plataformas en línea como 3 Patti Octro. Según Google Play, 3 Patti Octro tiene más de 50 millones de descargas y una calificación de 4.36 de 5 estrellas. También es uno de los mejores juegos de cartas en AppBrain.</p>
|
10 |
-
<h3>Las características y variaciones de 3 Patti Octro</h3>
|
11 |
-
|
12 |
-
<ul>
|
13 |
-
<li>Puedes jugar con tus amigos u otros jugadores de todo el mundo en tiempo real. </li>
|
14 |
-
<li>Puedes chatear con tus oponentes y enviarles emojis y regalos. </li>
|
15 |
-
<li>Puedes elegir entre diferentes mesas con diferentes apuestas y límites de apuesta. </li>
|
16 |
-
<li>Puede unirse o crear habitaciones privadas donde puede invitar a sus amigos o familiares. </li>
|
17 |
-
<li>Puedes participar en varios torneos y eventos donde puedes ganar grandes premios y recompensas. </li>
|
18 |
-
<li>Puedes jugar diferentes variaciones del juego, como Chatai, donde puedes usar dos juegos de cartas; 6 Patti, donde puedes usar seis cartas en lugar de tres; AK47, donde Ases, Reyes, Cuatros y Sietes son comodines ; y torneos, donde puedes competir con otros jugadores en un formato eliminatorio. </li>
|
19 |
-
</ul>
|
20 |
-
<h2>Cómo descargar e instalar 3 Patti Octro APK? </h2>
|
21 |
-
<p>Si desea jugar 3 Patti Octro en su teléfono inteligente u ordenador, es necesario descargar e instalar su archivo APK. APK significa Android Package Kit, que es un formato de archivo que contiene el código de la aplicación, recursos y metadatos. Al descargar e instalar el archivo APK, puede disfrutar de la última versión de la aplicación sin esperar la actualización oficial de la tienda de aplicaciones. Aquí están los pasos para descargar e instalar 3 Patti Octro APK en sus dispositivos Android o PC o portátil. </p>
|
22 |
-
<h3>Los pasos para descargar e instalar 3 Patti Octro APK en dispositivos Android</h3>
|
23 |
-
<ol>
|
24 |
-
<li>Ir al sitio web oficial de 3 Patti Octro o cualquier otra fuente de confianza que proporciona el archivo APK de la aplicación. </li>
|
25 |
-
<li>Haga clic en el botón de descarga y espere a que el archivo se descargue en su dispositivo. </li>
|
26 |
-
<li>Una vez descargado el archivo, vaya a la configuración de su dispositivo y habilite la opción de instalar aplicaciones de fuentes desconocidas. Esto le permitirá instalar el archivo APK sin ningún problema. </li>
|
27 |
-
<li>Localice el archivo descargado en el administrador de archivos de su dispositivo y toque en él para iniciar el proceso de instalación. </li>
|
28 |
-
|
29 |
-
<li>Iniciar la aplicación y disfrutar de jugar 3 Patti Octro en línea. </li>
|
30 |
-
</ol>
|
31 |
-
<h3>Los pasos para descargar e instalar 3 Patti Octro APK en PC o portátil</h3>
|
32 |
-
<ol>
|
33 |
-
<li>Para jugar 3 Patti Octro en su PC o portátil, es necesario utilizar un emulador de Android, que es un software que simula el sistema operativo Android en su ordenador. Algunos de los emuladores populares de Android son BlueStacks, NoxPlayer y LDPlayer. Puede descargar cualquiera de ellos desde sus sitios web oficiales. </li>
|
34 |
-
<li>Instalar el emulador de Android en su PC o portátil y lanzarlo. </li>
|
35 |
-
<li>Ir al sitio web oficial de 3 Patti Octro o cualquier otra fuente de confianza que proporciona el archivo APK de la aplicación. </li>
|
36 |
-
<li>Descargue el archivo APK en su computadora y arrástrelo y suéltelo en la ventana del emulador. Alternativamente, puedes usar el navegador incorporado del emulador para descargar el archivo APK directamente. </li>
|
37 |
-
<li>El emulador detectará e instalará automáticamente el archivo APK en su computadora. </li>
|
38 |
-
<li>Abra el cajón de aplicaciones en el emulador y haga clic en el icono de 3 Patti Octro para iniciar la aplicación. </li>
|
39 |
-
<li>Disfruta jugando 3 Patti Octro en línea en su PC o portátil. </li>
|
40 |
-
</ol>
|
41 |
-
<h2>Cómo jugar 3 Patti Octro en línea? </h2>
|
42 |
-
<p>Ahora que ha descargado e instalado 3 Patti Octro en su dispositivo, es posible que se pregunte cómo jugar en línea. No te preocupes, te tenemos cubierto. Estas son algunas de las reglas básicas y consejos de 3 Patti Octro, así como algunos de los modos y torneos que puedes probar. </p>
|
43 |
-
<h3>Las reglas y consejos de 3 Patti Octro</h3>
|
44 |
-
<p>Las reglas de 3 Patti Octro son similares a las de 3 Patti tradicionales, con algunas diferencias menores. Estas son algunas de las reglas principales que necesitas saber:</p>
|
45 |
-
<ul>
|
46 |
-
<li>El juego se juega con una baraja estándar de 52 cartas, sin comodines (a menos que estés jugando una variación que los use). </li>
|
47 |
-
<li>El juego puede ser jugado por dos a cinco jugadores a la vez. Cada jugador recibe tres cartas boca abajo. </li>
|
48 |
-
|
49 |
-
<li>La clasificación de las manos, de mayor a menor, es la siguiente: Trail o Set (tres de una clase), Secuencia pura (escalera de color), Secuencia (recta), Color (color), Par (dos de una clase), y High Card.</li>
|
50 |
-
<li>Los jugadores pueden ver sus cartas o jugar a ciegas. Un jugador que ve sus cartas tiene que apostar el doble de la cantidad de un jugador ciego. Un jugador ciego puede elegir ver sus cartas en cualquier momento, pero luego tiene que apostar de acuerdo con las reglas del jugador visto. </li>
|
51 |
-
<li>Los jugadores también pueden abandonar sus cartas si creen que tienen una mano débil o no quieren continuar la ronda. Un jugador doblado no puede unirse a la ronda y pierde todas las fichas que ha apostado hasta ahora. </li>
|
52 |
-
<li>La ronda termina cuando todos menos un jugador doblan sus cartas, o cuando dos jugadores permanecen y uno de ellos pide un espectáculo. Un espectáculo es una comparación de las manos de los dos jugadores, y el que tiene la mano más alta gana el bote. </li>
|
53 |
-
</ul>
|
54 |
-
<p>Estos son algunos de los consejos que pueden ayudarte a mejorar tus habilidades y ganar más juegos:</p>
|
55 |
-
<ul>
|
56 |
-
<li>Aprende el ranking de las manos y memorízalas bien. Esto te ayudará a decidir si apostar, abandonar o mostrar tus cartas. </li>
|
57 |
-
<li>Observa a tus oponentes y sus patrones de apuestas. Esto te ayudará a adivinar sus cartas y farolear de manera efectiva. </li>
|
58 |
-
<li>Juega según tu posición y tu bankroll. Si estás en una posición tardía, tienes más información sobre los otros jugadores y puedes tomar mejores decisiones. Si tienes un bankroll bajo, debes jugar con precaución y evitar apuestas arriesgadas. </li>
|
59 |
-
<li>Prueba diferentes variaciones y modos del juego para darle vida a tu experiencia y desafiarte a ti mismo. También puedes unirte a torneos y eventos para ganar premios y recompensas más grandes. </li>
|
60 |
-
</ul>
|
61 |
-
<h3>Los modos y torneos de 3 Patti Octro</h3>
|
62 |
-
<p>3 Patti Octro ofrece varios modos y torneos que puedes jugar online con otros jugadores. Algunos de estos modos y torneos son:</p>
|
63 |
-
<ul>
|
64 |
-
|
65 |
-
<li>Modo privado: Este es el modo en el que puede crear o unirse a habitaciones privadas donde puede invitar a sus amigos o familiares. También puedes personalizar las reglas y ajustes del juego según tus preferencias. </li>
|
66 |
-
<li>Modo Torneo: Este es el modo en el que puedes participar en varios torneos y eventos donde puedes competir con otros jugadores en un formato eliminatorio. Puedes ganar grandes premios y recompensas al alcanzar las etapas finales del torneo. </li>
|
67 |
-
<li>6 Modo Patti: Este es el modo donde puedes jugar 6 Patti, que es una variación de 3 Patti donde usas seis cartas en lugar de tres. Puedes formar dos manos separadas de tres cartas cada una, y compararlas con las manos de tu oponente. </li>
|
68 |
-
<li>Modo Chatai: Este es el modo en el que puedes jugar Chatai, que es una variación de 3 Patti donde usas dos juegos de cartas. Puedes cambiar entre los sets durante el juego y usar tres cartas de cualquiera de ellos para formar tu mano. </li>
|
69 |
-
<li>Modo AK47: Este es el modo donde puedes jugar AK47, que es una variación de 3 Patti donde Ases, Reyes, Cuatro y Sietes son bromistas. Puede utilizar estas tarjetas para reemplazar cualquier otra tarjeta en su mano. </li>
|
70 |
-
</ul>
|
71 |
-
<h2>¿Por qué elegir 3 Patti Octro sobre otros juegos de cartas? </h2>
|
72 |
-
<p>Es posible que se pregunte por qué debe elegir 3 Patti Octro sobre otros juegos de cartas que están disponibles en línea. Bueno, hay muchas razones por las que 3 Patti Octro es mejor que otros juegos de cartas, como:</p>
|
73 |
-
<p></p>
|
74 |
-
<h3>Los beneficios y ventajas de 3 Patti Octro</h3>
|
75 |
-
<p>Algunos de los beneficios y ventajas de 3 Patti Octro son:</p>
|
76 |
-
<ul>
|
77 |
-
<li>Es gratis para descargar y jugar. No tienes que pagar nada para disfrutar de este juego en tu dispositivo. </li>
|
78 |
-
<li>Es fácil de aprender y jugar. No necesitas ninguna experiencia o conocimiento previo para jugar a este juego. Solo tienes que seguir las reglas simples y consejos que hemos proporcionado anteriormente. </li>
|
79 |
-
|
80 |
-
<li>Es social e interactivo. Puedes chatear con tus oponentes y enviarles emojis y regalos. También puedes hacer nuevos amigos y unirte a comunidades de 3 jugadores de Patti Octro. </li>
|
81 |
-
<li>Es gratificante y rentable. Puedes ganar fichas, monedas, bonos y premios jugando el juego regularmente. También puede cambiar sus fichas por dinero real o tarjetas de regalo. </li>
|
82 |
-
</ul>
|
83 |
-
<h3>Los testimonios y comentarios de 3 jugadores de Patti Octro</h3>
|
84 |
-
<p>No solo tomes nuestra palabra. Estos son algunos de los testimonios y comentarios de 3 jugadores de Patti Octro que han compartido sus opiniones y experiencias en Google Play:</p>
|
85 |
-
<blockquote>
|
86 |
-
<p>"El mejor juego de la historia. Me encanta este juego. Es muy adictivo y entretenido. Lo juego todos los días con mis amigos y familiares. Es muy fácil de usar y tiene muchas opciones para jugar. Se lo recomiendo a todos los amantes de los juegos de cartas."</p>
|
87 |
-
<cite>- Ravi Kumar, 5 estrellas</cite>
|
88 |
-
</blockquote>
|
89 |
-
<blockquote>
|
90 |
-
<p>"Juego impresionante. He estado jugando a este juego durante mucho tiempo y lo disfruto mucho. Es muy desafiante y divertido. Tiene muchas variaciones y modos para elegir. También es muy social e interactivo. He hecho muchos amigos a través de este juego."</p>
|
91 |
-
<cite>- Priya Sharma, 5 estrellas</cite>
|
92 |
-
</blockquote>
|
93 |
-
<blockquote>
|
94 |
-
<p>"Gran juego. Me gusta mucho este juego. Es muy realista y emocionante. Tiene gráficos y efectos de sonido increíbles. También es muy justo y seguro. No engaña o hackea su cuenta. Es un juego genuino." </p>
|
95 |
-
<cite>- Rajesh Singh, 5 estrellas</cite>
|
96 |
-
</blockquote>
|
97 |
-
<h2>Conclusión</h2>
|
98 |
-
<h4>Resumen de los puntos principales</h4>
|
99 |
-
|
100 |
-
<p>Para jugar 3 Patti Octro en su teléfono inteligente u ordenador, es necesario descargar e instalar su archivo APK desde su sitio web oficial o cualquier otra fuente de confianza. A continuación, puede seguir las reglas simples y consejos del juego, así como probar diferentes modos y torneos que se adapten a sus preferencias y habilidades. </p>
|
101 |
-
<p>3 Patti Octro es mejor que otros juegos de cartas porque ofrece muchos beneficios y ventajas, como ser gratis, fácil, divertido, emocionante, social, interactivo, gratificante y rentable. También tiene muchos testimonios positivos y comentarios de sus jugadores que han disfrutado del juego inmensamente. </p>
|
102 |
-
<h4>Llamada a la acción</h4>
|
103 |
-
<p>Entonces, ¿qué estás esperando? Descargar 3 Patti Octro APK hoy y unirse a los millones de fans que están jugando a este increíble juego de cartas en línea. ¡No te arrepentirás! </p>
|
104 |
-
<h2>Preguntas frecuentes</h2>
|
105 |
-
<p>Aquí están algunas de las preguntas más frecuentes sobre 3 Patti Octro:</p>
|
106 |
-
<ol>
|
107 |
-
<li><strong>Es 3 Patti Octro seguro y legal? </strong></li>
|
108 |
-
<p>Sí, 3 Patti Octro es seguro y legal para jugar en línea. La aplicación no contiene ningún malware o virus que pueda dañar su dispositivo o datos. La aplicación también cumple con todas las leyes y reglamentos que rigen los juegos en línea en la India y otros países. </p>
|
109 |
-
<li><strong>¿Cómo puedo obtener más fichas en 3 Patti Octro? </strong></li>
|
110 |
-
<p>Puedes obtener más fichas en 3 Patti Octro jugando el juego regularmente y ganando más rondas. También puede obtener fichas gratuitas al iniciar sesión diariamente, invitar a sus amigos, completar tareas, ver videos, girar la rueda, etc. También puede comprar fichas con dinero real o tarjetas de regalo si lo desea. </p>
|
111 |
-
<li><strong>¿Cómo puedo contactar al servicio de atención al cliente de 3 Patti Octro? </strong></li>
|
112 |
-
<p>Puede ponerse en contacto con el servicio de atención al cliente de 3 Patti Octro enviando un correo electrónico a [email protected] o rellenando el formulario en su sitio web. También puede visitar su página de Facebook o cuenta de Twitter para obtener más información y actualizaciones. </p>
|
113 |
-
<li><strong>¿Puedo jugar 3 Patti Octro sin conexión? </strong></li>
|
114 |
-
|
115 |
-
<li><strong>¿Puedo jugar 3 Patti Octro con dinero real? </strong></li>
|
116 |
-
<p>No, no se puede jugar 3 Patti Octro con dinero real. La aplicación solo utiliza fichas virtuales que no tienen valor real o tasa de cambio. La aplicación no es compatible con ninguna forma de juego o apuestas con dinero real. La aplicación es para fines de entretenimiento y diversión solamente. </p> 64aa2da5cf<br />
|
117 |
-
<br />
|
118 |
-
<br />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Benson/text-generation/Examples/Descargar Efectos De Sonido Final Cut Pro.md
DELETED
@@ -1,140 +0,0 @@
|
|
1 |
-
|
2 |
-
<h1>Cómo descargar efectos de sonido para Final Cut Pro</h1>
|
3 |
-
<p>Los efectos de sonido son la guinda del pastel de la producción de video. Pueden hacer que sus videos sean más realistas, atractivos e inmersivos. Si desea agregar algunos silbidos, pájaros, pasos o explosiones, puede encontrar una variedad de efectos de sonido en línea o crear su propio. En este artículo, te mostraremos cómo descargar y usar efectos de sonido en Final Cut Pro, uno de los programas de edición de video más populares para usuarios de Mac. También compartiremos algunos recursos gratuitos donde puedes encontrar efectos de sonido de alta calidad para tus proyectos. </p>
|
4 |
-
<h2>descargar efectos de sonido final cut pro</h2><br /><p><b><b>Download</b> ✪✪✪ <a href="https://bltlly.com/2v6KjW">https://bltlly.com/2v6KjW</a></b></p><br /><br />
|
5 |
-
<h2>¿Qué son los efectos de sonido y por qué usarlos en Final Cut Pro? </h2>
|
6 |
-
<h3>Los efectos de sonido son clips de audio que mejoran la producción de vídeo</h3>
|
7 |
-
<p>Los efectos de sonido son cualquier sonido que no forma parte del audio original grabado con su video. Pueden ser sonidos naturales, como viento, lluvia o animales, o sonidos artificiales, como sirenas, disparos o música. Los efectos de sonido se pueden utilizar para complementar o contrastar las imágenes, crear un sentido de realismo o fantasía, o enfatizar un cierto estado de ánimo o emoción. </p>
|
8 |
-
<h3>Los efectos de sonido pueden agregar realismo, temas de historia, estado de ánimo y transiciones a sus videos</h3>
|
9 |
-
<p>Usar efectos de sonido en tus videos puede tener muchos beneficios. Estos son algunos ejemplos de cómo puedes usar efectos de sonido en Final Cut Pro:</p>
|
10 |
-
<ul>
|
11 |
-
<li>Añade realismo: Puedes usar efectos de sonido para hacer tus escenas más creíbles y auténticas. Por ejemplo, puede agregar los sonidos de los neumáticos de los automóviles crujiendo en la grava, una brisa suave o perros ladrando en el fondo. </li>
|
12 |
-
<li>Temas de la historia: Puedes usar efectos de sonido para transmitir el tema o mensaje de tu video. Por ejemplo, puedes usar menos o efectos de sonido más oscuros para crear una sensación de aislamiento o soledad, o más o más efectos de sonido más brillantes para crear una sensación de calidez o felicidad. </li>
|
13 |
-
|
14 |
-
<li>Transiciones: Puede utilizar efectos de sonido para suavizar o resaltar los cambios entre escenas o tomas. Por ejemplo, puede usar silbidos, silbidos o clics para crear transiciones sin fisuras, o bloqueos, explosiones o estallidos para crear transiciones abruptas. </li>
|
15 |
-
</ul>
|
16 |
-
<h2>Cómo instalar efectos de sonido en Final Cut Pro</h2>
|
17 |
-
<h3>Buscar efectos de sonido en línea o grabar su propio</h3>
|
18 |
-
<p>El primer paso para usar efectos de sonido en Final Cut Pro es encontrarlos. Hay muchas fuentes donde puede descargar o comprar efectos de sonido en línea, como sitios web, bibliotecas, mercados o aplicaciones. También puede grabar sus propios efectos de sonido utilizando un micrófono, una grabadora o su teléfono inteligente. También puede usar efectos de sonido de otros medios, como películas, programas de televisión o juegos, siempre que tenga el permiso o la licencia para hacerlo. </p>
|
19 |
-
<h3>Añadir efectos de sonido a la carpeta Final Cut Pro en tu Mac</h3>
|
20 |
-
<p>El siguiente paso es agregar los efectos de sonido a la carpeta Final Cut Pro en tu Mac. Esto les facilitará el acceso y la organización en el software. Para ello, siga estos pasos:</p>
|
21 |
-
<ol>
|
22 |
-
<li>Localice los archivos de efectos de sonido en su computadora o unidad externa. </li>
|
23 |
-
<li>Copie o mueva los archivos de efectos de sonido a la carpeta Final Cut Pro. La ubicación predeterminada es: Macintosh HD > Usuarios > [su nombre de usuario] > Películas > Plantillas de movimiento > Efectos de sonido. También puede crear subcarpetas dentro de la carpeta Efectos de sonido para categorizar sus efectos de sonido por tipo, género o proyecto. </li>
|
24 |
-
<li>Inicie Final Cut Pro y espere a que escanee e indexe los nuevos efectos de sonido. </li>
|
25 |
-
</ol>
|
26 |
-
<h3>Acceda a efectos de sonido desde la barra lateral de Fotos y Audio en Final Cut Pro</h3>
|
27 |
-
<p>El paso final es acceder a los efectos de sonido de la barra lateral Fotos y Audio en Final Cut Pro. Aquí es donde puede navegar, previsualizar e importar efectos de sonido a su proyecto. Para hacer esto, siga estos pasos:</p>
|
28 |
-
<p></p>
|
29 |
-
<ol>
|
30 |
-
|
31 |
-
<li>Seleccione la pestaña Efectos de sonido de la barra lateral. Verá una lista de categorías de efectos de sonido, como Animales, Ambiente, Foley, Música y más. </li>
|
32 |
-
<li>Expande una categoría haciendo clic en la flecha junto a ella. Verás una lista de subcategorías o efectos de sonido individuales dentro de esa categoría. </li>
|
33 |
-
<li>Seleccione un efecto de sonido haciendo clic en él. Verá una vista previa del efecto de sonido en el visor y lo escuchará reproducirse a través de sus altavoces o auriculares. </li>
|
34 |
-
<li>Arrastre y suelte el efecto de sonido a su línea de tiempo o pistas de audio, o haga clic en el botón Importar seleccionado en la parte inferior de la barra lateral. </li>
|
35 |
-
</ol>
|
36 |
-
<h2>Cómo usar efectos de sonido en Final Cut Pro</h2>
|
37 |
-
<h3>Arrastre y suelte efectos de sonido a su línea de tiempo o pistas de audio</h3>
|
38 |
-
<p>Una vez que haya importado efectos de sonido a su proyecto, puede utilizarlos en su línea de tiempo o pistas de audio. Puede arrastrar y soltar efectos de sonido desde la barra lateral Fotos y audio, desde el navegador o desde el buscador. También puede copiar y pegar efectos de sonido de un clip a otro. Para hacer esto, siga estos pasos:</p>
|
39 |
-
<ol>
|
40 |
-
<li>Seleccione un clip de efecto de sonido en su línea de tiempo o pistas de audio. </li>
|
41 |
-
<li>Mueva el cabezal de reproducción a donde desea colocar el efecto de sonido. </li>
|
42 |
-
<li>Arrastre y suelte el clip de efectos de sonido a una nueva posición en su línea de tiempo o pistas de audio. También puede arrastrarlo y soltarlo en otro clip para crear un clip conectado. </li>
|
43 |
-
<li>Ajuste la longitud del clip de efectos de sonido arrastrando sus bordes hacia adentro o hacia afuera. </li>
|
44 |
-
<li>Ajuste la posición del clip de efectos de sonido arrastrándolo hacia la izquierda o hacia la derecha. </li>
|
45 |
-
</ol>
|
46 |
-
<h3>Ajuste la configuración del efecto de sonido usando el inspector de audio</h3>
|
47 |
-
<p>También puede ajustar la configuración de sus clips de efectos de sonido usando el inspector de audio. Aquí es donde puede cambiar el volumen, la panorámica, el fundido, la ecualización y más efectos de sonido. Para ello, siga estos pasos:</p>
|
48 |
-
<ol>
|
49 |
-
<li>Seleccione un clip de efecto de sonido en su línea de tiempo o pistas de audio. </li>
|
50 |
-
|
51 |
-
<li>Utilice los controles deslizantes, botones, casillas de verificación y menús en el inspector de audio para ajustar la configuración de su clip de efectos de sonido. También puede usar fotogramas clave para animar la configuración a lo largo del tiempo. </li>
|
52 |
-
</ol>
|
53 |
-
<h3>Aplicar efectos de audio y filtros para mejorar o modificar los efectos de sonido</h3>
|
54 |
-
<p>También puede aplicar efectos de audio y filtros para mejorar o modificar sus efectos de sonido. Los filtros y efectos de audio son ajustes preestablecidos que pueden cambiar la calidad de sonido, tono o estilo de sus efectos de sonido. Los efectos de audio y los filtros están disponibles en el navegador de efectos de Final Cut Pro. Para hacer esto, siga estos pasos:</p>
|
55 |
-
<ol>
|
56 |
-
<li>Seleccione un clip de efecto de sonido en su línea de tiempo o pistas de audio. </li>
|
57 |
-
<li>Abra el navegador de efectos haciendo clic en el botón Efectos en la esquina superior derecha de la ventana Final Cut Pro, o presionando Comando-5 en su teclado. </li>
|
58 |
-
<li>Seleccione la pestaña Audio del navegador de efectos. Verá una lista de efectos de audio y categorías de filtros, como Distortion, EQ, Reverb y más. </li>
|
59 |
-
<li>Expande una categoría haciendo clic en la flecha junto a ella. Verás una lista de efectos de audio y filtros dentro de esa categoría. </li>
|
60 |
-
<li>Seleccione un efecto de audio o filtro haciendo clic en él. Verá una vista previa del efecto de audio o filtro en el visor y lo escuchará reproducirse a través de sus altavoces o auriculares. </li>
|
61 |
-
<li>Arrastre y suelte el efecto de audio o el filtro a su clip de efectos de sonido en su línea de tiempo o pistas de audio. También puede hacer doble clic en el efecto de audio o filtrar para aplicarlo a su clip de efectos de sonido. </li>
|
62 |
-
<li>Ajuste los parámetros del efecto de audio o filtro usando el inspector de audio o los controles en pantalla en el visor. </li>
|
63 |
-
</ol>
|
64 |
-
<h2>Dónde encontrar efectos de sonido gratis para Final Cut Pro</h2>
|
65 |
-
<h3>Descargar efectos de sonido gratis desde el sitio web de Apple</h3>
|
66 |
-
|
67 |
-
<ol>
|
68 |
-
<li>Ir a <a href=">https://support.apple.com/en-us/HT211878</a>. </li>
|
69 |
-
<li>Desplácese hacia abajo a la sección titulada "Efectos de sonido gratis para Final Cut Pro". </li>
|
70 |
-
<li>Haga clic en el botón Descargar junto a la categoría de efectos de sonido que desee. </li>
|
71 |
-
<li>Guarde el archivo zip en su computadora o unidad externa. </li>
|
72 |
-
<li>Descomprima el archivo y copie o mueva los archivos de efectos de sonido a la carpeta Final Cut Pro en su Mac.</li>
|
73 |
-
</ol>
|
74 |
-
<h3>Descargar efectos de sonido gratis de recursos en línea</h3>
|
75 |
-
<p>Otra forma de encontrar efectos de sonido gratis para Final Cut Pro es descargarlos de recursos en línea. Hay muchos sitios web, bibliotecas, mercados o aplicaciones que ofrecen efectos de sonido gratuitos que puedes usar en tus proyectos, como Freesound, SoundBible, Zapsplat y más. Sin embargo, siempre debe verificar los requisitos de licencia y atribución antes de usar estos efectos de sonido. Para descargar estos efectos de sonido, siga estos pasos:</p>
|
76 |
-
<ol>
|
77 |
-
<li>Ir al sitio web, biblioteca, mercado o aplicación que ofrece efectos de sonido gratis. </li>
|
78 |
-
<li>Navegar o buscar los efectos de sonido que desee. </li>
|
79 |
-
<li>Descargue los archivos de efectos de sonido en su computadora o unidad externa. </li>
|
80 |
-
<li>Copie o mueva los archivos de efectos de sonido a la carpeta Final Cut Pro en su Mac.</li>
|
81 |
-
</ol>
|
82 |
-
<h3>Descargar efectos de sonido gratis de Motion Array</h3>
|
83 |
-
<p>Una tercera forma de encontrar efectos de sonido gratis para Final Cut Pro es descargarlos de Motion Array. Motion Array es una plataforma que ofrece miles de música libre de derechos, efectos de sonido, plantillas de video, material de archivo y más para los creadores de video. Puede acceder a algunos de sus contenidos de forma gratuita al registrarse en una cuenta gratuita. Para descargar estos efectos de sonido, siga estos pasos:</p>
|
84 |
-
<ol>
|
85 |
-
<li>Ir a <a href=">https://motionarray.com/browse/sound-effects/free</a>. </li>
|
86 |
-
<li>Navegar o buscar los efectos de sonido que desee. </li>
|
87 |
-
<li>Haga clic en el botón Descargar junto al efecto de sonido que desee. </li>
|
88 |
-
|
89 |
-
<li>Descomprima el archivo y copie o mueva el archivo de efectos de sonido a la carpeta Final Cut Pro en su Mac.</li>
|
90 |
-
</ol>
|
91 |
-
<h2>Conclusión</h2>
|
92 |
-
<h3>Resumir los puntos principales del artículo</h3>
|
93 |
-
<p>En este artículo, te hemos mostrado cómo descargar y usar efectos de sonido en Final Cut Pro. Hemos explicado cuáles son los efectos de sonido y por qué usarlos en Final Cut Pro, cómo instalar efectos de sonido en Final Cut Pro, cómo usar efectos de sonido en Final Cut Pro y dónde encontrar efectos de sonido gratuitos para Final Cut Pro. Esperamos que este artículo te haya ayudado a mejorar tu producción de video con efectos de sonido en Final Cut Pro.</p>
|
94 |
-
<h3>Proporcionar una llamada a la acción para el lector</h3>
|
95 |
-
<p>Si tiene alguna pregunta o comentario sobre este artículo, no dude en dejarlos a continuación. Nos encantaría saber de usted y sus comentarios. Si te gustó este artículo, por favor compártelo con tus amigos y colegas que podrían estar interesados en aprender a descargar y usar efectos de sonido en Final Cut Pro. Y si quieres saber más sobre la edición de vídeo, echa un vistazo a nuestros otros artículos en nuestro sitio web. ¡Gracias por leer y editar feliz! </p>
|
96 |
-
<h2>Preguntas frecuentes</h2>
|
97 |
-
<h3>¿Cuáles son algunos ejemplos de efectos de sonido? </h3>
|
98 |
-
<p>Algunos ejemplos de efectos de sonido son:</p>
|
99 |
-
<ul>
|
100 |
-
<li>Sonidos de animales, como ladridos, maullidos, rugidos o gorjeos. </li>
|
101 |
-
<li>Sonidos de ambiente, como viento, lluvia, truenos o océano. </li>
|
102 |
-
<li>Sonidos de Foley, como pasos, apertura de puertas o rotura de cristales. </li>
|
103 |
-
<li>Sonidos de dibujos animados, como boing, pop o splat. </li>
|
104 |
-
<li>Sonidos musicales, como piano, guitarra o batería. </li>
|
105 |
-
</ul>
|
106 |
-
<h3>¿Cómo puedo editar efectos de sonido en Final Cut Pro? </h3>
|
107 |
-
<p>Puede editar efectos de sonido en Final Cut Pro utilizando las siguientes herramientas:</p>
|
108 |
-
<ul>
|
109 |
-
<li>El inspector de audio, donde puede ajustar el volumen, panorámica, fundido, ecualización y más de sus efectos de sonido. </li>
|
110 |
-
<li>El navegador de efectos, donde puede aplicar efectos de audio y filtros para mejorar o modificar sus efectos de sonido. </li>
|
111 |
-
|
112 |
-
<li>La herramienta de análisis de audio, donde puede solucionar problemas de audio comunes como ruido, zumbido o distorsión. </li>
|
113 |
-
</ul>
|
114 |
-
<h3>¿Cómo puedo crear mis propios efectos de sonido? </h3>
|
115 |
-
<p>Puedes crear tus propios efectos de sonido usando los siguientes métodos:</p>
|
116 |
-
<ul>
|
117 |
-
<li>Graba tus propios efectos de sonido usando un micrófono, una grabadora o tu smartphone. </li>
|
118 |
-
<li>Mezcla y superposición de efectos de sonido existentes utilizando un software de edición de audio como Audacity o GarageBand.</li>
|
119 |
-
<li>Generar efectos de sonido sintéticos usando un sintetizador o un instrumento de software como Logic Pro o Ableton Live.</li>
|
120 |
-
</ul>
|
121 |
-
<h3>¿Cómo puedo organizar mis efectos de sonido en Final Cut Pro? </h3>
|
122 |
-
<p>Puedes organizar tus efectos de sonido en Final Cut Pro usando las siguientes características:</p>
|
123 |
-
<ul>
|
124 |
-
<li>La carpeta de efectos de sonido en tu Mac, donde puedes crear subcarpetas para categorizar tus efectos de sonido por tipo, género o proyecto. </li>
|
125 |
-
<li>La barra lateral de fotos y audio en Final Cut Pro, donde puede navegar y previsualizar sus efectos de sonido por categoría. </li>
|
126 |
-
<li>La herramienta de palabras clave en Final Cut Pro, donde puede asignar palabras clave a sus efectos de sonido para que sean más fáciles de encontrar y filtrar. </li>
|
127 |
-
<li>La herramienta Favoritos en Final Cut Pro, donde puedes marcar tus efectos de sonido más usados o favoritos como favoritos para acceder a ellos rápidamente. </li>
|
128 |
-
</ul>
|
129 |
-
<h3>¿Cómo puedo exportar mi video con efectos de sonido en Final Cut Pro? </h3>
|
130 |
-
<p>Puede exportar su vídeo con efectos de sonido en Final Cut Pro utilizando los siguientes pasos:</p>
|
131 |
-
<ol>
|
132 |
-
<li>Seleccione el proyecto que contiene sus efectos de vídeo y sonido en el navegador. </li>
|
133 |
-
<li>Haga clic en el botón Compartir en la esquina superior derecha de la ventana Final Cut Pro, o pulse Comando-E en el teclado. </li>
|
134 |
-
<li>Seleccione el formato y el destino al que desea exportar su vídeo. Puede elegir entre opciones como Apple Devices, YouTube, Vimeo, Master File y más. </li>
|
135 |
-
|
136 |
-
<li>Haga clic en el botón Siguiente para proceder al proceso de exportación. Puede supervisar el progreso de la exportación en la ventana Tareas en segundo plano. </li>
|
137 |
-
<li>Una vez que la exportación se ha completado, puede encontrar el archivo de vídeo en la ubicación que especificó. También puede compartirlo en línea o reproducirlo en su dispositivo. </li>
|
138 |
-
</ol></p> 64aa2da5cf<br />
|
139 |
-
<br />
|
140 |
-
<br />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Bidwill/Sanskrit-asr/README.md
DELETED
@@ -1,13 +0,0 @@
|
|
1 |
-
---
|
2 |
-
title: Sanskrit Asr
|
3 |
-
emoji: 📚
|
4 |
-
colorFrom: purple
|
5 |
-
colorTo: purple
|
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/Big-Web/MMSD/env/Lib/site-packages/pip/_vendor/chardet/big5prober.py
DELETED
@@ -1,47 +0,0 @@
|
|
1 |
-
######################## BEGIN LICENSE BLOCK ########################
|
2 |
-
# The Original Code is Mozilla Communicator client code.
|
3 |
-
#
|
4 |
-
# The Initial Developer of the Original Code is
|
5 |
-
# Netscape Communications Corporation.
|
6 |
-
# Portions created by the Initial Developer are Copyright (C) 1998
|
7 |
-
# the Initial Developer. All Rights Reserved.
|
8 |
-
#
|
9 |
-
# Contributor(s):
|
10 |
-
# Mark Pilgrim - port to Python
|
11 |
-
#
|
12 |
-
# This library is free software; you can redistribute it and/or
|
13 |
-
# modify it under the terms of the GNU Lesser General Public
|
14 |
-
# License as published by the Free Software Foundation; either
|
15 |
-
# version 2.1 of the License, or (at your option) any later version.
|
16 |
-
#
|
17 |
-
# This library is distributed in the hope that it will be useful,
|
18 |
-
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
19 |
-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
20 |
-
# Lesser General Public License for more details.
|
21 |
-
#
|
22 |
-
# You should have received a copy of the GNU Lesser General Public
|
23 |
-
# License along with this library; if not, write to the Free Software
|
24 |
-
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
|
25 |
-
# 02110-1301 USA
|
26 |
-
######################### END LICENSE BLOCK #########################
|
27 |
-
|
28 |
-
from .chardistribution import Big5DistributionAnalysis
|
29 |
-
from .codingstatemachine import CodingStateMachine
|
30 |
-
from .mbcharsetprober import MultiByteCharSetProber
|
31 |
-
from .mbcssm import BIG5_SM_MODEL
|
32 |
-
|
33 |
-
|
34 |
-
class Big5Prober(MultiByteCharSetProber):
|
35 |
-
def __init__(self) -> None:
|
36 |
-
super().__init__()
|
37 |
-
self.coding_sm = CodingStateMachine(BIG5_SM_MODEL)
|
38 |
-
self.distribution_analyzer = Big5DistributionAnalysis()
|
39 |
-
self.reset()
|
40 |
-
|
41 |
-
@property
|
42 |
-
def charset_name(self) -> str:
|
43 |
-
return "Big5"
|
44 |
-
|
45 |
-
@property
|
46 |
-
def language(self) -> str:
|
47 |
-
return "Chinese"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Big-Web/MMSD/env/Lib/site-packages/pip/_vendor/chardet/mbcssm.py
DELETED
@@ -1,661 +0,0 @@
|
|
1 |
-
######################## BEGIN LICENSE BLOCK ########################
|
2 |
-
# The Original Code is mozilla.org code.
|
3 |
-
#
|
4 |
-
# The Initial Developer of the Original Code is
|
5 |
-
# Netscape Communications Corporation.
|
6 |
-
# Portions created by the Initial Developer are Copyright (C) 1998
|
7 |
-
# the Initial Developer. All Rights Reserved.
|
8 |
-
#
|
9 |
-
# Contributor(s):
|
10 |
-
# Mark Pilgrim - port to Python
|
11 |
-
#
|
12 |
-
# This library is free software; you can redistribute it and/or
|
13 |
-
# modify it under the terms of the GNU Lesser General Public
|
14 |
-
# License as published by the Free Software Foundation; either
|
15 |
-
# version 2.1 of the License, or (at your option) any later version.
|
16 |
-
#
|
17 |
-
# This library is distributed in the hope that it will be useful,
|
18 |
-
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
19 |
-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
20 |
-
# Lesser General Public License for more details.
|
21 |
-
#
|
22 |
-
# You should have received a copy of the GNU Lesser General Public
|
23 |
-
# License along with this library; if not, write to the Free Software
|
24 |
-
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
|
25 |
-
# 02110-1301 USA
|
26 |
-
######################### END LICENSE BLOCK #########################
|
27 |
-
|
28 |
-
from .codingstatemachinedict import CodingStateMachineDict
|
29 |
-
from .enums import MachineState
|
30 |
-
|
31 |
-
# BIG5
|
32 |
-
|
33 |
-
# fmt: off
|
34 |
-
BIG5_CLS = (
|
35 |
-
1, 1, 1, 1, 1, 1, 1, 1, # 00 - 07 #allow 0x00 as legal value
|
36 |
-
1, 1, 1, 1, 1, 1, 0, 0, # 08 - 0f
|
37 |
-
1, 1, 1, 1, 1, 1, 1, 1, # 10 - 17
|
38 |
-
1, 1, 1, 0, 1, 1, 1, 1, # 18 - 1f
|
39 |
-
1, 1, 1, 1, 1, 1, 1, 1, # 20 - 27
|
40 |
-
1, 1, 1, 1, 1, 1, 1, 1, # 28 - 2f
|
41 |
-
1, 1, 1, 1, 1, 1, 1, 1, # 30 - 37
|
42 |
-
1, 1, 1, 1, 1, 1, 1, 1, # 38 - 3f
|
43 |
-
2, 2, 2, 2, 2, 2, 2, 2, # 40 - 47
|
44 |
-
2, 2, 2, 2, 2, 2, 2, 2, # 48 - 4f
|
45 |
-
2, 2, 2, 2, 2, 2, 2, 2, # 50 - 57
|
46 |
-
2, 2, 2, 2, 2, 2, 2, 2, # 58 - 5f
|
47 |
-
2, 2, 2, 2, 2, 2, 2, 2, # 60 - 67
|
48 |
-
2, 2, 2, 2, 2, 2, 2, 2, # 68 - 6f
|
49 |
-
2, 2, 2, 2, 2, 2, 2, 2, # 70 - 77
|
50 |
-
2, 2, 2, 2, 2, 2, 2, 1, # 78 - 7f
|
51 |
-
4, 4, 4, 4, 4, 4, 4, 4, # 80 - 87
|
52 |
-
4, 4, 4, 4, 4, 4, 4, 4, # 88 - 8f
|
53 |
-
4, 4, 4, 4, 4, 4, 4, 4, # 90 - 97
|
54 |
-
4, 4, 4, 4, 4, 4, 4, 4, # 98 - 9f
|
55 |
-
4, 3, 3, 3, 3, 3, 3, 3, # a0 - a7
|
56 |
-
3, 3, 3, 3, 3, 3, 3, 3, # a8 - af
|
57 |
-
3, 3, 3, 3, 3, 3, 3, 3, # b0 - b7
|
58 |
-
3, 3, 3, 3, 3, 3, 3, 3, # b8 - bf
|
59 |
-
3, 3, 3, 3, 3, 3, 3, 3, # c0 - c7
|
60 |
-
3, 3, 3, 3, 3, 3, 3, 3, # c8 - cf
|
61 |
-
3, 3, 3, 3, 3, 3, 3, 3, # d0 - d7
|
62 |
-
3, 3, 3, 3, 3, 3, 3, 3, # d8 - df
|
63 |
-
3, 3, 3, 3, 3, 3, 3, 3, # e0 - e7
|
64 |
-
3, 3, 3, 3, 3, 3, 3, 3, # e8 - ef
|
65 |
-
3, 3, 3, 3, 3, 3, 3, 3, # f0 - f7
|
66 |
-
3, 3, 3, 3, 3, 3, 3, 0 # f8 - ff
|
67 |
-
)
|
68 |
-
|
69 |
-
BIG5_ST = (
|
70 |
-
MachineState.ERROR,MachineState.START,MachineState.START, 3,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,#00-07
|
71 |
-
MachineState.ERROR,MachineState.ERROR,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ERROR,#08-0f
|
72 |
-
MachineState.ERROR,MachineState.START,MachineState.START,MachineState.START,MachineState.START,MachineState.START,MachineState.START,MachineState.START#10-17
|
73 |
-
)
|
74 |
-
# fmt: on
|
75 |
-
|
76 |
-
BIG5_CHAR_LEN_TABLE = (0, 1, 1, 2, 0)
|
77 |
-
|
78 |
-
BIG5_SM_MODEL: CodingStateMachineDict = {
|
79 |
-
"class_table": BIG5_CLS,
|
80 |
-
"class_factor": 5,
|
81 |
-
"state_table": BIG5_ST,
|
82 |
-
"char_len_table": BIG5_CHAR_LEN_TABLE,
|
83 |
-
"name": "Big5",
|
84 |
-
}
|
85 |
-
|
86 |
-
# CP949
|
87 |
-
# fmt: off
|
88 |
-
CP949_CLS = (
|
89 |
-
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, # 00 - 0f
|
90 |
-
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, # 10 - 1f
|
91 |
-
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, # 20 - 2f
|
92 |
-
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, # 30 - 3f
|
93 |
-
1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, # 40 - 4f
|
94 |
-
4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 1, 1, 1, 1, 1, # 50 - 5f
|
95 |
-
1, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, # 60 - 6f
|
96 |
-
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 1, 1, 1, 1, 1, # 70 - 7f
|
97 |
-
0, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, # 80 - 8f
|
98 |
-
6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, # 90 - 9f
|
99 |
-
6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, # a0 - af
|
100 |
-
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, # b0 - bf
|
101 |
-
7, 7, 7, 7, 7, 7, 9, 2, 2, 3, 2, 2, 2, 2, 2, 2, # c0 - cf
|
102 |
-
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, # d0 - df
|
103 |
-
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, # e0 - ef
|
104 |
-
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, # f0 - ff
|
105 |
-
)
|
106 |
-
|
107 |
-
CP949_ST = (
|
108 |
-
#cls= 0 1 2 3 4 5 6 7 8 9 # previous state =
|
109 |
-
MachineState.ERROR,MachineState.START, 3,MachineState.ERROR,MachineState.START,MachineState.START, 4, 5,MachineState.ERROR, 6, # MachineState.START
|
110 |
-
MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR, # MachineState.ERROR
|
111 |
-
MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME, # MachineState.ITS_ME
|
112 |
-
MachineState.ERROR,MachineState.ERROR,MachineState.START,MachineState.START,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.START,MachineState.START,MachineState.START, # 3
|
113 |
-
MachineState.ERROR,MachineState.ERROR,MachineState.START,MachineState.START,MachineState.START,MachineState.START,MachineState.START,MachineState.START,MachineState.START,MachineState.START, # 4
|
114 |
-
MachineState.ERROR,MachineState.START,MachineState.START,MachineState.START,MachineState.START,MachineState.START,MachineState.START,MachineState.START,MachineState.START,MachineState.START, # 5
|
115 |
-
MachineState.ERROR,MachineState.START,MachineState.START,MachineState.START,MachineState.START,MachineState.ERROR,MachineState.ERROR,MachineState.START,MachineState.START,MachineState.START, # 6
|
116 |
-
)
|
117 |
-
# fmt: on
|
118 |
-
|
119 |
-
CP949_CHAR_LEN_TABLE = (0, 1, 2, 0, 1, 1, 2, 2, 0, 2)
|
120 |
-
|
121 |
-
CP949_SM_MODEL: CodingStateMachineDict = {
|
122 |
-
"class_table": CP949_CLS,
|
123 |
-
"class_factor": 10,
|
124 |
-
"state_table": CP949_ST,
|
125 |
-
"char_len_table": CP949_CHAR_LEN_TABLE,
|
126 |
-
"name": "CP949",
|
127 |
-
}
|
128 |
-
|
129 |
-
# EUC-JP
|
130 |
-
# fmt: off
|
131 |
-
EUCJP_CLS = (
|
132 |
-
4, 4, 4, 4, 4, 4, 4, 4, # 00 - 07
|
133 |
-
4, 4, 4, 4, 4, 4, 5, 5, # 08 - 0f
|
134 |
-
4, 4, 4, 4, 4, 4, 4, 4, # 10 - 17
|
135 |
-
4, 4, 4, 5, 4, 4, 4, 4, # 18 - 1f
|
136 |
-
4, 4, 4, 4, 4, 4, 4, 4, # 20 - 27
|
137 |
-
4, 4, 4, 4, 4, 4, 4, 4, # 28 - 2f
|
138 |
-
4, 4, 4, 4, 4, 4, 4, 4, # 30 - 37
|
139 |
-
4, 4, 4, 4, 4, 4, 4, 4, # 38 - 3f
|
140 |
-
4, 4, 4, 4, 4, 4, 4, 4, # 40 - 47
|
141 |
-
4, 4, 4, 4, 4, 4, 4, 4, # 48 - 4f
|
142 |
-
4, 4, 4, 4, 4, 4, 4, 4, # 50 - 57
|
143 |
-
4, 4, 4, 4, 4, 4, 4, 4, # 58 - 5f
|
144 |
-
4, 4, 4, 4, 4, 4, 4, 4, # 60 - 67
|
145 |
-
4, 4, 4, 4, 4, 4, 4, 4, # 68 - 6f
|
146 |
-
4, 4, 4, 4, 4, 4, 4, 4, # 70 - 77
|
147 |
-
4, 4, 4, 4, 4, 4, 4, 4, # 78 - 7f
|
148 |
-
5, 5, 5, 5, 5, 5, 5, 5, # 80 - 87
|
149 |
-
5, 5, 5, 5, 5, 5, 1, 3, # 88 - 8f
|
150 |
-
5, 5, 5, 5, 5, 5, 5, 5, # 90 - 97
|
151 |
-
5, 5, 5, 5, 5, 5, 5, 5, # 98 - 9f
|
152 |
-
5, 2, 2, 2, 2, 2, 2, 2, # a0 - a7
|
153 |
-
2, 2, 2, 2, 2, 2, 2, 2, # a8 - af
|
154 |
-
2, 2, 2, 2, 2, 2, 2, 2, # b0 - b7
|
155 |
-
2, 2, 2, 2, 2, 2, 2, 2, # b8 - bf
|
156 |
-
2, 2, 2, 2, 2, 2, 2, 2, # c0 - c7
|
157 |
-
2, 2, 2, 2, 2, 2, 2, 2, # c8 - cf
|
158 |
-
2, 2, 2, 2, 2, 2, 2, 2, # d0 - d7
|
159 |
-
2, 2, 2, 2, 2, 2, 2, 2, # d8 - df
|
160 |
-
0, 0, 0, 0, 0, 0, 0, 0, # e0 - e7
|
161 |
-
0, 0, 0, 0, 0, 0, 0, 0, # e8 - ef
|
162 |
-
0, 0, 0, 0, 0, 0, 0, 0, # f0 - f7
|
163 |
-
0, 0, 0, 0, 0, 0, 0, 5 # f8 - ff
|
164 |
-
)
|
165 |
-
|
166 |
-
EUCJP_ST = (
|
167 |
-
3, 4, 3, 5,MachineState.START,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,#00-07
|
168 |
-
MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,#08-0f
|
169 |
-
MachineState.ITS_ME,MachineState.ITS_ME,MachineState.START,MachineState.ERROR,MachineState.START,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,#10-17
|
170 |
-
MachineState.ERROR,MachineState.ERROR,MachineState.START,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR, 3,MachineState.ERROR,#18-1f
|
171 |
-
3,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.START,MachineState.START,MachineState.START,MachineState.START#20-27
|
172 |
-
)
|
173 |
-
# fmt: on
|
174 |
-
|
175 |
-
EUCJP_CHAR_LEN_TABLE = (2, 2, 2, 3, 1, 0)
|
176 |
-
|
177 |
-
EUCJP_SM_MODEL: CodingStateMachineDict = {
|
178 |
-
"class_table": EUCJP_CLS,
|
179 |
-
"class_factor": 6,
|
180 |
-
"state_table": EUCJP_ST,
|
181 |
-
"char_len_table": EUCJP_CHAR_LEN_TABLE,
|
182 |
-
"name": "EUC-JP",
|
183 |
-
}
|
184 |
-
|
185 |
-
# EUC-KR
|
186 |
-
# fmt: off
|
187 |
-
EUCKR_CLS = (
|
188 |
-
1, 1, 1, 1, 1, 1, 1, 1, # 00 - 07
|
189 |
-
1, 1, 1, 1, 1, 1, 0, 0, # 08 - 0f
|
190 |
-
1, 1, 1, 1, 1, 1, 1, 1, # 10 - 17
|
191 |
-
1, 1, 1, 0, 1, 1, 1, 1, # 18 - 1f
|
192 |
-
1, 1, 1, 1, 1, 1, 1, 1, # 20 - 27
|
193 |
-
1, 1, 1, 1, 1, 1, 1, 1, # 28 - 2f
|
194 |
-
1, 1, 1, 1, 1, 1, 1, 1, # 30 - 37
|
195 |
-
1, 1, 1, 1, 1, 1, 1, 1, # 38 - 3f
|
196 |
-
1, 1, 1, 1, 1, 1, 1, 1, # 40 - 47
|
197 |
-
1, 1, 1, 1, 1, 1, 1, 1, # 48 - 4f
|
198 |
-
1, 1, 1, 1, 1, 1, 1, 1, # 50 - 57
|
199 |
-
1, 1, 1, 1, 1, 1, 1, 1, # 58 - 5f
|
200 |
-
1, 1, 1, 1, 1, 1, 1, 1, # 60 - 67
|
201 |
-
1, 1, 1, 1, 1, 1, 1, 1, # 68 - 6f
|
202 |
-
1, 1, 1, 1, 1, 1, 1, 1, # 70 - 77
|
203 |
-
1, 1, 1, 1, 1, 1, 1, 1, # 78 - 7f
|
204 |
-
0, 0, 0, 0, 0, 0, 0, 0, # 80 - 87
|
205 |
-
0, 0, 0, 0, 0, 0, 0, 0, # 88 - 8f
|
206 |
-
0, 0, 0, 0, 0, 0, 0, 0, # 90 - 97
|
207 |
-
0, 0, 0, 0, 0, 0, 0, 0, # 98 - 9f
|
208 |
-
0, 2, 2, 2, 2, 2, 2, 2, # a0 - a7
|
209 |
-
2, 2, 2, 2, 2, 3, 3, 3, # a8 - af
|
210 |
-
2, 2, 2, 2, 2, 2, 2, 2, # b0 - b7
|
211 |
-
2, 2, 2, 2, 2, 2, 2, 2, # b8 - bf
|
212 |
-
2, 2, 2, 2, 2, 2, 2, 2, # c0 - c7
|
213 |
-
2, 3, 2, 2, 2, 2, 2, 2, # c8 - cf
|
214 |
-
2, 2, 2, 2, 2, 2, 2, 2, # d0 - d7
|
215 |
-
2, 2, 2, 2, 2, 2, 2, 2, # d8 - df
|
216 |
-
2, 2, 2, 2, 2, 2, 2, 2, # e0 - e7
|
217 |
-
2, 2, 2, 2, 2, 2, 2, 2, # e8 - ef
|
218 |
-
2, 2, 2, 2, 2, 2, 2, 2, # f0 - f7
|
219 |
-
2, 2, 2, 2, 2, 2, 2, 0 # f8 - ff
|
220 |
-
)
|
221 |
-
|
222 |
-
EUCKR_ST = (
|
223 |
-
MachineState.ERROR,MachineState.START, 3,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,#00-07
|
224 |
-
MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ERROR,MachineState.ERROR,MachineState.START,MachineState.START #08-0f
|
225 |
-
)
|
226 |
-
# fmt: on
|
227 |
-
|
228 |
-
EUCKR_CHAR_LEN_TABLE = (0, 1, 2, 0)
|
229 |
-
|
230 |
-
EUCKR_SM_MODEL: CodingStateMachineDict = {
|
231 |
-
"class_table": EUCKR_CLS,
|
232 |
-
"class_factor": 4,
|
233 |
-
"state_table": EUCKR_ST,
|
234 |
-
"char_len_table": EUCKR_CHAR_LEN_TABLE,
|
235 |
-
"name": "EUC-KR",
|
236 |
-
}
|
237 |
-
|
238 |
-
# JOHAB
|
239 |
-
# fmt: off
|
240 |
-
JOHAB_CLS = (
|
241 |
-
4,4,4,4,4,4,4,4, # 00 - 07
|
242 |
-
4,4,4,4,4,4,0,0, # 08 - 0f
|
243 |
-
4,4,4,4,4,4,4,4, # 10 - 17
|
244 |
-
4,4,4,0,4,4,4,4, # 18 - 1f
|
245 |
-
4,4,4,4,4,4,4,4, # 20 - 27
|
246 |
-
4,4,4,4,4,4,4,4, # 28 - 2f
|
247 |
-
4,3,3,3,3,3,3,3, # 30 - 37
|
248 |
-
3,3,3,3,3,3,3,3, # 38 - 3f
|
249 |
-
3,1,1,1,1,1,1,1, # 40 - 47
|
250 |
-
1,1,1,1,1,1,1,1, # 48 - 4f
|
251 |
-
1,1,1,1,1,1,1,1, # 50 - 57
|
252 |
-
1,1,1,1,1,1,1,1, # 58 - 5f
|
253 |
-
1,1,1,1,1,1,1,1, # 60 - 67
|
254 |
-
1,1,1,1,1,1,1,1, # 68 - 6f
|
255 |
-
1,1,1,1,1,1,1,1, # 70 - 77
|
256 |
-
1,1,1,1,1,1,1,2, # 78 - 7f
|
257 |
-
6,6,6,6,8,8,8,8, # 80 - 87
|
258 |
-
8,8,8,8,8,8,8,8, # 88 - 8f
|
259 |
-
8,7,7,7,7,7,7,7, # 90 - 97
|
260 |
-
7,7,7,7,7,7,7,7, # 98 - 9f
|
261 |
-
7,7,7,7,7,7,7,7, # a0 - a7
|
262 |
-
7,7,7,7,7,7,7,7, # a8 - af
|
263 |
-
7,7,7,7,7,7,7,7, # b0 - b7
|
264 |
-
7,7,7,7,7,7,7,7, # b8 - bf
|
265 |
-
7,7,7,7,7,7,7,7, # c0 - c7
|
266 |
-
7,7,7,7,7,7,7,7, # c8 - cf
|
267 |
-
7,7,7,7,5,5,5,5, # d0 - d7
|
268 |
-
5,9,9,9,9,9,9,5, # d8 - df
|
269 |
-
9,9,9,9,9,9,9,9, # e0 - e7
|
270 |
-
9,9,9,9,9,9,9,9, # e8 - ef
|
271 |
-
9,9,9,9,9,9,9,9, # f0 - f7
|
272 |
-
9,9,5,5,5,5,5,0 # f8 - ff
|
273 |
-
)
|
274 |
-
|
275 |
-
JOHAB_ST = (
|
276 |
-
# cls = 0 1 2 3 4 5 6 7 8 9
|
277 |
-
MachineState.ERROR ,MachineState.START ,MachineState.START ,MachineState.START ,MachineState.START ,MachineState.ERROR ,MachineState.ERROR ,3 ,3 ,4 , # MachineState.START
|
278 |
-
MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME, # MachineState.ITS_ME
|
279 |
-
MachineState.ERROR ,MachineState.ERROR ,MachineState.ERROR ,MachineState.ERROR ,MachineState.ERROR ,MachineState.ERROR ,MachineState.ERROR ,MachineState.ERROR ,MachineState.ERROR ,MachineState.ERROR , # MachineState.ERROR
|
280 |
-
MachineState.ERROR ,MachineState.START ,MachineState.START ,MachineState.ERROR ,MachineState.ERROR ,MachineState.START ,MachineState.START ,MachineState.START ,MachineState.START ,MachineState.START , # 3
|
281 |
-
MachineState.ERROR ,MachineState.START ,MachineState.ERROR ,MachineState.START ,MachineState.ERROR ,MachineState.START ,MachineState.ERROR ,MachineState.START ,MachineState.ERROR ,MachineState.START , # 4
|
282 |
-
)
|
283 |
-
# fmt: on
|
284 |
-
|
285 |
-
JOHAB_CHAR_LEN_TABLE = (0, 1, 1, 1, 1, 0, 0, 2, 2, 2)
|
286 |
-
|
287 |
-
JOHAB_SM_MODEL: CodingStateMachineDict = {
|
288 |
-
"class_table": JOHAB_CLS,
|
289 |
-
"class_factor": 10,
|
290 |
-
"state_table": JOHAB_ST,
|
291 |
-
"char_len_table": JOHAB_CHAR_LEN_TABLE,
|
292 |
-
"name": "Johab",
|
293 |
-
}
|
294 |
-
|
295 |
-
# EUC-TW
|
296 |
-
# fmt: off
|
297 |
-
EUCTW_CLS = (
|
298 |
-
2, 2, 2, 2, 2, 2, 2, 2, # 00 - 07
|
299 |
-
2, 2, 2, 2, 2, 2, 0, 0, # 08 - 0f
|
300 |
-
2, 2, 2, 2, 2, 2, 2, 2, # 10 - 17
|
301 |
-
2, 2, 2, 0, 2, 2, 2, 2, # 18 - 1f
|
302 |
-
2, 2, 2, 2, 2, 2, 2, 2, # 20 - 27
|
303 |
-
2, 2, 2, 2, 2, 2, 2, 2, # 28 - 2f
|
304 |
-
2, 2, 2, 2, 2, 2, 2, 2, # 30 - 37
|
305 |
-
2, 2, 2, 2, 2, 2, 2, 2, # 38 - 3f
|
306 |
-
2, 2, 2, 2, 2, 2, 2, 2, # 40 - 47
|
307 |
-
2, 2, 2, 2, 2, 2, 2, 2, # 48 - 4f
|
308 |
-
2, 2, 2, 2, 2, 2, 2, 2, # 50 - 57
|
309 |
-
2, 2, 2, 2, 2, 2, 2, 2, # 58 - 5f
|
310 |
-
2, 2, 2, 2, 2, 2, 2, 2, # 60 - 67
|
311 |
-
2, 2, 2, 2, 2, 2, 2, 2, # 68 - 6f
|
312 |
-
2, 2, 2, 2, 2, 2, 2, 2, # 70 - 77
|
313 |
-
2, 2, 2, 2, 2, 2, 2, 2, # 78 - 7f
|
314 |
-
0, 0, 0, 0, 0, 0, 0, 0, # 80 - 87
|
315 |
-
0, 0, 0, 0, 0, 0, 6, 0, # 88 - 8f
|
316 |
-
0, 0, 0, 0, 0, 0, 0, 0, # 90 - 97
|
317 |
-
0, 0, 0, 0, 0, 0, 0, 0, # 98 - 9f
|
318 |
-
0, 3, 4, 4, 4, 4, 4, 4, # a0 - a7
|
319 |
-
5, 5, 1, 1, 1, 1, 1, 1, # a8 - af
|
320 |
-
1, 1, 1, 1, 1, 1, 1, 1, # b0 - b7
|
321 |
-
1, 1, 1, 1, 1, 1, 1, 1, # b8 - bf
|
322 |
-
1, 1, 3, 1, 3, 3, 3, 3, # c0 - c7
|
323 |
-
3, 3, 3, 3, 3, 3, 3, 3, # c8 - cf
|
324 |
-
3, 3, 3, 3, 3, 3, 3, 3, # d0 - d7
|
325 |
-
3, 3, 3, 3, 3, 3, 3, 3, # d8 - df
|
326 |
-
3, 3, 3, 3, 3, 3, 3, 3, # e0 - e7
|
327 |
-
3, 3, 3, 3, 3, 3, 3, 3, # e8 - ef
|
328 |
-
3, 3, 3, 3, 3, 3, 3, 3, # f0 - f7
|
329 |
-
3, 3, 3, 3, 3, 3, 3, 0 # f8 - ff
|
330 |
-
)
|
331 |
-
|
332 |
-
EUCTW_ST = (
|
333 |
-
MachineState.ERROR,MachineState.ERROR,MachineState.START, 3, 3, 3, 4,MachineState.ERROR,#00-07
|
334 |
-
MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ITS_ME,MachineState.ITS_ME,#08-0f
|
335 |
-
MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ERROR,MachineState.START,MachineState.ERROR,#10-17
|
336 |
-
MachineState.START,MachineState.START,MachineState.START,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,#18-1f
|
337 |
-
5,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.START,MachineState.ERROR,MachineState.START,MachineState.START,#20-27
|
338 |
-
MachineState.START,MachineState.ERROR,MachineState.START,MachineState.START,MachineState.START,MachineState.START,MachineState.START,MachineState.START #28-2f
|
339 |
-
)
|
340 |
-
# fmt: on
|
341 |
-
|
342 |
-
EUCTW_CHAR_LEN_TABLE = (0, 0, 1, 2, 2, 2, 3)
|
343 |
-
|
344 |
-
EUCTW_SM_MODEL: CodingStateMachineDict = {
|
345 |
-
"class_table": EUCTW_CLS,
|
346 |
-
"class_factor": 7,
|
347 |
-
"state_table": EUCTW_ST,
|
348 |
-
"char_len_table": EUCTW_CHAR_LEN_TABLE,
|
349 |
-
"name": "x-euc-tw",
|
350 |
-
}
|
351 |
-
|
352 |
-
# GB2312
|
353 |
-
# fmt: off
|
354 |
-
GB2312_CLS = (
|
355 |
-
1, 1, 1, 1, 1, 1, 1, 1, # 00 - 07
|
356 |
-
1, 1, 1, 1, 1, 1, 0, 0, # 08 - 0f
|
357 |
-
1, 1, 1, 1, 1, 1, 1, 1, # 10 - 17
|
358 |
-
1, 1, 1, 0, 1, 1, 1, 1, # 18 - 1f
|
359 |
-
1, 1, 1, 1, 1, 1, 1, 1, # 20 - 27
|
360 |
-
1, 1, 1, 1, 1, 1, 1, 1, # 28 - 2f
|
361 |
-
3, 3, 3, 3, 3, 3, 3, 3, # 30 - 37
|
362 |
-
3, 3, 1, 1, 1, 1, 1, 1, # 38 - 3f
|
363 |
-
2, 2, 2, 2, 2, 2, 2, 2, # 40 - 47
|
364 |
-
2, 2, 2, 2, 2, 2, 2, 2, # 48 - 4f
|
365 |
-
2, 2, 2, 2, 2, 2, 2, 2, # 50 - 57
|
366 |
-
2, 2, 2, 2, 2, 2, 2, 2, # 58 - 5f
|
367 |
-
2, 2, 2, 2, 2, 2, 2, 2, # 60 - 67
|
368 |
-
2, 2, 2, 2, 2, 2, 2, 2, # 68 - 6f
|
369 |
-
2, 2, 2, 2, 2, 2, 2, 2, # 70 - 77
|
370 |
-
2, 2, 2, 2, 2, 2, 2, 4, # 78 - 7f
|
371 |
-
5, 6, 6, 6, 6, 6, 6, 6, # 80 - 87
|
372 |
-
6, 6, 6, 6, 6, 6, 6, 6, # 88 - 8f
|
373 |
-
6, 6, 6, 6, 6, 6, 6, 6, # 90 - 97
|
374 |
-
6, 6, 6, 6, 6, 6, 6, 6, # 98 - 9f
|
375 |
-
6, 6, 6, 6, 6, 6, 6, 6, # a0 - a7
|
376 |
-
6, 6, 6, 6, 6, 6, 6, 6, # a8 - af
|
377 |
-
6, 6, 6, 6, 6, 6, 6, 6, # b0 - b7
|
378 |
-
6, 6, 6, 6, 6, 6, 6, 6, # b8 - bf
|
379 |
-
6, 6, 6, 6, 6, 6, 6, 6, # c0 - c7
|
380 |
-
6, 6, 6, 6, 6, 6, 6, 6, # c8 - cf
|
381 |
-
6, 6, 6, 6, 6, 6, 6, 6, # d0 - d7
|
382 |
-
6, 6, 6, 6, 6, 6, 6, 6, # d8 - df
|
383 |
-
6, 6, 6, 6, 6, 6, 6, 6, # e0 - e7
|
384 |
-
6, 6, 6, 6, 6, 6, 6, 6, # e8 - ef
|
385 |
-
6, 6, 6, 6, 6, 6, 6, 6, # f0 - f7
|
386 |
-
6, 6, 6, 6, 6, 6, 6, 0 # f8 - ff
|
387 |
-
)
|
388 |
-
|
389 |
-
GB2312_ST = (
|
390 |
-
MachineState.ERROR,MachineState.START,MachineState.START,MachineState.START,MachineState.START,MachineState.START, 3,MachineState.ERROR,#00-07
|
391 |
-
MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ITS_ME,MachineState.ITS_ME,#08-0f
|
392 |
-
MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ERROR,MachineState.ERROR,MachineState.START,#10-17
|
393 |
-
4,MachineState.ERROR,MachineState.START,MachineState.START,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,#18-1f
|
394 |
-
MachineState.ERROR,MachineState.ERROR, 5,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ITS_ME,MachineState.ERROR,#20-27
|
395 |
-
MachineState.ERROR,MachineState.ERROR,MachineState.START,MachineState.START,MachineState.START,MachineState.START,MachineState.START,MachineState.START #28-2f
|
396 |
-
)
|
397 |
-
# fmt: on
|
398 |
-
|
399 |
-
# To be accurate, the length of class 6 can be either 2 or 4.
|
400 |
-
# But it is not necessary to discriminate between the two since
|
401 |
-
# it is used for frequency analysis only, and we are validating
|
402 |
-
# each code range there as well. So it is safe to set it to be
|
403 |
-
# 2 here.
|
404 |
-
GB2312_CHAR_LEN_TABLE = (0, 1, 1, 1, 1, 1, 2)
|
405 |
-
|
406 |
-
GB2312_SM_MODEL: CodingStateMachineDict = {
|
407 |
-
"class_table": GB2312_CLS,
|
408 |
-
"class_factor": 7,
|
409 |
-
"state_table": GB2312_ST,
|
410 |
-
"char_len_table": GB2312_CHAR_LEN_TABLE,
|
411 |
-
"name": "GB2312",
|
412 |
-
}
|
413 |
-
|
414 |
-
# Shift_JIS
|
415 |
-
# fmt: off
|
416 |
-
SJIS_CLS = (
|
417 |
-
1, 1, 1, 1, 1, 1, 1, 1, # 00 - 07
|
418 |
-
1, 1, 1, 1, 1, 1, 0, 0, # 08 - 0f
|
419 |
-
1, 1, 1, 1, 1, 1, 1, 1, # 10 - 17
|
420 |
-
1, 1, 1, 0, 1, 1, 1, 1, # 18 - 1f
|
421 |
-
1, 1, 1, 1, 1, 1, 1, 1, # 20 - 27
|
422 |
-
1, 1, 1, 1, 1, 1, 1, 1, # 28 - 2f
|
423 |
-
1, 1, 1, 1, 1, 1, 1, 1, # 30 - 37
|
424 |
-
1, 1, 1, 1, 1, 1, 1, 1, # 38 - 3f
|
425 |
-
2, 2, 2, 2, 2, 2, 2, 2, # 40 - 47
|
426 |
-
2, 2, 2, 2, 2, 2, 2, 2, # 48 - 4f
|
427 |
-
2, 2, 2, 2, 2, 2, 2, 2, # 50 - 57
|
428 |
-
2, 2, 2, 2, 2, 2, 2, 2, # 58 - 5f
|
429 |
-
2, 2, 2, 2, 2, 2, 2, 2, # 60 - 67
|
430 |
-
2, 2, 2, 2, 2, 2, 2, 2, # 68 - 6f
|
431 |
-
2, 2, 2, 2, 2, 2, 2, 2, # 70 - 77
|
432 |
-
2, 2, 2, 2, 2, 2, 2, 1, # 78 - 7f
|
433 |
-
3, 3, 3, 3, 3, 2, 2, 3, # 80 - 87
|
434 |
-
3, 3, 3, 3, 3, 3, 3, 3, # 88 - 8f
|
435 |
-
3, 3, 3, 3, 3, 3, 3, 3, # 90 - 97
|
436 |
-
3, 3, 3, 3, 3, 3, 3, 3, # 98 - 9f
|
437 |
-
#0xa0 is illegal in sjis encoding, but some pages does
|
438 |
-
#contain such byte. We need to be more error forgiven.
|
439 |
-
2, 2, 2, 2, 2, 2, 2, 2, # a0 - a7
|
440 |
-
2, 2, 2, 2, 2, 2, 2, 2, # a8 - af
|
441 |
-
2, 2, 2, 2, 2, 2, 2, 2, # b0 - b7
|
442 |
-
2, 2, 2, 2, 2, 2, 2, 2, # b8 - bf
|
443 |
-
2, 2, 2, 2, 2, 2, 2, 2, # c0 - c7
|
444 |
-
2, 2, 2, 2, 2, 2, 2, 2, # c8 - cf
|
445 |
-
2, 2, 2, 2, 2, 2, 2, 2, # d0 - d7
|
446 |
-
2, 2, 2, 2, 2, 2, 2, 2, # d8 - df
|
447 |
-
3, 3, 3, 3, 3, 3, 3, 3, # e0 - e7
|
448 |
-
3, 3, 3, 3, 3, 4, 4, 4, # e8 - ef
|
449 |
-
3, 3, 3, 3, 3, 3, 3, 3, # f0 - f7
|
450 |
-
3, 3, 3, 3, 3, 0, 0, 0, # f8 - ff
|
451 |
-
)
|
452 |
-
|
453 |
-
SJIS_ST = (
|
454 |
-
MachineState.ERROR,MachineState.START,MachineState.START, 3,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,#00-07
|
455 |
-
MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,#08-0f
|
456 |
-
MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ERROR,MachineState.ERROR,MachineState.START,MachineState.START,MachineState.START,MachineState.START #10-17
|
457 |
-
)
|
458 |
-
# fmt: on
|
459 |
-
|
460 |
-
SJIS_CHAR_LEN_TABLE = (0, 1, 1, 2, 0, 0)
|
461 |
-
|
462 |
-
SJIS_SM_MODEL: CodingStateMachineDict = {
|
463 |
-
"class_table": SJIS_CLS,
|
464 |
-
"class_factor": 6,
|
465 |
-
"state_table": SJIS_ST,
|
466 |
-
"char_len_table": SJIS_CHAR_LEN_TABLE,
|
467 |
-
"name": "Shift_JIS",
|
468 |
-
}
|
469 |
-
|
470 |
-
# UCS2-BE
|
471 |
-
# fmt: off
|
472 |
-
UCS2BE_CLS = (
|
473 |
-
0, 0, 0, 0, 0, 0, 0, 0, # 00 - 07
|
474 |
-
0, 0, 1, 0, 0, 2, 0, 0, # 08 - 0f
|
475 |
-
0, 0, 0, 0, 0, 0, 0, 0, # 10 - 17
|
476 |
-
0, 0, 0, 3, 0, 0, 0, 0, # 18 - 1f
|
477 |
-
0, 0, 0, 0, 0, 0, 0, 0, # 20 - 27
|
478 |
-
0, 3, 3, 3, 3, 3, 0, 0, # 28 - 2f
|
479 |
-
0, 0, 0, 0, 0, 0, 0, 0, # 30 - 37
|
480 |
-
0, 0, 0, 0, 0, 0, 0, 0, # 38 - 3f
|
481 |
-
0, 0, 0, 0, 0, 0, 0, 0, # 40 - 47
|
482 |
-
0, 0, 0, 0, 0, 0, 0, 0, # 48 - 4f
|
483 |
-
0, 0, 0, 0, 0, 0, 0, 0, # 50 - 57
|
484 |
-
0, 0, 0, 0, 0, 0, 0, 0, # 58 - 5f
|
485 |
-
0, 0, 0, 0, 0, 0, 0, 0, # 60 - 67
|
486 |
-
0, 0, 0, 0, 0, 0, 0, 0, # 68 - 6f
|
487 |
-
0, 0, 0, 0, 0, 0, 0, 0, # 70 - 77
|
488 |
-
0, 0, 0, 0, 0, 0, 0, 0, # 78 - 7f
|
489 |
-
0, 0, 0, 0, 0, 0, 0, 0, # 80 - 87
|
490 |
-
0, 0, 0, 0, 0, 0, 0, 0, # 88 - 8f
|
491 |
-
0, 0, 0, 0, 0, 0, 0, 0, # 90 - 97
|
492 |
-
0, 0, 0, 0, 0, 0, 0, 0, # 98 - 9f
|
493 |
-
0, 0, 0, 0, 0, 0, 0, 0, # a0 - a7
|
494 |
-
0, 0, 0, 0, 0, 0, 0, 0, # a8 - af
|
495 |
-
0, 0, 0, 0, 0, 0, 0, 0, # b0 - b7
|
496 |
-
0, 0, 0, 0, 0, 0, 0, 0, # b8 - bf
|
497 |
-
0, 0, 0, 0, 0, 0, 0, 0, # c0 - c7
|
498 |
-
0, 0, 0, 0, 0, 0, 0, 0, # c8 - cf
|
499 |
-
0, 0, 0, 0, 0, 0, 0, 0, # d0 - d7
|
500 |
-
0, 0, 0, 0, 0, 0, 0, 0, # d8 - df
|
501 |
-
0, 0, 0, 0, 0, 0, 0, 0, # e0 - e7
|
502 |
-
0, 0, 0, 0, 0, 0, 0, 0, # e8 - ef
|
503 |
-
0, 0, 0, 0, 0, 0, 0, 0, # f0 - f7
|
504 |
-
0, 0, 0, 0, 0, 0, 4, 5 # f8 - ff
|
505 |
-
)
|
506 |
-
|
507 |
-
UCS2BE_ST = (
|
508 |
-
5, 7, 7,MachineState.ERROR, 4, 3,MachineState.ERROR,MachineState.ERROR,#00-07
|
509 |
-
MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,#08-0f
|
510 |
-
MachineState.ITS_ME,MachineState.ITS_ME, 6, 6, 6, 6,MachineState.ERROR,MachineState.ERROR,#10-17
|
511 |
-
6, 6, 6, 6, 6,MachineState.ITS_ME, 6, 6,#18-1f
|
512 |
-
6, 6, 6, 6, 5, 7, 7,MachineState.ERROR,#20-27
|
513 |
-
5, 8, 6, 6,MachineState.ERROR, 6, 6, 6,#28-2f
|
514 |
-
6, 6, 6, 6,MachineState.ERROR,MachineState.ERROR,MachineState.START,MachineState.START #30-37
|
515 |
-
)
|
516 |
-
# fmt: on
|
517 |
-
|
518 |
-
UCS2BE_CHAR_LEN_TABLE = (2, 2, 2, 0, 2, 2)
|
519 |
-
|
520 |
-
UCS2BE_SM_MODEL: CodingStateMachineDict = {
|
521 |
-
"class_table": UCS2BE_CLS,
|
522 |
-
"class_factor": 6,
|
523 |
-
"state_table": UCS2BE_ST,
|
524 |
-
"char_len_table": UCS2BE_CHAR_LEN_TABLE,
|
525 |
-
"name": "UTF-16BE",
|
526 |
-
}
|
527 |
-
|
528 |
-
# UCS2-LE
|
529 |
-
# fmt: off
|
530 |
-
UCS2LE_CLS = (
|
531 |
-
0, 0, 0, 0, 0, 0, 0, 0, # 00 - 07
|
532 |
-
0, 0, 1, 0, 0, 2, 0, 0, # 08 - 0f
|
533 |
-
0, 0, 0, 0, 0, 0, 0, 0, # 10 - 17
|
534 |
-
0, 0, 0, 3, 0, 0, 0, 0, # 18 - 1f
|
535 |
-
0, 0, 0, 0, 0, 0, 0, 0, # 20 - 27
|
536 |
-
0, 3, 3, 3, 3, 3, 0, 0, # 28 - 2f
|
537 |
-
0, 0, 0, 0, 0, 0, 0, 0, # 30 - 37
|
538 |
-
0, 0, 0, 0, 0, 0, 0, 0, # 38 - 3f
|
539 |
-
0, 0, 0, 0, 0, 0, 0, 0, # 40 - 47
|
540 |
-
0, 0, 0, 0, 0, 0, 0, 0, # 48 - 4f
|
541 |
-
0, 0, 0, 0, 0, 0, 0, 0, # 50 - 57
|
542 |
-
0, 0, 0, 0, 0, 0, 0, 0, # 58 - 5f
|
543 |
-
0, 0, 0, 0, 0, 0, 0, 0, # 60 - 67
|
544 |
-
0, 0, 0, 0, 0, 0, 0, 0, # 68 - 6f
|
545 |
-
0, 0, 0, 0, 0, 0, 0, 0, # 70 - 77
|
546 |
-
0, 0, 0, 0, 0, 0, 0, 0, # 78 - 7f
|
547 |
-
0, 0, 0, 0, 0, 0, 0, 0, # 80 - 87
|
548 |
-
0, 0, 0, 0, 0, 0, 0, 0, # 88 - 8f
|
549 |
-
0, 0, 0, 0, 0, 0, 0, 0, # 90 - 97
|
550 |
-
0, 0, 0, 0, 0, 0, 0, 0, # 98 - 9f
|
551 |
-
0, 0, 0, 0, 0, 0, 0, 0, # a0 - a7
|
552 |
-
0, 0, 0, 0, 0, 0, 0, 0, # a8 - af
|
553 |
-
0, 0, 0, 0, 0, 0, 0, 0, # b0 - b7
|
554 |
-
0, 0, 0, 0, 0, 0, 0, 0, # b8 - bf
|
555 |
-
0, 0, 0, 0, 0, 0, 0, 0, # c0 - c7
|
556 |
-
0, 0, 0, 0, 0, 0, 0, 0, # c8 - cf
|
557 |
-
0, 0, 0, 0, 0, 0, 0, 0, # d0 - d7
|
558 |
-
0, 0, 0, 0, 0, 0, 0, 0, # d8 - df
|
559 |
-
0, 0, 0, 0, 0, 0, 0, 0, # e0 - e7
|
560 |
-
0, 0, 0, 0, 0, 0, 0, 0, # e8 - ef
|
561 |
-
0, 0, 0, 0, 0, 0, 0, 0, # f0 - f7
|
562 |
-
0, 0, 0, 0, 0, 0, 4, 5 # f8 - ff
|
563 |
-
)
|
564 |
-
|
565 |
-
UCS2LE_ST = (
|
566 |
-
6, 6, 7, 6, 4, 3,MachineState.ERROR,MachineState.ERROR,#00-07
|
567 |
-
MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,#08-0f
|
568 |
-
MachineState.ITS_ME,MachineState.ITS_ME, 5, 5, 5,MachineState.ERROR,MachineState.ITS_ME,MachineState.ERROR,#10-17
|
569 |
-
5, 5, 5,MachineState.ERROR, 5,MachineState.ERROR, 6, 6,#18-1f
|
570 |
-
7, 6, 8, 8, 5, 5, 5,MachineState.ERROR,#20-27
|
571 |
-
5, 5, 5,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR, 5, 5,#28-2f
|
572 |
-
5, 5, 5,MachineState.ERROR, 5,MachineState.ERROR,MachineState.START,MachineState.START #30-37
|
573 |
-
)
|
574 |
-
# fmt: on
|
575 |
-
|
576 |
-
UCS2LE_CHAR_LEN_TABLE = (2, 2, 2, 2, 2, 2)
|
577 |
-
|
578 |
-
UCS2LE_SM_MODEL: CodingStateMachineDict = {
|
579 |
-
"class_table": UCS2LE_CLS,
|
580 |
-
"class_factor": 6,
|
581 |
-
"state_table": UCS2LE_ST,
|
582 |
-
"char_len_table": UCS2LE_CHAR_LEN_TABLE,
|
583 |
-
"name": "UTF-16LE",
|
584 |
-
}
|
585 |
-
|
586 |
-
# UTF-8
|
587 |
-
# fmt: off
|
588 |
-
UTF8_CLS = (
|
589 |
-
1, 1, 1, 1, 1, 1, 1, 1, # 00 - 07 #allow 0x00 as a legal value
|
590 |
-
1, 1, 1, 1, 1, 1, 0, 0, # 08 - 0f
|
591 |
-
1, 1, 1, 1, 1, 1, 1, 1, # 10 - 17
|
592 |
-
1, 1, 1, 0, 1, 1, 1, 1, # 18 - 1f
|
593 |
-
1, 1, 1, 1, 1, 1, 1, 1, # 20 - 27
|
594 |
-
1, 1, 1, 1, 1, 1, 1, 1, # 28 - 2f
|
595 |
-
1, 1, 1, 1, 1, 1, 1, 1, # 30 - 37
|
596 |
-
1, 1, 1, 1, 1, 1, 1, 1, # 38 - 3f
|
597 |
-
1, 1, 1, 1, 1, 1, 1, 1, # 40 - 47
|
598 |
-
1, 1, 1, 1, 1, 1, 1, 1, # 48 - 4f
|
599 |
-
1, 1, 1, 1, 1, 1, 1, 1, # 50 - 57
|
600 |
-
1, 1, 1, 1, 1, 1, 1, 1, # 58 - 5f
|
601 |
-
1, 1, 1, 1, 1, 1, 1, 1, # 60 - 67
|
602 |
-
1, 1, 1, 1, 1, 1, 1, 1, # 68 - 6f
|
603 |
-
1, 1, 1, 1, 1, 1, 1, 1, # 70 - 77
|
604 |
-
1, 1, 1, 1, 1, 1, 1, 1, # 78 - 7f
|
605 |
-
2, 2, 2, 2, 3, 3, 3, 3, # 80 - 87
|
606 |
-
4, 4, 4, 4, 4, 4, 4, 4, # 88 - 8f
|
607 |
-
4, 4, 4, 4, 4, 4, 4, 4, # 90 - 97
|
608 |
-
4, 4, 4, 4, 4, 4, 4, 4, # 98 - 9f
|
609 |
-
5, 5, 5, 5, 5, 5, 5, 5, # a0 - a7
|
610 |
-
5, 5, 5, 5, 5, 5, 5, 5, # a8 - af
|
611 |
-
5, 5, 5, 5, 5, 5, 5, 5, # b0 - b7
|
612 |
-
5, 5, 5, 5, 5, 5, 5, 5, # b8 - bf
|
613 |
-
0, 0, 6, 6, 6, 6, 6, 6, # c0 - c7
|
614 |
-
6, 6, 6, 6, 6, 6, 6, 6, # c8 - cf
|
615 |
-
6, 6, 6, 6, 6, 6, 6, 6, # d0 - d7
|
616 |
-
6, 6, 6, 6, 6, 6, 6, 6, # d8 - df
|
617 |
-
7, 8, 8, 8, 8, 8, 8, 8, # e0 - e7
|
618 |
-
8, 8, 8, 8, 8, 9, 8, 8, # e8 - ef
|
619 |
-
10, 11, 11, 11, 11, 11, 11, 11, # f0 - f7
|
620 |
-
12, 13, 13, 13, 14, 15, 0, 0 # f8 - ff
|
621 |
-
)
|
622 |
-
|
623 |
-
UTF8_ST = (
|
624 |
-
MachineState.ERROR,MachineState.START,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR, 12, 10,#00-07
|
625 |
-
9, 11, 8, 7, 6, 5, 4, 3,#08-0f
|
626 |
-
MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,#10-17
|
627 |
-
MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,#18-1f
|
628 |
-
MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,#20-27
|
629 |
-
MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,#28-2f
|
630 |
-
MachineState.ERROR,MachineState.ERROR, 5, 5, 5, 5,MachineState.ERROR,MachineState.ERROR,#30-37
|
631 |
-
MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,#38-3f
|
632 |
-
MachineState.ERROR,MachineState.ERROR,MachineState.ERROR, 5, 5, 5,MachineState.ERROR,MachineState.ERROR,#40-47
|
633 |
-
MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,#48-4f
|
634 |
-
MachineState.ERROR,MachineState.ERROR, 7, 7, 7, 7,MachineState.ERROR,MachineState.ERROR,#50-57
|
635 |
-
MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,#58-5f
|
636 |
-
MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR, 7, 7,MachineState.ERROR,MachineState.ERROR,#60-67
|
637 |
-
MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,#68-6f
|
638 |
-
MachineState.ERROR,MachineState.ERROR, 9, 9, 9, 9,MachineState.ERROR,MachineState.ERROR,#70-77
|
639 |
-
MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,#78-7f
|
640 |
-
MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR, 9,MachineState.ERROR,MachineState.ERROR,#80-87
|
641 |
-
MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,#88-8f
|
642 |
-
MachineState.ERROR,MachineState.ERROR, 12, 12, 12, 12,MachineState.ERROR,MachineState.ERROR,#90-97
|
643 |
-
MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,#98-9f
|
644 |
-
MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR, 12,MachineState.ERROR,MachineState.ERROR,#a0-a7
|
645 |
-
MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,#a8-af
|
646 |
-
MachineState.ERROR,MachineState.ERROR, 12, 12, 12,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,#b0-b7
|
647 |
-
MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,#b8-bf
|
648 |
-
MachineState.ERROR,MachineState.ERROR,MachineState.START,MachineState.START,MachineState.START,MachineState.START,MachineState.ERROR,MachineState.ERROR,#c0-c7
|
649 |
-
MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR #c8-cf
|
650 |
-
)
|
651 |
-
# fmt: on
|
652 |
-
|
653 |
-
UTF8_CHAR_LEN_TABLE = (0, 1, 0, 0, 0, 0, 2, 3, 3, 3, 4, 4, 5, 5, 6, 6)
|
654 |
-
|
655 |
-
UTF8_SM_MODEL: CodingStateMachineDict = {
|
656 |
-
"class_table": UTF8_CLS,
|
657 |
-
"class_factor": 16,
|
658 |
-
"state_table": UTF8_ST,
|
659 |
-
"char_len_table": UTF8_CHAR_LEN_TABLE,
|
660 |
-
"name": "UTF-8",
|
661 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Big-Web/MMSD/env/Lib/site-packages/setuptools/config/expand.py
DELETED
@@ -1,462 +0,0 @@
|
|
1 |
-
"""Utility functions to expand configuration directives or special values
|
2 |
-
(such glob patterns).
|
3 |
-
|
4 |
-
We can split the process of interpreting configuration files into 2 steps:
|
5 |
-
|
6 |
-
1. The parsing the file contents from strings to value objects
|
7 |
-
that can be understand by Python (for example a string with a comma
|
8 |
-
separated list of keywords into an actual Python list of strings).
|
9 |
-
|
10 |
-
2. The expansion (or post-processing) of these values according to the
|
11 |
-
semantics ``setuptools`` assign to them (for example a configuration field
|
12 |
-
with the ``file:`` directive should be expanded from a list of file paths to
|
13 |
-
a single string with the contents of those files concatenated)
|
14 |
-
|
15 |
-
This module focus on the second step, and therefore allow sharing the expansion
|
16 |
-
functions among several configuration file formats.
|
17 |
-
|
18 |
-
**PRIVATE MODULE**: API reserved for setuptools internal usage only.
|
19 |
-
"""
|
20 |
-
import ast
|
21 |
-
import importlib
|
22 |
-
import io
|
23 |
-
import os
|
24 |
-
import pathlib
|
25 |
-
import sys
|
26 |
-
import warnings
|
27 |
-
from glob import iglob
|
28 |
-
from configparser import ConfigParser
|
29 |
-
from importlib.machinery import ModuleSpec
|
30 |
-
from itertools import chain
|
31 |
-
from typing import (
|
32 |
-
TYPE_CHECKING,
|
33 |
-
Callable,
|
34 |
-
Dict,
|
35 |
-
Iterable,
|
36 |
-
Iterator,
|
37 |
-
List,
|
38 |
-
Mapping,
|
39 |
-
Optional,
|
40 |
-
Tuple,
|
41 |
-
TypeVar,
|
42 |
-
Union,
|
43 |
-
cast
|
44 |
-
)
|
45 |
-
from pathlib import Path
|
46 |
-
from types import ModuleType
|
47 |
-
|
48 |
-
from distutils.errors import DistutilsOptionError
|
49 |
-
|
50 |
-
from .._path import same_path as _same_path
|
51 |
-
|
52 |
-
if TYPE_CHECKING:
|
53 |
-
from setuptools.dist import Distribution # noqa
|
54 |
-
from setuptools.discovery import ConfigDiscovery # noqa
|
55 |
-
from distutils.dist import DistributionMetadata # noqa
|
56 |
-
|
57 |
-
chain_iter = chain.from_iterable
|
58 |
-
_Path = Union[str, os.PathLike]
|
59 |
-
_K = TypeVar("_K")
|
60 |
-
_V = TypeVar("_V", covariant=True)
|
61 |
-
|
62 |
-
|
63 |
-
class StaticModule:
|
64 |
-
"""Proxy to a module object that avoids executing arbitrary code."""
|
65 |
-
|
66 |
-
def __init__(self, name: str, spec: ModuleSpec):
|
67 |
-
module = ast.parse(pathlib.Path(spec.origin).read_bytes())
|
68 |
-
vars(self).update(locals())
|
69 |
-
del self.self
|
70 |
-
|
71 |
-
def _find_assignments(self) -> Iterator[Tuple[ast.AST, ast.AST]]:
|
72 |
-
for statement in self.module.body:
|
73 |
-
if isinstance(statement, ast.Assign):
|
74 |
-
yield from ((target, statement.value) for target in statement.targets)
|
75 |
-
elif isinstance(statement, ast.AnnAssign) and statement.value:
|
76 |
-
yield (statement.target, statement.value)
|
77 |
-
|
78 |
-
def __getattr__(self, attr):
|
79 |
-
"""Attempt to load an attribute "statically", via :func:`ast.literal_eval`."""
|
80 |
-
try:
|
81 |
-
return next(
|
82 |
-
ast.literal_eval(value)
|
83 |
-
for target, value in self._find_assignments()
|
84 |
-
if isinstance(target, ast.Name) and target.id == attr
|
85 |
-
)
|
86 |
-
except Exception as e:
|
87 |
-
raise AttributeError(f"{self.name} has no attribute {attr}") from e
|
88 |
-
|
89 |
-
|
90 |
-
def glob_relative(
|
91 |
-
patterns: Iterable[str], root_dir: Optional[_Path] = None
|
92 |
-
) -> List[str]:
|
93 |
-
"""Expand the list of glob patterns, but preserving relative paths.
|
94 |
-
|
95 |
-
:param list[str] patterns: List of glob patterns
|
96 |
-
:param str root_dir: Path to which globs should be relative
|
97 |
-
(current directory by default)
|
98 |
-
:rtype: list
|
99 |
-
"""
|
100 |
-
glob_characters = {'*', '?', '[', ']', '{', '}'}
|
101 |
-
expanded_values = []
|
102 |
-
root_dir = root_dir or os.getcwd()
|
103 |
-
for value in patterns:
|
104 |
-
|
105 |
-
# Has globby characters?
|
106 |
-
if any(char in value for char in glob_characters):
|
107 |
-
# then expand the glob pattern while keeping paths *relative*:
|
108 |
-
glob_path = os.path.abspath(os.path.join(root_dir, value))
|
109 |
-
expanded_values.extend(sorted(
|
110 |
-
os.path.relpath(path, root_dir).replace(os.sep, "/")
|
111 |
-
for path in iglob(glob_path, recursive=True)))
|
112 |
-
|
113 |
-
else:
|
114 |
-
# take the value as-is
|
115 |
-
path = os.path.relpath(value, root_dir).replace(os.sep, "/")
|
116 |
-
expanded_values.append(path)
|
117 |
-
|
118 |
-
return expanded_values
|
119 |
-
|
120 |
-
|
121 |
-
def read_files(filepaths: Union[str, bytes, Iterable[_Path]], root_dir=None) -> str:
|
122 |
-
"""Return the content of the files concatenated using ``\n`` as str
|
123 |
-
|
124 |
-
This function is sandboxed and won't reach anything outside ``root_dir``
|
125 |
-
|
126 |
-
(By default ``root_dir`` is the current directory).
|
127 |
-
"""
|
128 |
-
from setuptools.extern.more_itertools import always_iterable
|
129 |
-
|
130 |
-
root_dir = os.path.abspath(root_dir or os.getcwd())
|
131 |
-
_filepaths = (os.path.join(root_dir, path) for path in always_iterable(filepaths))
|
132 |
-
return '\n'.join(
|
133 |
-
_read_file(path)
|
134 |
-
for path in _filter_existing_files(_filepaths)
|
135 |
-
if _assert_local(path, root_dir)
|
136 |
-
)
|
137 |
-
|
138 |
-
|
139 |
-
def _filter_existing_files(filepaths: Iterable[_Path]) -> Iterator[_Path]:
|
140 |
-
for path in filepaths:
|
141 |
-
if os.path.isfile(path):
|
142 |
-
yield path
|
143 |
-
else:
|
144 |
-
warnings.warn(f"File {path!r} cannot be found")
|
145 |
-
|
146 |
-
|
147 |
-
def _read_file(filepath: Union[bytes, _Path]) -> str:
|
148 |
-
with io.open(filepath, encoding='utf-8') as f:
|
149 |
-
return f.read()
|
150 |
-
|
151 |
-
|
152 |
-
def _assert_local(filepath: _Path, root_dir: str):
|
153 |
-
if Path(os.path.abspath(root_dir)) not in Path(os.path.abspath(filepath)).parents:
|
154 |
-
msg = f"Cannot access {filepath!r} (or anything outside {root_dir!r})"
|
155 |
-
raise DistutilsOptionError(msg)
|
156 |
-
|
157 |
-
return True
|
158 |
-
|
159 |
-
|
160 |
-
def read_attr(
|
161 |
-
attr_desc: str,
|
162 |
-
package_dir: Optional[Mapping[str, str]] = None,
|
163 |
-
root_dir: Optional[_Path] = None
|
164 |
-
):
|
165 |
-
"""Reads the value of an attribute from a module.
|
166 |
-
|
167 |
-
This function will try to read the attributed statically first
|
168 |
-
(via :func:`ast.literal_eval`), and only evaluate the module if it fails.
|
169 |
-
|
170 |
-
Examples:
|
171 |
-
read_attr("package.attr")
|
172 |
-
read_attr("package.module.attr")
|
173 |
-
|
174 |
-
:param str attr_desc: Dot-separated string describing how to reach the
|
175 |
-
attribute (see examples above)
|
176 |
-
:param dict[str, str] package_dir: Mapping of package names to their
|
177 |
-
location in disk (represented by paths relative to ``root_dir``).
|
178 |
-
:param str root_dir: Path to directory containing all the packages in
|
179 |
-
``package_dir`` (current directory by default).
|
180 |
-
:rtype: str
|
181 |
-
"""
|
182 |
-
root_dir = root_dir or os.getcwd()
|
183 |
-
attrs_path = attr_desc.strip().split('.')
|
184 |
-
attr_name = attrs_path.pop()
|
185 |
-
module_name = '.'.join(attrs_path)
|
186 |
-
module_name = module_name or '__init__'
|
187 |
-
_parent_path, path, module_name = _find_module(module_name, package_dir, root_dir)
|
188 |
-
spec = _find_spec(module_name, path)
|
189 |
-
|
190 |
-
try:
|
191 |
-
return getattr(StaticModule(module_name, spec), attr_name)
|
192 |
-
except Exception:
|
193 |
-
# fallback to evaluate module
|
194 |
-
module = _load_spec(spec, module_name)
|
195 |
-
return getattr(module, attr_name)
|
196 |
-
|
197 |
-
|
198 |
-
def _find_spec(module_name: str, module_path: Optional[_Path]) -> ModuleSpec:
|
199 |
-
spec = importlib.util.spec_from_file_location(module_name, module_path)
|
200 |
-
spec = spec or importlib.util.find_spec(module_name)
|
201 |
-
|
202 |
-
if spec is None:
|
203 |
-
raise ModuleNotFoundError(module_name)
|
204 |
-
|
205 |
-
return spec
|
206 |
-
|
207 |
-
|
208 |
-
def _load_spec(spec: ModuleSpec, module_name: str) -> ModuleType:
|
209 |
-
name = getattr(spec, "__name__", module_name)
|
210 |
-
if name in sys.modules:
|
211 |
-
return sys.modules[name]
|
212 |
-
module = importlib.util.module_from_spec(spec)
|
213 |
-
sys.modules[name] = module # cache (it also ensures `==` works on loaded items)
|
214 |
-
spec.loader.exec_module(module) # type: ignore
|
215 |
-
return module
|
216 |
-
|
217 |
-
|
218 |
-
def _find_module(
|
219 |
-
module_name: str, package_dir: Optional[Mapping[str, str]], root_dir: _Path
|
220 |
-
) -> Tuple[_Path, Optional[str], str]:
|
221 |
-
"""Given a module (that could normally be imported by ``module_name``
|
222 |
-
after the build is complete), find the path to the parent directory where
|
223 |
-
it is contained and the canonical name that could be used to import it
|
224 |
-
considering the ``package_dir`` in the build configuration and ``root_dir``
|
225 |
-
"""
|
226 |
-
parent_path = root_dir
|
227 |
-
module_parts = module_name.split('.')
|
228 |
-
if package_dir:
|
229 |
-
if module_parts[0] in package_dir:
|
230 |
-
# A custom path was specified for the module we want to import
|
231 |
-
custom_path = package_dir[module_parts[0]]
|
232 |
-
parts = custom_path.rsplit('/', 1)
|
233 |
-
if len(parts) > 1:
|
234 |
-
parent_path = os.path.join(root_dir, parts[0])
|
235 |
-
parent_module = parts[1]
|
236 |
-
else:
|
237 |
-
parent_module = custom_path
|
238 |
-
module_name = ".".join([parent_module, *module_parts[1:]])
|
239 |
-
elif '' in package_dir:
|
240 |
-
# A custom parent directory was specified for all root modules
|
241 |
-
parent_path = os.path.join(root_dir, package_dir[''])
|
242 |
-
|
243 |
-
path_start = os.path.join(parent_path, *module_name.split("."))
|
244 |
-
candidates = chain(
|
245 |
-
(f"{path_start}.py", os.path.join(path_start, "__init__.py")),
|
246 |
-
iglob(f"{path_start}.*")
|
247 |
-
)
|
248 |
-
module_path = next((x for x in candidates if os.path.isfile(x)), None)
|
249 |
-
return parent_path, module_path, module_name
|
250 |
-
|
251 |
-
|
252 |
-
def resolve_class(
|
253 |
-
qualified_class_name: str,
|
254 |
-
package_dir: Optional[Mapping[str, str]] = None,
|
255 |
-
root_dir: Optional[_Path] = None
|
256 |
-
) -> Callable:
|
257 |
-
"""Given a qualified class name, return the associated class object"""
|
258 |
-
root_dir = root_dir or os.getcwd()
|
259 |
-
idx = qualified_class_name.rfind('.')
|
260 |
-
class_name = qualified_class_name[idx + 1 :]
|
261 |
-
pkg_name = qualified_class_name[:idx]
|
262 |
-
|
263 |
-
_parent_path, path, module_name = _find_module(pkg_name, package_dir, root_dir)
|
264 |
-
module = _load_spec(_find_spec(module_name, path), module_name)
|
265 |
-
return getattr(module, class_name)
|
266 |
-
|
267 |
-
|
268 |
-
def cmdclass(
|
269 |
-
values: Dict[str, str],
|
270 |
-
package_dir: Optional[Mapping[str, str]] = None,
|
271 |
-
root_dir: Optional[_Path] = None
|
272 |
-
) -> Dict[str, Callable]:
|
273 |
-
"""Given a dictionary mapping command names to strings for qualified class
|
274 |
-
names, apply :func:`resolve_class` to the dict values.
|
275 |
-
"""
|
276 |
-
return {k: resolve_class(v, package_dir, root_dir) for k, v in values.items()}
|
277 |
-
|
278 |
-
|
279 |
-
def find_packages(
|
280 |
-
*,
|
281 |
-
namespaces=True,
|
282 |
-
fill_package_dir: Optional[Dict[str, str]] = None,
|
283 |
-
root_dir: Optional[_Path] = None,
|
284 |
-
**kwargs
|
285 |
-
) -> List[str]:
|
286 |
-
"""Works similarly to :func:`setuptools.find_packages`, but with all
|
287 |
-
arguments given as keyword arguments. Moreover, ``where`` can be given
|
288 |
-
as a list (the results will be simply concatenated).
|
289 |
-
|
290 |
-
When the additional keyword argument ``namespaces`` is ``True``, it will
|
291 |
-
behave like :func:`setuptools.find_namespace_packages`` (i.e. include
|
292 |
-
implicit namespaces as per :pep:`420`).
|
293 |
-
|
294 |
-
The ``where`` argument will be considered relative to ``root_dir`` (or the current
|
295 |
-
working directory when ``root_dir`` is not given).
|
296 |
-
|
297 |
-
If the ``fill_package_dir`` argument is passed, this function will consider it as a
|
298 |
-
similar data structure to the ``package_dir`` configuration parameter add fill-in
|
299 |
-
any missing package location.
|
300 |
-
|
301 |
-
:rtype: list
|
302 |
-
"""
|
303 |
-
from setuptools.discovery import construct_package_dir
|
304 |
-
from setuptools.extern.more_itertools import unique_everseen, always_iterable
|
305 |
-
|
306 |
-
if namespaces:
|
307 |
-
from setuptools.discovery import PEP420PackageFinder as PackageFinder
|
308 |
-
else:
|
309 |
-
from setuptools.discovery import PackageFinder # type: ignore
|
310 |
-
|
311 |
-
root_dir = root_dir or os.curdir
|
312 |
-
where = kwargs.pop('where', ['.'])
|
313 |
-
packages: List[str] = []
|
314 |
-
fill_package_dir = {} if fill_package_dir is None else fill_package_dir
|
315 |
-
search = list(unique_everseen(always_iterable(where)))
|
316 |
-
|
317 |
-
if len(search) == 1 and all(not _same_path(search[0], x) for x in (".", root_dir)):
|
318 |
-
fill_package_dir.setdefault("", search[0])
|
319 |
-
|
320 |
-
for path in search:
|
321 |
-
package_path = _nest_path(root_dir, path)
|
322 |
-
pkgs = PackageFinder.find(package_path, **kwargs)
|
323 |
-
packages.extend(pkgs)
|
324 |
-
if pkgs and not (
|
325 |
-
fill_package_dir.get("") == path
|
326 |
-
or os.path.samefile(package_path, root_dir)
|
327 |
-
):
|
328 |
-
fill_package_dir.update(construct_package_dir(pkgs, path))
|
329 |
-
|
330 |
-
return packages
|
331 |
-
|
332 |
-
|
333 |
-
def _nest_path(parent: _Path, path: _Path) -> str:
|
334 |
-
path = parent if path in {".", ""} else os.path.join(parent, path)
|
335 |
-
return os.path.normpath(path)
|
336 |
-
|
337 |
-
|
338 |
-
def version(value: Union[Callable, Iterable[Union[str, int]], str]) -> str:
|
339 |
-
"""When getting the version directly from an attribute,
|
340 |
-
it should be normalised to string.
|
341 |
-
"""
|
342 |
-
if callable(value):
|
343 |
-
value = value()
|
344 |
-
|
345 |
-
value = cast(Iterable[Union[str, int]], value)
|
346 |
-
|
347 |
-
if not isinstance(value, str):
|
348 |
-
if hasattr(value, '__iter__'):
|
349 |
-
value = '.'.join(map(str, value))
|
350 |
-
else:
|
351 |
-
value = '%s' % value
|
352 |
-
|
353 |
-
return value
|
354 |
-
|
355 |
-
|
356 |
-
def canonic_package_data(package_data: dict) -> dict:
|
357 |
-
if "*" in package_data:
|
358 |
-
package_data[""] = package_data.pop("*")
|
359 |
-
return package_data
|
360 |
-
|
361 |
-
|
362 |
-
def canonic_data_files(
|
363 |
-
data_files: Union[list, dict], root_dir: Optional[_Path] = None
|
364 |
-
) -> List[Tuple[str, List[str]]]:
|
365 |
-
"""For compatibility with ``setup.py``, ``data_files`` should be a list
|
366 |
-
of pairs instead of a dict.
|
367 |
-
|
368 |
-
This function also expands glob patterns.
|
369 |
-
"""
|
370 |
-
if isinstance(data_files, list):
|
371 |
-
return data_files
|
372 |
-
|
373 |
-
return [
|
374 |
-
(dest, glob_relative(patterns, root_dir))
|
375 |
-
for dest, patterns in data_files.items()
|
376 |
-
]
|
377 |
-
|
378 |
-
|
379 |
-
def entry_points(text: str, text_source="entry-points") -> Dict[str, dict]:
|
380 |
-
"""Given the contents of entry-points file,
|
381 |
-
process it into a 2-level dictionary (``dict[str, dict[str, str]]``).
|
382 |
-
The first level keys are entry-point groups, the second level keys are
|
383 |
-
entry-point names, and the second level values are references to objects
|
384 |
-
(that correspond to the entry-point value).
|
385 |
-
"""
|
386 |
-
parser = ConfigParser(default_section=None, delimiters=("=",)) # type: ignore
|
387 |
-
parser.optionxform = str # case sensitive
|
388 |
-
parser.read_string(text, text_source)
|
389 |
-
groups = {k: dict(v.items()) for k, v in parser.items()}
|
390 |
-
groups.pop(parser.default_section, None)
|
391 |
-
return groups
|
392 |
-
|
393 |
-
|
394 |
-
class EnsurePackagesDiscovered:
|
395 |
-
"""Some expand functions require all the packages to already be discovered before
|
396 |
-
they run, e.g. :func:`read_attr`, :func:`resolve_class`, :func:`cmdclass`.
|
397 |
-
|
398 |
-
Therefore in some cases we will need to run autodiscovery during the evaluation of
|
399 |
-
the configuration. However, it is better to postpone calling package discovery as
|
400 |
-
much as possible, because some parameters can influence it (e.g. ``package_dir``),
|
401 |
-
and those might not have been processed yet.
|
402 |
-
"""
|
403 |
-
|
404 |
-
def __init__(self, distribution: "Distribution"):
|
405 |
-
self._dist = distribution
|
406 |
-
self._called = False
|
407 |
-
|
408 |
-
def __call__(self):
|
409 |
-
"""Trigger the automatic package discovery, if it is still necessary."""
|
410 |
-
if not self._called:
|
411 |
-
self._called = True
|
412 |
-
self._dist.set_defaults(name=False) # Skip name, we can still be parsing
|
413 |
-
|
414 |
-
def __enter__(self):
|
415 |
-
return self
|
416 |
-
|
417 |
-
def __exit__(self, _exc_type, _exc_value, _traceback):
|
418 |
-
if self._called:
|
419 |
-
self._dist.set_defaults.analyse_name() # Now we can set a default name
|
420 |
-
|
421 |
-
def _get_package_dir(self) -> Mapping[str, str]:
|
422 |
-
self()
|
423 |
-
pkg_dir = self._dist.package_dir
|
424 |
-
return {} if pkg_dir is None else pkg_dir
|
425 |
-
|
426 |
-
@property
|
427 |
-
def package_dir(self) -> Mapping[str, str]:
|
428 |
-
"""Proxy to ``package_dir`` that may trigger auto-discovery when used."""
|
429 |
-
return LazyMappingProxy(self._get_package_dir)
|
430 |
-
|
431 |
-
|
432 |
-
class LazyMappingProxy(Mapping[_K, _V]):
|
433 |
-
"""Mapping proxy that delays resolving the target object, until really needed.
|
434 |
-
|
435 |
-
>>> def obtain_mapping():
|
436 |
-
... print("Running expensive function!")
|
437 |
-
... return {"key": "value", "other key": "other value"}
|
438 |
-
>>> mapping = LazyMappingProxy(obtain_mapping)
|
439 |
-
>>> mapping["key"]
|
440 |
-
Running expensive function!
|
441 |
-
'value'
|
442 |
-
>>> mapping["other key"]
|
443 |
-
'other value'
|
444 |
-
"""
|
445 |
-
|
446 |
-
def __init__(self, obtain_mapping_value: Callable[[], Mapping[_K, _V]]):
|
447 |
-
self._obtain = obtain_mapping_value
|
448 |
-
self._value: Optional[Mapping[_K, _V]] = None
|
449 |
-
|
450 |
-
def _target(self) -> Mapping[_K, _V]:
|
451 |
-
if self._value is None:
|
452 |
-
self._value = self._obtain()
|
453 |
-
return self._value
|
454 |
-
|
455 |
-
def __getitem__(self, key: _K) -> _V:
|
456 |
-
return self._target()[key]
|
457 |
-
|
458 |
-
def __len__(self) -> int:
|
459 |
-
return len(self._target())
|
460 |
-
|
461 |
-
def __iter__(self) -> Iterator[_K]:
|
462 |
-
return iter(self._target())
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/BigData-KSU/VQA-in-Medical-Imagery/CLIP/model_moe.py
DELETED
@@ -1,498 +0,0 @@
|
|
1 |
-
from collections import OrderedDict
|
2 |
-
from typing import Tuple, Union
|
3 |
-
|
4 |
-
import torch
|
5 |
-
import torch.nn.functional as F
|
6 |
-
from torch import nn
|
7 |
-
from mixture_of_experts import MoE
|
8 |
-
|
9 |
-
|
10 |
-
class Bottleneck(nn.Module):
|
11 |
-
expansion = 4
|
12 |
-
|
13 |
-
def __init__(self, inplanes, planes, stride=1):
|
14 |
-
super().__init__()
|
15 |
-
|
16 |
-
# all conv layers have stride 1. an avgpool is performed after the second convolution when stride > 1
|
17 |
-
self.conv1 = nn.Conv2d(inplanes, planes, 1, bias=False)
|
18 |
-
self.bn1 = nn.BatchNorm2d(planes)
|
19 |
-
|
20 |
-
self.conv2 = nn.Conv2d(planes, planes, 3, padding=1, bias=False)
|
21 |
-
self.bn2 = nn.BatchNorm2d(planes)
|
22 |
-
|
23 |
-
self.avgpool = nn.AvgPool2d(stride) if stride > 1 else nn.Identity()
|
24 |
-
|
25 |
-
self.conv3 = nn.Conv2d(planes, planes * self.expansion, 1, bias=False)
|
26 |
-
self.bn3 = nn.BatchNorm2d(planes * self.expansion)
|
27 |
-
|
28 |
-
self.relu = nn.ReLU(inplace=True)
|
29 |
-
self.downsample = None
|
30 |
-
self.stride = stride
|
31 |
-
|
32 |
-
if stride > 1 or inplanes != planes * Bottleneck.expansion:
|
33 |
-
# downsampling layer is prepended with an avgpool, and the subsequent convolution has stride 1
|
34 |
-
self.downsample = nn.Sequential(OrderedDict([
|
35 |
-
("-1", nn.AvgPool2d(stride)),
|
36 |
-
("0", nn.Conv2d(inplanes, planes * self.expansion, 1, stride=1, bias=False)),
|
37 |
-
("1", nn.BatchNorm2d(planes * self.expansion))
|
38 |
-
]))
|
39 |
-
|
40 |
-
def forward(self, x: torch.Tensor):
|
41 |
-
identity = x
|
42 |
-
|
43 |
-
out = self.relu(self.bn1(self.conv1(x)))
|
44 |
-
out = self.relu(self.bn2(self.conv2(out)))
|
45 |
-
out = self.avgpool(out)
|
46 |
-
out = self.bn3(self.conv3(out))
|
47 |
-
|
48 |
-
if self.downsample is not None:
|
49 |
-
identity = self.downsample(x)
|
50 |
-
|
51 |
-
out += identity
|
52 |
-
out = self.relu(out)
|
53 |
-
return out
|
54 |
-
|
55 |
-
|
56 |
-
class AttentionPool2d(nn.Module):
|
57 |
-
def __init__(self, spacial_dim: int, embed_dim: int, num_heads: int, output_dim: int = None):
|
58 |
-
super().__init__()
|
59 |
-
self.positional_embedding = nn.Parameter(torch.randn(spacial_dim ** 2 + 1, embed_dim) / embed_dim ** 0.5)
|
60 |
-
self.k_proj = nn.Linear(embed_dim, embed_dim)
|
61 |
-
self.q_proj = nn.Linear(embed_dim, embed_dim)
|
62 |
-
self.v_proj = nn.Linear(embed_dim, embed_dim)
|
63 |
-
self.c_proj = nn.Linear(embed_dim, output_dim or embed_dim)
|
64 |
-
self.num_heads = num_heads
|
65 |
-
|
66 |
-
def forward(self, x):
|
67 |
-
x = x.reshape(x.shape[0], x.shape[1], x.shape[2] * x.shape[3]).permute(2, 0, 1) # NCHW -> (HW)NC
|
68 |
-
x = torch.cat([x.mean(dim=0, keepdim=True), x], dim=0) # (HW+1)NC
|
69 |
-
x = x + self.positional_embedding[:, None, :].to(x.dtype) # (HW+1)NC
|
70 |
-
x, _ = F.multi_head_attention_forward(
|
71 |
-
query=x, key=x, value=x,
|
72 |
-
embed_dim_to_check=x.shape[-1],
|
73 |
-
num_heads=self.num_heads,
|
74 |
-
q_proj_weight=self.q_proj.weight,
|
75 |
-
k_proj_weight=self.k_proj.weight,
|
76 |
-
v_proj_weight=self.v_proj.weight,
|
77 |
-
in_proj_weight=None,
|
78 |
-
in_proj_bias=torch.cat([self.q_proj.bias, self.k_proj.bias, self.v_proj.bias]),
|
79 |
-
bias_k=None,
|
80 |
-
bias_v=None,
|
81 |
-
add_zero_attn=False,
|
82 |
-
dropout_p=0,
|
83 |
-
out_proj_weight=self.c_proj.weight,
|
84 |
-
out_proj_bias=self.c_proj.bias,
|
85 |
-
use_separate_proj_weight=True,
|
86 |
-
training=self.training,
|
87 |
-
need_weights=False
|
88 |
-
)
|
89 |
-
|
90 |
-
return x[0]
|
91 |
-
|
92 |
-
|
93 |
-
class ModifiedResNet(nn.Module):
|
94 |
-
"""
|
95 |
-
A ResNet class that is similar to torchvision's but contains the following changes:
|
96 |
-
- There are now 3 "stem" convolutions as opposed to 1, with an average pool instead of a max pool.
|
97 |
-
- Performs anti-aliasing strided convolutions, where an avgpool is prepended to convolutions with stride > 1
|
98 |
-
- The final pooling layer is a QKV attention instead of an average pool
|
99 |
-
"""
|
100 |
-
|
101 |
-
def __init__(self, layers, output_dim, heads, input_resolution=224, width=64):
|
102 |
-
super().__init__()
|
103 |
-
self.output_dim = output_dim
|
104 |
-
self.input_resolution = input_resolution
|
105 |
-
|
106 |
-
# the 3-layer stem
|
107 |
-
self.conv1 = nn.Conv2d(3, width // 2, kernel_size=3, stride=2, padding=1, bias=False)
|
108 |
-
self.bn1 = nn.BatchNorm2d(width // 2)
|
109 |
-
self.conv2 = nn.Conv2d(width // 2, width // 2, kernel_size=3, padding=1, bias=False)
|
110 |
-
self.bn2 = nn.BatchNorm2d(width // 2)
|
111 |
-
self.conv3 = nn.Conv2d(width // 2, width, kernel_size=3, padding=1, bias=False)
|
112 |
-
self.bn3 = nn.BatchNorm2d(width)
|
113 |
-
self.avgpool = nn.AvgPool2d(2)
|
114 |
-
self.relu = nn.ReLU(inplace=True)
|
115 |
-
|
116 |
-
# residual layers
|
117 |
-
self._inplanes = width # this is a *mutable* variable used during construction
|
118 |
-
self.layer1 = self._make_layer(width, layers[0])
|
119 |
-
self.layer2 = self._make_layer(width * 2, layers[1], stride=2)
|
120 |
-
self.layer3 = self._make_layer(width * 4, layers[2], stride=2)
|
121 |
-
self.layer4 = self._make_layer(width * 8, layers[3], stride=2)
|
122 |
-
|
123 |
-
embed_dim = width * 32 # the ResNet feature dimension
|
124 |
-
self.attnpool = AttentionPool2d(input_resolution // 32, embed_dim, heads, output_dim)
|
125 |
-
|
126 |
-
def _make_layer(self, planes, blocks, stride=1):
|
127 |
-
layers = [Bottleneck(self._inplanes, planes, stride)]
|
128 |
-
|
129 |
-
self._inplanes = planes * Bottleneck.expansion
|
130 |
-
for _ in range(1, blocks):
|
131 |
-
layers.append(Bottleneck(self._inplanes, planes))
|
132 |
-
|
133 |
-
return nn.Sequential(*layers)
|
134 |
-
|
135 |
-
def forward(self, x):
|
136 |
-
def stem(x):
|
137 |
-
for conv, bn in [(self.conv1, self.bn1), (self.conv2, self.bn2), (self.conv3, self.bn3)]:
|
138 |
-
x = self.relu(bn(conv(x)))
|
139 |
-
x = self.avgpool(x)
|
140 |
-
return x
|
141 |
-
|
142 |
-
x = x.type(self.conv1.weight.dtype)
|
143 |
-
x = stem(x)
|
144 |
-
x = self.layer1(x)
|
145 |
-
x = self.layer2(x)
|
146 |
-
x = self.layer3(x)
|
147 |
-
|
148 |
-
|
149 |
-
#x = self.layer4(x)
|
150 |
-
#print(x.shape)
|
151 |
-
#x = self.attnpool(x)
|
152 |
-
|
153 |
-
return x
|
154 |
-
|
155 |
-
|
156 |
-
class LayerNorm(nn.LayerNorm):
|
157 |
-
"""Subclass torch's LayerNorm to handle fp16."""
|
158 |
-
|
159 |
-
def forward(self, x: torch.Tensor):
|
160 |
-
orig_type = x.dtype
|
161 |
-
ret = super().forward(x.type(torch.float32))
|
162 |
-
return ret.type(orig_type)
|
163 |
-
|
164 |
-
|
165 |
-
class QuickGELU(nn.Module):
|
166 |
-
def forward(self, x: torch.Tensor):
|
167 |
-
return x * torch.sigmoid(1.702 * x)
|
168 |
-
|
169 |
-
|
170 |
-
class ResidualAttentionBlock(nn.Module):
|
171 |
-
def __init__(self, d_model: int, n_head: int, attn_mask: torch.Tensor = None):
|
172 |
-
super().__init__()
|
173 |
-
|
174 |
-
self.attn = nn.MultiheadAttention(d_model, n_head)
|
175 |
-
self.ln_1 = LayerNorm(d_model)
|
176 |
-
self.mlp = nn.Sequential(OrderedDict([
|
177 |
-
("c_fc", nn.Linear(d_model, d_model * 4)),
|
178 |
-
("gelu", QuickGELU()),
|
179 |
-
("c_proj", nn.Linear(d_model * 4, d_model))
|
180 |
-
]))
|
181 |
-
self.ln_2 = LayerNorm(d_model)
|
182 |
-
self.attn_mask = attn_mask
|
183 |
-
|
184 |
-
def attention(self, x: torch.Tensor):
|
185 |
-
self.attn_mask = self.attn_mask.to(dtype=x.dtype, device=x.device) if self.attn_mask is not None else None
|
186 |
-
return self.attn(x, x, x, need_weights=True, attn_mask=self.attn_mask)
|
187 |
-
|
188 |
-
def forward(self, x: torch.Tensor):
|
189 |
-
attention_res = self.attention(self.ln_1(x))
|
190 |
-
x, weight = x+attention_res[0], attention_res[1]
|
191 |
-
x = x + self.mlp(self.ln_2(x))
|
192 |
-
return x, weight
|
193 |
-
|
194 |
-
|
195 |
-
class ResidualAttentionBlock_MOE(nn.Module):
|
196 |
-
def __init__(self, d_model: int, n_head: int, attn_mask: torch.Tensor = None):
|
197 |
-
super().__init__()
|
198 |
-
|
199 |
-
self.attn = nn.MultiheadAttention(d_model, n_head)
|
200 |
-
self.ln_1 = LayerNorm(d_model)
|
201 |
-
self.mlp = moe = MoE(
|
202 |
-
dim = 512,
|
203 |
-
num_experts = 16, # increase the experts (# parameters) of your model without increasing computation
|
204 |
-
hidden_dim = 512 * 4, # size of hidden dimension in each expert, defaults to 4 * dimension
|
205 |
-
activation = nn.LeakyReLU, # use your preferred activation, will default to GELU
|
206 |
-
second_policy_train = 'random', # in top_2 gating, policy for whether to use a second-place expert
|
207 |
-
second_policy_eval = 'random', # all (always) | none (never) | threshold (if gate value > the given threshold) | random (if gate value > threshold * random_uniform(0, 1))
|
208 |
-
second_threshold_train = 0.2,
|
209 |
-
second_threshold_eval = 0.2,
|
210 |
-
capacity_factor_train = 1.25, # experts have fixed capacity per batch. we need some extra capacity in case gating is not perfectly balanced.
|
211 |
-
capacity_factor_eval = 2., # capacity_factor_* should be set to a value >=1
|
212 |
-
loss_coef = 1e-2 # multiplier on the auxiliary expert balancing auxiliary loss
|
213 |
-
)
|
214 |
-
|
215 |
-
self.ln_2 = LayerNorm(d_model)
|
216 |
-
self.attn_mask = attn_mask
|
217 |
-
|
218 |
-
def attention(self, x: torch.Tensor):
|
219 |
-
self.attn_mask = self.attn_mask.to(dtype=x.dtype, device=x.device) if self.attn_mask is not None else None
|
220 |
-
return self.attn(x, x, x, need_weights=True, attn_mask=self.attn_mask)
|
221 |
-
|
222 |
-
def forward(self, x: torch.Tensor):
|
223 |
-
attention_res = self.attention(self.ln_1(x))
|
224 |
-
x, weight = x+attention_res[0], attention_res[1]
|
225 |
-
x = x + self.mlp(self.ln_2(x))
|
226 |
-
return x, weight
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
class ResidualAttentionBlock_old(nn.Module):
|
231 |
-
def __init__(self, d_model: int, n_head: int, attn_mask: torch.Tensor = None):
|
232 |
-
super().__init__()
|
233 |
-
|
234 |
-
self.attn = nn.MultiheadAttention(d_model, n_head)
|
235 |
-
self.ln_1 = LayerNorm(d_model)
|
236 |
-
self.mlp = nn.Sequential(OrderedDict([
|
237 |
-
("c_fc", nn.Linear(d_model, d_model * 4)),
|
238 |
-
("gelu", QuickGELU()),
|
239 |
-
("c_proj", nn.Linear(d_model * 4, d_model))
|
240 |
-
]))
|
241 |
-
self.ln_2 = LayerNorm(d_model)
|
242 |
-
self.attn_mask = attn_mask
|
243 |
-
|
244 |
-
def attention(self, x: torch.Tensor):
|
245 |
-
self.attn_mask = self.attn_mask.to(dtype=x.dtype, device=x.device) if self.attn_mask is not None else None
|
246 |
-
return self.attn(x, x, x, need_weights=False, attn_mask=self.attn_mask)[0]
|
247 |
-
|
248 |
-
def forward(self, x: torch.Tensor):
|
249 |
-
x = x + self.attention(self.ln_1(x))
|
250 |
-
x = x + self.mlp(self.ln_2(x))
|
251 |
-
return x
|
252 |
-
|
253 |
-
|
254 |
-
class Transformer(nn.Module):
|
255 |
-
def __init__(self, width: int, layers: int, heads: int, attn_mask: torch.Tensor = None):
|
256 |
-
super().__init__()
|
257 |
-
self.width = width
|
258 |
-
self.layers = layers
|
259 |
-
self.resblocks = nn.Sequential(*[ResidualAttentionBlock(width, heads, attn_mask) for _ in range(layers)])
|
260 |
-
|
261 |
-
def forward(self, x: torch.Tensor):
|
262 |
-
weights = []
|
263 |
-
r=0
|
264 |
-
|
265 |
-
for block in self.resblocks:
|
266 |
-
#if r<=10:
|
267 |
-
# for param in block.parameters():
|
268 |
-
# param.requires_grad = False
|
269 |
-
#if r%2==0:
|
270 |
-
|
271 |
-
x, weight = block(x)
|
272 |
-
weights.append(weight)
|
273 |
-
#print("r=",r)
|
274 |
-
#if r==5:
|
275 |
-
# break
|
276 |
-
#r = r + 1
|
277 |
-
|
278 |
-
return x, weights
|
279 |
-
|
280 |
-
### OLD transformer without attetion
|
281 |
-
class Transformer_Ecnoder_clip(nn.Module):
|
282 |
-
def __init__(self, width: int, layers: int, heads: int, attn_mask: torch.Tensor = None):
|
283 |
-
super().__init__()
|
284 |
-
self.width = width
|
285 |
-
self.layers = layers
|
286 |
-
self.resblocks = nn.Sequential(*[ResidualAttentionBlock(width, heads, attn_mask) for _ in range(layers)])
|
287 |
-
|
288 |
-
def forward(self, x: torch.Tensor):
|
289 |
-
return self.resblocks(x)
|
290 |
-
|
291 |
-
|
292 |
-
class VisualTransformer(nn.Module):
|
293 |
-
def __init__(self, input_resolution: int, patch_size: int, width: int, layers: int, heads: int, output_dim: int):
|
294 |
-
super().__init__()
|
295 |
-
self.input_resolution = input_resolution
|
296 |
-
self.output_dim = output_dim
|
297 |
-
self.conv1 = nn.Conv2d(in_channels=3, out_channels=width, kernel_size=patch_size, stride=patch_size, bias=False)
|
298 |
-
|
299 |
-
scale = width ** -0.5
|
300 |
-
self.class_embedding = nn.Parameter(scale * torch.randn(width))
|
301 |
-
self.positional_embedding = nn.Parameter(scale * torch.randn((input_resolution // patch_size) ** 2 + 1, width))
|
302 |
-
self.ln_pre = LayerNorm(width)
|
303 |
-
|
304 |
-
self.transformer = Transformer(width, layers, heads)
|
305 |
-
|
306 |
-
self.ln_post = LayerNorm(width)
|
307 |
-
self.proj = nn.Parameter(scale * torch.randn(width, 512))
|
308 |
-
|
309 |
-
def forward(self, x: torch.Tensor):
|
310 |
-
x = self.conv1(x) # shape = [*, width, grid, grid]
|
311 |
-
x = x.reshape(x.shape[0], x.shape[1], -1) # shape = [*, width, grid ** 2]
|
312 |
-
x = x.permute(0, 2, 1) # shape = [*, grid ** 2, width]
|
313 |
-
x = torch.cat([self.class_embedding.to(x.dtype) + torch.zeros(x.shape[0], 1, x.shape[-1], dtype=x.dtype, device=x.device), x], dim=1) # shape = [*, grid ** 2 + 1, width]
|
314 |
-
|
315 |
-
|
316 |
-
x = x + self.positional_embedding.to(x.dtype)
|
317 |
-
x = self.ln_pre(x)
|
318 |
-
|
319 |
-
x = x.permute(1, 0, 2) # NLD -> LND
|
320 |
-
x,weight = self.transformer(x)
|
321 |
-
x = x.permute(1, 0, 2) # LND -> NLD
|
322 |
-
#hide_feat=x
|
323 |
-
#x = self.ln_post(x[:, 0, :])
|
324 |
-
#x=self.ln_post(x)
|
325 |
-
if self.proj is not None:
|
326 |
-
hide_feat=self.ln_post(x) @ self.proj
|
327 |
-
x = self.ln_post(x[:, 0, :]) @ self.proj
|
328 |
-
#print(hide_feat.shape)
|
329 |
-
|
330 |
-
return x,weight,hide_feat
|
331 |
-
|
332 |
-
|
333 |
-
class CLIP(nn.Module):
|
334 |
-
def __init__(self,
|
335 |
-
embed_dim: int,
|
336 |
-
# vision
|
337 |
-
image_resolution: int,
|
338 |
-
vision_layers: Union[Tuple[int, int, int, int], int],
|
339 |
-
vision_width: int,
|
340 |
-
vision_patch_size: int,
|
341 |
-
# text
|
342 |
-
context_length: int,
|
343 |
-
vocab_size: int,
|
344 |
-
transformer_width: int,
|
345 |
-
transformer_heads: int,
|
346 |
-
transformer_layers: int
|
347 |
-
):
|
348 |
-
super().__init__()
|
349 |
-
|
350 |
-
self.context_length = context_length
|
351 |
-
|
352 |
-
if isinstance(vision_layers, (tuple, list)):
|
353 |
-
vision_heads = vision_width * 32 // 64
|
354 |
-
self.visual = ModifiedResNet(
|
355 |
-
layers=vision_layers,
|
356 |
-
output_dim=embed_dim,
|
357 |
-
heads=vision_heads,
|
358 |
-
input_resolution=image_resolution,
|
359 |
-
width=vision_width
|
360 |
-
)
|
361 |
-
else:
|
362 |
-
vision_heads = vision_width // 64
|
363 |
-
self.visual = VisualTransformer(
|
364 |
-
input_resolution=image_resolution,
|
365 |
-
patch_size=vision_patch_size,
|
366 |
-
width=vision_width,
|
367 |
-
layers=vision_layers,
|
368 |
-
heads=vision_heads,
|
369 |
-
output_dim=embed_dim
|
370 |
-
)
|
371 |
-
|
372 |
-
self.transformer = Transformer(
|
373 |
-
width=transformer_width,
|
374 |
-
layers=transformer_layers,
|
375 |
-
heads=transformer_heads,
|
376 |
-
attn_mask=self.build_attention_mask()
|
377 |
-
)
|
378 |
-
|
379 |
-
self.vocab_size = vocab_size
|
380 |
-
self.token_embedding = nn.Embedding(vocab_size, transformer_width)
|
381 |
-
self.positional_embedding = nn.Parameter(torch.empty(self.context_length, transformer_width))
|
382 |
-
self.ln_final = LayerNorm(transformer_width)
|
383 |
-
|
384 |
-
self.text_projection = nn.Parameter(torch.empty(transformer_width, embed_dim))
|
385 |
-
self.logit_scale = nn.Parameter(torch.ones([]))
|
386 |
-
|
387 |
-
def build_attention_mask(self):
|
388 |
-
# lazily create causal attention mask, with full attention between the vision tokens
|
389 |
-
# pytorch uses additive attention mask; fill with -inf
|
390 |
-
mask = torch.empty(self.context_length, self.context_length)
|
391 |
-
mask.fill_(float("-inf"))
|
392 |
-
mask.triu_(1) # zero out the lower diagonal
|
393 |
-
return mask
|
394 |
-
|
395 |
-
@property
|
396 |
-
def dtype(self):
|
397 |
-
return self.visual.conv1.weight.dtype
|
398 |
-
|
399 |
-
def encode_image(self, image):
|
400 |
-
return self.visual(image.type(self.dtype))
|
401 |
-
|
402 |
-
def encode_text(self, text):
|
403 |
-
x = self.token_embedding(text).type(self.dtype) # [batch_size, n_ctx, d_model]
|
404 |
-
|
405 |
-
x = x + self.positional_embedding.type(self.dtype)
|
406 |
-
x = x.permute(1, 0, 2) # NLD -> LND
|
407 |
-
x,weight = self.transformer(x)
|
408 |
-
x = x.permute(1, 0, 2) # LND -> NLD
|
409 |
-
x = self.ln_final(x).type(self.dtype)
|
410 |
-
|
411 |
-
# x.shape = [batch_size, n_ctx, transformer.width]
|
412 |
-
# take features from the eot embedding (eot_token is the highest number in each sequence)
|
413 |
-
hide_feat=x
|
414 |
-
x = x[torch.arange(x.shape[0]), text.argmax(dim=-1)] @ self.text_projection
|
415 |
-
|
416 |
-
return x,weight,hide_feat
|
417 |
-
|
418 |
-
def forward(self, image, text):
|
419 |
-
image_features,weight_image,hide_image = self.encode_image(image)
|
420 |
-
text_features,weight_text,hide_text = self.encode_text(text)
|
421 |
-
|
422 |
-
# normalized features
|
423 |
-
image_features = image_features / image_features.norm(dim=-1, keepdim=True)
|
424 |
-
text_features = text_features / text_features.norm(dim=-1, keepdim=True)
|
425 |
-
|
426 |
-
# cosine similarity as logits
|
427 |
-
logit_scale = self.logit_scale.exp()
|
428 |
-
logits_per_iamge = logit_scale * image_features @ text_features.t()
|
429 |
-
logits_per_text = logit_scale * text_features @ image_features.t()
|
430 |
-
|
431 |
-
|
432 |
-
|
433 |
-
|
434 |
-
# shape = [global_batch_size, global_batch_size]
|
435 |
-
#return image_features, text_features logits_per_iamge, logits_per_text,hide_image,hide_text
|
436 |
-
return image_features, text_features,hide_image,hide_text
|
437 |
-
|
438 |
-
def convert_weights(model: nn.Module):
|
439 |
-
"""Convert applicable model parameters to fp16"""
|
440 |
-
|
441 |
-
def _convert_weights_to_fp16(l):
|
442 |
-
if isinstance(l, (nn.Conv1d, nn.Conv2d, nn.Linear)):
|
443 |
-
l.weight.data = l.weight.data.half()
|
444 |
-
if l.bias is not None:
|
445 |
-
l.bias.data = l.bias.data.half()
|
446 |
-
|
447 |
-
if isinstance(l, nn.MultiheadAttention):
|
448 |
-
for attr in [*[f"{s}_proj_weight" for s in ["in", "q", "k", "v"]], "in_proj_bias", "bias_k", "bias_v"]:
|
449 |
-
tensor = getattr(l, attr)
|
450 |
-
if tensor is not None:
|
451 |
-
tensor.data = tensor.data.half()
|
452 |
-
|
453 |
-
for name in ["text_projection", "proj"]:
|
454 |
-
if hasattr(l, name):
|
455 |
-
attr = getattr(l, name)
|
456 |
-
if attr is not None:
|
457 |
-
attr.data = attr.data.half()
|
458 |
-
|
459 |
-
model.apply(_convert_weights_to_fp16)
|
460 |
-
|
461 |
-
|
462 |
-
def build_model(state_dict: dict):
|
463 |
-
vit = "visual.proj" in state_dict
|
464 |
-
|
465 |
-
if vit:
|
466 |
-
vision_width = state_dict["visual.conv1.weight"].shape[0]
|
467 |
-
vision_layers = len([k for k in state_dict.keys() if k.startswith("visual.") and k.endswith(".attn.in_proj_weight")])
|
468 |
-
vision_patch_size = state_dict["visual.conv1.weight"].shape[-1]
|
469 |
-
grid_size = round((state_dict["visual.positional_embedding"].shape[0] - 1) ** 0.5)
|
470 |
-
image_resolution = vision_patch_size * grid_size
|
471 |
-
else:
|
472 |
-
counts: list = [len(set(k.split(".")[2] for k in state_dict if k.startswith(f"visual.layer{b}"))) for b in [1, 2, 3, 4]]
|
473 |
-
vision_layers = tuple(counts)
|
474 |
-
vision_width = state_dict["visual.layer1.0.conv1.weight"].shape[0]
|
475 |
-
output_width = round((state_dict["visual.attnpool.positional_embedding"].shape[0] - 1) ** 0.5)
|
476 |
-
vision_patch_size = None
|
477 |
-
assert output_width ** 2 + 1 == state_dict["visual.attnpool.positional_embedding"].shape[0]
|
478 |
-
image_resolution = output_width * 32
|
479 |
-
|
480 |
-
embed_dim = state_dict["text_projection"].shape[1]
|
481 |
-
context_length = state_dict["positional_embedding"].shape[0]
|
482 |
-
vocab_size = state_dict["token_embedding.weight"].shape[0]
|
483 |
-
transformer_width = state_dict["ln_final.weight"].shape[0]
|
484 |
-
transformer_heads = transformer_width // 64
|
485 |
-
transformer_layers = len(set(k.split(".")[2] for k in state_dict if k.startswith(f"transformer.resblocks")))
|
486 |
-
|
487 |
-
model = CLIP(
|
488 |
-
embed_dim,
|
489 |
-
image_resolution, vision_layers, vision_width, vision_patch_size,
|
490 |
-
context_length, vocab_size, transformer_width, transformer_heads, transformer_layers
|
491 |
-
)
|
492 |
-
|
493 |
-
for key in ["input_resolution", "context_length", "vocab_size"]:
|
494 |
-
del state_dict[key]
|
495 |
-
|
496 |
-
convert_weights(model)
|
497 |
-
model.load_state_dict(state_dict)
|
498 |
-
return model.eval()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/CVPR/Dual-Key_Backdoor_Attacks/datagen/detectron2/docs/tutorials/models.md
DELETED
@@ -1,135 +0,0 @@
|
|
1 |
-
# Use Models
|
2 |
-
|
3 |
-
Models (and their sub-models) in detectron2 are built by
|
4 |
-
functions such as `build_model`, `build_backbone`, `build_roi_heads`:
|
5 |
-
```python
|
6 |
-
from detectron2.modeling import build_model
|
7 |
-
model = build_model(cfg) # returns a torch.nn.Module
|
8 |
-
```
|
9 |
-
|
10 |
-
Note that `build_model` only builds the model structure, and fill it with random parameters.
|
11 |
-
To load an existing checkpoint to the model, use
|
12 |
-
`DetectionCheckpointer(model).load(file_path)`.
|
13 |
-
Detectron2 recognizes models in pytorch's `.pth` format, as well as the `.pkl` files
|
14 |
-
in our model zoo.
|
15 |
-
|
16 |
-
You can use a model by just `outputs = model(inputs)`.
|
17 |
-
Next, we explain the inputs/outputs format used by the builtin models in detectron2.
|
18 |
-
|
19 |
-
[DefaultPredictor](../modules/engine.html#detectron2.engine.defaults.DefaultPredictor)
|
20 |
-
is a wrapper around model that provides the default behavior for regular inference. It includes model loading as
|
21 |
-
well as preprocessing, and operates on single image rather than batches.
|
22 |
-
|
23 |
-
|
24 |
-
### Model Input Format
|
25 |
-
|
26 |
-
All builtin models take a `list[dict]` as the inputs. Each dict
|
27 |
-
corresponds to information about one image.
|
28 |
-
|
29 |
-
The dict may contain the following keys:
|
30 |
-
|
31 |
-
* "image": `Tensor` in (C, H, W) format. The meaning of channels are defined by `cfg.INPUT.FORMAT`.
|
32 |
-
Image normalization, if any, will be performed inside the model.
|
33 |
-
* "instances": an [Instances](../modules/structures.html#detectron2.structures.Instances)
|
34 |
-
object, with the following fields:
|
35 |
-
+ "gt_boxes": a [Boxes](../modules/structures.html#detectron2.structures.Boxes) object storing N boxes, one for each instance.
|
36 |
-
+ "gt_classes": `Tensor` of long type, a vector of N labels, in range [0, num_categories).
|
37 |
-
+ "gt_masks": a [PolygonMasks](../modules/structures.html#detectron2.structures.PolygonMasks)
|
38 |
-
or [BitMasks](../modules/structures.html#detectron2.structures.BitMasks) object storing N masks, one for each instance.
|
39 |
-
+ "gt_keypoints": a [Keypoints](../modules/structures.html#detectron2.structures.Keypoints)
|
40 |
-
object storing N keypoint sets, one for each instance.
|
41 |
-
* "proposals": an [Instances](../modules/structures.html#detectron2.structures.Instances)
|
42 |
-
object used only in Fast R-CNN style models, with the following fields:
|
43 |
-
+ "proposal_boxes": a [Boxes](../modules/structures.html#detectron2.structures.Boxes) object storing P proposal boxes.
|
44 |
-
+ "objectness_logits": `Tensor`, a vector of P scores, one for each proposal.
|
45 |
-
* "height", "width": the **desired** output height and width, which is not necessarily the same
|
46 |
-
as the height or width of the `image` input field.
|
47 |
-
For example, the `image` input field might be a resized image,
|
48 |
-
but you may want the outputs to be in **original** resolution.
|
49 |
-
|
50 |
-
If provided, the model will produce output in this resolution,
|
51 |
-
rather than in the resolution of the `image` as input into the model. This is more efficient and accurate.
|
52 |
-
* "sem_seg": `Tensor[int]` in (H, W) format. The semantic segmentation ground truth.
|
53 |
-
Values represent category labels starting from 0.
|
54 |
-
|
55 |
-
|
56 |
-
#### How it connects to data loader:
|
57 |
-
|
58 |
-
The output of the default [DatasetMapper]( ../modules/data.html#detectron2.data.DatasetMapper) is a dict
|
59 |
-
that follows the above format.
|
60 |
-
After the data loader performs batching, it becomes `list[dict]` which the builtin models support.
|
61 |
-
|
62 |
-
|
63 |
-
### Model Output Format
|
64 |
-
|
65 |
-
When in training mode, the builtin models output a `dict[str->ScalarTensor]` with all the losses.
|
66 |
-
|
67 |
-
When in inference mode, the builtin models output a `list[dict]`, one dict for each image.
|
68 |
-
Based on the tasks the model is doing, each dict may contain the following fields:
|
69 |
-
|
70 |
-
* "instances": [Instances](../modules/structures.html#detectron2.structures.Instances)
|
71 |
-
object with the following fields:
|
72 |
-
* "pred_boxes": [Boxes](../modules/structures.html#detectron2.structures.Boxes) object storing N boxes, one for each detected instance.
|
73 |
-
* "scores": `Tensor`, a vector of N scores.
|
74 |
-
* "pred_classes": `Tensor`, a vector of N labels in range [0, num_categories).
|
75 |
-
+ "pred_masks": a `Tensor` of shape (N, H, W), masks for each detected instance.
|
76 |
-
+ "pred_keypoints": a `Tensor` of shape (N, num_keypoint, 3).
|
77 |
-
Each row in the last dimension is (x, y, score). Scores are larger than 0.
|
78 |
-
* "sem_seg": `Tensor` of (num_categories, H, W), the semantic segmentation prediction.
|
79 |
-
* "proposals": [Instances](../modules/structures.html#detectron2.structures.Instances)
|
80 |
-
object with the following fields:
|
81 |
-
* "proposal_boxes": [Boxes](../modules/structures.html#detectron2.structures.Boxes)
|
82 |
-
object storing N boxes.
|
83 |
-
* "objectness_logits": a torch vector of N scores.
|
84 |
-
* "panoptic_seg": A tuple of `(Tensor, list[dict])`. The tensor has shape (H, W), where each element
|
85 |
-
represent the segment id of the pixel. Each dict describes one segment id and has the following fields:
|
86 |
-
* "id": the segment id
|
87 |
-
* "isthing": whether the segment is a thing or stuff
|
88 |
-
* "category_id": the category id of this segment. It represents the thing
|
89 |
-
class id when `isthing==True`, and the stuff class id otherwise.
|
90 |
-
|
91 |
-
|
92 |
-
### How to use a model in your code:
|
93 |
-
|
94 |
-
Construct your own `list[dict]` as inputs, with the necessary keys. Then call `outputs = model(inputs)`.
|
95 |
-
For example, in order to do inference, provide dicts with "image", and optionally "height" and "width".
|
96 |
-
|
97 |
-
Note that when in training mode, all models are required to be used under an `EventStorage`.
|
98 |
-
The training statistics will be put into the storage:
|
99 |
-
```python
|
100 |
-
from detectron2.utils.events import EventStorage
|
101 |
-
with EventStorage() as storage:
|
102 |
-
losses = model(inputs)
|
103 |
-
```
|
104 |
-
|
105 |
-
Another small thing to remember: detectron2 models do not support `model.to(device)` or `model.cpu()`.
|
106 |
-
The device is defined in `cfg.MODEL.DEVICE` and cannot be changed afterwards.
|
107 |
-
|
108 |
-
|
109 |
-
### Partially execute a model:
|
110 |
-
|
111 |
-
Sometimes you may want to obtain an intermediate tensor inside a model.
|
112 |
-
Since there are typically hundreds of intermediate tensors, there isn't an API that provides you
|
113 |
-
the intermediate result you need.
|
114 |
-
You have the following options:
|
115 |
-
|
116 |
-
1. Write a (sub)model. Following the [tutorial](write-models.html), you can
|
117 |
-
rewrite a model component (e.g. a head of a model), such that it
|
118 |
-
does the same thing as the existing component, but returns the output
|
119 |
-
you need.
|
120 |
-
2. Partially execute a model. You can create the model as usual,
|
121 |
-
but use custom code to execute it instead of its `forward()`. For example,
|
122 |
-
the following code obtains mask features before mask head.
|
123 |
-
|
124 |
-
```python
|
125 |
-
images = ImageList.from_tensors(...) # preprocessed input tensor
|
126 |
-
model = build_model(cfg)
|
127 |
-
features = model.backbone(images.tensor)
|
128 |
-
proposals, _ = model.proposal_generator(images, features)
|
129 |
-
instances = model.roi_heads._forward_box(features, proposals)
|
130 |
-
mask_features = [features[f] for f in model.roi_heads.in_features]
|
131 |
-
mask_features = model.roi_heads.mask_pooler(mask_features, [x.pred_boxes for x in instances])
|
132 |
-
```
|
133 |
-
|
134 |
-
Note that both options require you to read the existing forward code to understand
|
135 |
-
how to write code to obtain the outputs you need.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/CVPR/LIVE/pybind11/tests/test_union.cpp
DELETED
@@ -1,22 +0,0 @@
|
|
1 |
-
/*
|
2 |
-
tests/test_class.cpp -- test py::class_ definitions and basic functionality
|
3 |
-
|
4 |
-
Copyright (c) 2019 Roland Dreier <[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 |
-
|
12 |
-
TEST_SUBMODULE(union_, m) {
|
13 |
-
union TestUnion {
|
14 |
-
int value_int;
|
15 |
-
unsigned value_uint;
|
16 |
-
};
|
17 |
-
|
18 |
-
py::class_<TestUnion>(m, "TestUnion")
|
19 |
-
.def(py::init<>())
|
20 |
-
.def_readonly("as_int", &TestUnion::value_int)
|
21 |
-
.def_readwrite("as_uint", &TestUnion::value_uint);
|
22 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/CVPR/LIVE/pybind11/tools/clang/README.md
DELETED
@@ -1,2 +0,0 @@
|
|
1 |
-
This is simply clang's Python bindings (clang.cindex) ported to Python 3. Please see http://llvm.org/svn/llvm-project/cfe/trunk/bindings/python/ for the original project.
|
2 |
-
|
|
|
|
|
|
spaces/CVPR/LIVE/thrust/thrust/detail/internal_functional.h
DELETED
@@ -1,560 +0,0 @@
|
|
1 |
-
/*
|
2 |
-
* Copyright 2008-2018 NVIDIA Corporation
|
3 |
-
*
|
4 |
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
5 |
-
* you may not use this file except in compliance with the License.
|
6 |
-
* You may obtain a copy of the License at
|
7 |
-
*
|
8 |
-
* http://www.apache.org/licenses/LICENSE-2.0
|
9 |
-
*
|
10 |
-
* Unless required by applicable law or agreed to in writing, software
|
11 |
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
12 |
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13 |
-
* See the License for the specific language governing permissions and
|
14 |
-
* limitations under the License.
|
15 |
-
*/
|
16 |
-
|
17 |
-
|
18 |
-
/*! \file internal_functional.inl
|
19 |
-
* \brief Non-public functionals used to implement algorithm internals.
|
20 |
-
*/
|
21 |
-
|
22 |
-
#pragma once
|
23 |
-
|
24 |
-
#include <thrust/tuple.h>
|
25 |
-
#include <thrust/iterator/iterator_traits.h>
|
26 |
-
#include <thrust/detail/static_assert.h>
|
27 |
-
#include <thrust/detail/type_traits.h>
|
28 |
-
#include <thrust/iterator/detail/tuple_of_iterator_references.h>
|
29 |
-
#include <thrust/detail/raw_reference_cast.h>
|
30 |
-
#include <thrust/detail/memory_wrapper.h> // for ::new
|
31 |
-
|
32 |
-
namespace thrust
|
33 |
-
{
|
34 |
-
namespace detail
|
35 |
-
{
|
36 |
-
|
37 |
-
// unary_negate does not need to know argument_type
|
38 |
-
template<typename Predicate>
|
39 |
-
struct unary_negate
|
40 |
-
{
|
41 |
-
typedef bool result_type;
|
42 |
-
|
43 |
-
Predicate pred;
|
44 |
-
|
45 |
-
__host__ __device__
|
46 |
-
explicit unary_negate(const Predicate& pred) : pred(pred) {}
|
47 |
-
|
48 |
-
template <typename T>
|
49 |
-
__host__ __device__
|
50 |
-
bool operator()(const T& x)
|
51 |
-
{
|
52 |
-
return !bool(pred(x));
|
53 |
-
}
|
54 |
-
};
|
55 |
-
|
56 |
-
// binary_negate does not need to know first_argument_type or second_argument_type
|
57 |
-
template<typename Predicate>
|
58 |
-
struct binary_negate
|
59 |
-
{
|
60 |
-
typedef bool result_type;
|
61 |
-
|
62 |
-
Predicate pred;
|
63 |
-
|
64 |
-
__host__ __device__
|
65 |
-
explicit binary_negate(const Predicate& pred) : pred(pred) {}
|
66 |
-
|
67 |
-
template <typename T1, typename T2>
|
68 |
-
__host__ __device__
|
69 |
-
bool operator()(const T1& x, const T2& y)
|
70 |
-
{
|
71 |
-
return !bool(pred(x,y));
|
72 |
-
}
|
73 |
-
};
|
74 |
-
|
75 |
-
template<typename Predicate>
|
76 |
-
__host__ __device__
|
77 |
-
thrust::detail::unary_negate<Predicate> not1(const Predicate &pred)
|
78 |
-
{
|
79 |
-
return thrust::detail::unary_negate<Predicate>(pred);
|
80 |
-
}
|
81 |
-
|
82 |
-
template<typename Predicate>
|
83 |
-
__host__ __device__
|
84 |
-
thrust::detail::binary_negate<Predicate> not2(const Predicate &pred)
|
85 |
-
{
|
86 |
-
return thrust::detail::binary_negate<Predicate>(pred);
|
87 |
-
}
|
88 |
-
|
89 |
-
|
90 |
-
// convert a predicate to a 0 or 1 integral value
|
91 |
-
template<typename Predicate, typename IntegralType>
|
92 |
-
struct predicate_to_integral
|
93 |
-
{
|
94 |
-
Predicate pred;
|
95 |
-
|
96 |
-
__host__ __device__
|
97 |
-
explicit predicate_to_integral(const Predicate& pred) : pred(pred) {}
|
98 |
-
|
99 |
-
template <typename T>
|
100 |
-
__host__ __device__
|
101 |
-
IntegralType operator()(const T& x)
|
102 |
-
{
|
103 |
-
return pred(x) ? IntegralType(1) : IntegralType(0);
|
104 |
-
}
|
105 |
-
};
|
106 |
-
|
107 |
-
|
108 |
-
// note that detail::equal_to does not force conversion from T2 -> T1 as equal_to does
|
109 |
-
template<typename T1>
|
110 |
-
struct equal_to
|
111 |
-
{
|
112 |
-
typedef bool result_type;
|
113 |
-
|
114 |
-
template <typename T2>
|
115 |
-
__host__ __device__
|
116 |
-
bool operator()(const T1& lhs, const T2& rhs) const
|
117 |
-
{
|
118 |
-
return lhs == rhs;
|
119 |
-
}
|
120 |
-
};
|
121 |
-
|
122 |
-
// note that equal_to_value does not force conversion from T2 -> T1 as equal_to does
|
123 |
-
template<typename T2>
|
124 |
-
struct equal_to_value
|
125 |
-
{
|
126 |
-
T2 rhs;
|
127 |
-
|
128 |
-
__host__ __device__
|
129 |
-
equal_to_value(const T2& rhs) : rhs(rhs) {}
|
130 |
-
|
131 |
-
template <typename T1>
|
132 |
-
__host__ __device__
|
133 |
-
bool operator()(const T1& lhs) const
|
134 |
-
{
|
135 |
-
return lhs == rhs;
|
136 |
-
}
|
137 |
-
};
|
138 |
-
|
139 |
-
template<typename Predicate>
|
140 |
-
struct tuple_binary_predicate
|
141 |
-
{
|
142 |
-
typedef bool result_type;
|
143 |
-
|
144 |
-
__host__ __device__
|
145 |
-
tuple_binary_predicate(const Predicate& p) : pred(p) {}
|
146 |
-
|
147 |
-
template<typename Tuple>
|
148 |
-
__host__ __device__
|
149 |
-
bool operator()(const Tuple& t) const
|
150 |
-
{
|
151 |
-
return pred(thrust::get<0>(t), thrust::get<1>(t));
|
152 |
-
}
|
153 |
-
|
154 |
-
mutable Predicate pred;
|
155 |
-
};
|
156 |
-
|
157 |
-
template<typename Predicate>
|
158 |
-
struct tuple_not_binary_predicate
|
159 |
-
{
|
160 |
-
typedef bool result_type;
|
161 |
-
|
162 |
-
__host__ __device__
|
163 |
-
tuple_not_binary_predicate(const Predicate& p) : pred(p) {}
|
164 |
-
|
165 |
-
template<typename Tuple>
|
166 |
-
__host__ __device__
|
167 |
-
bool operator()(const Tuple& t) const
|
168 |
-
{
|
169 |
-
return !pred(thrust::get<0>(t), thrust::get<1>(t));
|
170 |
-
}
|
171 |
-
|
172 |
-
mutable Predicate pred;
|
173 |
-
};
|
174 |
-
|
175 |
-
template<typename Generator>
|
176 |
-
struct host_generate_functor
|
177 |
-
{
|
178 |
-
typedef void result_type;
|
179 |
-
|
180 |
-
__thrust_exec_check_disable__
|
181 |
-
__host__ __device__
|
182 |
-
host_generate_functor(Generator g)
|
183 |
-
: gen(g) {}
|
184 |
-
|
185 |
-
// operator() does not take an lvalue reference because some iterators
|
186 |
-
// produce temporary proxy references when dereferenced. for example,
|
187 |
-
// consider the temporary tuple of references produced by zip_iterator.
|
188 |
-
// such temporaries cannot bind to an lvalue reference.
|
189 |
-
//
|
190 |
-
// to WAR this, accept a const reference (which is bindable to a temporary),
|
191 |
-
// and const_cast in the implementation.
|
192 |
-
//
|
193 |
-
// XXX change to an rvalue reference upon c++0x (which either a named variable
|
194 |
-
// or temporary can bind to)
|
195 |
-
template<typename T>
|
196 |
-
__host__
|
197 |
-
void operator()(const T &x)
|
198 |
-
{
|
199 |
-
// we have to be naughty and const_cast this to get it to work
|
200 |
-
T &lvalue = const_cast<T&>(x);
|
201 |
-
|
202 |
-
// this assigns correctly whether x is a true reference or proxy
|
203 |
-
lvalue = gen();
|
204 |
-
}
|
205 |
-
|
206 |
-
Generator gen;
|
207 |
-
};
|
208 |
-
|
209 |
-
template<typename Generator>
|
210 |
-
struct device_generate_functor
|
211 |
-
{
|
212 |
-
typedef void result_type;
|
213 |
-
|
214 |
-
__thrust_exec_check_disable__
|
215 |
-
__host__ __device__
|
216 |
-
device_generate_functor(Generator g)
|
217 |
-
: gen(g) {}
|
218 |
-
|
219 |
-
// operator() does not take an lvalue reference because some iterators
|
220 |
-
// produce temporary proxy references when dereferenced. for example,
|
221 |
-
// consider the temporary tuple of references produced by zip_iterator.
|
222 |
-
// such temporaries cannot bind to an lvalue reference.
|
223 |
-
//
|
224 |
-
// to WAR this, accept a const reference (which is bindable to a temporary),
|
225 |
-
// and const_cast in the implementation.
|
226 |
-
//
|
227 |
-
// XXX change to an rvalue reference upon c++0x (which either a named variable
|
228 |
-
// or temporary can bind to)
|
229 |
-
template<typename T>
|
230 |
-
__host__ __device__
|
231 |
-
void operator()(const T &x)
|
232 |
-
{
|
233 |
-
// we have to be naughty and const_cast this to get it to work
|
234 |
-
T &lvalue = const_cast<T&>(x);
|
235 |
-
|
236 |
-
// this assigns correctly whether x is a true reference or proxy
|
237 |
-
lvalue = gen();
|
238 |
-
}
|
239 |
-
|
240 |
-
Generator gen;
|
241 |
-
};
|
242 |
-
|
243 |
-
template<typename System, typename Generator>
|
244 |
-
struct generate_functor
|
245 |
-
: thrust::detail::eval_if<
|
246 |
-
thrust::detail::is_convertible<System, thrust::host_system_tag>::value,
|
247 |
-
thrust::detail::identity_<host_generate_functor<Generator> >,
|
248 |
-
thrust::detail::identity_<device_generate_functor<Generator> >
|
249 |
-
>
|
250 |
-
{};
|
251 |
-
|
252 |
-
|
253 |
-
template<typename ResultType, typename BinaryFunction>
|
254 |
-
struct zipped_binary_op
|
255 |
-
{
|
256 |
-
typedef ResultType result_type;
|
257 |
-
|
258 |
-
__host__ __device__
|
259 |
-
zipped_binary_op(BinaryFunction binary_op)
|
260 |
-
: m_binary_op(binary_op) {}
|
261 |
-
|
262 |
-
template<typename Tuple>
|
263 |
-
__host__ __device__
|
264 |
-
inline result_type operator()(Tuple t)
|
265 |
-
{
|
266 |
-
return m_binary_op(thrust::get<0>(t), thrust::get<1>(t));
|
267 |
-
}
|
268 |
-
|
269 |
-
BinaryFunction m_binary_op;
|
270 |
-
};
|
271 |
-
|
272 |
-
|
273 |
-
template<typename T>
|
274 |
-
struct is_non_const_reference
|
275 |
-
: thrust::detail::and_<
|
276 |
-
thrust::detail::not_<thrust::detail::is_const<T> >,
|
277 |
-
thrust::detail::or_<thrust::detail::is_reference<T>,
|
278 |
-
thrust::detail::is_proxy_reference<T> >
|
279 |
-
>
|
280 |
-
{};
|
281 |
-
|
282 |
-
template<typename T> struct is_tuple_of_iterator_references : thrust::detail::false_type {};
|
283 |
-
|
284 |
-
template<typename T1, typename T2, typename T3,
|
285 |
-
typename T4, typename T5, typename T6,
|
286 |
-
typename T7, typename T8, typename T9,
|
287 |
-
typename T10>
|
288 |
-
struct is_tuple_of_iterator_references<
|
289 |
-
thrust::detail::tuple_of_iterator_references<
|
290 |
-
T1,T2,T3,T4,T5,T6,T7,T8,T9,T10
|
291 |
-
>
|
292 |
-
>
|
293 |
-
: thrust::detail::true_type
|
294 |
-
{};
|
295 |
-
|
296 |
-
// use this enable_if to avoid assigning to temporaries in the transform functors below
|
297 |
-
// XXX revisit this problem with c++11 perfect forwarding
|
298 |
-
template<typename T>
|
299 |
-
struct enable_if_non_const_reference_or_tuple_of_iterator_references
|
300 |
-
: thrust::detail::enable_if<
|
301 |
-
is_non_const_reference<T>::value || is_tuple_of_iterator_references<T>::value
|
302 |
-
>
|
303 |
-
{};
|
304 |
-
|
305 |
-
|
306 |
-
template<typename UnaryFunction>
|
307 |
-
struct unary_transform_functor
|
308 |
-
{
|
309 |
-
typedef void result_type;
|
310 |
-
|
311 |
-
UnaryFunction f;
|
312 |
-
|
313 |
-
__host__ __device__
|
314 |
-
unary_transform_functor(UnaryFunction f)
|
315 |
-
: f(f)
|
316 |
-
{}
|
317 |
-
|
318 |
-
__thrust_exec_check_disable__
|
319 |
-
template<typename Tuple>
|
320 |
-
inline __host__ __device__
|
321 |
-
typename enable_if_non_const_reference_or_tuple_of_iterator_references<
|
322 |
-
typename thrust::tuple_element<1,Tuple>::type
|
323 |
-
>::type
|
324 |
-
operator()(Tuple t)
|
325 |
-
{
|
326 |
-
thrust::get<1>(t) = f(thrust::get<0>(t));
|
327 |
-
}
|
328 |
-
};
|
329 |
-
|
330 |
-
|
331 |
-
template<typename BinaryFunction>
|
332 |
-
struct binary_transform_functor
|
333 |
-
{
|
334 |
-
BinaryFunction f;
|
335 |
-
|
336 |
-
__host__ __device__
|
337 |
-
binary_transform_functor(BinaryFunction f)
|
338 |
-
: f(f)
|
339 |
-
{}
|
340 |
-
|
341 |
-
__thrust_exec_check_disable__
|
342 |
-
template<typename Tuple>
|
343 |
-
inline __host__ __device__
|
344 |
-
typename enable_if_non_const_reference_or_tuple_of_iterator_references<
|
345 |
-
typename thrust::tuple_element<2,Tuple>::type
|
346 |
-
>::type
|
347 |
-
operator()(Tuple t)
|
348 |
-
{
|
349 |
-
thrust::get<2>(t) = f(thrust::get<0>(t), thrust::get<1>(t));
|
350 |
-
}
|
351 |
-
};
|
352 |
-
|
353 |
-
|
354 |
-
template<typename UnaryFunction, typename Predicate>
|
355 |
-
struct unary_transform_if_functor
|
356 |
-
{
|
357 |
-
UnaryFunction unary_op;
|
358 |
-
Predicate pred;
|
359 |
-
|
360 |
-
__host__ __device__
|
361 |
-
unary_transform_if_functor(UnaryFunction unary_op, Predicate pred)
|
362 |
-
: unary_op(unary_op), pred(pred)
|
363 |
-
{}
|
364 |
-
|
365 |
-
__thrust_exec_check_disable__
|
366 |
-
template<typename Tuple>
|
367 |
-
inline __host__ __device__
|
368 |
-
typename enable_if_non_const_reference_or_tuple_of_iterator_references<
|
369 |
-
typename thrust::tuple_element<1,Tuple>::type
|
370 |
-
>::type
|
371 |
-
operator()(Tuple t)
|
372 |
-
{
|
373 |
-
if(pred(thrust::get<0>(t)))
|
374 |
-
{
|
375 |
-
thrust::get<1>(t) = unary_op(thrust::get<0>(t));
|
376 |
-
}
|
377 |
-
}
|
378 |
-
}; // end unary_transform_if_functor
|
379 |
-
|
380 |
-
|
381 |
-
template<typename UnaryFunction, typename Predicate>
|
382 |
-
struct unary_transform_if_with_stencil_functor
|
383 |
-
{
|
384 |
-
UnaryFunction unary_op;
|
385 |
-
Predicate pred;
|
386 |
-
|
387 |
-
__host__ __device__
|
388 |
-
unary_transform_if_with_stencil_functor(UnaryFunction unary_op, Predicate pred)
|
389 |
-
: unary_op(unary_op), pred(pred)
|
390 |
-
{}
|
391 |
-
|
392 |
-
__thrust_exec_check_disable__
|
393 |
-
template<typename Tuple>
|
394 |
-
inline __host__ __device__
|
395 |
-
typename enable_if_non_const_reference_or_tuple_of_iterator_references<
|
396 |
-
typename thrust::tuple_element<2,Tuple>::type
|
397 |
-
>::type
|
398 |
-
operator()(Tuple t)
|
399 |
-
{
|
400 |
-
if(pred(thrust::get<1>(t)))
|
401 |
-
thrust::get<2>(t) = unary_op(thrust::get<0>(t));
|
402 |
-
}
|
403 |
-
}; // end unary_transform_if_with_stencil_functor
|
404 |
-
|
405 |
-
|
406 |
-
template<typename BinaryFunction, typename Predicate>
|
407 |
-
struct binary_transform_if_functor
|
408 |
-
{
|
409 |
-
BinaryFunction binary_op;
|
410 |
-
Predicate pred;
|
411 |
-
|
412 |
-
__host__ __device__
|
413 |
-
binary_transform_if_functor(BinaryFunction binary_op, Predicate pred)
|
414 |
-
: binary_op(binary_op), pred(pred) {}
|
415 |
-
|
416 |
-
__thrust_exec_check_disable__
|
417 |
-
template<typename Tuple>
|
418 |
-
inline __host__ __device__
|
419 |
-
typename enable_if_non_const_reference_or_tuple_of_iterator_references<
|
420 |
-
typename thrust::tuple_element<3,Tuple>::type
|
421 |
-
>::type
|
422 |
-
operator()(Tuple t)
|
423 |
-
{
|
424 |
-
if(pred(thrust::get<2>(t)))
|
425 |
-
thrust::get<3>(t) = binary_op(thrust::get<0>(t), thrust::get<1>(t));
|
426 |
-
}
|
427 |
-
}; // end binary_transform_if_functor
|
428 |
-
|
429 |
-
|
430 |
-
template<typename T>
|
431 |
-
struct host_destroy_functor
|
432 |
-
{
|
433 |
-
__host__
|
434 |
-
void operator()(T &x) const
|
435 |
-
{
|
436 |
-
x.~T();
|
437 |
-
} // end operator()()
|
438 |
-
}; // end host_destroy_functor
|
439 |
-
|
440 |
-
|
441 |
-
template<typename T>
|
442 |
-
struct device_destroy_functor
|
443 |
-
{
|
444 |
-
// add __host__ to allow the omp backend to compile with nvcc
|
445 |
-
__host__ __device__
|
446 |
-
void operator()(T &x) const
|
447 |
-
{
|
448 |
-
x.~T();
|
449 |
-
} // end operator()()
|
450 |
-
}; // end device_destroy_functor
|
451 |
-
|
452 |
-
|
453 |
-
template<typename System, typename T>
|
454 |
-
struct destroy_functor
|
455 |
-
: thrust::detail::eval_if<
|
456 |
-
thrust::detail::is_convertible<System, thrust::host_system_tag>::value,
|
457 |
-
thrust::detail::identity_<host_destroy_functor<T> >,
|
458 |
-
thrust::detail::identity_<device_destroy_functor<T> >
|
459 |
-
>
|
460 |
-
{};
|
461 |
-
|
462 |
-
|
463 |
-
template <typename T>
|
464 |
-
struct fill_functor
|
465 |
-
{
|
466 |
-
T exemplar;
|
467 |
-
|
468 |
-
__thrust_exec_check_disable__
|
469 |
-
__host__ __device__
|
470 |
-
fill_functor(const T& _exemplar)
|
471 |
-
: exemplar(_exemplar) {}
|
472 |
-
|
473 |
-
__thrust_exec_check_disable__
|
474 |
-
__host__ __device__
|
475 |
-
fill_functor(const fill_functor & other)
|
476 |
-
:exemplar(other.exemplar){}
|
477 |
-
|
478 |
-
__thrust_exec_check_disable__
|
479 |
-
__host__ __device__
|
480 |
-
~fill_functor() {}
|
481 |
-
|
482 |
-
__thrust_exec_check_disable__
|
483 |
-
__host__ __device__
|
484 |
-
T operator()(void) const
|
485 |
-
{
|
486 |
-
return exemplar;
|
487 |
-
}
|
488 |
-
};
|
489 |
-
|
490 |
-
|
491 |
-
template<typename T>
|
492 |
-
struct uninitialized_fill_functor
|
493 |
-
{
|
494 |
-
T exemplar;
|
495 |
-
|
496 |
-
__thrust_exec_check_disable__
|
497 |
-
__host__ __device__
|
498 |
-
uninitialized_fill_functor(const T & x):exemplar(x){}
|
499 |
-
|
500 |
-
__thrust_exec_check_disable__
|
501 |
-
__host__ __device__
|
502 |
-
uninitialized_fill_functor(const uninitialized_fill_functor & other)
|
503 |
-
:exemplar(other.exemplar){}
|
504 |
-
|
505 |
-
__thrust_exec_check_disable__
|
506 |
-
__host__ __device__
|
507 |
-
~uninitialized_fill_functor() {}
|
508 |
-
|
509 |
-
__thrust_exec_check_disable__
|
510 |
-
__host__ __device__
|
511 |
-
void operator()(T &x)
|
512 |
-
{
|
513 |
-
::new(static_cast<void*>(&x)) T(exemplar);
|
514 |
-
} // end operator()()
|
515 |
-
}; // end uninitialized_fill_functor
|
516 |
-
|
517 |
-
|
518 |
-
// this predicate tests two two-element tuples
|
519 |
-
// we first use a Compare for the first element
|
520 |
-
// if the first elements are equivalent, we use
|
521 |
-
// < for the second elements
|
522 |
-
template<typename Compare>
|
523 |
-
struct compare_first_less_second
|
524 |
-
{
|
525 |
-
compare_first_less_second(Compare c)
|
526 |
-
: comp(c) {}
|
527 |
-
|
528 |
-
template<typename T1, typename T2>
|
529 |
-
__host__ __device__
|
530 |
-
bool operator()(T1 lhs, T2 rhs)
|
531 |
-
{
|
532 |
-
return comp(thrust::get<0>(lhs), thrust::get<0>(rhs)) || (!comp(thrust::get<0>(rhs), thrust::get<0>(lhs)) && thrust::get<1>(lhs) < thrust::get<1>(rhs));
|
533 |
-
}
|
534 |
-
|
535 |
-
Compare comp;
|
536 |
-
}; // end compare_first_less_second
|
537 |
-
|
538 |
-
|
539 |
-
template<typename Compare>
|
540 |
-
struct compare_first
|
541 |
-
{
|
542 |
-
Compare comp;
|
543 |
-
|
544 |
-
__host__ __device__
|
545 |
-
compare_first(Compare comp)
|
546 |
-
: comp(comp)
|
547 |
-
{}
|
548 |
-
|
549 |
-
template<typename Tuple1, typename Tuple2>
|
550 |
-
__host__ __device__
|
551 |
-
bool operator()(const Tuple1 &x, const Tuple2 &y)
|
552 |
-
{
|
553 |
-
return comp(thrust::raw_reference_cast(thrust::get<0>(x)), thrust::raw_reference_cast(thrust::get<0>(y)));
|
554 |
-
}
|
555 |
-
}; // end compare_first
|
556 |
-
|
557 |
-
|
558 |
-
} // end namespace detail
|
559 |
-
} // end namespace thrust
|
560 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/CVPR/LIVE/thrust/thrust/device_vector.h
DELETED
@@ -1,496 +0,0 @@
|
|
1 |
-
/*
|
2 |
-
* Copyright 2008-2018 NVIDIA Corporation
|
3 |
-
*
|
4 |
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
5 |
-
* you may not use this file except in compliance with the License.
|
6 |
-
* You may obtain a copy of the License at
|
7 |
-
*
|
8 |
-
* http://www.apache.org/licenses/LICENSE-2.0
|
9 |
-
*
|
10 |
-
* Unless required by applicable law or agreed to in writing, software
|
11 |
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
12 |
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13 |
-
* See the License for the specific language governing permissions and
|
14 |
-
* limitations under the License.
|
15 |
-
*/
|
16 |
-
|
17 |
-
|
18 |
-
/*! \file device_vector.h
|
19 |
-
* \brief A dynamically-sizable array of elements which reside in the "device" memory space
|
20 |
-
*/
|
21 |
-
|
22 |
-
#pragma once
|
23 |
-
|
24 |
-
#include <thrust/detail/config.h>
|
25 |
-
#include <thrust/detail/vector_base.h>
|
26 |
-
#include <thrust/device_allocator.h>
|
27 |
-
|
28 |
-
#include <vector>
|
29 |
-
#include <utility>
|
30 |
-
|
31 |
-
namespace thrust
|
32 |
-
{
|
33 |
-
|
34 |
-
// forward declaration of host_vector
|
35 |
-
template<typename T, typename Alloc> class host_vector;
|
36 |
-
|
37 |
-
/*! \addtogroup container_classes Container Classes
|
38 |
-
* \addtogroup device_containers Device Containers
|
39 |
-
* \ingroup container_classes
|
40 |
-
* \{
|
41 |
-
*/
|
42 |
-
|
43 |
-
/*! A \p device_vector is a container that supports random access to elements,
|
44 |
-
* constant time removal of elements at the end, and linear time insertion
|
45 |
-
* and removal of elements at the beginning or in the middle. The number of
|
46 |
-
* elements in a \p device_vector may vary dynamically; memory management is
|
47 |
-
* automatic. The memory associated with a \p device_vector resides in the memory
|
48 |
-
* space of a parallel device.
|
49 |
-
*
|
50 |
-
* \see http://www.sgi.com/tech/stl/Vector.html
|
51 |
-
* \see device_allocator
|
52 |
-
* \see host_vector
|
53 |
-
*/
|
54 |
-
template<typename T, typename Alloc = thrust::device_allocator<T> >
|
55 |
-
class device_vector
|
56 |
-
: public detail::vector_base<T,Alloc>
|
57 |
-
{
|
58 |
-
private:
|
59 |
-
typedef detail::vector_base<T,Alloc> Parent;
|
60 |
-
|
61 |
-
public:
|
62 |
-
/*! \cond
|
63 |
-
*/
|
64 |
-
typedef typename Parent::size_type size_type;
|
65 |
-
typedef typename Parent::value_type value_type;
|
66 |
-
/*! \endcond
|
67 |
-
*/
|
68 |
-
|
69 |
-
/*! This constructor creates an empty \p device_vector.
|
70 |
-
*/
|
71 |
-
device_vector(void)
|
72 |
-
:Parent() {}
|
73 |
-
|
74 |
-
/*! This constructor creates an empty \p device_vector.
|
75 |
-
* \param alloc The allocator to use by this device_vector.
|
76 |
-
*/
|
77 |
-
device_vector(const Alloc &alloc)
|
78 |
-
:Parent(alloc) {}
|
79 |
-
|
80 |
-
/*! The destructor erases the elements.
|
81 |
-
*/
|
82 |
-
// Define an empty destructor to explicitly specify
|
83 |
-
// its execution space qualifier, as a workaround for nvcc warning
|
84 |
-
~device_vector(void) {}
|
85 |
-
|
86 |
-
/*! This constructor creates a \p device_vector with the given
|
87 |
-
* size.
|
88 |
-
* \param n The number of elements to initially create.
|
89 |
-
*/
|
90 |
-
explicit device_vector(size_type n)
|
91 |
-
:Parent(n) {}
|
92 |
-
|
93 |
-
/*! This constructor creates a \p device_vector with the given
|
94 |
-
* size.
|
95 |
-
* \param n The number of elements to initially create.
|
96 |
-
* \param alloc The allocator to use by this device_vector.
|
97 |
-
*/
|
98 |
-
explicit device_vector(size_type n, const Alloc &alloc)
|
99 |
-
:Parent(n,alloc) {}
|
100 |
-
|
101 |
-
/*! This constructor creates a \p device_vector with copies
|
102 |
-
* of an exemplar element.
|
103 |
-
* \param n The number of elements to initially create.
|
104 |
-
* \param value An element to copy.
|
105 |
-
*/
|
106 |
-
explicit device_vector(size_type n, const value_type &value)
|
107 |
-
:Parent(n,value) {}
|
108 |
-
|
109 |
-
/*! This constructor creates a \p device_vector with copies
|
110 |
-
* of an exemplar element.
|
111 |
-
* \param n The number of elements to initially create.
|
112 |
-
* \param value An element to copy.
|
113 |
-
* \param alloc The allocator to use by this device_vector.
|
114 |
-
*/
|
115 |
-
explicit device_vector(size_type n, const value_type &value, const Alloc &alloc)
|
116 |
-
:Parent(n,value,alloc) {}
|
117 |
-
|
118 |
-
/*! Copy constructor copies from an exemplar \p device_vector.
|
119 |
-
* \param v The \p device_vector to copy.
|
120 |
-
*/
|
121 |
-
device_vector(const device_vector &v)
|
122 |
-
:Parent(v) {}
|
123 |
-
|
124 |
-
/*! Copy constructor copies from an exemplar \p device_vector.
|
125 |
-
* \param v The \p device_vector to copy.
|
126 |
-
* \param alloc The allocator to use by this device_vector.
|
127 |
-
*/
|
128 |
-
device_vector(const device_vector &v, const Alloc &alloc)
|
129 |
-
:Parent(v,alloc) {}
|
130 |
-
|
131 |
-
#if THRUST_CPP_DIALECT >= 2011
|
132 |
-
/*! Move constructor moves from another \p device_vector.
|
133 |
-
* \param v The device_vector to move.
|
134 |
-
*/
|
135 |
-
device_vector(device_vector &&v)
|
136 |
-
:Parent(std::move(v)) {}
|
137 |
-
|
138 |
-
/*! Move constructor moves from another \p device_vector.
|
139 |
-
* \param v The device_vector to move.
|
140 |
-
* \param alloc The allocator to use by this device_vector.
|
141 |
-
*/
|
142 |
-
device_vector(device_vector &&v, const Alloc &alloc)
|
143 |
-
:Parent(std::move(v), alloc) {}
|
144 |
-
#endif // THRUST_CPP_DIALECT >= 2011
|
145 |
-
|
146 |
-
/*! Copy assign operator copies another \p device_vector with the same type.
|
147 |
-
* \param v The \p device_vector to copy.
|
148 |
-
*/
|
149 |
-
device_vector &operator=(const device_vector &v)
|
150 |
-
{ Parent::operator=(v); return *this; }
|
151 |
-
|
152 |
-
#if THRUST_CPP_DIALECT >= 2011
|
153 |
-
/*! Move assign operator moves from another \p device_vector.
|
154 |
-
* \param v The device_vector to move.
|
155 |
-
*/
|
156 |
-
device_vector &operator=(device_vector &&v)
|
157 |
-
{ Parent::operator=(std::move(v)); return *this; }
|
158 |
-
#endif // THRUST_CPP_DIALECT >= 2011
|
159 |
-
|
160 |
-
/*! Copy constructor copies from an exemplar \p device_vector with different type.
|
161 |
-
* \param v The \p device_vector to copy.
|
162 |
-
*/
|
163 |
-
template<typename OtherT, typename OtherAlloc>
|
164 |
-
explicit device_vector(const device_vector<OtherT,OtherAlloc> &v)
|
165 |
-
:Parent(v) {}
|
166 |
-
|
167 |
-
/*! Assign operator copies from an exemplar \p device_vector with different type.
|
168 |
-
* \param v The \p device_vector to copy.
|
169 |
-
*/
|
170 |
-
template<typename OtherT, typename OtherAlloc>
|
171 |
-
device_vector &operator=(const device_vector<OtherT,OtherAlloc> &v)
|
172 |
-
{ Parent::operator=(v); return *this; }
|
173 |
-
|
174 |
-
/*! Copy constructor copies from an exemplar \c std::vector.
|
175 |
-
* \param v The <tt>std::vector</tt> to copy.
|
176 |
-
*/
|
177 |
-
template<typename OtherT, typename OtherAlloc>
|
178 |
-
device_vector(const std::vector<OtherT,OtherAlloc> &v)
|
179 |
-
:Parent(v) {}
|
180 |
-
|
181 |
-
/*! Assign operator copies from an exemplar <tt>std::vector</tt>.
|
182 |
-
* \param v The <tt>std::vector</tt> to copy.
|
183 |
-
*/
|
184 |
-
template<typename OtherT, typename OtherAlloc>
|
185 |
-
device_vector &operator=(const std::vector<OtherT,OtherAlloc> &v)
|
186 |
-
{ Parent::operator=(v); return *this;}
|
187 |
-
|
188 |
-
/*! Copy constructor copies from an exemplar \p host_vector with possibly different type.
|
189 |
-
* \param v The \p host_vector to copy.
|
190 |
-
*/
|
191 |
-
template<typename OtherT, typename OtherAlloc>
|
192 |
-
device_vector(const host_vector<OtherT,OtherAlloc> &v);
|
193 |
-
|
194 |
-
/*! Assign operator copies from an examplar \p host_vector.
|
195 |
-
* \param v The \p host_vector to copy.
|
196 |
-
*/
|
197 |
-
template<typename OtherT, typename OtherAlloc>
|
198 |
-
device_vector &operator=(const host_vector<OtherT,OtherAlloc> &v)
|
199 |
-
{ Parent::operator=(v); return *this; }
|
200 |
-
|
201 |
-
/*! This constructor builds a \p device_vector from a range.
|
202 |
-
* \param first The beginning of the range.
|
203 |
-
* \param last The end of the range.
|
204 |
-
*/
|
205 |
-
template<typename InputIterator>
|
206 |
-
device_vector(InputIterator first, InputIterator last)
|
207 |
-
:Parent(first,last) {}
|
208 |
-
|
209 |
-
/*! This constructor builds a \p device_vector from a range.
|
210 |
-
* \param first The beginning of the range.
|
211 |
-
* \param last The end of the range.
|
212 |
-
* \param alloc The allocator to use by this device_vector.
|
213 |
-
*/
|
214 |
-
template<typename InputIterator>
|
215 |
-
device_vector(InputIterator first, InputIterator last, const Alloc &alloc)
|
216 |
-
:Parent(first,last,alloc) {}
|
217 |
-
|
218 |
-
// declare these members for the purpose of Doxygenating them
|
219 |
-
// they actually exist in a derived-from class
|
220 |
-
#if 0
|
221 |
-
/*! \brief Resizes this vector to the specified number of elements.
|
222 |
-
* \param new_size Number of elements this vector should contain.
|
223 |
-
* \param x Data with which new elements should be populated.
|
224 |
-
* \throw std::length_error If n exceeds max_size().
|
225 |
-
*
|
226 |
-
* This method will resize this vector to the specified number of
|
227 |
-
* elements. If the number is smaller than this vector's current
|
228 |
-
* size this vector is truncated, otherwise this vector is
|
229 |
-
* extended and new elements are populated with given data.
|
230 |
-
*/
|
231 |
-
void resize(size_type new_size, const value_type &x = value_type());
|
232 |
-
|
233 |
-
/*! Returns the number of elements in this vector.
|
234 |
-
*/
|
235 |
-
size_type size(void) const;
|
236 |
-
|
237 |
-
/*! Returns the size() of the largest possible vector.
|
238 |
-
* \return The largest possible return value of size().
|
239 |
-
*/
|
240 |
-
size_type max_size(void) const;
|
241 |
-
|
242 |
-
/*! \brief If n is less than or equal to capacity(), this call has no effect.
|
243 |
-
* Otherwise, this method is a request for allocation of additional memory. If
|
244 |
-
* the request is successful, then capacity() is greater than or equal to
|
245 |
-
* n; otherwise, capacity() is unchanged. In either case, size() is unchanged.
|
246 |
-
* \throw std::length_error If n exceeds max_size().
|
247 |
-
*/
|
248 |
-
void reserve(size_type n);
|
249 |
-
|
250 |
-
/*! Returns the number of elements which have been reserved in this
|
251 |
-
* vector.
|
252 |
-
*/
|
253 |
-
size_type capacity(void) const;
|
254 |
-
|
255 |
-
/*! This method shrinks the capacity of this vector to exactly
|
256 |
-
* fit its elements.
|
257 |
-
*/
|
258 |
-
void shrink_to_fit(void);
|
259 |
-
|
260 |
-
/*! \brief Subscript access to the data contained in this vector_dev.
|
261 |
-
* \param n The index of the element for which data should be accessed.
|
262 |
-
* \return Read/write reference to data.
|
263 |
-
*
|
264 |
-
* This operator allows for easy, array-style, data access.
|
265 |
-
* Note that data access with this operator is unchecked and
|
266 |
-
* out_of_range lookups are not defined.
|
267 |
-
*/
|
268 |
-
reference operator[](size_type n);
|
269 |
-
|
270 |
-
/*! \brief Subscript read access to the data contained in this vector_dev.
|
271 |
-
* \param n The index of the element for which data should be accessed.
|
272 |
-
* \return Read reference to data.
|
273 |
-
*
|
274 |
-
* This operator allows for easy, array-style, data access.
|
275 |
-
* Note that data access with this operator is unchecked and
|
276 |
-
* out_of_range lookups are not defined.
|
277 |
-
*/
|
278 |
-
const_reference operator[](size_type n) const;
|
279 |
-
|
280 |
-
/*! This method returns an iterator pointing to the beginning of
|
281 |
-
* this vector.
|
282 |
-
* \return mStart
|
283 |
-
*/
|
284 |
-
iterator begin(void);
|
285 |
-
|
286 |
-
/*! This method returns a const_iterator pointing to the beginning
|
287 |
-
* of this vector.
|
288 |
-
* \return mStart
|
289 |
-
*/
|
290 |
-
const_iterator begin(void) const;
|
291 |
-
|
292 |
-
/*! This method returns a const_iterator pointing to the beginning
|
293 |
-
* of this vector.
|
294 |
-
* \return mStart
|
295 |
-
*/
|
296 |
-
const_iterator cbegin(void) const;
|
297 |
-
|
298 |
-
/*! This method returns a reverse_iterator pointing to the beginning of
|
299 |
-
* this vector's reversed sequence.
|
300 |
-
* \return A reverse_iterator pointing to the beginning of this
|
301 |
-
* vector's reversed sequence.
|
302 |
-
*/
|
303 |
-
reverse_iterator rbegin(void);
|
304 |
-
|
305 |
-
/*! This method returns a const_reverse_iterator pointing to the beginning of
|
306 |
-
* this vector's reversed sequence.
|
307 |
-
* \return A const_reverse_iterator pointing to the beginning of this
|
308 |
-
* vector's reversed sequence.
|
309 |
-
*/
|
310 |
-
const_reverse_iterator rbegin(void) const;
|
311 |
-
|
312 |
-
/*! This method returns a const_reverse_iterator pointing to the beginning of
|
313 |
-
* this vector's reversed sequence.
|
314 |
-
* \return A const_reverse_iterator pointing to the beginning of this
|
315 |
-
* vector's reversed sequence.
|
316 |
-
*/
|
317 |
-
const_reverse_iterator crbegin(void) const;
|
318 |
-
|
319 |
-
/*! This method returns an iterator pointing to one element past the
|
320 |
-
* last of this vector.
|
321 |
-
* \return begin() + size().
|
322 |
-
*/
|
323 |
-
iterator end(void);
|
324 |
-
|
325 |
-
/*! This method returns a const_iterator pointing to one element past the
|
326 |
-
* last of this vector.
|
327 |
-
* \return begin() + size().
|
328 |
-
*/
|
329 |
-
const_iterator end(void) const;
|
330 |
-
|
331 |
-
/*! This method returns a const_iterator pointing to one element past the
|
332 |
-
* last of this vector.
|
333 |
-
* \return begin() + size().
|
334 |
-
*/
|
335 |
-
const_iterator cend(void) const;
|
336 |
-
|
337 |
-
/*! This method returns a reverse_iterator pointing to one element past the
|
338 |
-
* last of this vector's reversed sequence.
|
339 |
-
* \return rbegin() + size().
|
340 |
-
*/
|
341 |
-
reverse_iterator rend(void);
|
342 |
-
|
343 |
-
/*! This method returns a const_reverse_iterator pointing to one element past the
|
344 |
-
* last of this vector's reversed sequence.
|
345 |
-
* \return rbegin() + size().
|
346 |
-
*/
|
347 |
-
const_reverse_iterator rend(void) const;
|
348 |
-
|
349 |
-
/*! This method returns a const_reverse_iterator pointing to one element past the
|
350 |
-
* last of this vector's reversed sequence.
|
351 |
-
* \return rbegin() + size().
|
352 |
-
*/
|
353 |
-
const_reverse_iterator crend(void) const;
|
354 |
-
|
355 |
-
/*! This method returns a const_reference referring to the first element of this
|
356 |
-
* vector.
|
357 |
-
* \return The first element of this vector.
|
358 |
-
*/
|
359 |
-
const_reference front(void) const;
|
360 |
-
|
361 |
-
/*! This method returns a reference pointing to the first element of this
|
362 |
-
* vector.
|
363 |
-
* \return The first element of this vector.
|
364 |
-
*/
|
365 |
-
reference front(void);
|
366 |
-
|
367 |
-
/*! This method returns a const reference pointing to the last element of
|
368 |
-
* this vector.
|
369 |
-
* \return The last element of this vector.
|
370 |
-
*/
|
371 |
-
const_reference back(void) const;
|
372 |
-
|
373 |
-
/*! This method returns a reference referring to the last element of
|
374 |
-
* this vector_dev.
|
375 |
-
* \return The last element of this vector.
|
376 |
-
*/
|
377 |
-
reference back(void);
|
378 |
-
|
379 |
-
/*! This method returns a pointer to this vector's first element.
|
380 |
-
* \return A pointer to the first element of this vector.
|
381 |
-
*/
|
382 |
-
pointer data(void);
|
383 |
-
|
384 |
-
/*! This method returns a const_pointer to this vector's first element.
|
385 |
-
* \return a const_pointer to the first element of this vector.
|
386 |
-
*/
|
387 |
-
const_pointer data(void) const;
|
388 |
-
|
389 |
-
/*! This method resizes this vector to 0.
|
390 |
-
*/
|
391 |
-
void clear(void);
|
392 |
-
|
393 |
-
/*! This method returns true iff size() == 0.
|
394 |
-
* \return true if size() == 0; false, otherwise.
|
395 |
-
*/
|
396 |
-
bool empty(void) const;
|
397 |
-
|
398 |
-
/*! This method appends the given element to the end of this vector.
|
399 |
-
* \param x The element to append.
|
400 |
-
*/
|
401 |
-
void push_back(const value_type &x);
|
402 |
-
|
403 |
-
/*! This method erases the last element of this vector, invalidating
|
404 |
-
* all iterators and references to it.
|
405 |
-
*/
|
406 |
-
void pop_back(void);
|
407 |
-
|
408 |
-
/*! This method swaps the contents of this device_vector with another vector.
|
409 |
-
* \param v The vector with which to swap.
|
410 |
-
*/
|
411 |
-
void swap(device_vector &v);
|
412 |
-
|
413 |
-
/*! This method removes the element at position pos.
|
414 |
-
* \param pos The position of the element of interest.
|
415 |
-
* \return An iterator pointing to the new location of the element that followed the element
|
416 |
-
* at position pos.
|
417 |
-
*/
|
418 |
-
iterator erase(iterator pos);
|
419 |
-
|
420 |
-
/*! This method removes the range of elements [first,last) from this vector.
|
421 |
-
* \param first The beginning of the range of elements to remove.
|
422 |
-
* \param last The end of the range of elements to remove.
|
423 |
-
* \return An iterator pointing to the new location of the element that followed the last
|
424 |
-
* element in the sequence [first,last).
|
425 |
-
*/
|
426 |
-
iterator erase(iterator first, iterator last);
|
427 |
-
|
428 |
-
/*! This method inserts a single copy of a given exemplar value at the
|
429 |
-
* specified position in this vector.
|
430 |
-
* \param position The insertion position.
|
431 |
-
* \param x The exemplar element to copy & insert.
|
432 |
-
* \return An iterator pointing to the newly inserted element.
|
433 |
-
*/
|
434 |
-
iterator insert(iterator position, const T &x);
|
435 |
-
|
436 |
-
/*! This method inserts a copy of an exemplar value to a range at the
|
437 |
-
* specified position in this vector.
|
438 |
-
* \param position The insertion position
|
439 |
-
* \param n The number of insertions to perform.
|
440 |
-
* \param x The value to replicate and insert.
|
441 |
-
*/
|
442 |
-
void insert(iterator position, size_type n, const T &x);
|
443 |
-
|
444 |
-
/*! This method inserts a copy of an input range at the specified position
|
445 |
-
* in this vector.
|
446 |
-
* \param position The insertion position.
|
447 |
-
* \param first The beginning of the range to copy.
|
448 |
-
* \param last The end of the range to copy.
|
449 |
-
*
|
450 |
-
* \tparam InputIterator is a model of <a href="http://www.sgi.com/tech/stl/InputIterator.html>Input Iterator</a>,
|
451 |
-
* and \p InputIterator's \c value_type is a model of <a href="http://www.sgi.com/tech/stl/Assignable.html">Assignable</a>.
|
452 |
-
*/
|
453 |
-
template<typename InputIterator>
|
454 |
-
void insert(iterator position, InputIterator first, InputIterator last);
|
455 |
-
|
456 |
-
/*! This version of \p assign replicates a given exemplar
|
457 |
-
* \p n times into this vector.
|
458 |
-
* \param n The number of times to copy \p x.
|
459 |
-
* \param x The exemplar element to replicate.
|
460 |
-
*/
|
461 |
-
void assign(size_type n, const T &x);
|
462 |
-
|
463 |
-
/*! This version of \p assign makes this vector a copy of a given input range.
|
464 |
-
* \param first The beginning of the range to copy.
|
465 |
-
* \param last The end of the range to copy.
|
466 |
-
*
|
467 |
-
* \tparam InputIterator is a model of <a href="http://www.sgi.com/tech/stl/InputIterator">Input Iterator</a>.
|
468 |
-
*/
|
469 |
-
template<typename InputIterator>
|
470 |
-
void assign(InputIterator first, InputIterator last);
|
471 |
-
|
472 |
-
/*! This method returns a copy of this vector's allocator.
|
473 |
-
* \return A copy of the alloctor used by this vector.
|
474 |
-
*/
|
475 |
-
allocator_type get_allocator(void) const;
|
476 |
-
#endif // end doxygen-only members
|
477 |
-
}; // end device_vector
|
478 |
-
|
479 |
-
/*! Exchanges the values of two vectors.
|
480 |
-
* \p x The first \p device_vector of interest.
|
481 |
-
* \p y The second \p device_vector of interest.
|
482 |
-
*/
|
483 |
-
template<typename T, typename Alloc>
|
484 |
-
void swap(device_vector<T,Alloc> &a, device_vector<T,Alloc> &b)
|
485 |
-
{
|
486 |
-
a.swap(b);
|
487 |
-
} // end swap()
|
488 |
-
|
489 |
-
/*! \}
|
490 |
-
*/
|
491 |
-
|
492 |
-
} // end thrust
|
493 |
-
|
494 |
-
#include <thrust/detail/device_vector.inl>
|
495 |
-
|
496 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/CVPR/LIVE/thrust/thrust/system/omp/detail/copy_if.h
DELETED
@@ -1,51 +0,0 @@
|
|
1 |
-
/*
|
2 |
-
* Copyright 2008-2013 NVIDIA Corporation
|
3 |
-
*
|
4 |
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
5 |
-
* you may not use this file except in compliance with the License.
|
6 |
-
* You may obtain a copy of the License at
|
7 |
-
*
|
8 |
-
* http://www.apache.org/licenses/LICENSE-2.0
|
9 |
-
*
|
10 |
-
* Unless required by applicable law or agreed to in writing, software
|
11 |
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
12 |
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13 |
-
* See the License for the specific language governing permissions and
|
14 |
-
* limitations under the License.
|
15 |
-
*/
|
16 |
-
|
17 |
-
#pragma once
|
18 |
-
|
19 |
-
#include <thrust/detail/config.h>
|
20 |
-
#include <thrust/system/omp/detail/execution_policy.h>
|
21 |
-
|
22 |
-
namespace thrust
|
23 |
-
{
|
24 |
-
namespace system
|
25 |
-
{
|
26 |
-
namespace omp
|
27 |
-
{
|
28 |
-
namespace detail
|
29 |
-
{
|
30 |
-
|
31 |
-
|
32 |
-
template<typename DerivedPolicy,
|
33 |
-
typename InputIterator1,
|
34 |
-
typename InputIterator2,
|
35 |
-
typename OutputIterator,
|
36 |
-
typename Predicate>
|
37 |
-
OutputIterator copy_if(execution_policy<DerivedPolicy> &exec,
|
38 |
-
InputIterator1 first,
|
39 |
-
InputIterator1 last,
|
40 |
-
InputIterator2 stencil,
|
41 |
-
OutputIterator result,
|
42 |
-
Predicate pred);
|
43 |
-
|
44 |
-
|
45 |
-
} // end detail
|
46 |
-
} // end omp
|
47 |
-
} // end system
|
48 |
-
} // end thrust
|
49 |
-
|
50 |
-
#include <thrust/system/omp/detail/copy_if.inl>
|
51 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/CVPR/LIVE/thrust/thrust/system/tbb/detail/swap_ranges.h
DELETED
@@ -1,23 +0,0 @@
|
|
1 |
-
/*
|
2 |
-
* Copyright 2008-2013 NVIDIA Corporation
|
3 |
-
*
|
4 |
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
5 |
-
* you may not use this file except in compliance with the License.
|
6 |
-
* You may obtain a copy of the License at
|
7 |
-
*
|
8 |
-
* http://www.apache.org/licenses/LICENSE-2.0
|
9 |
-
*
|
10 |
-
* Unless required by applicable law or agreed to in writing, software
|
11 |
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
12 |
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13 |
-
* See the License for the specific language governing permissions and
|
14 |
-
* limitations under the License.
|
15 |
-
*/
|
16 |
-
|
17 |
-
#pragma once
|
18 |
-
|
19 |
-
#include <thrust/detail/config.h>
|
20 |
-
|
21 |
-
// tbb inherits swap_ranges
|
22 |
-
#include <thrust/system/cpp/detail/swap_ranges.h>
|
23 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/CVPR/monoscene_lite/monoscene/.ipynb_checkpoints/modules-checkpoint.py
DELETED
@@ -1,194 +0,0 @@
|
|
1 |
-
import torch
|
2 |
-
import torch.nn as nn
|
3 |
-
from monoscene.DDR import Bottleneck3D
|
4 |
-
|
5 |
-
|
6 |
-
class ASPP(nn.Module):
|
7 |
-
"""
|
8 |
-
ASPP 3D
|
9 |
-
Adapt from https://github.com/cv-rits/LMSCNet/blob/main/LMSCNet/models/LMSCNet.py#L7
|
10 |
-
"""
|
11 |
-
|
12 |
-
def __init__(self, planes, dilations_conv_list):
|
13 |
-
super().__init__()
|
14 |
-
|
15 |
-
# ASPP Block
|
16 |
-
self.conv_list = dilations_conv_list
|
17 |
-
self.conv1 = nn.ModuleList(
|
18 |
-
[
|
19 |
-
nn.Conv3d(
|
20 |
-
planes, planes, kernel_size=3, padding=dil, dilation=dil, bias=False
|
21 |
-
)
|
22 |
-
for dil in dilations_conv_list
|
23 |
-
]
|
24 |
-
)
|
25 |
-
self.bn1 = nn.ModuleList(
|
26 |
-
[nn.BatchNorm3d(planes) for dil in dilations_conv_list]
|
27 |
-
)
|
28 |
-
self.conv2 = nn.ModuleList(
|
29 |
-
[
|
30 |
-
nn.Conv3d(
|
31 |
-
planes, planes, kernel_size=3, padding=dil, dilation=dil, bias=False
|
32 |
-
)
|
33 |
-
for dil in dilations_conv_list
|
34 |
-
]
|
35 |
-
)
|
36 |
-
self.bn2 = nn.ModuleList(
|
37 |
-
[nn.BatchNorm3d(planes) for dil in dilations_conv_list]
|
38 |
-
)
|
39 |
-
self.relu = nn.ReLU()
|
40 |
-
|
41 |
-
def forward(self, x_in):
|
42 |
-
|
43 |
-
y = self.bn2[0](self.conv2[0](self.relu(self.bn1[0](self.conv1[0](x_in)))))
|
44 |
-
for i in range(1, len(self.conv_list)):
|
45 |
-
y += self.bn2[i](self.conv2[i](self.relu(self.bn1[i](self.conv1[i](x_in)))))
|
46 |
-
x_in = self.relu(y + x_in) # modified
|
47 |
-
|
48 |
-
return x_in
|
49 |
-
|
50 |
-
|
51 |
-
class SegmentationHead(nn.Module):
|
52 |
-
"""
|
53 |
-
3D Segmentation heads to retrieve semantic segmentation at each scale.
|
54 |
-
Formed by Dim expansion, Conv3D, ASPP block, Conv3D.
|
55 |
-
Taken from https://github.com/cv-rits/LMSCNet/blob/main/LMSCNet/models/LMSCNet.py#L7
|
56 |
-
"""
|
57 |
-
|
58 |
-
def __init__(self, inplanes, planes, nbr_classes, dilations_conv_list):
|
59 |
-
super().__init__()
|
60 |
-
|
61 |
-
# First convolution
|
62 |
-
self.conv0 = nn.Conv3d(inplanes, planes, kernel_size=3, padding=1, stride=1)
|
63 |
-
|
64 |
-
# ASPP Block
|
65 |
-
self.conv_list = dilations_conv_list
|
66 |
-
self.conv1 = nn.ModuleList(
|
67 |
-
[
|
68 |
-
nn.Conv3d(
|
69 |
-
planes, planes, kernel_size=3, padding=dil, dilation=dil, bias=False
|
70 |
-
)
|
71 |
-
for dil in dilations_conv_list
|
72 |
-
]
|
73 |
-
)
|
74 |
-
self.bn1 = nn.ModuleList(
|
75 |
-
[nn.BatchNorm3d(planes) for dil in dilations_conv_list]
|
76 |
-
)
|
77 |
-
self.conv2 = nn.ModuleList(
|
78 |
-
[
|
79 |
-
nn.Conv3d(
|
80 |
-
planes, planes, kernel_size=3, padding=dil, dilation=dil, bias=False
|
81 |
-
)
|
82 |
-
for dil in dilations_conv_list
|
83 |
-
]
|
84 |
-
)
|
85 |
-
self.bn2 = nn.ModuleList(
|
86 |
-
[nn.BatchNorm3d(planes) for dil in dilations_conv_list]
|
87 |
-
)
|
88 |
-
self.relu = nn.ReLU()
|
89 |
-
|
90 |
-
self.conv_classes = nn.Conv3d(
|
91 |
-
planes, nbr_classes, kernel_size=3, padding=1, stride=1
|
92 |
-
)
|
93 |
-
|
94 |
-
def forward(self, x_in):
|
95 |
-
|
96 |
-
# Convolution to go from inplanes to planes features...
|
97 |
-
x_in = self.relu(self.conv0(x_in))
|
98 |
-
|
99 |
-
y = self.bn2[0](self.conv2[0](self.relu(self.bn1[0](self.conv1[0](x_in)))))
|
100 |
-
for i in range(1, len(self.conv_list)):
|
101 |
-
y += self.bn2[i](self.conv2[i](self.relu(self.bn1[i](self.conv1[i](x_in)))))
|
102 |
-
x_in = self.relu(y + x_in) # modified
|
103 |
-
|
104 |
-
x_in = self.conv_classes(x_in)
|
105 |
-
|
106 |
-
return x_in
|
107 |
-
|
108 |
-
|
109 |
-
class ProcessKitti(nn.Module):
|
110 |
-
def __init__(self, feature, norm_layer, bn_momentum, dilations=[1, 2, 3]):
|
111 |
-
super(Process, self).__init__()
|
112 |
-
self.main = nn.Sequential(
|
113 |
-
*[
|
114 |
-
Bottleneck3D(
|
115 |
-
feature,
|
116 |
-
feature // 4,
|
117 |
-
bn_momentum=bn_momentum,
|
118 |
-
norm_layer=norm_layer,
|
119 |
-
dilation=[i, i, i],
|
120 |
-
)
|
121 |
-
for i in dilations
|
122 |
-
]
|
123 |
-
)
|
124 |
-
|
125 |
-
def forward(self, x):
|
126 |
-
return self.main(x)
|
127 |
-
|
128 |
-
|
129 |
-
class Process(nn.Module):
|
130 |
-
def __init__(self, feature, norm_layer, bn_momentum, dilations=[1, 2, 3]):
|
131 |
-
super(Process, self).__init__()
|
132 |
-
self.main = nn.Sequential(
|
133 |
-
*[
|
134 |
-
Bottleneck3D(
|
135 |
-
feature,
|
136 |
-
feature // 4,
|
137 |
-
bn_momentum=bn_momentum,
|
138 |
-
norm_layer=norm_layer,
|
139 |
-
dilation=[i, i, i],
|
140 |
-
)
|
141 |
-
for i in dilations
|
142 |
-
]
|
143 |
-
)
|
144 |
-
|
145 |
-
def forward(self, x):
|
146 |
-
return self.main(x)
|
147 |
-
|
148 |
-
|
149 |
-
class Upsample(nn.Module):
|
150 |
-
def __init__(self, in_channels, out_channels, norm_layer, bn_momentum):
|
151 |
-
super(Upsample, self).__init__()
|
152 |
-
self.main = nn.Sequential(
|
153 |
-
nn.ConvTranspose3d(
|
154 |
-
in_channels,
|
155 |
-
out_channels,
|
156 |
-
kernel_size=3,
|
157 |
-
stride=2,
|
158 |
-
padding=1,
|
159 |
-
dilation=1,
|
160 |
-
output_padding=1,
|
161 |
-
),
|
162 |
-
norm_layer(out_channels, momentum=bn_momentum),
|
163 |
-
nn.ReLU(),
|
164 |
-
)
|
165 |
-
|
166 |
-
def forward(self, x):
|
167 |
-
return self.main(x)
|
168 |
-
|
169 |
-
|
170 |
-
class Downsample(nn.Module):
|
171 |
-
def __init__(self, feature, norm_layer, bn_momentum, expansion=8):
|
172 |
-
super(Downsample, self).__init__()
|
173 |
-
self.main = Bottleneck3D(
|
174 |
-
feature,
|
175 |
-
feature // 4,
|
176 |
-
bn_momentum=bn_momentum,
|
177 |
-
expansion=expansion,
|
178 |
-
stride=2,
|
179 |
-
downsample=nn.Sequential(
|
180 |
-
nn.AvgPool3d(kernel_size=2, stride=2),
|
181 |
-
nn.Conv3d(
|
182 |
-
feature,
|
183 |
-
int(feature * expansion / 4),
|
184 |
-
kernel_size=1,
|
185 |
-
stride=1,
|
186 |
-
bias=False,
|
187 |
-
),
|
188 |
-
norm_layer(int(feature * expansion / 4), momentum=bn_momentum),
|
189 |
-
),
|
190 |
-
norm_layer=norm_layer,
|
191 |
-
)
|
192 |
-
|
193 |
-
def forward(self, x):
|
194 |
-
return self.main(x)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|