Commit
·
170eba4
1
Parent(s):
879e951
Update parquet files (step 55 of 121)
Browse filesThis view is limited to 50 files because it contains too many changes.
See raw diff
- spaces/1acneusushi/gradio-2dmoleculeeditor/Telerikwebuidllfreedownload.md +0 -128
- spaces/1acneusushi/gradio-2dmoleculeeditor/data/Bandicam 5.1.1 Crack Download The Ultimate Guide.md +0 -33
- spaces/1acneusushi/gradio-2dmoleculeeditor/data/Dont Crack Program Website How to Find and Use Free or Open-Source Software or Services.md +0 -25
- spaces/1acneusushi/gradio-2dmoleculeeditor/data/Free Video Downloader for YouTube 0.5.4 The Best Software to Save YouTube Videos Offline.md +0 -30
- spaces/1gistliPinn/ChatGPT4/Examples/Age Of Mythology Gold Edition No Cd _HOT_ Crack Download.md +0 -6
- spaces/1gistliPinn/ChatGPT4/Examples/Chup Chup Ke Man 3 Full Movie Indonesia Subtitles Download Dont Miss the Funniest Bollywood Comedy of the Year.md +0 -6
- spaces/1gistliPinn/ChatGPT4/Examples/Free Download Hulk 3 3gp In Hindi.md +0 -6
- spaces/1line/AutoGPT/BULLETIN.md +0 -2
- spaces/1pelhydcardo/ChatGPT-prompt-generator/assets/Discover the World of the Harder Styles with Q-dance APK.md +0 -164
- spaces/1pelhydcardo/ChatGPT-prompt-generator/assets/Dmod A Sandbox Game with Endless Possibilities and Features.md +0 -180
- spaces/1pelhydcardo/ChatGPT-prompt-generator/assets/Download Ba Straata the Amapiano Song that is Taking Over the Charts by DJ Maphorisa Visca.md +0 -138
- spaces/1phancelerku/anime-remove-background/1 Gallery APK The Best Photo and Video Gallery with Encryption.md +0 -126
- spaces/1phancelerku/anime-remove-background/Download Drive World Mod Apk and Enjoy Unlimited Driving Fun.md +0 -109
- spaces/7hao/bingo/next.config.js +0 -38
- spaces/AI-Hobbyist/Hoyo-RVC/my_utils.py +0 -21
- spaces/AIGC-Audio/AudioGPT/NeuralSeq/data_gen/tts/emotion/test_emotion.py +0 -184
- spaces/AIGText/GlyphControl/ldm/modules/encoders/__init__.py +0 -0
- spaces/Ababababababbababa/Ashaar/poetry_diacritizer/dataset.py +0 -238
- spaces/Abdllh/AraPoet/app.py +0 -121
- spaces/AchyuthGamer/OpenGPT-Chat-UI/src/routes/conversation/[id]/worker.js +0 -252
- spaces/AchyuthGamer/OpenGPT/g4f/Provider/Ails.py +0 -106
- spaces/Al-Chan/Vits_League_of_Legends_Yuumi_TTS/utils.py +0 -400
- spaces/AlexKoff88/stable_diffusion/README.md +0 -13
- spaces/AlexWang/lama/bin/predict.py +0 -89
- spaces/Amrrs/DragGan-Inversion/PTI/models/StyleCLIP/mapper/training/train_utils.py +0 -13
- spaces/Andy1621/IAT_enhancement/README.md +0 -13
- spaces/Andy1621/uniformer_image_detection/configs/mask_rcnn/mask_rcnn_r101_fpn_1x_coco.py +0 -2
- spaces/Andy1621/uniformer_image_detection/configs/tridentnet/tridentnet_r50_caffe_mstrain_1x_coco.py +0 -22
- spaces/Andy1621/uniformer_image_detection/mmdet/models/roi_heads/sparse_roi_head.py +0 -311
- spaces/Anon4review/HIPTDemo/app.py +0 -310
- spaces/Anonymous-sub/Rerender/ControlNet/annotator/uniformer/mmcv/runner/base_module.py +0 -195
- spaces/Ariharasudhan/YoloV5/utils/loggers/clearml/hpo.py +0 -84
- spaces/Ataturk-Chatbot/HuggingFaceChat/venv/lib/python3.11/site-packages/pip/_vendor/urllib3/packages/backports/makefile.py +0 -51
- spaces/Ataturk-Chatbot/HuggingFaceChat/venv/lib/python3.11/site-packages/pkg_resources/_vendor/pyparsing/util.py +0 -235
- spaces/Audio-AGI/AudioSep/models/CLAP/open_clip/linear_probe.py +0 -66
- spaces/AutoLLM/AutoAgents/autoagents/tools/tools.py +0 -65
- spaces/Banjoo/What_The_Bun/app.py +0 -22
- spaces/Benson/text-generation/Examples/Barra De Bar De Hasrate Mp3 Cancin.md +0 -66
- spaces/BernardoOlisan/vqganclip/taming-transformers/taming/data/utils.py +0 -114
- spaces/BilalSardar/QuestionAndAnswer/README.md +0 -12
- spaces/BramVanroy/spacey_conll/utils.py +0 -68
- spaces/CMU-80100/80-100-Pre-Writing-Chatbot-Section-H/prompts.py +0 -17
- spaces/CVPR/LIVE/pybind11/tests/test_sequences_and_iterators.cpp +0 -358
- spaces/CVPR/LIVE/thrust/thrust/detail/config/deprecated.h +0 -33
- spaces/CVPR/LIVE/thrust/thrust/system/cpp/detail/swap_ranges.h +0 -22
- spaces/CVPR/WALT/configs/_base_/datasets/parking_instance.py +0 -48
- spaces/CVPR/regionclip-demo/detectron2/modeling/meta_arch/build.py +0 -25
- spaces/CharyWind/webui-docker/Dockerfile +0 -43
- spaces/CjangCjengh/Sanskrit-TTS/app.py +0 -114
- spaces/Cyril666/ContourNet-ABI/maskrcnn_benchmark/solver/lr_scheduler.py +0 -52
spaces/1acneusushi/gradio-2dmoleculeeditor/Telerikwebuidllfreedownload.md
DELETED
@@ -1,128 +0,0 @@
|
|
1 |
-
## Telerikwebuidllfreedownload
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-

|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
**Click Here ✏ [https://jinyurl.com/2tA08d](https://jinyurl.com/2tA08d)**
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
# How to Download and Install Telerik Web UI DLL for ASP.NET AJAX
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
Telerik Web UI DLL is a core assembly that contains the Telerik UI for ASP.NET AJAX controls. It also includes the default skin and the design surface code for Visual Studio. If you want to use the Telerik UI for ASP.NET AJAX controls in your web applications, you need to download and install this assembly.
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
In this article, we will show you how to download and install Telerik Web UI DLL for ASP.NET AJAX in a few easy steps.
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
## Step 1: Download Telerik Web UI DLL
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
There are two ways to download Telerik Web UI DLL: from the official website or from a third-party website.
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
### Option 1: Download from the official website
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
If you have a subscription or a free trial for the Telerik UI for ASP.NET AJAX controls, you can download Telerik Web UI DLL from the official website. Here are the steps:
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
1. Go to [https://www.telerik.com/account/product-download?product=ASPNETAJAX](https://www.telerik.com/account/product-download?product=ASPNETAJAX).
|
56 |
-
|
57 |
-
2. Select PURCHASE if you have a subscription or DOWNLOAD TRIAL if you use the free trial[^3^].
|
58 |
-
|
59 |
-
3. Log in with your Telerik account credentials or create a new account if you don't have one.
|
60 |
-
|
61 |
-
4. Select the version of Telerik UI for ASP.NET AJAX that you want to download. You can choose the latest version or a previous one.
|
62 |
-
|
63 |
-
5. Click on DOWNLOAD ZIP FILE to download a ZIP archive that contains all the assemblies and resources for the selected version.
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
### Option 2: Download from a third-party website
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
If you don't have a subscription or a free trial for the Telerik UI for ASP.NET AJAX controls, you can download Telerik Web UI DLL from a third-party website that offers free .DLL downloads. Here are the steps:
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
1. Go to [https://www.dllme.com/dll/files/telerik\_web\_ui](https://www.dllme.com/dll/files/telerik_web_ui).
|
76 |
-
|
77 |
-
2. Select the version or variant of Telerik Web UI DLL that you need[^2^]. You can also request a different version if it is not available.
|
78 |
-
|
79 |
-
3. Click on DOWNLOAD to download a ZIP archive that contains only the Telerik Web UI DLL file.
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
## Step 2: Install Telerik Web UI DLL
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
After you download Telerik Web UI DLL, you need to install it on your computer. There are two ways to install Telerik Web UI DLL: manually or automatically.
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
### Option 1: Install manually
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
If you downloaded Telerik Web UI DLL from a third-party website or if you want to have more control over the installation process, you can install it manually. Here are the steps:
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
1. Extract the ZIP archive that contains Telerik Web UI DLL to a folder of your choice.
|
100 |
-
|
101 |
-
2. Copy the Telerik.Web.UI.dll file to one of these locations:
|
102 |
-
|
103 |
-
- The Bin folder of your web application project.
|
104 |
-
|
105 |
-
- The Global Assembly Cache (GAC) of your computer. To do this, you need to use the gacutil.exe tool that comes with Visual Studio or .NET Framework SDK. For example, you can run this command in a command prompt: `gacutil.exe -i C:\Telerik\Web\UI\Telerik.Web.UI.dll`
|
106 |
-
|
107 |
-
3. Add a reference to Telerik.Web.UI.dll in your web application project. To do this, you need to use Visual Studio or another IDE that supports .NET development. For example, you can follow these steps in Visual Studio:
|
108 |
-
|
109 |
-
- Right-click on your web application project in Solution Explorer and select Add Reference.
|
110 |
-
|
111 |
-
- In the Reference Manager window, select Browse and navigate to the location where you copied Telerik.Web.UI.dll.
|
112 |
-
|
113 |
-
- Select Telerik.Web.UI.dll and click OK.
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
### Option 2: Install automatically
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
If you downloaded Telerik Web UI DLL from the official website and if you have Visual Studio installed on
|
122 |
-
|
123 |
-
145887f19f
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/1acneusushi/gradio-2dmoleculeeditor/data/Bandicam 5.1.1 Crack Download The Ultimate Guide.md
DELETED
@@ -1,33 +0,0 @@
|
|
1 |
-
<br />
|
2 |
-
<h1>How to Get Bandicam 5.1.1 Crack Download for Free</h1>
|
3 |
-
<p>Bandicam is a popular screen recording software that allows you to capture your gameplay, webcam, desktop, or any other video source with high quality and performance. However, the free version of Bandicam has some limitations, such as a watermark on the recorded videos and a 10-minute recording time limit per file. If you want to enjoy the full features of Bandicam without any restrictions, you may need to purchase a license key or look for a crack version.</p>
|
4 |
-
<h2>bandicam 5.1.1 crack download</h2><br /><p><b><b>DOWNLOAD</b> ✪ <a href="https://byltly.com/2uKxXD">https://byltly.com/2uKxXD</a></b></p><br /><br />
|
5 |
-
<p>In this article, we will show you how to get Bandicam 5.1.1 crack download for free, which is the latest version of the software as of May 2023. We will also explain the risks and benefits of using a cracked version of Bandicam and provide some alternatives if you don't want to take any chances.</p>
|
6 |
-
<h2>What is Bandicam 5.1.1 Crack Download?</h2>
|
7 |
-
<p>Bandicam 5.1.1 crack download is a modified version of the original Bandicam software that bypasses the activation process and unlocks all the premium features without paying for a license key. A crack is usually a file or a program that you need to run or copy to the installation folder of Bandicam to make it work.</p>
|
8 |
-
<p>There are many websites that claim to offer Bandicam 5.1.1 crack download for free, but not all of them are reliable or safe. Some of them may contain viruses, malware, spyware, or adware that can harm your computer or steal your personal information. Some of them may also provide fake or outdated cracks that don't work or cause errors.</p>
|
9 |
-
<p>Therefore, you need to be careful and cautious when looking for Bandicam 5.1.1 crack download online. You should always scan the files with an antivirus program before opening them and avoid clicking on suspicious links or pop-ups. You should also read the reviews and comments from other users to see if the crack is working or not.</p>
|
10 |
-
<p></p>
|
11 |
-
<h2>How to Get Bandicam 5.1.1 Crack Download for Free?</h2>
|
12 |
-
<p>If you still want to try Bandicam 5.1.1 crack download for free, here are the steps you need to follow:</p>
|
13 |
-
<ol>
|
14 |
-
<li>Download Bandicam 5.1.1 from the official website: <a href="https://www.bandicam.com/downloads/">https://www.bandicam.com/downloads/</a>. This is the trial version that you need to install on your computer.</li>
|
15 |
-
<li>Download Bandicam 5.1.1 crack from a reputable website: <a href="https://crack4windows.com/crack?s=bandicam&id=46042">https://crack4windows.com/crack?s=bandicam&id=46042</a>. This is one of the websites that we found that offers a working crack for Bandicam 5.1.1 as of May 2023.</li>
|
16 |
-
<li>Extract the zip file that contains the crack and run the file named "bandicam_crack.exe" as administrator.</li>
|
17 |
-
<li>Follow the instructions on the screen and click on "Crack" button.</li>
|
18 |
-
<li>Wait for a few seconds until the crack is applied successfully.</li>
|
19 |
-
<li>Launch Bandicam and enjoy the full features without any limitations.</li>
|
20 |
-
</ol>
|
21 |
-
<h2>What are the Risks and Benefits of Using Bandicam 5.1.1 Crack Download?</h2>
|
22 |
-
<p>Using Bandicam 5.1.1 crack download has some advantages and disadvantages that you need to consider before deciding whether to use it or not.</p>
|
23 |
-
<h3>The Benefits of Using Bandicam 5.1.1 Crack Download</h3>
|
24 |
-
<ul>
|
25 |
-
<li>You can use all the features of Bandicam without paying for a license key.</li>
|
26 |
-
<li>You can record videos without any watermark or time limit.</li>
|
27 |
-
<li>You can save money and use it for other purposes.</li>
|
28 |
-
</ul>
|
29 |
-
<h3>The Risks of Using Bandicam 5.1.1 Crack Download</h3>
|
30 |
-
<ul>
|
31 |
-
<li>You may violate the terms and conditions of Band</p> ddb901b051<br />
|
32 |
-
<br />
|
33 |
-
<br />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/1acneusushi/gradio-2dmoleculeeditor/data/Dont Crack Program Website How to Find and Use Free or Open-Source Software or Services.md
DELETED
@@ -1,25 +0,0 @@
|
|
1 |
-
|
2 |
-
<h1>How to Crack Program Website: A Guide for Beginners</h1>
|
3 |
-
<p>Cracking program website is the process of breaking into a website that offers paid software or services and accessing them for free. This can be done by exploiting vulnerabilities in the website's code, bypassing security measures, or using tools that generate fake credentials or keys. Cracking program website can be tempting for some people who want to save money or access premium features, but it is also illegal and unethical.</p>
|
4 |
-
<h2>crack program website</h2><br /><p><b><b>DOWNLOAD</b> 🌟 <a href="https://byltly.com/2uKvpQ">https://byltly.com/2uKvpQ</a></b></p><br /><br />
|
5 |
-
<p>In this article, we will explain how to crack program website, what are the risks and consequences of doing so, and what are some alternatives to cracking program website. We will also provide some tips and resources to help you learn more about web security and ethical hacking.</p>
|
6 |
-
<h2>How to Crack Program Website</h2>
|
7 |
-
<p>There is no one definitive way to crack program website, as different websites may have different levels of security and protection. However, some of the common methods that hackers use to crack program website are:</p>
|
8 |
-
<ul>
|
9 |
-
<li><b>SQL injection.</b> This is a technique that involves inserting malicious SQL commands into a web form or URL to manipulate the database behind the website. This can allow hackers to access, modify, or delete data, or execute commands on the server. For example, hackers can use SQL injection to retrieve usernames and passwords from the database, or create new accounts with admin privileges.</li>
|
10 |
-
<li><b>Brute force attack.</b> This is a technique that involves trying different combinations of usernames and passwords until finding the correct one. This can be done manually or with automated tools that use dictionaries or lists of common passwords. For example, hackers can use brute force attack to guess the login credentials of a website's admin panel or user accounts.</li>
|
11 |
-
<li><b>Keygen or crack software.</b> These are tools that generate fake serial numbers, license keys, or activation codes for paid software or services. These tools can either be downloaded from the internet or created by hackers themselves. For example, hackers can use keygen or crack software to activate a trial version of a software or service without paying for it.</li>
|
12 |
-
</ul>
|
13 |
-
<h2>The Risks and Consequences of Cracking Program Website</h2>
|
14 |
-
<p>While cracking program website may seem like a way to get free stuff or access premium features, it is actually a very risky and unethical practice. Here are some of the reasons why you should avoid cracking program website and respect the intellectual property rights of the developers who create these software or services:</p>
|
15 |
-
<p></p>
|
16 |
-
<ul>
|
17 |
-
<li><b>Cracking program website can harm your computer and data.</b> Cracking program website can expose your computer to malware, viruses, or spyware that can compromise your system's security and performance. They can also corrupt your files, damage your hardware, or steal your personal information. You may end up spending more money and time on fixing your computer than buying the original software or service.</li>
|
18 |
-
<li><b>Cracking program website can ruin your user experience and quality.</b> Cracking program website can result in poor user experience and quality. The cracked software or service may not work properly with your system or other software, causing crashes, glitches, or compatibility issues. They may also produce poor output quality, introduce unwanted ads or pop-ups, or lack important features or updates. You may end up wasting your time and energy on troubleshooting instead of enjoying the software or service.</li>
|
19 |
-
<li><b>Cracking program website can hurt your reputation and career.</b> Cracking program website is illegal and unethical. By doing so, you are violating the intellectual property rights of the developers who spent countless hours and resources on creating these software or services. You are also depriving them of the income they deserve for their hard work and innovation. You may face legal consequences, such as fines or lawsuits, if you are caught using or distributing cracked software or services. You may also lose the respect and trust of your peers, clients, or employers in your field.</li>
|
20 |
-
</ul>
|
21 |
-
<h2>The Alternatives to Cracking Program Website</h2>
|
22 |
-
<p>As you can see, cracking program website is not worth it. It is a short-sighted and selfish act that can have serious negative consequences for yourself and others. If you want to use software or services for your personal or professional needs, you should buy them from reputable sources and support the developers who make them. Not only will you get better quality and experience, but you will also contribute to the growth and sustainability of the software industry.</p>
|
23 |
-
<p>However, if you are on a tight budget or just want to explore different options, you can also use free or open-source software or services that are legally</p> ddb901b051<br />
|
24 |
-
<br />
|
25 |
-
<br />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/1acneusushi/gradio-2dmoleculeeditor/data/Free Video Downloader for YouTube 0.5.4 The Best Software to Save YouTube Videos Offline.md
DELETED
@@ -1,30 +0,0 @@
|
|
1 |
-
|
2 |
-
<h1>Free Video Downloader for YouTube 0.5.4: A Simple and Fast Way to Download Videos</h1>
|
3 |
-
<p>If you are looking for a free and easy way to download videos from YouTube, you might want to check out Free Video Downloader for YouTube 0.5.4. This is a lightweight and user-friendly software that allows you to download any video from YouTube in various formats and resolutions. You can also choose to download only the audio track or the subtitles of the video.</p>
|
4 |
-
<h2>free video downloader for youtube 0.5.4</h2><br /><p><b><b>DOWNLOAD</b> ->>> <a href="https://byltly.com/2uKzjR">https://byltly.com/2uKzjR</a></b></p><br /><br />
|
5 |
-
<p>Free Video Downloader for YouTube 0.5.4 has a simple and intuitive interface that lets you paste the URL of the video you want to download, or use the built-in search function to find the video. You can then select the output format and quality, and start the download with one click. The software supports MP4, MKV, WEBM, MP3, M4A, and SRT formats, and can download videos up to 8K resolution.</p>
|
6 |
-
<p>One of the best features of Free Video Downloader for YouTube 0.5.4 is that it can download multiple videos at once, and even entire playlists or channels. You can also set up a queue of videos to download later, or schedule downloads to start and stop at specific times. The software also has a smart mode that can apply your preferred settings to all downloads automatically.</p>
|
7 |
-
<p>Free Video Downloader for YouTube 0.5.4 is compatible with Windows 7, 8, 10, and Mac OS X 10.10 or higher. It is also free of ads, malware, or spyware, and does not require any registration or subscription. You can download it from the official website or from various software portals.</p>
|
8 |
-
<p>If you want to enjoy your favorite YouTube videos offline, or save them for backup or editing purposes, Free Video Downloader for YouTube 0.5.4 is a great option to consider. It is fast, reliable, and easy to use, and can handle any video you throw at it.</p>
|
9 |
-
<p></p>
|
10 |
-
|
11 |
-
<p>How to use Free Video Downloader for YouTube 0.5.4</p>
|
12 |
-
<p>Using Free Video Downloader for YouTube 0.5.4 is very simple and straightforward. Here are the steps you need to follow:</p>
|
13 |
-
<ol>
|
14 |
-
<li>Download and install the software from the official website or from a trusted software portal.</li>
|
15 |
-
<li>Launch the software and copy the URL of the YouTube video you want to download. You can also use the built-in search function to find the video.</li>
|
16 |
-
<li>Paste the URL in the input box and click on the "Analyze" button. The software will show you the available formats and qualities for the video.</li>
|
17 |
-
<li>Select the output format and quality you prefer, and click on the "Download" button. You can also choose to download only the audio or the subtitles of the video.</li>
|
18 |
-
<li>The software will start downloading the video and show you the progress and speed. You can pause, resume, or cancel the download at any time.</li>
|
19 |
-
<li>Once the download is complete, you can find the video in the output folder you specified. You can also open the video with your default media player or edit it with your preferred software.</li>
|
20 |
-
</ol>
|
21 |
-
<p>Tips and tricks for using Free Video Downloader for YouTube 0.5.4</p>
|
22 |
-
<p>Here are some tips and tricks to make the most out of Free Video Downloader for YouTube 0.5.4:</p>
|
23 |
-
<ul>
|
24 |
-
<li>If you want to download multiple videos at once, you can use the "Add to queue" button instead of the "Download" button. You can then manage your queue from the "Downloads" tab and start or stop all downloads with one click.</li>
|
25 |
-
<li>If you want to download an entire playlist or channel from YouTube, you can copy and paste the URL of the playlist or channel in the input box and click on the "Analyze" button. The software will show you all the videos in the playlist or channel and let you select which ones you want to download.</li>
|
26 |
-
<li>If you want to apply your preferred settings to all downloads automatically, you can use the "Smart mode" feature. You can enable it from the "Settings" tab and choose your default output format, quality, subtitles, and output folder. The software will then use these settings for every download without asking you.</li>
|
27 |
-
<li>If you want to schedule your downloads to start and stop at specific times, you can use the "Scheduler" feature. You can enable it from the "Settings" tab and set up your preferred start and stop times. The software will then follow your schedule and download only during those times.</li>
|
28 |
-
</ul></p> ddb901b051<br />
|
29 |
-
<br />
|
30 |
-
<br />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/1gistliPinn/ChatGPT4/Examples/Age Of Mythology Gold Edition No Cd _HOT_ Crack Download.md
DELETED
@@ -1,6 +0,0 @@
|
|
1 |
-
<h2>Age Of Mythology Gold Edition No Cd Crack Download</h2><br /><p><b><b>DOWNLOAD</b> >>> <a href="https://imgfil.com/2uxXUA">https://imgfil.com/2uxXUA</a></b></p><br /><br />
|
2 |
-
|
3 |
-
8a78ff9644<br />
|
4 |
-
<br />
|
5 |
-
<br />
|
6 |
-
<p></p>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/1gistliPinn/ChatGPT4/Examples/Chup Chup Ke Man 3 Full Movie Indonesia Subtitles Download Dont Miss the Funniest Bollywood Comedy of the Year.md
DELETED
@@ -1,6 +0,0 @@
|
|
1 |
-
<h2>Chup Chup Ke Man 3 Full Movie Indonesia Subtitles Download</h2><br /><p><b><b>DOWNLOAD</b> › <a href="https://imgfil.com/2uy0LG">https://imgfil.com/2uy0LG</a></b></p><br /><br />
|
2 |
-
|
3 |
-
aaccfb2cb3<br />
|
4 |
-
<br />
|
5 |
-
<br />
|
6 |
-
<p></p>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/1gistliPinn/ChatGPT4/Examples/Free Download Hulk 3 3gp In Hindi.md
DELETED
@@ -1,6 +0,0 @@
|
|
1 |
-
<h2>Free Download Hulk 3 3gp In Hindi</h2><br /><p><b><b>Download File</b> ☑ <a href="https://imgfil.com/2uxY2d">https://imgfil.com/2uxY2d</a></b></p><br /><br />
|
2 |
-
<br />
|
3 |
-
d5da3c52bf<br />
|
4 |
-
<br />
|
5 |
-
<br />
|
6 |
-
<p></p>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/1line/AutoGPT/BULLETIN.md
DELETED
@@ -1,2 +0,0 @@
|
|
1 |
-
Welcome to Auto-GPT! We'll keep you informed of the latest news and features by printing messages here.
|
2 |
-
If you don't wish to see this message, you can run Auto-GPT with the --skip-news flag
|
|
|
|
|
|
spaces/1pelhydcardo/ChatGPT-prompt-generator/assets/Discover the World of the Harder Styles with Q-dance APK.md
DELETED
@@ -1,164 +0,0 @@
|
|
1 |
-
|
2 |
-
<h1>Q-dance APK: The Ultimate App for Harder Styles Fans</h1>
|
3 |
-
<p>If you are a fan of the harder styles of electronic music, such as hardstyle, hardcore, rawstyle, and more, you probably have heard of Q-dance. Q-dance is one of the leading promoters and organizers of events and festivals dedicated to these genres. But did you know that Q-dance also has an app that lets you experience everything their scene has to offer to the fullest? In this article, we will tell you everything you need to know about Q-dance APK, the app that will take your harder styles fandom to the next level.</p>
|
4 |
-
<h2>What is Q-dance?</h2>
|
5 |
-
<p>Before we dive into the app, let's first introduce Q-dance. Q-dance is a Dutch company that was founded in 1999 by Wouter Tavecchio and Jan Lok. Their mission is to create unforgettable experiences for fans of the harder styles, by organizing events and festivals that showcase the best artists, stages, shows, and sounds in the industry.</p>
|
6 |
-
<h2>q dance apk</h2><br /><p><b><b>Download Zip</b> ○○○ <a href="https://urlin.us/2uSUUl">https://urlin.us/2uSUUl</a></b></p><br /><br />
|
7 |
-
<h3>The history and mission of Q-dance</h3>
|
8 |
-
<p>Q-dance started as a small party organizer in Amsterdam, where they hosted events with names like "Qlubtempo" and "Qlimax". They soon gained popularity and recognition for their innovative and spectacular productions, which featured massive stages, pyrotechnics, lasers, and special effects. They also introduced their iconic logo, the letter Q with a skull inside, which became a symbol of their brand and their community.</p>
|
9 |
-
<p>Over the years, Q-dance expanded their reach and influence, by hosting events and festivals all over the world, such as Defqon.1, Dominator, Mysteryland, Tomorrowland, Electric Daisy Carnival, and more. They also launched their own radio station, Q-dance Radio, which broadcasts 24/7 the best tracks and mixes from their artists and genres. Their vision is to spread the love and passion for the harder styles to as many people as possible, and to create a global family of like-minded fans.</p>
|
10 |
-
<h3>The events and festivals of Q-dance</h3>
|
11 |
-
<p>Q-dance is known for organizing some of the most epic and legendary events and festivals in the harder styles scene. Here are some of their most famous ones:</p>
|
12 |
-
<ul>
|
13 |
-
<li><b>Defqon.1:</b> The ultimate festival for hardstyle lovers. It takes place every year in June in Biddinghuizen, Netherlands, and attracts over 80,000 visitors. It features 14 stages with different subgenres of hardstyle, such as euphoric, raw, freestyle, classics, etc. It also has a camping area where fans can stay for the whole weekend and enjoy activities like workshops, games, sports, etc.</li>
|
14 |
-
<li><b>Qlimax:</b> The most prestigious indoor event for hardstyle fans. It takes place every year in November in GelreDome, Arnhem, Netherlands, and attracts over 30,000 visitors. It features one main stage with a stunning show that combines music, lights, lasers, fireworks, dancers, actors, etc. It also has a theme that changes every year and tells a story through the show.</li>
|
15 |
-
<li><b>Dominator:</b> The biggest outdoor festival for hardcore fans. It takes place every year in July in Eersel, Netherlands, and attracts over 50,000 visitors. It features 7 stages with different subgenres of hardcore, such as uptempo, frenchcore, terrorcore, <p>etc. It also has a camping area where fans can stay for the whole weekend and enjoy activities like workshops, games, sports, etc.</li>
|
16 |
-
<li><b>Mysteryland:</b> The oldest and most diverse electronic music festival in the world. It takes place every year in August in Haarlemmermeer, Netherlands, and attracts over 100,000 visitors. It features over 20 stages with different genres of electronic music, such as house, techno, trance, hardstyle, etc. It also has a camping area where fans can stay for the whole weekend and enjoy activities like yoga, meditation, art, etc.</li>
|
17 |
-
<li><b>Tomorrowland:</b> The most popular and famous electronic music festival in the world. It takes place every year in July in Boom, Belgium, and attracts over 400,000 visitors. It features over 30 stages with different genres of electronic music, such as EDM, big room, progressive, hardstyle, etc. It also has a camping area where fans can stay for the whole weekend and enjoy activities like workshops, games, sports, etc.</li>
|
18 |
-
</ul>
|
19 |
-
<h3>The artists and genres of Q-dance</h3>
|
20 |
-
<p>Q-dance is also known for supporting and promoting some of the best artists and genres in the harder styles scene. Here are some of them:</p>
|
21 |
-
<ul>
|
22 |
-
<li><b>Hardstyle:</b> The main genre of Q-dance. It is a subgenre of electronic music that combines elements of hard trance, hardcore, and techno. It is characterized by distorted kicks, reverse basses, melodic synths, and uplifting vocals. Some of the most famous hardstyle artists are Headhunterz, Wildstylez, D-Block & S-te-Fan, Coone, Da Tweekaz, etc.</li>
|
23 |
-
<li><b>Hardcore:</b> The fastest and hardest genre of Q-dance. It is a subgenre of electronic music that originated from the rave scene in the early 1990s. It is characterized by fast tempos (above 160 BPM), distorted kicks, aggressive vocals, and industrial sounds. Some of the most famous hardcore artists are Angerfist, Miss K8, Mad Dog, Nosferatu, Korsakoff, etc.</li>
|
24 |
-
<li><b>Rawstyle:</b> The darker and edgier genre of Q-dance. It is a subgenre of hardstyle that emerged in the late 2000s. It is characterized by raw kicks, screeches, distorted vocals, and ominous atmospheres. Some of the most famous rawstyle artists are Radical Redemption, Warface, <h2>What is Q-dance APK?</h2>
|
25 |
-
<p>Q-dance APK is the official app of Q-dance, which allows you to access and enjoy all the content and features that Q-dance has to offer. Whether you want to watch live-streams, shows, series, and movies, relive over 500+ live-sets from the full Q-dance history, connect and interact with your friends around the globe, or keep track of your favorite artists and events, Q-dance APK has it all.</p>
|
26 |
-
<h3>The features and benefits of Q-dance APK</h3>
|
27 |
-
<p>Q-dance APK is more than just an app. It is your digital portal into the world of the harder styles. Here are some of the features and benefits that you can get from Q-dance APK:</p>
|
28 |
-
<p>q dance app download<br />
|
29 |
-
q dance network subscription<br />
|
30 |
-
q dance radio live stream<br />
|
31 |
-
q dance harder styles music<br />
|
32 |
-
q dance events 2023<br />
|
33 |
-
q dance gelredome arnhem<br />
|
34 |
-
q dance app chromecast<br />
|
35 |
-
q dance network shows<br />
|
36 |
-
q dance live sets archive<br />
|
37 |
-
q dance app android auto<br />
|
38 |
-
q dance app review<br />
|
39 |
-
q dance app login problem<br />
|
40 |
-
q dance app data privacy<br />
|
41 |
-
q dance app notifications<br />
|
42 |
-
q dance app map of holy grounds<br />
|
43 |
-
q dance app timetable per stage<br />
|
44 |
-
q dance app location arrow<br />
|
45 |
-
q dance app drop a pin<br />
|
46 |
-
q dance app x qlusive holland<br />
|
47 |
-
q dance app defqon 1 2023<br />
|
48 |
-
q dance app the warrior show<br />
|
49 |
-
q dance app dvds and movies<br />
|
50 |
-
q dance app series and documentaries<br />
|
51 |
-
q dance app youtube premium<br />
|
52 |
-
q dance app net energy gain<br />
|
53 |
-
q dance app mini sun experiment<br />
|
54 |
-
q dance app nuclear fusion reaction<br />
|
55 |
-
q dance app korea institute of fusion energy<br />
|
56 |
-
q dance app 100 million degrees celsius<br />
|
57 |
-
q dance app 30 seconds record<br />
|
58 |
-
q dance apk mod<br />
|
59 |
-
q dance apk hack<br />
|
60 |
-
q dance apk premium<br />
|
61 |
-
q dance apk free download<br />
|
62 |
-
q dance apk latest version<br />
|
63 |
-
q dance apk update 2023<br />
|
64 |
-
q dance apk offline mode<br />
|
65 |
-
q dance apk no ads<br />
|
66 |
-
q dance apk unlimited access<br />
|
67 |
-
q dance apk for pc<br />
|
68 |
-
q dance apk for ios<br />
|
69 |
-
q dance apk for windows 10<br />
|
70 |
-
q dance apk for macbook pro<br />
|
71 |
-
q dance apk for firestick tv<br />
|
72 |
-
q dance apk for smart tv<br />
|
73 |
-
q dance apk for roku tv<br />
|
74 |
-
q dance apk for samsung galaxy s21 ultra</p>
|
75 |
-
<ul>
|
76 |
-
<li><b>Live-streams:</b> Watch live-streams of Q-dance events and festivals, such as Defqon.1, Qlimax, Dominator, Mysteryland, Tomorrowland, and more. You can also chat with other viewers and share your reactions and opinions.</li>
|
77 |
-
<li><b>Shows, series, and movies:</b> Watch exclusive shows, series, and movies produced by Q-dance, such as The Road to Redemption, The Source Code of Creation, The Return of Headhunterz, The Sound of Q-dance, and more. You can also watch documentaries, interviews, behind-the-scenes, and other content that gives you an insight into the harder styles scene.</li>
|
78 |
-
<li><b>Live-sets:</b> Relive over 500+ live-sets from the full Q-dance history, from the classics to the latest ones. You can also create your own playlists and download them for offline listening.</li>
|
79 |
-
<li><b>Connect & interact:</b> Connect and interact with your friends around the globe who share your passion for the harder styles. You can also follow your favorite artists and events and get notified about their news and updates.</li>
|
80 |
-
<li><b>Keep track:</b> Keep track of your favorite artists and events and never miss a thing. You can also browse through the Q-dance calendar and discover new events and festivals that suit your taste.</li>
|
81 |
-
</ul>
|
82 |
-
<h3>How to download and install Q-dance APK</h3>
|
83 |
-
<p>Q-dance APK is available for Android devices running on version 5.0 or higher. You can download it for free from the Google Play Store or from other sources like Aptoide. Here are the steps to download and install Q-dance APK:</p>
|
84 |
-
<ol>
|
85 |
-
<li>Go to the Google Play Store or Aptoide and search for Q-dance APK.</li>
|
86 |
-
<li>Select the app from the results and tap on Install.</li>
|
87 |
-
<li>Wait for the app to download and install on your device.</li>
|
88 |
-
<li>Open the app and sign in with your email or Facebook account.</li>
|
89 |
-
<li>Enjoy the app and all its features.</li>
|
90 |
-
</ol>
|
91 |
-
<h3>How to use Q-dance APK</h3>
|
92 |
-
<p>Q-dance APK is easy to use and navigate. Here are some tips on how to use Q-dance APK:</p>
|
93 |
-
<ul>
|
94 |
-
<li>To watch live-streams, shows, series, and movies, go to the Home tab and select what you want to watch. You can also filter by genre or category.</li>
|
95 |
-
<li>To relive live-sets, go to the Music tab and select what you want to listen to. You can also filter by event or artist.</li>
|
96 |
-
<li>To connect and interact with your friends, go to the Friends tab and select who you want to chat with. You can also see who is online or nearby.</li>
|
97 |
-
<li>To follow your favorite artists and events, go to the Profile tab and select who you want to follow. You can also see their news and updates.</li>
|
98 |
-
<li>To keep track of your favorite artists and events, go to the Calendar tab and select what you want to see. You can also see what's coming up next.</li>
|
99 |
-
</ul>
|
100 |
-
<h2>Why should you get Q-dance APK?</h2>
|
101 |
-
<p>If you are a fan of the harder styles of electronic music, you should definitely get Q-dance APK. Here are some reasons why:</p>
|
102 |
-
<h3>The advantages of Q-dance APK over other apps</h3>
|
103 |
-
<p>Q-dance APK is not just another music app. It is a dedicated app for the harder styles scene that offers you more than any other app. Here are some of the advantages of Q-dance APK over other apps:</p>
|
104 |
-
<ul>
|
105 |
-
<li><b>Quality:</b> Q-dance APK offers you the highest video bitrate and audio quality while also being able to cast it to your TV. You can enjoy your favorite content in HD without any interruptions or glitches.</li>
|
106 |
-
<li><b>Variety <li><b>Variety:</b> Q-dance APK offers you a wide range of content and genres to choose from. You can watch and listen to hardstyle, hardcore, rawstyle, and more. You can also discover new artists and events that you might not find on other apps.</li>
|
107 |
-
<li><b>Exclusivity:</b> Q-dance APK offers you exclusive content and features that you can't get anywhere else. You can watch live-streams of Q-dance events and festivals, such as Defqon.1, Qlimax, Dominator, Mysteryland, Tomorrowland, and more. You can also watch shows, series, and movies produced by Q-dance, such as The Road to Redemption, The Source Code of Creation, The Return of Headhunterz, The Sound of Q-dance, and more.</li>
|
108 |
-
<li><b>Community:</b> Q-dance APK offers you a chance to connect and interact with your fellow harder styles fans around the world. You can chat with them, share your opinions and reactions, and make new friends. You can also follow your favorite artists and events and get notified about their news and updates.</li>
|
109 |
-
</ul>
|
110 |
-
<h3>The testimonials and reviews of Q-dance APK users</h3>
|
111 |
-
<p>Don't just take our word for it. Here are some of the testimonials and reviews of Q-dance APK users who have tried and loved the app:</p>
|
112 |
-
<blockquote>
|
113 |
-
<p>"Q-dance APK is the best app for harder styles fans. I can watch live-streams of my favorite events and festivals, relive live-sets from the past, and discover new artists and genres. The app is easy to use and has great quality. I highly recommend it to anyone who loves the harder styles." - John Smith</p>
|
114 |
-
</blockquote>
|
115 |
-
<blockquote>
|
116 |
-
<p>"Q-dance APK is the ultimate app for harder styles fans. I can watch shows, series, and movies produced by Q-dance, such as The Road to Redemption, The Source Code of Creation, The Return of Headhunterz, The Sound of Q-dance, and more. The app is amazing and has exclusive content that I can't find anywhere else." - Jane Doe</p>
|
117 |
-
</blockquote>
|
118 |
-
<blockquote>
|
119 |
-
<p>"Q-dance APK is the perfect app for harder styles fans. I can connect and interact with other fans around the world who share my passion for the harder styles. I can also follow my favorite artists and events and get notified about their news and updates. The app is awesome and has a great community." - Mike Jones</p>
|
120 |
-
</blockquote>
|
121 |
-
<h3>The future plans and updates of Q-dance APK</h3>
|
122 |
-
<p>Q-dance APK is not just an app. It is a constantly evolving platform that aims to provide you with the best experience possible. Here are some of the future plans and updates that Q-dance APK has in store for you:</p>
|
123 |
-
<ul>
|
124 |
-
<li><b>New content:</b> Q-dance APK will continue to add new content and genres to its library, such as frenchcore, uptempo, terrorcore, etc. You will also be able to watch live-streams of new events and festivals that Q-dance will organize or participate in.</li>
|
125 |
-
<li><b>New features:</b> Q-dance APK will continue to improve its features and functionality, such as adding subtitles, offline mode, casting options, etc. You will also be able to customize your profile and preferences according to your taste.</li>
|
126 |
-
<li><b>New opportunities:</b> Q-dance APK will continue to offer you new opportunities to engage with the harder styles scene, such as contests, giveaways, meet-and-greets, etc. You will also be able to access exclusive deals and discounts on tickets, merchandise, etc.</li>
|
127 |
-
</ul>
|
128 |
-
<h2>Conclusion</h2>
|
129 |
-
<p>Q-dance APK is the ultimate app for harder styles fans. It allows you to access and enjoy all the content and features that Q-dance has to offer. Whether you want to watch live-streams, shows, series, movies, relive live-sets, connect and interact with your friends, or keep track of your favorite artists and events, Q-dance APK has it all. You can download it for free from the Google Play Store or from other sources like Aptoide. You will not regret it.</p>
|
130 |
-
<p>Q-dance APK is more than just an app. It is your digital portal into the world of the harder styles. It is the app that will take your harder styles fandom to the next level. So what are you waiting for? Get Q-dance APK today and join the Q-dance family.</p>
|
131 |
-
<h3>A summary of the main points of the article</h3>
|
132 |
-
<p>Here are the main points of the article:</p>
|
133 |
-
<ul>
|
134 |
-
<li>Q-dance is one of the leading promoters and organizers of events and festivals dedicated to the harder styles of electronic music, such as hardstyle, hardcore, rawstyle, and more.</li>
|
135 |
-
<li>Q-dance APK is the official app of Q-dance, which allows you to access and enjoy all the content and features that Q-dance has to offer.</li>
|
136 |
-
<li>Q-dance APK offers you live-streams, shows, series, movies, live-sets, connect & interact, and keep track features.</li>
|
137 |
-
<li>Q-dance APK has many advantages over other apps, such as quality, variety, exclusivity, and community.</li>
|
138 |
-
<li>Q-dance APK users have given positive testimonials and reviews about the app.</li>
|
139 |
-
<li>Q-dance APK has future plans and updates that will make the app even better.</li>
|
140 |
-
</ul>
|
141 |
-
<h3>A call to action for the readers</h3>
|
142 |
-
<p>If you are a fan of the harder styles of electronic music, you should definitely get Q-dance APK. It is the ultimate app for harder styles fans. It is free, easy to use, and full of amazing content and features. You will not be disappointed.</p>
|
143 |
-
<p>To download Q-dance APK, go to the Google Play Store or Aptoide and search for Q-dance APK. Install it on your device and sign in with your email or Facebook account. Enjoy the app and all its features.</p>
|
144 |
-
<p>If you have any questions or feedback about Q-dance APK, feel free to contact us at [email protected]. We would love to hear from you.</p>
|
145 |
-
<p>Thank you for reading this article. We hope you found it informative and helpful. If you did, please share it with your friends and family who might also be interested in Q-dance APK. We appreciate your support.</p>
|
146 |
-
<h2>FAQs</h2>
|
147 |
-
<p>Here are some frequently asked questions about Q-dance APK:</p>
|
148 |
-
<h4>What is the difference between Q-dance APK and Q-dance Radio?</h4>
|
149 |
-
<p>Q-dance APK is an app that offers you more than just radio. It offers you live-streams, shows, series, movies, live-sets, connect & interact, and keep track features. Q-dance Radio is a radio station that broadcasts 24/7 the best tracks and mixes from Q-dance artists and genres. You can listen to Q-dance Radio on Q-dance APK or on their website.</p>
|
150 |
-
<h4>Is Q-dance APK safe to download?</h4>
|
151 |
-
<p>Yes, Q-dance APK is safe to download. It does not contain any viruses or malware that could harm your device or data. However, we recommend that you download it from trusted sources like the Google Play Store or Aptoide. Do not download it from unknown or suspicious websites or links.</p>
|
152 |
-
<h4>How much data does Q-dance APK use?</h4>
|
153 |
-
<p>The amount of data that Q-dance APK uses depends on what you watch or listen to on the app. Live-streams, shows, series, movies, and live-sets use more data than connect & interact and keep track features. You can reduce the amount of data that Q-dance APK uses by adjusting the video quality or downloading the content for offline viewing. You can also use Wi-Fi instead of mobile data when possible.</p>
|
154 |
-
<h4>Can I use Q-dance APK on other devices?</h4>
|
155 |
-
<p>Yes, you can use Q-dance APK on other devices besides your Android phone or tablet. You can use Q-dance APK on your smart TV, laptop, desktop, or any device that supports casting or mirroring. You can also use Q-dance APK on your iOS device by downloading it from the App Store. However, some features may not be available or compatible on some devices.</p>
|
156 |
-
<h4>How can I support Q-dance APK?</h4>
|
157 |
-
<p>There are many ways you can support Q-dance APK and help us improve our app and service. Here are some of them:</p>
|
158 |
-
<ul>
|
159 |
-
<li><b>Rate and review:</b> Rate and review Q-dance APK on the Google Play Store or the App Store and tell us what you think about our app. Your feedback is valuable and helps us make Q-dance APK better for you and other users.</li>
|
160 |
-
<li><b>Share and recommend:</b> Share and recommend Q-dance APK to your friends and family who might also be interested in Q-dance and the harder styles. You can also share your favorite content and features on social media and tag us @Q_dance.</li>
|
161 |
-
<li><b>Subscribe and donate:</b> Subscribe and donate to Q-dance and support our mission and vision. You can subscribe to Q-dance Premium and get access to exclusive content and features, such as ad-free streaming, offline mode, priority access, etc. You can also donate to Q-dance Foundation and help us create a positive impact on society through music, art, education, etc.</li>
|
162 |
-
</ul></p> 197e85843d<br />
|
163 |
-
<br />
|
164 |
-
<br />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/1pelhydcardo/ChatGPT-prompt-generator/assets/Dmod A Sandbox Game with Endless Possibilities and Features.md
DELETED
@@ -1,180 +0,0 @@
|
|
1 |
-
|
2 |
-
<h1>Dmod Free Download: A Sandbox Game with Endless Possibilities</h1>
|
3 |
-
<p>If you are looking for a fun and creative sandbox game that lets you craft, build, and explore a vast world with different creatures and items, then you should try <strong>Dmod</strong>. Dmod is a free game that is available for Android devices and PC. In this article, we will tell you what Dmod is, why you should download it for free, how to download it on your PC, how to play it and enjoy its features, what are its pros and cons, and what are some alternatives to Dmod. Let's get started!</p>
|
4 |
-
<h2>dmod free download</h2><br /><p><b><b>Download Zip</b> ––– <a href="https://urlin.us/2uSTjM">https://urlin.us/2uSTjM</a></b></p><br /><br />
|
5 |
-
<h2>What is Dmod and what are its features?</h2>
|
6 |
-
<p>Dmod is a sandbox game that was created by Gruesome Games. It is still in beta version, but it has already gained a lot of popularity among sandbox game fans. According to its description on Google Play Store, Dmod allows you to:</p>
|
7 |
-
<ul>
|
8 |
-
<li>Craft your items and tools to aid in your survival and building.</li>
|
9 |
-
<li>Build anything you can imagine with different blocks and materials.</li>
|
10 |
-
<li>Explore a huge world with different biomes, structures, and secrets.</li>
|
11 |
-
<li>Encounter many different creatures, some of which can be tamed and used as mounts.</li>
|
12 |
-
<li>Customize your controls, UI, and keystrokes according to your preferences.</li>
|
13 |
-
<li>Join the Discord community to get help with the game and frequent updates on development.</li>
|
14 |
-
</ul>
|
15 |
-
<p>Dmod has simple but appealing graphics that give it a retro feel. The controls are intuitive and easy to use. The gameplay is creative and engaging. You can create your own adventure in Dmod or join other players online. There are also many mods that you can install to enhance your gaming experience.</p>
|
16 |
-
<h2>Why should you download Dmod for free?</h2>
|
17 |
-
<p>There are many reasons why you should download Dmod for free. Here are some of them:</p>
|
18 |
-
<ul>
|
19 |
-
<li>Dmod is a fun and creative game that lets you express your imagination and creativity.</li>
|
20 |
-
<li>Dmod is free to download and play. You don't need to pay anything to enjoy its features.</li>
|
21 |
-
<li>Dmod is constantly updated with new items, mechanics, and features. You will never get bored of playing it.</li>
|
22 |
-
<li>Dmod has a supportive and active community that can help you with the game and share their creations with you.</li>
|
23 |
-
<li>Dmod is compatible with Android devices and PC. You can play it on any device that suits you.</li>
|
24 |
-
</ul>
|
25 |
-
<p>If you are interested in downloading Dmod for free, keep reading to find out how.</p>
|
26 |
-
<h <h2>How to Download Dmod for Free on PC</h2>
|
27 |
-
<p>If you want to play Dmod on your PC, you will need to use an Android emulator. An emulator is a software that allows you to run Android apps on your PC. There are many emulators that you can choose from, but we recommend using <strong>MuMu Player</strong>. MuMu Player is a fast and stable emulator that has a high compatibility with Dmod. Here are the steps to download Dmod for free on PC using MuMu Player:</p>
|
28 |
-
<h3>Step 1: Download and install MuMu Player on your PC</h3>
|
29 |
-
<p>Go to the official website of MuMu Player and click on the download button. Choose the version that matches your PC's operating system (Windows or Mac). Once the download is complete, run the installer and follow the instructions to install MuMu Player on your PC.</p>
|
30 |
-
<p>dmod sandbox game download<br />
|
31 |
-
dmod apk download for android<br />
|
32 |
-
dmod mumu player download<br />
|
33 |
-
dmod texture pack download<br />
|
34 |
-
dmod mod menu download<br />
|
35 |
-
dmod latest version download<br />
|
36 |
-
dmod pc download windows 10<br />
|
37 |
-
dmod online game download<br />
|
38 |
-
dmod hack download ios<br />
|
39 |
-
dmod beta version download<br />
|
40 |
-
dmod google play download<br />
|
41 |
-
dmod keystrokes download<br />
|
42 |
-
dmod mcpe client download<br />
|
43 |
-
dmod free fire download<br />
|
44 |
-
dmod minecraft bedrock edition download<br />
|
45 |
-
dmod game trailer download<br />
|
46 |
-
dmod auto gg download<br />
|
47 |
-
dmod crosshair download<br />
|
48 |
-
dmod app store download<br />
|
49 |
-
dmod discord server download<br />
|
50 |
-
dmod game review download<br />
|
51 |
-
dmod java similarities download<br />
|
52 |
-
dmod lotad client download<br />
|
53 |
-
dmod sketch client download<br />
|
54 |
-
dmod game tips download<br />
|
55 |
-
dmod game guide download<br />
|
56 |
-
dmod game cheats download<br />
|
57 |
-
dmod game mods download<br />
|
58 |
-
dmod game skins download<br />
|
59 |
-
dmod game maps download<br />
|
60 |
-
dmod game wiki download<br />
|
61 |
-
dmod game forum download<br />
|
62 |
-
dmod game support download<br />
|
63 |
-
dmod game update download<br />
|
64 |
-
dmod game patch notes download<br />
|
65 |
-
dmod game feedback download<br />
|
66 |
-
dmod game rating download<br />
|
67 |
-
dmod game screenshots download<br />
|
68 |
-
dmod game videos download<br />
|
69 |
-
dmod game livestreams download<br />
|
70 |
-
dmod game community download<br />
|
71 |
-
dmod game events download<br />
|
72 |
-
dmod game challenges download<br />
|
73 |
-
dmod game achievements download<br />
|
74 |
-
dmod game leaderboard download<br />
|
75 |
-
dmod game controller support download<br />
|
76 |
-
dmod game settings download<br />
|
77 |
-
dmod game system requirements download</p>
|
78 |
-
<h3>Step 2: Start MuMu Player and complete Google sign-in to access the Play Store</h3>
|
79 |
-
<p>Launch MuMu Player from your desktop or start menu. You will see a window with a virtual Android device. Click on the Google Play Store icon on the home screen. You will be asked to sign in with your Google account. If you don't have one, you can create one for free. Completing Google sign-in will give you access to the Play Store and all its apps.</p>
|
80 |
-
<h3>Step 3: Search Dmod in App center</h3>
|
81 |
-
<p>Once you are in the Play Store, click on the search bar and type <strong>Dmod</strong>. You will see a list of results. Look for the one that has the logo of Dmod and the name of Gruesome Games as the developer. Click on it to go to its app page.</p>
|
82 |
-
<h3>Step 4: Complete Google sign-in (if you skipped step 2) to install Dmod</h3>
|
83 |
-
<p>If you skipped step 2, you will be prompted to sign in with your Google account again before you can install Dmod. Follow the same steps as before to complete Google sign-in. If you already did step 2, you can skip this step and proceed to the next one.</p>
|
84 |
-
<h3>Step 5: Once installation completes, click the game icon to start the game</h3>
|
85 |
-
<p>Click on the install button on the app page of Dmod. Wait for a few minutes until the installation is complete. You will see a notification that says <strong>Dmod has been installed</strong>. Click on the open button or go back to the home screen and click on the game icon of Dmod. The game will start and you can enjoy playing it on your PC.</p>
|
86 |
-
<h2>How to Play Dmod and Enjoy Its Features</h2>
|
87 |
-
<p>Now that you have downloaded Dmod for free on your PC, you can start playing it and enjoy its features. Here are some tips and tricks to help you get started:</p>
|
88 |
-
<h3>Crafting, building, and exploring in a sandbox world</h3>
|
89 |
-
<p>Dmod is a sandbox game that gives you complete freedom to craft, build, and explore a vast world with different biomes, structures, and secrets. You can collect resources from trees, rocks, plants, animals, and chests. You can use these resources to craft items and tools that can help you survive and build. You can also use blocks and materials to build anything you can imagine, from houses and castles to bridges and statues. You can also explore the world and discover new places, such as dungeons, temples, villages, and more.</p>
|
90 |
-
<h3>Encountering different creatures and taming some of them as mounts</h3>
|
91 |
-
<p>Dmod has many different creatures that you can encounter in your adventure. Some of them are friendly, such as sheep, cows, chickens, and horses. Some of them are hostile, such as zombies, skeletons, spiders, and dragons. Some of them are neutral, such as wolves, bears, and lions. You can fight them or avoid them depending on your situation. You can also tame some of them as mounts by feeding them their favorite food or using a saddle. For example, you can tame a horse by feeding it apples or carrots or using a saddle. You can then ride it around the world faster than walking.</p>
|
92 |
-
<h3>Customizing your controls, UI, and keystrokes</h3>
|
93 |
-
<p>Dmod allows you to customize your controls, UI, and keystrokes according to your preferences. You can access the settings menu by clicking on the gear icon on the top right corner of the screen. You can change the sensitivity, size, position, and opacity of your controls. You can also change the UI scale, font size, language, sound volume, graphics quality, and more. You can also assign different keystrokes for different actions, such as moving , such as moving, jumping, attacking, etc. You can also reset the settings to default if you want.</p>
|
94 |
-
<h3>Joining the Discord community for help and updates</h3>
|
95 |
-
<p>Dmod has a Discord community that you can join to get help with the game and updates on development. You can chat with other players, share your creations, ask questions, report bugs, suggest ideas, and more. You can also get access to exclusive content, such as sneak peeks, beta versions, and giveaways. To join the Discord community, you need to have a Discord account and click on the invite link on the game's app page or website.</p>
|
96 |
-
<h2>Pros and Cons of Dmod</h2>
|
97 |
-
<p>Dmod is a great game that has many pros and cons. Here are some of them:</p>
|
98 |
-
<table>
|
99 |
-
<tr>
|
100 |
-
<th>Pros</th>
|
101 |
-
<th>Cons</th>
|
102 |
-
</tr>
|
103 |
-
<tr>
|
104 |
-
<td>Simple but appealing graphics</td>
|
105 |
-
<td>Still in beta version</td>
|
106 |
-
</tr>
|
107 |
-
<tr>
|
108 |
-
<td>Intuitive and customizable controls</td>
|
109 |
-
<td>May have some bugs or glitches</td>
|
110 |
-
</tr>
|
111 |
-
<tr>
|
112 |
-
<td>Creative and engaging gameplay</td>
|
113 |
-
<td>Requires internet connection</td>
|
114 |
-
</tr>
|
115 |
-
<tr>
|
116 |
-
<td>Frequent updates with new features</td>
|
117 |
-
<td>Limited mod support</td>
|
118 |
-
</tr>
|
119 |
-
<tr>
|
120 |
-
<td>Supportive and active community</td>
|
121 |
-
<td>No official wiki or tutorial</td>
|
122 |
-
</tr>
|
123 |
-
</table>
|
124 |
-
<p>As you can see, Dmod has more pros than cons. However, you should also be aware of the cons before you download it for free.</p>
|
125 |
-
<h2>Alternatives to Dmod</h2>
|
126 |
-
<p>If you are looking for other sandbox games that you can try for free or with a low cost, here are some alternatives to Dmod:</p>
|
127 |
-
<ul>
|
128 |
-
<li><strong>Minecraft</strong>: The most popular sandbox game in the world. You can create, explore, and survive in a blocky world with infinite possibilities. You can also play with other players online or offline. Minecraft has a huge modding community that adds new content and features to the game. Minecraft costs $26.95 for PC and $6.99 for Android.</li>
|
129 |
-
<li><strong>Terraria</strong>: A 2D sandbox game that combines elements of action, adventure, and RPG. You can dig, fight, build, and explore in a randomly generated world with different biomes, enemies, bosses, and items. You can also play with other players online or offline. Terraria has a large modding community that enhances the game's experience. Terraria costs $9.99 for PC and $4.99 for Android.</li>
|
130 |
-
<li><strong>Roblox</strong>: A platform that allows you to create and play games made by other users. You can choose from millions of games in different genres, such as adventure, simulation, role-playing, racing, etc. You can also customize your avatar and chat with other players online. Roblox is free to download and play on PC and Android.</li>
|
131 |
-
</ul>
|
132 |
-
<p>These are some of the alternatives to Dmod that you can check out if you want more variety in your sandbox gaming.</p>
|
133 |
-
<h2>Conclusion</h2>
|
134 |
-
<p>Dmod is a free sandbox game that lets you craft, build, and explore a vast world with different creatures and items. You can download it for free on your PC using an Android emulator like MuMu Player. You can also play it on your Android device by downloading it from the Google Play Store. Dmod has many features that make it fun and creative, such as crafting, building, exploring, taming mounts, customizing controls, joining the Discord community, etc. Dmod also has some pros and cons that you should consider before downloading it for free. Dmod is a great game for sandbox game fans who want to express their imagination and creativity in a simple but appealing way.</p>
|
135 |
-
<p>If you are interested in Dmod, don't hesitate to download it for free and try it out yourself. You will not regret it!</p>
|
136 |
-
<h2>FAQs</h2>
|
137 |
-
<p>Here are some frequently asked questions about Dmod:</p>
|
138 |
-
<h3>What is the difference between Dmod and Minecraft?</h3>
|
139 |
-
<p>Dmod and Minecraft are both sandbox games that allow you to craft, build, and explore a blocky world with different biomes, structures, and creatures. However, there are some differences between them:</p>
|
140 |
-
<ul>
|
141 |
-
<li>Dmod is free to download and play on PC and Android devices while Minecraft costs $26.95 for PC and $6.99 for Android devices.</li>
|
142 |
-
<li>Dmod has simple but appealing graphics that give it a retro feel while Minecraft has more realistic graphics that give it a modern look.</li>
|
143 |
-
<li>D <li>Dmod has more creatures that you can encounter and tame as mounts while Minecraft has fewer creatures and only some of them can be tamed as mounts.</li>
|
144 |
-
<li>Dmod has more customization options for your controls, UI, and keystrokes while Minecraft has less customization options for these aspects.</li>
|
145 |
-
<li>Dmod has a Discord community that provides help and updates on the game while Minecraft does not have an official Discord community.</li>
|
146 |
-
</ul>
|
147 |
-
<p>These are some of the differences between Dmod and Minecraft. However, both games are fun and creative in their own ways. You can try both of them and see which one you like better.</p>
|
148 |
-
<h3>How can I install mods for Dmod?</h3>
|
149 |
-
<p>Mods are modifications that add new content and features to the game. Dmod has a limited mod support, but you can still install some mods for it. Here are the steps to install mods for Dmod:</p>
|
150 |
-
<ol>
|
151 |
-
<li>Download the mod file from a trusted source. Make sure it is compatible with the version of Dmod that you have.</li>
|
152 |
-
<li>Locate the folder where Dmod is installed on your PC or Android device. For PC, it is usually in C:\Users\YourName\AppData\Local\MuMu\emulator\nemu\vmonitor\Android\data\com.gruesomegames.dmod. For Android, it is usually in Android\data\com.gruesomegames.dmod.</li>
|
153 |
-
<li>Copy and paste the mod file into the folder. If there is already a file with the same name, replace it with the mod file.</li>
|
154 |
-
<li>Start Dmod and enjoy the mod.</li>
|
155 |
-
</ol>
|
156 |
-
<p>Note: Installing mods may cause some issues or errors with the game. Make sure you backup your game data before installing mods. Also, uninstall any mods that are not working properly or causing problems.</p>
|
157 |
-
<h3>What are some tips and tricks for playing Dmod?</h3>
|
158 |
-
<p>Dmod is a game that requires creativity and strategy. Here are some tips and tricks that can help you play better:</p>
|
159 |
-
<ul>
|
160 |
-
<li>Collect as many resources as you can from trees, rocks, plants, animals, and chests. You will need them to craft items and tools that can help you survive and build.</li>
|
161 |
-
<li>Craft a workbench as soon as possible. It will allow you to craft more advanced items and tools that can improve your gameplay.</li>
|
162 |
-
<li>Build a shelter before nightfall. The night is dark and dangerous in Dmod. You will need a shelter to protect yourself from hostile creatures and environmental hazards.</li>
|
163 |
-
<li>Explore the world and discover new places. You will find different biomes, structures, and secrets that can enrich your gaming experience. You will also find new resources, items, and creatures that can help you or challenge you.</li>
|
164 |
-
<li>Tame some creatures as mounts. They will make your travel faster and easier. They will also help you fight enemies or carry items for you.</li>
|
165 |
-
</ul>
|
166 |
-
<p>These are some of the tips and tricks that can help you play Dmod better. However, the best way to learn is by playing yourself. So go ahead and download Dmod for free and have fun!</p>
|
167 |
-
<h3>How can I contact the developer of Dmod?</h3>
|
168 |
-
<p>If you have any questions, feedback, suggestions, or bug reports for Dmod, you can contact the developer of Dmod by using one of these methods:</p>
|
169 |
-
<ul>
|
170 |
-
<li>Email: [email protected]</li>
|
171 |
-
<li>Discord: Gruesome Games#0001</li>
|
172 |
-
<li>Twitter: @GruesomeGames</li>
|
173 |
-
</ul>
|
174 |
-
<p>The developer of Dmod is very responsive and friendly. He will try to answer your queries and resolve your issues as soon as possible.</p>
|
175 |
-
<h3>Is Dmod safe to download and play?</h3>
|
176 |
-
<p>Dmod is safe to download and play on your PC or Android device. It does not contain any viruses, malware, spyware, or other harmful software. It also does not require any personal information or permissions from you. It only requires an internet connection to play online or update the game.</p>
|
177 |
-
<p>However, you should always download Dmod from a trusted source, such as the Google Play Store or the official website. You should also avoid downloading any mods or files from untrusted sources, as they may contain harmful software or damage your game data.</p>
|
178 |
-
<p>If you follow these precautions, you can download and play Dmod safely without any worries.</p> 197e85843d<br />
|
179 |
-
<br />
|
180 |
-
<br />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/1pelhydcardo/ChatGPT-prompt-generator/assets/Download Ba Straata the Amapiano Song that is Taking Over the Charts by DJ Maphorisa Visca.md
DELETED
@@ -1,138 +0,0 @@
|
|
1 |
-
<br />
|
2 |
-
<h1>Download Ba Straata: A New Amapiano Album by DJ Maphorisa and Visca</h1>
|
3 |
-
<p>If you are a fan of Amapiano music, you might have heard of the new album by DJ Maphorisa and Visca, called <strong>Ba Straata</strong>. This album is a fusion of Amapiano and Afrobeat, featuring some of the most talented artists in South Africa. In this article, we will tell you everything you need to know about <strong>Ba Straata</strong>, and how you can download it for free.</p>
|
4 |
-
<h2>What is Ba Straata?</h2>
|
5 |
-
<p><strong>Ba Straata</strong> is the latest album by DJ Maphorisa and Visca, two of the most popular producers and DJs in South Africa. They are known for their collaborations with other Amapiano stars, such as Kabza De Small, Madumane, and Focalistic. <strong>Ba Straata</strong> is their first solo album, and it showcases their unique style and creativity.</p>
|
6 |
-
<h2>download ba straata</h2><br /><p><b><b>Download Zip</b> <a href="https://urlin.us/2uT380">https://urlin.us/2uT380</a></b></p><br /><br />
|
7 |
-
<h3>The meaning of Ba Straata</h3>
|
8 |
-
<p>The title of the album, <strong>Ba Straata</strong>, is a slang term that means "they are on fire" or "they are killing it". It is a way of expressing admiration and respect for someone who is doing something amazing or impressive. DJ Maphorisa and Visca chose this title to reflect their confidence and passion for their music.</p>
|
9 |
-
<h3>The features of Ba Straata</h3>
|
10 |
-
<p><strong>Ba Straata</strong> is a 12-track album that combines the elements of Amapiano and Afrobeat, creating a fresh and exciting sound. The album features some of the best vocalists and rappers in South Africa, such as 2woshort, Stompiiey, ShaunMusiq, F teearse, Madumane, Toss, M.J, Shino Kikai, MaWhoo, Da Muziqal Chef, and Kabza De Small. The album covers various themes, such as love, partying, hustling, and having fun.</p>
|
11 |
-
<h3>The tracklist of Ba Straata</h3>
|
12 |
-
<p>Here is the complete tracklist of <strong>Ba Straata</strong>:</p>
|
13 |
-
<table>
|
14 |
-
<tr><td>1. Intro (feat. 2woshort)</td></tr>
|
15 |
-
<tr><td>2. Namba Namba (feat. Stompiiey & ShaunMusiq)</td></tr>
|
16 |
-
<tr><td>3. Sbali (feat. F teearse)</td></tr>
|
17 |
-
<tr><td>4. Sponono (feat. Madumane & Toss)</td></tr>
|
18 |
-
<tr><td>5. Ngwana (feat. M.J & Shino Kikai)</td></tr>
|
19 |
-
<tr><td>6. Nkosi (feat. MaWhoo)</td></tr>
|
20 |
-
<tr><td>7. Umsholozi (feat. Da Muziqal Chef & Kabza De Small)</td></tr>
|
21 |
-
<tr><td>8. Ngwana Wa Motho (feat. Visca)</td></tr>
|
22 |
-
<tr><td>9. Ngwana Wa Motho Remix (feat. Visca & Madumane)</td></tr>
|
23 |
-
<tr><td>10. Ngwana Wa Motho Instrumental (feat. Visca)</td></tr>
|
24 |
-
<tr><td>11. Outro (feat. 2woshort)</td></tr>
|
25 |
-
<tr><td>12. Bonus Track: Ngwana Wa Motho Acapella </td></tr>
|
26 |
-
</table>
|
27 |
-
<h2>Why should you download Ba Straata?</h2>
|
28 |
-
<p><strong>Ba Straata</strong> is not just another Amapiano album. It is a masterpiece that showcases the talent and diversity of DJ Maphorisa and Visca, as well as their collaborators. Here are some of the reasons why you should download <strong>Ba Straata</strong> today:</p>
|
29 |
-
<h3>The benefits of downloading Ba Straata</h3>
|
30 |
-
<ul>
|
31 |
-
<li>You will enjoy the best of both worlds: Amapiano and Afrobeat. These two genres are very popular and influential in South Africa and beyond, and they blend perfectly in <strong>Ba Straata</strong>. You will experience the smooth and groovy melodies of Amapiano, as well as the upbeat and catchy rhythms of Afrobeat.</li>
|
32 |
-
<li>You will discover new artists and songs. <strong>Ba Straata</strong> features some of the rising stars and hidden gems of the South African music scene, such as 2woshort, Stompiiey, ShaunMusiq, F teearse, Toss, M.J, Shino Kikai, MaWhoo, and Da Muziqal Chef. You will also hear some of the hits and classics from Madumane and Kabza De Small, who are already well-known and respected in the industry.</li>
|
33 |
-
<li>You will support local and independent music. DJ Maphorisa and Visca are not signed to any major label or company. They are self-made and independent artists who work hard to produce quality music for their fans. By downloading <strong>Ba Straata</strong>, you will show your appreciation and support for their work, and help them grow their fan base and reach more listeners.</li>
|
34 |
-
</ul>
|
35 |
-
<h3>The best platforms to download Ba Straata</h3>
|
36 |
-
<p><strong>Ba Straata</strong> is available for free download on various platforms, such as Fakaza, Zamusic, Hiphopza, and SaHipHop. These platforms are dedicated to promoting South African music, especially Amapiano, Afrobeat, Hip Hop, and House. You can also stream <strong>Ba Straata</strong> on Spotify, Apple Music, YouTube Music, and Deezer. However, we recommend that you download the album rather than stream it, because:</p>
|
37 |
-
<ul>
|
38 |
-
<li>You will save data and storage space. Streaming music can consume a lot of data and storage space on your device, especially if you have a limited or slow internet connection. Downloading music allows you to save data and storage space, and enjoy your music offline anytime and anywhere.</li>
|
39 |
-
<li>You will have better sound quality. Streaming music can sometimes compromise the sound quality of the music, depending on the bitrate and format of the audio file. Downloading music ensures that you get the best sound quality possible, without any interruptions or distortions.</li>
|
40 |
-
<li>You will own the music. Streaming music does not give you ownership or control over the music. You can only access the music as long as you have an active subscription or account on the streaming platform. Downloading music gives you ownership and control over the music. You can transfer, copy, delete, or share the music as you wish.</li>
|
41 |
-
</ul>
|
42 |
-
<h3>The reviews of Ba Straata</h3>
|
43 |
-
<p><strong>Ba Straata</strong> has received positive reviews from critics and fans alike. Here are some of the comments and feedback that <strong>Ba Straata</strong> has received:</p>
|
44 |
-
<p>FIBA 3x3 World Cup<br />
|
45 |
-
3x3 basketball rules<br />
|
46 |
-
3x3 basketball tournaments<br />
|
47 |
-
How to play 3x3 basketball<br />
|
48 |
-
3x3 basketball rankings<br />
|
49 |
-
3x3 basketball Olympics<br />
|
50 |
-
3x3 basketball court dimensions<br />
|
51 |
-
3x3 basketball tips and tricks<br />
|
52 |
-
Best 3x3 basketball players<br />
|
53 |
-
3x3 basketball highlights<br />
|
54 |
-
3x3 basketball history<br />
|
55 |
-
3x3 basketball equipment<br />
|
56 |
-
3x3 basketball drills<br />
|
57 |
-
3x3 basketball strategy<br />
|
58 |
-
3x3 basketball training<br />
|
59 |
-
3x3 basketball videos<br />
|
60 |
-
3x3 basketball teams<br />
|
61 |
-
3x3 basketball leagues<br />
|
62 |
-
3x3 basketball skills<br />
|
63 |
-
3x3 basketball shoes<br />
|
64 |
-
3x3 basketball jerseys<br />
|
65 |
-
3x3 basketball stats<br />
|
66 |
-
3x3 basketball news<br />
|
67 |
-
3x3 basketball live stream<br />
|
68 |
-
3x3 basketball schedule<br />
|
69 |
-
3x3 basketball scoring system<br />
|
70 |
-
3x3 basketball coaching<br />
|
71 |
-
3x3 basketball benefits<br />
|
72 |
-
3x3 basketball workout<br />
|
73 |
-
3x3 basketball online game<br />
|
74 |
-
3x3 basketball dunk contest<br />
|
75 |
-
3x3 basketball shop<br />
|
76 |
-
3x3 basketball podcast<br />
|
77 |
-
3x3 basketball blog<br />
|
78 |
-
3x3 basketball quotes<br />
|
79 |
-
3x</p>
|
80 |
-
<blockquote>"Ba Straata is a brilliant album that showcases the versatility and creativity of DJ Maphorisa and Visca. They have successfully blended Amapiano and Afrobeat in a way that is fresh and exciting. The album is full of bangers that will make you dance and vibe. This is definitely one of the best albums of 2023." - Music Review SA</blockquote>
|
81 |
-
<blockquote>"I love Ba Straata! It is a masterpiece that has something for everyone. Whether you like Amapiano or Afrobeat, you will find a song that suits your mood and taste. The production is top-notch, and the vocals are amazing. DJ Maphorisa and Visca have done a great job with this album." - Thando Mkhize, a fan from Durban</blockquote>
|
82 |
-
<blockquote>"Ba Straata is a game-changer in the South African music scene. It is an album that pushes the boundaries of Amapiano and Afrobeat, creating a new sound that is unique and original. DJ Maphorisa and Visca have proven that they are not only producers but artists in their own right. Ba Straata is a must-have for any music lover." - DJ Sbu, a radio personality from Johannesburg[^12 </blockquote>
|
83 |
-
<h2>How to download Ba Straata?</h2>
|
84 |
-
<p>Now that you know what <strong>Ba Straata</strong> is, why you should download it, and what others think of it, you might be wondering how to download it. Don't worry, we have got you covered. Here are the steps and tips to download <strong>Ba Straata</strong> for free:</p>
|
85 |
-
<h3>The steps to download Ba Straata</h3>
|
86 |
-
<ol>
|
87 |
-
<li>Choose a platform that offers free download of <strong>Ba Straata</strong>, such as Fakaza, Zamusic, Hiphopza, or SaHipHop. You can find the links to these platforms in the references section below .</li>
|
88 |
-
<li>Click on the link that takes you to the page where <strong>Ba Straata</strong> is available for download. You will see the album cover, the tracklist, and the download button.</li>
|
89 |
-
<li>Click on the download button and wait for the download to start. Depending on your internet speed and the size of the file, the download may take a few minutes or longer.</li>
|
90 |
-
<li>Once the download is complete, you will find the file in your device's downloads folder. You can then open the file and play it with your preferred music player.</li>
|
91 |
-
</ol>
|
92 |
-
<h3>The tips to enjoy Ba Straata</h3>
|
93 |
-
<ul>
|
94 |
-
<li>Use headphones or speakers to listen to <strong>Ba Straata</strong>. This will enhance the sound quality and the bass of the music, making you feel the vibe and energy of <strong>Ba Straata</strong>.</li>
|
95 |
-
<li>Share <strong>Ba Straata</strong> with your friends and family. You can send them the link to download <strong>Ba Straata</strong>, or copy and paste the file to their devices. You can also play <strong>Ba Straata</strong> at parties, gatherings, or events, and enjoy the music with others.</li>
|
96 |
-
<li>Follow DJ Maphorisa and Visca on social media. You can find their handles and pages in the references section below . You can also follow their collaborators and featured artists on social media. This will help you stay updated with their latest news, releases, and events.</li>
|
97 |
-
</ul>
|
98 |
-
<h3>The alternatives to Ba Straata</h3>
|
99 |
-
<p>If you like <strong>Ba Straata</strong>, you might also like some of the other albums and songs by DJ Maphorisa and Visca, or by their collaborators and featured artists. Here are some of the alternatives to <strong>Ba Straata</strong> that you can check out:</p>
|
100 |
-
<ul>
|
101 |
-
<li><em>Rumble In The Jungle</em> by Kabza De Small, DJ Maphorisa, and Tresor. This is another Amapiano album that features Afrobeat influences, as well as vocals from Tresor, a Congolese singer-songwriter.</li>
|
102 |
-
<li><em>Sghubu Ses Excellent</em> by Focalistic. This is a Hip Hop album that incorporates Amapiano beats and melodies, as well as features from Madumane, Kabza De Small, DJ Maphorisa, Riky Rick, and more.</li>
|
103 |
-
<li><em>Made With Love</em> by Madumane. This is an EP that showcases Madumane's versatility as a singer and rapper, as well as his collaborations with DJ Maphorisa, King Monada, Shasha, Kabza De Small, and more.</li>
|
104 |
-
<li><em>AmaPiano Is A Lifestyle Vol 2</em> by Various Artists. This is a compilation album that features some of the best Amapiano songs from various artists, such as DJ Maphorisa, Visca, Kabza De Small, Focalistic, Da Muziqal Chef, MaWhoo, and more.</li>
|
105 |
-
</ul>
|
106 |
-
<h2>Conclusion</h2>
|
107 |
-
<p><strong>Ba Straata</strong> is a new Amapiano album by DJ Maphorisa and Visca that you should not miss. It is a fusion of Amapiano and Afrobeat that features some of the most talented artists in South Africa. It is available for free download on various platforms, such as Fakaza, Zamusic, Hiphopza, and SaHipHop. It has received positive reviews from critics and fans alike. It is a masterpiece that showcases the talent and diversity of DJ Maphorisa and Visca. Download <strong>Ba Straata</strong> today and enjoy!</p>
|
108 |
-
<h2>FAQs</h2>
|
109 |
-
<p>Here are some of the frequently asked questions about < strong>Ba Straata</strong>:</p>
|
110 |
-
<ol>
|
111 |
-
<li>Who are DJ Maphorisa and Visca?</li>
|
112 |
-
<p>DJ Maphorisa and Visca are two of the most popular producers and DJs in South Africa. They are known for their collaborations with other Amapiano stars, such as Kabza De Small, Madumane, and Focalistic. <strong>Ba Straata</strong> is their first solo album, and it showcases their unique style and creativity.</p>
|
113 |
-
<li>What is Amapiano?</li>
|
114 |
-
<p>Amapiano is a genre of music that originated in South Africa in the early 2010s. It is a blend of house, jazz, kwaito, and lounge music, characterized by smooth and groovy melodies, deep basslines, and percussive elements. Amapiano is also influenced by Afrobeat, Hip Hop, and R&B. Amapiano is one of the most popular and influential genres in South Africa and beyond.</p>
|
115 |
-
<li>What is Afrobeat?</li>
|
116 |
-
<p>Afrobeat is a genre of music that originated in West Africa in the late 1960s. It is a fusion of African music, jazz, funk, soul, and highlife, characterized by upbeat and catchy rhythms, horns, guitars, keyboards, and vocals. Afrobeat is also influenced by Caribbean, Latin, and American music. Afrobeat is widely recognized and appreciated around the world.</p>
|
117 |
-
<li>How can I download <strong>Ba Straata</strong> for free?</li>
|
118 |
-
<p>You can download <strong>Ba Straata</strong> for free on various platforms, such as Fakaza, Zamusic, Hiphopza, and SaHipHop. These platforms are dedicated to promoting South African music, especially Amapiano, Afrobeat, Hip Hop, and House. You can also stream <strong>Ba Straata</strong> on Spotify, Apple Music, YouTube Music, and Deezer. However, we recommend that you download the album rather than stream it, because you will save data and storage space, have better sound quality, and own the music.</p>
|
119 |
-
<li>Where can I find more information about <strong>Ba Straata</strong>?</li>
|
120 |
-
<p>You can find more information about <strong>Ba Straata</strong> on social media. You can follow DJ Maphorisa and Visca on Twitter (@DjMaphorisa and @Visca_SA), Instagram (@djmaphorisa and @visca_sa), Facebook (DJ Maphorisa and Visca SA), and YouTube (DJ Maphorisa Official and Visca SA). You can also follow their collaborators and featured artists on social media. You can also check out the references section below for some of the links to the platforms where you can download or stream <strong>Ba Straata</strong>.</p>
|
121 |
-
</ol>
|
122 |
-
<h2>References</h2>
|
123 |
-
<ul>
|
124 |
-
<li>: [Download Ba Straata Album by DJ Maphorisa & Visca]</li>
|
125 |
-
<li>: [Download Ba Straata Album by DJ Maphorisa & Visca]</li>
|
126 |
-
<li>: [Download Ba Straata Album by DJ Maphorisa & Visca]</li>
|
127 |
-
<li>: [Download Ba Straata Album by DJ Maphorisa & Visca]</li>
|
128 |
-
<li>: [DJ Maphorisa Twitter](https://twitter.com/DjMaphorisa)</li>
|
129 |
-
<li>: [Visca Twitter](https://twitter.com/Visca_SA)</li>
|
130 |
-
<li>: [DJ Maphorisa Instagram](https://www.instagram.com/djmaphorisa/)</li>
|
131 |
-
<li>: [Visca Instagram](https://www.instagram.com/visca_sa/)</li>
|
132 |
-
<li>: [DJ Maphorisa Facebook](https://www.facebook.com/Djmaphorisa/)</li>
|
133 |
-
<li>: [Visca Facebook](https://www.facebook.com/viscasa/)</li>
|
134 |
-
<li>: [DJ Maphorisa YouTube](https://www.youtube.com/channel/UCW9tLXwXGcQKuHXZSFwmNhw)</li>
|
135 |
-
<li>: [Visca YouTube](https://www.youtube.com/channel/UC8QyvqkLxQYrYw0Zl7gXV8w)</li>
|
136 |
-
</ul></p> 197e85843d<br />
|
137 |
-
<br />
|
138 |
-
<br />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/1phancelerku/anime-remove-background/1 Gallery APK The Best Photo and Video Gallery with Encryption.md
DELETED
@@ -1,126 +0,0 @@
|
|
1 |
-
<br />
|
2 |
-
<h1>1 Gallery APK: A Smart, Light and Fast Photo and Video Gallery App</h1>
|
3 |
-
<p>If you are looking for a gallery app that can help you manage your photos and videos in a smart, light and fast way, you should check out 1 Gallery APK. This app is designed to offer you a great user experience, as well as a high level of security for your files. In this article, we will tell you what is 1 Gallery APK, why you should use it, how to use it, and how it compares with other gallery apps. Let's get started!</p>
|
4 |
-
<h2>1 gallery apk</h2><br /><p><b><b>DOWNLOAD</b> ✺ <a href="https://jinyurl.com/2uNNhg">https://jinyurl.com/2uNNhg</a></b></p><br /><br />
|
5 |
-
<h2>What is 1 Gallery APK?</h2>
|
6 |
-
<h3>A brief introduction to the app and its features</h3>
|
7 |
-
<p>1 Gallery APK is an Android app that allows you to view, edit and organize your photos and videos on your device. It is developed by Today Weather Studio, a team of passionate developers who aim to create simple and useful apps for users. Some of the features of 1 Gallery APK are:</p>
|
8 |
-
<ul>
|
9 |
-
<li>It supports various formats of photos and videos, such as JPG, PNG, GIF, MP4, MKV, etc.</li>
|
10 |
-
<li>It has a simple and intuitive user interface that makes it easy to navigate and use.</li>
|
11 |
-
<li>It has a powerful photo editor that lets you crop, rotate, resize, adjust brightness, contrast, saturation, etc.</li>
|
12 |
-
<li>It has a smart album feature that automatically organizes your photos and videos by date, location, people, etc.</li>
|
13 |
-
<li>It has a slideshow feature that lets you enjoy your photos and videos in full screen mode with music.</li>
|
14 |
-
<li>It has a dark theme option that reduces eye strain and saves battery life.</li>
|
15 |
-
</ul>
|
16 |
-
<h3>How to download and install the app on your Android device</h3>
|
17 |
-
<p>To download and install 1 Gallery APK on your Android device, you can follow these steps:</p>
|
18 |
-
<ol>
|
19 |
-
<li>Go to [this link](^2^) or [this link](^1^) on your browser.</li>
|
20 |
-
<li>Tap on the download button to download the APK file of the app.</li>
|
21 |
-
<li>Once the download is complete, open the file manager app on your device and locate the downloaded file.</li>
|
22 |
-
<li>Tap on the file and allow the installation from unknown sources if prompted.</li>
|
23 |
-
<li>Follow the instructions on the screen to complete the installation process.</li>
|
24 |
-
<li>Launch the app and enjoy!</li>
|
25 |
-
</ol>
|
26 |
-
<h2>Why use 1 Gallery APK?</h2>
|
27 |
-
<h3>The benefits of using the app for managing your photos and videos</h3>
|
28 |
-
<p>There are many benefits of using 1 Gallery APK for managing your photos and videos on your device. Some of them are:</p>
|
29 |
-
<ul>
|
30 |
-
<li>You can access all your photos and videos in one place without having to switch between different apps.</li>
|
31 |
-
<li>You can edit your photos and videos with various tools without having to download additional apps.</li>
|
32 |
-
<li>You can organize your photos and videos in different albums according to your preferences.</li>
|
33 |
-
<li>You can share your photos and videos with your friends and family via social media or email directly from the app.</li>
|
34 |
-
<li>You can save storage space on your device by deleting unwanted or duplicate files easily.</li>
|
35 |
-
</ul>
|
36 |
-
<h3>The security features of the app, such <h3>The security features of the app, such as hidden and encryption mode</h3>
|
37 |
-
<p>One of the most important features of 1 Gallery APK is its security. The app allows you to hide and encrypt your photos and videos with a password or fingerprint. This way, you can protect your privacy and prevent unauthorized access to your files. Here are some of the security features of the app:</p>
|
38 |
-
<ul>
|
39 |
-
<li>Hidden mode: You can hide any photo or video from the main gallery by long-pressing on it and selecting the hide option. The hidden files will be moved to a separate folder that can only be accessed by entering the password or fingerprint.</li>
|
40 |
-
<li>Encryption mode: You can encrypt any photo or video with AES encryption by long-pressing on it and selecting the encrypt option. The encrypted files will be stored in a secure vault that can only be accessed by entering the password or fingerprint.</li>
|
41 |
-
<li>Recycle bin: You can recover any deleted photo or video from the recycle bin within 30 days. The recycle bin can also be locked with a password or fingerprint.</li>
|
42 |
-
<li>Cloud backup: You can backup your photos and videos to Google Drive or Dropbox with encryption. You can also restore them from the cloud anytime.</li>
|
43 |
-
</ul>
|
44 |
-
<h2>How to use 1 Gallery APK?</h2>
|
45 |
-
<h3>How to view, edit and organize your photos and videos with the app</h3>
|
46 |
-
<p>Using 1 Gallery APK is very easy and convenient. You can view, edit and organize your photos and videos with the app in a few simple steps:</p>
|
47 |
-
<p>1 gallery photo vault apk<br />
|
48 |
-
1 gallery app download apk<br />
|
49 |
-
1 gallery pro apk<br />
|
50 |
-
1 gallery mod apk<br />
|
51 |
-
1 gallery premium apk<br />
|
52 |
-
1 gallery latest version apk<br />
|
53 |
-
1 gallery photo editor apk<br />
|
54 |
-
1 gallery android apk<br />
|
55 |
-
1 gallery apk free download<br />
|
56 |
-
1 gallery apk for pc<br />
|
57 |
-
1 gallery apk old version<br />
|
58 |
-
1 gallery apk mirror<br />
|
59 |
-
1 gallery apk pure<br />
|
60 |
-
1 gallery apk uptodown<br />
|
61 |
-
1 gallery apk modded<br />
|
62 |
-
1 gallery apk cracked<br />
|
63 |
-
1 gallery full apk<br />
|
64 |
-
1 gallery unlocked apk<br />
|
65 |
-
1 gallery paid apk<br />
|
66 |
-
1 gallery patched apk<br />
|
67 |
-
1 gallery plus apk<br />
|
68 |
-
1 gallery lite apk<br />
|
69 |
-
1 gallery dark theme apk<br />
|
70 |
-
1 gallery encryption feature apk<br />
|
71 |
-
1 gallery hidden files apk<br />
|
72 |
-
1 gallery fingerprint lock apk<br />
|
73 |
-
1 gallery alternative app apk<br />
|
74 |
-
1 gallery photo manager apk<br />
|
75 |
-
1 gallery video player apk<br />
|
76 |
-
1 gallery view huge images apk<br />
|
77 |
-
1 gallery photo backup apk<br />
|
78 |
-
1 gallery cloud sync apk<br />
|
79 |
-
1 gallery slideshow maker apk<br />
|
80 |
-
1 gallery collage creator apk<br />
|
81 |
-
1 gallery photo recovery apk<br />
|
82 |
-
1 gallery photo organizer apk<br />
|
83 |
-
1 gallery photo sorter apk<br />
|
84 |
-
1 gallery photo filter apk<br />
|
85 |
-
1 gallery photo resize apk<br />
|
86 |
-
1 gallery photo rotate apk<br />
|
87 |
-
1 gallery photo crop apk<br />
|
88 |
-
1 gallery photo share apk<br />
|
89 |
-
1 gallery photo print apk<br />
|
90 |
-
1 gallery photo delete apk<br />
|
91 |
-
1 gallery photo rename apk<br />
|
92 |
-
1 gallery photo move apk<br />
|
93 |
-
1 gallery photo copy apk</p>
|
94 |
-
<ol>
|
95 |
-
<li>Open the app and grant the necessary permissions to access your files.</li>
|
96 |
-
<li>You will see all your photos and videos in the main gallery, sorted by date. You can also switch to other views, such as albums, locations, people, etc.</li>
|
97 |
-
<li>To view a photo or video, just tap on it. You can zoom in or out, rotate, crop, share, delete, etc.</li>
|
98 |
-
<li>To edit a photo or video, tap on the edit icon at the bottom. You can use various tools, such as filters, stickers, text, frames, etc.</li>
|
99 |
-
<li>To organize your photos and videos, tap on the select icon at the top. You can select multiple files and move them to different albums, hide them, encrypt them, etc.</li>
|
100 |
-
</ol>
|
101 |
-
<h3>How to hide and encrypt your photos and videos with the app</h3>
|
102 |
-
<p>If you want to hide and encrypt your photos and videos with the app, you can follow these steps:</p>
|
103 |
-
<ol>
|
104 |
-
<li>Open the app and tap on the menu icon at the top left corner.</li>
|
105 |
-
<li>Tap on the hidden or encryption option. You will be asked to set up a password or fingerprint for the first time.</li>
|
106 |
-
<li>You will see an empty folder where you can add your photos and videos. Tap on the plus icon at the bottom right corner.</li>
|
107 |
-
<li>Select the photos and videos you want to hide or encrypt from your device. Tap on done when you are finished.</li>
|
108 |
-
<li>Your photos and videos will be hidden or encrypted in the folder. To access them, you need to enter the password or fingerprint.</li>
|
109 |
-
</ol>
|
110 |
-
<h2>Comparison of 1 Gallery APK with other gallery apps</h2>
|
111 |
-
<h3>A table that compares the features and performance of 1 Gallery APK with other popular gallery apps, such as Google Photos, Gallery Go, Simple Gallery, etc.</h3>
|
112 |
-
| Feature | 1 Gallery APK | Google Photos | Gallery Go | Simple Gallery | |---------|---------------|---------------|------------|----------------| | Photo and video formats supported | JPG, PNG, GIF, MP4, MKV, etc. | JPG, PNG, GIF, MP4, etc. | JPG, PNG, GIF, MP4 | JPG, PNG, GIF, MP4 | | Photo editor | Yes | Yes | Yes | Yes | | Video editor | No | Yes | No | No | | Smart album | Yes | Yes | Yes | No | | Slideshow | Yes | Yes | No | Yes | | Dark theme | Yes | Yes | No | Yes | | Hidden mode | Yes | No | No | Yes | | Encryption mode | Yes | No | No | No | | Recycle bin | Yes | No | No | Yes | | Cloud backup | Yes (Google Drive or Dropbox) | Yes (Google Photos) | No | No | | App size (MB) | 10.7 [ | App size (MB) | 10.7 | 42.8 | 10.8 | 6.5 | | Rating (out of 5) | 4.6 | 4.5 | 4.3 | 4.6 | As you can see from the table, 1 Gallery APK has many advantages over other gallery apps, such as supporting more formats, offering more security features, and having a smaller app size. It also has a high rating from users who have tried it and loved it. <h2>Conclusion</h2>
|
113 |
-
<h3>A summary of the main points and a call to action for the readers to try the app</h3>
|
114 |
-
<p>In conclusion, 1 Gallery APK is a smart, light and fast photo and video gallery app that can help you manage your files in a convenient and secure way. It has many features that make it stand out from other gallery apps, such as hidden and encryption mode, smart album, photo editor, cloud backup, etc. It also has a simple and intuitive user interface that makes it easy to use. If you are looking for a gallery app that can meet your needs and expectations, you should definitely give 1 Gallery APK a try. You can download it from [this link] or [this link] and enjoy!</p>
|
115 |
-
<h2>FAQs</h2>
|
116 |
-
<h3>Five unique questions and answers about the app</h3>
|
117 |
-
<p>Here are some of the frequently asked questions and answers about the app:</p>
|
118 |
-
<ol>
|
119 |
-
<li>Q: Is 1 Gallery APK free to use?<br>A: Yes, 1 Gallery APK is free to use. However, it does have some ads that support the development of the app. You can remove the ads by purchasing the premium version of the app.</li>
|
120 |
-
<li>Q: How can I backup my photos and videos to the cloud?<br>A: You can backup your photos and videos to the cloud by tapping on the menu icon at the top left corner, then tapping on the backup option. You can choose between Google Drive or Dropbox as your cloud service provider. You can also enable encryption for your backup files.</li>
|
121 |
-
<li>Q: How can I recover my password or fingerprint if I forget them?<br>A: You can recover your password or fingerprint by tapping on the menu icon at the top left corner, then tapping on the settings option. You can then tap on the security option and choose to reset your password or fingerprint.</li>
|
122 |
-
<li>Q: How can I change the theme of the app?<br>A: You can change the theme of the app by tapping on the menu icon at the top left corner, then tapping on the settings option. You can then tap on the theme option and choose between light or dark mode.</li>
|
123 |
-
<li>Q: How can I contact the developer of the app?<br>A: You can contact the developer of the app by tapping on the menu icon at the top left corner, then tapping on the feedback option. You can then send an email to [email protected] with your questions, suggestions or issues.</li>
|
124 |
-
</ol></p> 401be4b1e0<br />
|
125 |
-
<br />
|
126 |
-
<br />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/1phancelerku/anime-remove-background/Download Drive World Mod Apk and Enjoy Unlimited Driving Fun.md
DELETED
@@ -1,109 +0,0 @@
|
|
1 |
-
<br />
|
2 |
-
<h1>Drive World Mod APK: A Fun and Realistic Driving Simulator</h1>
|
3 |
-
<p>Do you love driving games? Do you want to experience the thrill of driving different vehicles on various roads and terrains? If yes, then you should try Drive World Mod APK, a fun and realistic driving simulator game for Android devices. In this game, you can drive cars, trucks, buses, motorcycles, and even planes in an open world map. You can also customize your vehicles, adjust your controls, and play with other players online. In this article, we will tell you everything you need to know about Drive World Mod APK, including its features, how to download and install it, and its pros and cons.</p>
|
4 |
-
<h2>drive world mod apk</h2><br /><p><b><b>Download Zip</b> ✶✶✶ <a href="https://jinyurl.com/2uNNkF">https://jinyurl.com/2uNNkF</a></b></p><br /><br />
|
5 |
-
<h2>What is Drive World Mod APK?</h2>
|
6 |
-
<p>Drive World Mod APK is a modified version of the original Drive World game, which is developed by Zuuks Games. The modded version offers unlimited money, unlocked vehicles, and no ads. With these features, you can enjoy the game without any limitations or interruptions. You can buy any vehicle you want, upgrade it, and drive it anywhere you want. You can also explore the open world map with different terrains, such as city, desert, mountain, snow, and more. You can also switch between offline mode and multiplayer mode anytime you want.</p>
|
7 |
-
<h3>Features of Drive World Mod APK</h3>
|
8 |
-
<p>Drive World Mod APK has many features that make it one of the best driving simulator games for Android devices. Here are some of them:</p>
|
9 |
-
<h4>- Various vehicles to choose from</h4>
|
10 |
-
<p>Drive World Mod APK offers more than 80 vehicles to choose from, including cars, trucks, buses, motorcycles, and planes. You can drive sports cars, muscle cars, classic cars, SUVs, pickup trucks, semi-trucks, school buses, city buses, motorbikes, dirt bikes, helicopters, jets, and more. You can also buy new vehicles with unlimited money and unlock all vehicles with the modded version.</p>
|
11 |
-
<p>drive world mod apk unlimited money<br />
|
12 |
-
drive world mod apk download for android<br />
|
13 |
-
drive world mod apk latest version<br />
|
14 |
-
drive world mod apk free shopping<br />
|
15 |
-
drive world mod apk offline<br />
|
16 |
-
drive world mod apk hack<br />
|
17 |
-
drive world mod apk no ads<br />
|
18 |
-
drive world mod apk revdl<br />
|
19 |
-
drive world mod apk rexdl<br />
|
20 |
-
drive world mod apk 2023<br />
|
21 |
-
drive world mod apk android 1<br />
|
22 |
-
drive world mod apk happymod<br />
|
23 |
-
drive world mod apk obb<br />
|
24 |
-
drive world mod apk data<br />
|
25 |
-
drive world mod apk pure<br />
|
26 |
-
drive world mod apk vip<br />
|
27 |
-
drive world mod apk unlocked<br />
|
28 |
-
drive world mod apk pro<br />
|
29 |
-
drive world mod apk premium<br />
|
30 |
-
drive world mod apk full<br />
|
31 |
-
drive world mod apk mega<br />
|
32 |
-
drive world mod apk mediafıre<br />
|
33 |
-
drive world mod apk 1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.1<br />
|
34 |
-
drive world mod apk 1.1.2<br />
|
35 |
-
drive world mod apk 1.2.3<br />
|
36 |
-
drive world mod apk 1.3.4<br />
|
37 |
-
drive world mod apk 1.4.5<br />
|
38 |
-
drive world mod apk 1.5.6<br />
|
39 |
-
drive world mod apk 1.6.7<br />
|
40 |
-
drive world mod apk 1.7.8<br />
|
41 |
-
drive world mod apk 1.8.9<br />
|
42 |
-
drive world mod apk 1.9.10<br />
|
43 |
-
drive world mod apk 2.0.11<br />
|
44 |
-
drive world mod apk 2.1.12<br />
|
45 |
-
drive world mod apk 2.2.13<br />
|
46 |
-
drive world mod apk 2.3.14<br />
|
47 |
-
drive world mod apk 2.4.15<br />
|
48 |
-
drive world mod apk 2.5.16<br />
|
49 |
-
drive world mod apk 2.6.17<br />
|
50 |
-
drive world mod apk 2.7.18<br />
|
51 |
-
drive world mod apk 2.8.19<br />
|
52 |
-
drive world mod apk 2.9.20<br />
|
53 |
-
drive world mod apk 3d graphics</p>
|
54 |
-
<h4>- Realistic driving physics and graphics</h4>
|
55 |
-
<p>Drive World Mod APK has realistic driving physics and graphics that make you feel like you are driving in real life. You can feel the weight of your vehicle, the speed of your engine, the traction of your tires, the braking of your brakes, and the steering of your wheel. You can also see the details of your vehicle, the environment, the weather effects, the traffic lights, the pedestrians, and the other vehicles on the road.</p>
|
56 |
-
<h4>- Open world map with different terrains</h4>
|
57 |
-
<p>Drive World Mod APK has an open world map with different terrains that you can explore freely. You can drive on highways, streets, bridges, tunnels, off-roads, hills, mountains, deserts, snowy areas, and more. You can also find hidden places, ramps, jumps, and stunts to perform. You can also change the time of day and the weather conditions to suit your mood.</p>
|
58 |
-
<h4>- Customizable controls and settings</h4>
|
59 |
-
<p>Drive World Mod APK has customizable controls and settings that let you adjust the game to your preference. You can choose between different control modes, such as tilt, touch, steering wheel, or buttons. You can also change the camera angle, the sound volume, the graphics quality, and the language of the game.</p>
|
60 |
-
<h4>- Offline <h4>- Offline mode and multiplayer mode</h4>
|
61 |
-
<p>Drive World Mod APK has both offline mode and multiplayer mode that you can switch anytime you want. In offline mode, you can drive alone or with AI traffic and pedestrians. You can also complete missions and challenges to earn money and rewards. In multiplayer mode, you can join online servers and play with other players from around the world. You can chat, race, cooperate, or compete with them. You can also create your own server and invite your friends to join.</p>
|
62 |
-
<h3>How to download and install Drive World Mod APK?</h3>
|
63 |
-
<p>If you want to download and install Drive World Mod APK on your Android device, you need to follow these steps:</p>
|
64 |
-
<h4>- Requirements for Drive World Mod APK</h4>
|
65 |
-
<p>Before you download and install Drive World Mod APK, you need to make sure that your device meets these requirements:</p>
|
66 |
-
| Requirement | Description | | --- | --- | | Android version | 4.1 or higher | | Storage space | At least 200 MB | | Internet connection | Required for multiplayer mode | | Permission | Enable installation from unknown sources | <h4>- Steps to download and install Drive World Mod APK</h4>
|
67 |
-
<p>After you check the requirements, you can proceed with these steps:</p>
|
68 |
-
<ol>
|
69 |
-
<li>Download the Drive World Mod APK file from a trusted source. You can use this link: [text].</li>
|
70 |
-
<li>Locate the downloaded file in your device's file manager and tap on it to start the installation.</li>
|
71 |
-
<li>Follow the instructions on the screen and wait for the installation to finish.</li>
|
72 |
-
<li>Launch the game and enjoy driving in Drive World Mod APK.</li>
|
73 |
-
</ol>
|
74 |
-
<h3>Pros and cons of Drive World Mod APK</h3>
|
75 |
-
<p>Drive World Mod APK has many pros and cons that you should consider before playing it. Here are some of them:</p>
|
76 |
-
<h4>- Pros of Drive World Mod APK</h4>
|
77 |
-
<ul>
|
78 |
-
<li>It has unlimited money, unlocked vehicles, and no ads.</li>
|
79 |
-
<li>It has realistic driving physics and graphics.</li>
|
80 |
-
<li>It has various vehicles to choose from.</li>
|
81 |
-
<li>It has an open world map with different terrains.</li>
|
82 |
-
<li>It has customizable controls and settings.</li>
|
83 |
-
<li>It has offline mode and multiplayer mode.</li>
|
84 |
-
</ul>
|
85 |
-
<h4>- Cons of Drive World Mod APK</h4>
|
86 |
-
<ul>
|
87 |
-
<li>It may not be compatible with some devices or Android versions.</li>
|
88 |
-
<li>It may have some bugs or glitches.</li>
|
89 |
-
<li>It may consume a lot of battery or data.</li>
|
90 |
-
<li>It may not be updated regularly or supported by the developer.</li>
|
91 |
-
</ul>
|
92 |
-
<h2>Conclusion</h2>
|
93 |
-
<p>Drive World Mod APK is a fun and realistic driving simulator game for Android devices. It offers unlimited money, unlocked vehicles, and no ads. It also has realistic driving physics and graphics, various vehicles to choose from, an open world map with different terrains, customizable controls and settings, offline mode and multiplayer mode. However, it also has some cons, such as compatibility issues, bugs or glitches, battery or data consumption, and lack of updates or support. Therefore, you should weigh the pros and cons before playing it. If you want to try Drive World Mod APK, you can download it from this link: [text].</p>
|
94 |
-
<h2>FAQs</h2>
|
95 |
-
<p>Here are some frequently asked questions about Drive World Mod APK:</p>
|
96 |
-
<ol>
|
97 |
-
<li><b>Is Drive World Mod APK safe to download and install?</b></li>
|
98 |
-
<p>Drive World Mod APK is safe to download and install if you get it from a trusted source. However, you should always scan the file for viruses or malware before installing it. You should also backup your data before playing it.</p>
|
99 |
-
<li><b>Is Drive World Mod APK legal to use?</b></li>
|
100 |
-
<p>Drive World Mod APK is not legal to use because it is a modified version of the original game. It violates the terms and conditions of the developer and the Google Play Store. Therefore, you should use it at your own risk. You may face legal actions or bans if you get caught using it.</p>
|
101 |
-
<li><b>How can I update Drive World Mod APK?</b></li>
|
102 |
-
<p>You cannot update Drive World Mod APK from the Google Play Store because it is not available there. You have to wait for the modder to release a new version of the modded game. You can check their website or social media for updates. You can also bookmark this page for future updates.</p>
|
103 |
-
<li><b>How can I uninstall Drive World Mod APK?</b></li>
|
104 |
-
<p>You can uninstall Drive World Mod APK like any other app on your device. You can go to your device's settings, find the app, and <p>You can uninstall Drive World Mod APK like any other app on your device. You can go to your device's settings, find the app, and tap on the uninstall option. You can also long-press the app icon on your home screen and drag it to the trash bin. You should also delete the downloaded file from your device's storage to free up some space.</p>
|
105 |
-
<li><b>Can I play Drive World Mod APK on PC?</b></li>
|
106 |
-
<p>You can play Drive World Mod APK on PC if you use an Android emulator. An Android emulator is a software that allows you to run Android apps and games on your PC. You can download and install an Android emulator of your choice, such as BlueStacks, NoxPlayer, or LDPlayer. Then, you can download and install Drive World Mod APK on the emulator and play it with your keyboard and mouse.</p>
|
107 |
-
</ol></p> 401be4b1e0<br />
|
108 |
-
<br />
|
109 |
-
<br />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/7hao/bingo/next.config.js
DELETED
@@ -1,38 +0,0 @@
|
|
1 |
-
/** @type {import('next').NextConfig} */
|
2 |
-
const nextConfig = {
|
3 |
-
// output: 'export',
|
4 |
-
// assetPrefix: '.',
|
5 |
-
webpack: (config, { isServer }) => {
|
6 |
-
if (!isServer) {
|
7 |
-
config.resolve = {
|
8 |
-
...config.resolve,
|
9 |
-
fallback: {
|
10 |
-
'bufferutil': false,
|
11 |
-
'utf-8-validate': false,
|
12 |
-
http: false,
|
13 |
-
https: false,
|
14 |
-
stream: false,
|
15 |
-
// fixes proxy-agent dependencies
|
16 |
-
net: false,
|
17 |
-
dns: false,
|
18 |
-
tls: false,
|
19 |
-
assert: false,
|
20 |
-
// fixes next-i18next dependencies
|
21 |
-
path: false,
|
22 |
-
fs: false,
|
23 |
-
// fixes mapbox dependencies
|
24 |
-
events: false,
|
25 |
-
// fixes sentry dependencies
|
26 |
-
process: false
|
27 |
-
}
|
28 |
-
};
|
29 |
-
}
|
30 |
-
config.module.exprContextCritical = false;
|
31 |
-
|
32 |
-
return config;
|
33 |
-
},
|
34 |
-
}
|
35 |
-
|
36 |
-
module.exports = (...args) => {
|
37 |
-
return nextConfig
|
38 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/AI-Hobbyist/Hoyo-RVC/my_utils.py
DELETED
@@ -1,21 +0,0 @@
|
|
1 |
-
import ffmpeg
|
2 |
-
import numpy as np
|
3 |
-
|
4 |
-
|
5 |
-
def load_audio(file, sr):
|
6 |
-
try:
|
7 |
-
# https://github.com/openai/whisper/blob/main/whisper/audio.py#L26
|
8 |
-
# This launches a subprocess to decode audio while down-mixing and resampling as necessary.
|
9 |
-
# Requires the ffmpeg CLI and `ffmpeg-python` package to be installed.
|
10 |
-
file = (
|
11 |
-
file.strip(" ").strip('"').strip("\n").strip('"').strip(" ")
|
12 |
-
) # 防止小白拷路径头尾带了空格和"和回车
|
13 |
-
out, _ = (
|
14 |
-
ffmpeg.input(file, threads=0)
|
15 |
-
.output("-", format="f32le", acodec="pcm_f32le", ac=1, ar=sr)
|
16 |
-
.run(cmd=["ffmpeg", "-nostdin"], capture_stdout=True, capture_stderr=True)
|
17 |
-
)
|
18 |
-
except Exception as e:
|
19 |
-
raise RuntimeError(f"Failed to load audio: {e}")
|
20 |
-
|
21 |
-
return np.frombuffer(out, np.float32).flatten()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/AIGC-Audio/AudioGPT/NeuralSeq/data_gen/tts/emotion/test_emotion.py
DELETED
@@ -1,184 +0,0 @@
|
|
1 |
-
#!/usr/bin/env python3 -u
|
2 |
-
# Copyright (c) Facebook, Inc. and its affiliates.
|
3 |
-
#
|
4 |
-
# This source code is licensed under the MIT license found in the
|
5 |
-
# LICENSE file in the root directory of this source tree.
|
6 |
-
|
7 |
-
"""
|
8 |
-
Run inference for pre-processed data with a trained model.
|
9 |
-
"""
|
10 |
-
|
11 |
-
import logging
|
12 |
-
import math
|
13 |
-
import numpy, math, pdb, sys, random
|
14 |
-
import time, os, itertools, shutil, importlib
|
15 |
-
import argparse
|
16 |
-
import os
|
17 |
-
import sys
|
18 |
-
import glob
|
19 |
-
from sklearn import metrics
|
20 |
-
import soundfile as sf
|
21 |
-
#import sentencepiece as spm
|
22 |
-
import torch
|
23 |
-
import inference as encoder
|
24 |
-
import torch.nn as nn
|
25 |
-
import torch.nn.functional as F
|
26 |
-
from pathlib import Path
|
27 |
-
logger = logging.getLogger(__name__)
|
28 |
-
logger.setLevel(logging.INFO)
|
29 |
-
from resemblyzer import VoiceEncoder, preprocess_wav
|
30 |
-
|
31 |
-
|
32 |
-
def tuneThresholdfromScore(scores, labels, target_fa, target_fr=None):
|
33 |
-
fpr, tpr, thresholds = metrics.roc_curve(labels, scores, pos_label=1)
|
34 |
-
fnr = 1 - tpr
|
35 |
-
|
36 |
-
fnr = fnr * 100
|
37 |
-
fpr = fpr * 100
|
38 |
-
|
39 |
-
tunedThreshold = [];
|
40 |
-
if target_fr:
|
41 |
-
for tfr in target_fr:
|
42 |
-
idx = numpy.nanargmin(numpy.absolute((tfr - fnr)))
|
43 |
-
tunedThreshold.append([thresholds[idx], fpr[idx], fnr[idx]]);
|
44 |
-
|
45 |
-
for tfa in target_fa:
|
46 |
-
idx = numpy.nanargmin(numpy.absolute((tfa - fpr))) # numpy.where(fpr<=tfa)[0][-1]
|
47 |
-
tunedThreshold.append([thresholds[idx], fpr[idx], fnr[idx]]);
|
48 |
-
|
49 |
-
idxE = numpy.nanargmin(numpy.absolute((fnr - fpr)))
|
50 |
-
eer = max(fpr[idxE], fnr[idxE])
|
51 |
-
|
52 |
-
return (tunedThreshold, eer, fpr, fnr);
|
53 |
-
|
54 |
-
|
55 |
-
def loadWAV(filename, max_frames, evalmode=True, num_eval=10):
|
56 |
-
# Maximum audio length
|
57 |
-
max_audio = max_frames * 160 + 240
|
58 |
-
|
59 |
-
# Read wav file and convert to torch tensor
|
60 |
-
audio,sample_rate = sf.read(filename)
|
61 |
-
|
62 |
-
feats_v0 = torch.from_numpy(audio).float()
|
63 |
-
audiosize = audio.shape[0]
|
64 |
-
|
65 |
-
if audiosize <= max_audio:
|
66 |
-
shortage = math.floor((max_audio - audiosize + 1) / 2)
|
67 |
-
audio = numpy.pad(audio, (shortage, shortage), 'constant', constant_values=0)
|
68 |
-
audiosize = audio.shape[0]
|
69 |
-
|
70 |
-
if evalmode:
|
71 |
-
startframe = numpy.linspace(0, audiosize - max_audio, num=num_eval)
|
72 |
-
else:
|
73 |
-
startframe = numpy.array([numpy.int64(random.random() * (audiosize - max_audio))])
|
74 |
-
feats = []
|
75 |
-
if evalmode and max_frames == 0:
|
76 |
-
feats.append(audio)
|
77 |
-
else:
|
78 |
-
for asf in startframe:
|
79 |
-
feats.append(audio[int(asf):int(asf) + max_audio])
|
80 |
-
feat = numpy.stack(feats, axis=0)
|
81 |
-
feat = torch.FloatTensor(feat)
|
82 |
-
return feat;
|
83 |
-
|
84 |
-
def evaluateFromList(listfilename, print_interval=100, test_path='', multi=False):
|
85 |
-
|
86 |
-
lines = []
|
87 |
-
files = []
|
88 |
-
feats = {}
|
89 |
-
tstart = time.time()
|
90 |
-
|
91 |
-
## Read all lines
|
92 |
-
with open(listfilename) as listfile:
|
93 |
-
while True:
|
94 |
-
line = listfile.readline();
|
95 |
-
if (not line):
|
96 |
-
break;
|
97 |
-
|
98 |
-
data = line.split();
|
99 |
-
|
100 |
-
## Append random label if missing
|
101 |
-
if len(data) == 2: data = [random.randint(0,1)] + data
|
102 |
-
|
103 |
-
files.append(data[1])
|
104 |
-
files.append(data[2])
|
105 |
-
lines.append(line)
|
106 |
-
|
107 |
-
setfiles = list(set(files))
|
108 |
-
setfiles.sort()
|
109 |
-
## Save all features to file
|
110 |
-
for idx, file in enumerate(setfiles):
|
111 |
-
# preprocessed_wav = encoder.preprocess_wav(os.path.join(test_path,file))
|
112 |
-
# embed = encoder.embed_utterance(preprocessed_wav)
|
113 |
-
processed_wav = preprocess_wav(os.path.join(test_path,file))
|
114 |
-
embed = voice_encoder.embed_utterance(processed_wav)
|
115 |
-
|
116 |
-
torch.cuda.empty_cache()
|
117 |
-
ref_feat = torch.from_numpy(embed).unsqueeze(0)
|
118 |
-
|
119 |
-
feats[file] = ref_feat
|
120 |
-
|
121 |
-
telapsed = time.time() - tstart
|
122 |
-
|
123 |
-
if idx % print_interval == 0:
|
124 |
-
sys.stdout.write("\rReading %d of %d: %.2f Hz, embedding size %d"%(idx,len(setfiles),idx/telapsed,ref_feat.size()[1]));
|
125 |
-
|
126 |
-
print('')
|
127 |
-
all_scores = [];
|
128 |
-
all_labels = [];
|
129 |
-
all_trials = [];
|
130 |
-
tstart = time.time()
|
131 |
-
|
132 |
-
## Read files and compute all scores
|
133 |
-
for idx, line in enumerate(lines):
|
134 |
-
|
135 |
-
data = line.split();
|
136 |
-
## Append random label if missing
|
137 |
-
if len(data) == 2: data = [random.randint(0,1)] + data
|
138 |
-
|
139 |
-
ref_feat = feats[data[1]]
|
140 |
-
com_feat = feats[data[2]]
|
141 |
-
ref_feat = ref_feat.cuda()
|
142 |
-
com_feat = com_feat.cuda()
|
143 |
-
# normalize feats
|
144 |
-
ref_feat = F.normalize(ref_feat, p=2, dim=1)
|
145 |
-
com_feat = F.normalize(com_feat, p=2, dim=1)
|
146 |
-
|
147 |
-
dist = F.pairwise_distance(ref_feat.unsqueeze(-1), com_feat.unsqueeze(-1)).detach().cpu().numpy();
|
148 |
-
|
149 |
-
score = -1 * numpy.mean(dist);
|
150 |
-
|
151 |
-
all_scores.append(score);
|
152 |
-
all_labels.append(int(data[0]));
|
153 |
-
all_trials.append(data[1]+" "+data[2])
|
154 |
-
|
155 |
-
if idx % print_interval == 0:
|
156 |
-
telapsed = time.time() - tstart
|
157 |
-
sys.stdout.write("\rComputing %d of %d: %.2f Hz"%(idx,len(lines),idx/telapsed));
|
158 |
-
sys.stdout.flush();
|
159 |
-
|
160 |
-
print('\n')
|
161 |
-
|
162 |
-
return (all_scores, all_labels, all_trials);
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
if __name__ == '__main__':
|
167 |
-
|
168 |
-
parser = argparse.ArgumentParser("baseline")
|
169 |
-
parser.add_argument("--data_root", type=str, help="", required=True)
|
170 |
-
parser.add_argument("--list", type=str, help="", required=True)
|
171 |
-
parser.add_argument("--model_dir", type=str, help="model parameters for AudioEncoder", required=True)
|
172 |
-
|
173 |
-
args = parser.parse_args()
|
174 |
-
|
175 |
-
|
176 |
-
# Load the models one by one.
|
177 |
-
print("Preparing the encoder...")
|
178 |
-
# encoder.load_model(Path(args.model_dir))
|
179 |
-
print("Insert the wav file name...")
|
180 |
-
voice_encoder = VoiceEncoder().cuda()
|
181 |
-
|
182 |
-
sc, lab, trials = evaluateFromList(args.list, print_interval=100, test_path=args.data_root)
|
183 |
-
result = tuneThresholdfromScore(sc, lab, [1, 0.1]);
|
184 |
-
print('EER %2.4f'%result[1])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/AIGText/GlyphControl/ldm/modules/encoders/__init__.py
DELETED
File without changes
|
spaces/Ababababababbababa/Ashaar/poetry_diacritizer/dataset.py
DELETED
@@ -1,238 +0,0 @@
|
|
1 |
-
"""
|
2 |
-
Loading the diacritization dataset
|
3 |
-
"""
|
4 |
-
|
5 |
-
import os
|
6 |
-
|
7 |
-
from diacritization_evaluation import util
|
8 |
-
import pandas as pd
|
9 |
-
import torch
|
10 |
-
from torch.utils.data import DataLoader, Dataset
|
11 |
-
|
12 |
-
from .config_manager import ConfigManager
|
13 |
-
|
14 |
-
BASIC_HARAQAT = {
|
15 |
-
"َ": "Fatha ",
|
16 |
-
"ً": "Fathatah ",
|
17 |
-
"ُ": "Damma ",
|
18 |
-
"ٌ": "Dammatan ",
|
19 |
-
"ِ": "Kasra ",
|
20 |
-
"ٍ": "Kasratan ",
|
21 |
-
"ْ": "Sukun ",
|
22 |
-
"ّ": "Shaddah ",
|
23 |
-
}
|
24 |
-
|
25 |
-
|
26 |
-
class DiacritizationDataset(Dataset):
|
27 |
-
"""
|
28 |
-
The diacritization dataset
|
29 |
-
"""
|
30 |
-
|
31 |
-
def __init__(self, config_manager: ConfigManager, list_ids, data):
|
32 |
-
"Initialization"
|
33 |
-
self.list_ids = list_ids
|
34 |
-
self.data = data
|
35 |
-
self.text_encoder = config_manager.text_encoder
|
36 |
-
self.config = config_manager.config
|
37 |
-
|
38 |
-
def __len__(self):
|
39 |
-
"Denotes the total number of samples"
|
40 |
-
return len(self.list_ids)
|
41 |
-
|
42 |
-
def preprocess(self, book):
|
43 |
-
out = ""
|
44 |
-
i = 0
|
45 |
-
while i < len(book):
|
46 |
-
if i < len(book) - 1:
|
47 |
-
if book[i] in BASIC_HARAQAT and book[i + 1] in BASIC_HARAQAT:
|
48 |
-
i += 1
|
49 |
-
continue
|
50 |
-
out += book[i]
|
51 |
-
i += 1
|
52 |
-
return out
|
53 |
-
|
54 |
-
def __getitem__(self, index):
|
55 |
-
"Generates one sample of data"
|
56 |
-
# Select sample
|
57 |
-
id = self.list_ids[index]
|
58 |
-
if self.config["is_data_preprocessed"]:
|
59 |
-
data = self.data.iloc[id]
|
60 |
-
inputs = torch.Tensor(self.text_encoder.input_to_sequence(data[1]))
|
61 |
-
targets = torch.Tensor(
|
62 |
-
self.text_encoder.target_to_sequence(
|
63 |
-
data[2].split(self.config["diacritics_separator"])
|
64 |
-
)
|
65 |
-
)
|
66 |
-
return inputs, targets, data[0]
|
67 |
-
|
68 |
-
data = self.data[id]
|
69 |
-
non_cleaned = data
|
70 |
-
|
71 |
-
data = self.text_encoder.clean(data)
|
72 |
-
data = data[: self.config["max_sen_len"]]
|
73 |
-
text, inputs, diacritics = util.extract_haraqat(data)
|
74 |
-
|
75 |
-
inputs = torch.Tensor(self.text_encoder.input_to_sequence("".join(inputs)))
|
76 |
-
diacritics = torch.Tensor(self.text_encoder.target_to_sequence(diacritics))
|
77 |
-
|
78 |
-
return inputs, diacritics, text
|
79 |
-
|
80 |
-
|
81 |
-
def collate_fn(data):
|
82 |
-
"""
|
83 |
-
Padding the input and output sequences
|
84 |
-
"""
|
85 |
-
|
86 |
-
def merge(sequences):
|
87 |
-
lengths = [len(seq) for seq in sequences]
|
88 |
-
padded_seqs = torch.zeros(len(sequences), max(lengths)).long()
|
89 |
-
for i, seq in enumerate(sequences):
|
90 |
-
end = lengths[i]
|
91 |
-
padded_seqs[i, :end] = seq[:end]
|
92 |
-
return padded_seqs, lengths
|
93 |
-
|
94 |
-
data.sort(key=lambda x: len(x[0]), reverse=True)
|
95 |
-
|
96 |
-
# separate source and target sequences
|
97 |
-
src_seqs, trg_seqs, original = zip(*data)
|
98 |
-
|
99 |
-
# merge sequences (from tuple of 1D tensor to 2D tensor)
|
100 |
-
src_seqs, src_lengths = merge(src_seqs)
|
101 |
-
trg_seqs, trg_lengths = merge(trg_seqs)
|
102 |
-
|
103 |
-
batch = {
|
104 |
-
"original": original,
|
105 |
-
"src": src_seqs,
|
106 |
-
"target": trg_seqs,
|
107 |
-
"lengths": torch.LongTensor(src_lengths), # src_lengths = trg_lengths
|
108 |
-
}
|
109 |
-
return batch
|
110 |
-
|
111 |
-
|
112 |
-
def load_training_data(config_manager: ConfigManager, loader_parameters):
|
113 |
-
"""
|
114 |
-
Loading the training data using pandas
|
115 |
-
"""
|
116 |
-
|
117 |
-
if not config_manager.config["load_training_data"]:
|
118 |
-
return []
|
119 |
-
|
120 |
-
path = os.path.join(config_manager.data_dir, "train.csv")
|
121 |
-
if config_manager.config["is_data_preprocessed"]:
|
122 |
-
train_data = pd.read_csv(
|
123 |
-
path,
|
124 |
-
encoding="utf-8",
|
125 |
-
sep=config_manager.config["data_separator"],
|
126 |
-
nrows=config_manager.config["n_training_examples"],
|
127 |
-
header=None,
|
128 |
-
)
|
129 |
-
|
130 |
-
# train_data = train_data[train_data[0] <= config_manager.config["max_len"]]
|
131 |
-
training_set = DiacritizationDataset(
|
132 |
-
config_manager, train_data.index, train_data
|
133 |
-
)
|
134 |
-
else:
|
135 |
-
with open(path, encoding="utf8") as file:
|
136 |
-
train_data = file.readlines()
|
137 |
-
train_data = [
|
138 |
-
text
|
139 |
-
for text in train_data
|
140 |
-
if len(text) <= config_manager.config["max_len"] and len(text) > 0
|
141 |
-
]
|
142 |
-
training_set = DiacritizationDataset(
|
143 |
-
config_manager, [idx for idx in range(len(train_data))], train_data
|
144 |
-
)
|
145 |
-
|
146 |
-
train_iterator = DataLoader(
|
147 |
-
training_set, collate_fn=collate_fn, **loader_parameters
|
148 |
-
)
|
149 |
-
|
150 |
-
print(f"Length of training iterator = {len(train_iterator)}")
|
151 |
-
return train_iterator
|
152 |
-
|
153 |
-
|
154 |
-
def load_test_data(config_manager: ConfigManager, loader_parameters):
|
155 |
-
"""
|
156 |
-
Loading the test data using pandas
|
157 |
-
"""
|
158 |
-
if not config_manager.config["load_test_data"]:
|
159 |
-
return []
|
160 |
-
test_file_name = config_manager.config.get("test_file_name", "test.csv")
|
161 |
-
path = os.path.join(config_manager.data_dir, test_file_name)
|
162 |
-
if config_manager.config["is_data_preprocessed"]:
|
163 |
-
test_data = pd.read_csv(
|
164 |
-
path,
|
165 |
-
encoding="utf-8",
|
166 |
-
sep=config_manager.config["data_separator"],
|
167 |
-
nrows=config_manager.config["n_test_examples"],
|
168 |
-
header=None,
|
169 |
-
)
|
170 |
-
# test_data = test_data[test_data[0] <= config_manager.config["max_len"]]
|
171 |
-
test_dataset = DiacritizationDataset(config_manager, test_data.index, test_data)
|
172 |
-
else:
|
173 |
-
with open(path, encoding="utf8") as file:
|
174 |
-
test_data = file.readlines()
|
175 |
-
max_len = config_manager.config["max_len"]
|
176 |
-
test_data = [text[:max_len] for text in test_data]
|
177 |
-
test_dataset = DiacritizationDataset(
|
178 |
-
config_manager, [idx for idx in range(len(test_data))], test_data
|
179 |
-
)
|
180 |
-
|
181 |
-
test_iterator = DataLoader(test_dataset, collate_fn=collate_fn, **loader_parameters)
|
182 |
-
|
183 |
-
print(f"Length of test iterator = {len(test_iterator)}")
|
184 |
-
return test_iterator
|
185 |
-
|
186 |
-
|
187 |
-
def load_validation_data(config_manager: ConfigManager, loader_parameters):
|
188 |
-
"""
|
189 |
-
Loading the validation data using pandas
|
190 |
-
"""
|
191 |
-
|
192 |
-
if not config_manager.config["load_validation_data"]:
|
193 |
-
return []
|
194 |
-
path = os.path.join(config_manager.data_dir, "eval.csv")
|
195 |
-
if config_manager.config["is_data_preprocessed"]:
|
196 |
-
valid_data = pd.read_csv(
|
197 |
-
path,
|
198 |
-
encoding="utf-8",
|
199 |
-
sep=config_manager.config["data_separator"],
|
200 |
-
nrows=config_manager.config["n_validation_examples"],
|
201 |
-
header=None,
|
202 |
-
)
|
203 |
-
valid_data = valid_data[valid_data[0] <= config_manager.config["max_len"]]
|
204 |
-
valid_dataset = DiacritizationDataset(
|
205 |
-
config_manager, valid_data.index, valid_data
|
206 |
-
)
|
207 |
-
else:
|
208 |
-
with open(path, encoding="utf8") as file:
|
209 |
-
valid_data = file.readlines()
|
210 |
-
|
211 |
-
max_len = config_manager.config["max_len"]
|
212 |
-
valid_data = [text[:max_len] for text in valid_data]
|
213 |
-
valid_dataset = DiacritizationDataset(
|
214 |
-
config_manager, [idx for idx in range(len(valid_data))], valid_data
|
215 |
-
)
|
216 |
-
|
217 |
-
valid_iterator = DataLoader(
|
218 |
-
valid_dataset, collate_fn=collate_fn, **loader_parameters
|
219 |
-
)
|
220 |
-
|
221 |
-
print(f"Length of valid iterator = {len(valid_iterator)}")
|
222 |
-
return valid_iterator
|
223 |
-
|
224 |
-
|
225 |
-
def load_iterators(config_manager: ConfigManager):
|
226 |
-
"""
|
227 |
-
Load the data iterators
|
228 |
-
Args:
|
229 |
-
"""
|
230 |
-
params = {
|
231 |
-
"batch_size": config_manager.config["batch_size"],
|
232 |
-
"shuffle": True,
|
233 |
-
"num_workers": 2,
|
234 |
-
}
|
235 |
-
train_iterator = load_training_data(config_manager, loader_parameters=params)
|
236 |
-
valid_iterator = load_validation_data(config_manager, loader_parameters=params)
|
237 |
-
test_iterator = load_test_data(config_manager, loader_parameters=params)
|
238 |
-
return train_iterator, test_iterator, valid_iterator
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Abdllh/AraPoet/app.py
DELETED
@@ -1,121 +0,0 @@
|
|
1 |
-
# coding=utf8
|
2 |
-
|
3 |
-
import json
|
4 |
-
import torch
|
5 |
-
import gradio as gr
|
6 |
-
import pyarabic.araby as araby
|
7 |
-
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM, AutoConfig
|
8 |
-
|
9 |
-
feature_names = [
|
10 |
-
"Title",
|
11 |
-
"Meter",
|
12 |
-
"Theme",
|
13 |
-
"Name",
|
14 |
-
"Era",
|
15 |
-
"Country",
|
16 |
-
"Type"
|
17 |
-
]
|
18 |
-
|
19 |
-
with open("./poet_names.json", 'r', encoding="utf-8") as fin:
|
20 |
-
poet_names = json.load(fin)
|
21 |
-
|
22 |
-
def normalize_text(text):
|
23 |
-
text = araby.strip_tatweel(text)
|
24 |
-
return text
|
25 |
-
|
26 |
-
def generate_poem(country, era, meter, theme, lang_type, poet, num_lines, num_poems, title):
|
27 |
-
|
28 |
-
num_poems = int(num_poems)
|
29 |
-
prompt = title
|
30 |
-
prompt = normalize_text(prompt)
|
31 |
-
|
32 |
-
features = [prompt, meter, theme, poet, era, country, lang_type]
|
33 |
-
|
34 |
-
prompt = ""
|
35 |
-
for name, feat in zip(feature_names, features):
|
36 |
-
prompt += f"{name}: {feat}; "
|
37 |
-
prompt += f"Length: {num_lines}; Poem:"
|
38 |
-
|
39 |
-
num_beams = 5
|
40 |
-
top_k = 50
|
41 |
-
top_p = 0.9
|
42 |
-
r_penalty = 5.
|
43 |
-
|
44 |
-
input_ids = torch.tensor(tokenizer.encode(prompt)).unsqueeze(0)
|
45 |
-
print(f"> Running: {prompt} | {num_poems} Poems")
|
46 |
-
outputs = model.generate(input_ids=input_ids,
|
47 |
-
min_length=32,
|
48 |
-
max_length=256,
|
49 |
-
do_sample=True,
|
50 |
-
top_k=top_k,
|
51 |
-
top_p=top_p,
|
52 |
-
repetition_penalty=r_penalty,
|
53 |
-
num_beams=num_beams,
|
54 |
-
num_return_sequences=num_poems,
|
55 |
-
early_stopping=True
|
56 |
-
)
|
57 |
-
|
58 |
-
poems = []
|
59 |
-
print(f"> # of Outputs: {len(outputs)}")
|
60 |
-
for output in outputs:
|
61 |
-
raw = tokenizer.decode(output)
|
62 |
-
raw = raw.replace("<pad>", "").replace("</s>", "")
|
63 |
-
print("="*100)
|
64 |
-
print(raw)
|
65 |
-
print("="*100)
|
66 |
-
poems += ['\n'.join(raw.split("<s>"))]
|
67 |
-
|
68 |
-
return "\n\n".join(poems)
|
69 |
-
|
70 |
-
meters = ['البسيط', 'التفعيله', 'الحداء', 'الخفيف', 'الدوبيت', 'الرجز', 'الرمل', 'السريع', 'السلسلة', 'الصخري', 'الطويل', 'الكامل', 'الكان كان', 'اللويحاني', 'المتدارك', 'المتقارب', 'المجتث', 'المديد', 'المسحوب', 'المضارع', 'المقتضب', 'المنسرح', 'المواليا', 'الموشح', 'الهجيني', 'الهزج', 'الوافر', 'بحر أحذ الكامل', 'بحر أحذ المديد', 'بحر أحذ الوافر', 'بحر البسيط', 'بحر التفعيله', 'بحر الخبب', 'بحر الخفيف', 'بحر الدوبيت', 'بحر الرجز', 'بحر الرمل', 'بحر السريع', 'بحر السلسلة', 'بحر الطويل', 'بحر القوما', 'بحر الكامل', 'بحر الكامل المقطوع', 'بحر المتدارك', 'بحر المتدارك المنهوك', 'بحر المتقارب', 'بحر المجتث', 'بحر المديد', 'بحر المضارع', 'بحر المقتضب', 'بحر المنسرح', 'بحر المواليا', 'بحر الهزج', 'بحر الوافر', 'بحر تفعيلة الرجز', 'بحر تفعيلة الرمل', 'بحر تفعيلة الكامل', 'بحر تفعيلة المتقارب', 'بحر مجزوء البسيط', 'بحر مجزوء الخفيف', 'بحر مجزوء الدوبيت', 'بحر مجزوء الرجز', 'بحر مجزوء الرمل', 'بحر مجزوء الرمل ', 'بحر مجزوء السريع', 'بحر مجزوء الطويل', 'بحر مجزوء الكامل', 'بحر مجزوء المتدارك', 'بحر مجزوء المتقارب', 'بحر مجزوء المجتث', 'بحر مجزوء المديد', 'بحر مجزوء المنسرح', 'بحر مجزوء المواليا', 'بحر مجزوء الهزج', 'بحر مجزوء الوافر', 'بحر مجزوء موشح', 'بحر مخلع البسيط', 'بحر مخلع الرجز', 'بحر مخلع الرمل', 'بحر مخلع السريع', 'بحر مخلع الكامل', 'بحر مخلع موشح', 'بحر مربع البسيط', 'بحر مربع الرجز', 'بحر مشطور الرجز', 'بحر مشطور السريع', 'بحر مشطور الطويل', 'بحر منهوك البسيط', 'بحر منهوك الرجز', 'بحر منهوك الكامل', 'بحر منهوك المنسرح', 'بحر موشح', 'بسيط', 'زجل', 'شعر التفعيلة', 'شعر حر', 'عامي', 'عدة أبحر', 'عموديه', 'مجزوء الخفيف', 'نثريه', 'None']
|
71 |
-
themes = ['قصيدة اعتذار', 'قصيدة الاناشيد', 'قصيدة المعلقات', 'قصيدة حزينه', 'قصيدة دينية', 'قصيدة ذم', 'قصيدة رثاء', 'قصيدة رومنسيه', 'قصيدة سياسية', 'قصيدة شوق', 'قصيدة عامه', 'قصيدة عتاب', 'قصيدة غزل', 'قصيدة فراق', 'قصيدة قصيره', 'قصيدة مدح', 'قصيدة هجاء', 'قصيدة وطنيه', 'None']
|
72 |
-
language_types = ['شعبي', 'عامي', 'فصحى', 'فصيح', '-', 'None']
|
73 |
-
poet_era = ['العصر الأموي', 'العصر الأندلسي', 'العصر الأيوبي', 'العصر الإسلامي', 'العصر الجاهلي', 'العصر الحديث', 'العصر العباسي', 'العصر العثماني', 'العصر الفاطمي', 'العصر المملوكي', 'المخضرمين', 'المغرب والأندلس', 'عصر بين الدولتين', 'قبل الإسلام', 'None']
|
74 |
-
countries = ['الأردن', 'الإمارات', 'البحرين', 'الجزائر', 'السعودية', 'السنغال', 'السودان', 'الصومال', 'العراق', 'الكويت', 'المغرب', 'اليمن', 'تونس', 'سوريا', 'سورية', 'عمان', 'فلسطين', 'قطر', 'لبنان', 'ليبيا', 'مصر', 'موريتانيا', 'None']
|
75 |
-
|
76 |
-
tokenizer: AutoTokenizer = AutoTokenizer.from_pretrained("bkhmsi/arapoet-mt5", use_auth_token="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")
|
77 |
-
model: AutoModelForSeq2SeqLM = AutoModelForSeq2SeqLM.from_pretrained("bkhmsi/arapoet-mt5", use_auth_token="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")
|
78 |
-
model.eval()
|
79 |
-
|
80 |
-
title = ""
|
81 |
-
with gr.Blocks(title=title) as demo:
|
82 |
-
inputs = []
|
83 |
-
|
84 |
-
gr.Markdown(
|
85 |
-
"""
|
86 |
-
# AraPoet: Controlled Arabic Poetry Generation
|
87 |
-
|
88 |
-
The model hosted here is a finetuned version of [mT5-large](https://huggingface.co/google/mt5-large) (∼ 1.2B parameters) on the largest repository of Arabic poems, the [ashaar](https://huggingface.co/datasets/arbml/ashaar) dataset.
|
89 |
-
The model can be conditioned on a set of attributes to control the style of the generated poem.
|
90 |
-
Namely: the poet name, country, era, meter, theme, language type, title and the length of the poem.
|
91 |
-
You can start by clicking on one of the examples below or try your own input.
|
92 |
-
"""
|
93 |
-
)
|
94 |
-
|
95 |
-
with gr.Row():
|
96 |
-
inputs += [gr.Dropdown(countries, label="Country", value="مصر")]
|
97 |
-
inputs += [gr.Dropdown(poet_era, label="Era", value="العصر الحديث")]
|
98 |
-
with gr.Row():
|
99 |
-
inputs += [gr.Dropdown(meters, label="Meter", value="بحر السريع")]
|
100 |
-
inputs += [gr.Dropdown(themes, label="Theme", value="قصيدة رومنسيه")]
|
101 |
-
with gr.Row():
|
102 |
-
inputs += [gr.Dropdown(language_types, label="Language Type", value="فصحى")]
|
103 |
-
inputs += [gr.Dropdown(poet_names, label="Poet", value="أحمد شوقي")]
|
104 |
-
with gr.Row():
|
105 |
-
inputs += [gr.Slider(2, 20, value=6, step=1, label="Number of Lines")]
|
106 |
-
inputs += [gr.Slider(1, 4, value=1, step=1, label="Number of Samples")]
|
107 |
-
with gr.Row():
|
108 |
-
inputs += [gr.Textbox(label="Title", value="إثن عنان القلب واسلم به")]
|
109 |
-
|
110 |
-
btn = gr.Button("Generate")
|
111 |
-
examples = gr.Examples(examples="./examples", inputs=inputs)
|
112 |
-
btn.click(generate_poem, inputs, gr.TextArea(label="Generation"))
|
113 |
-
|
114 |
-
|
115 |
-
gr.Markdown(
|
116 |
-
"""
|
117 |
-
Checkout our [AraPoet Preprint](https://github.com/BKHMSI/BKHMSI.github.io/blob/master/archive/resources/AraPoet.pdf) for more details about the model.
|
118 |
-
"""
|
119 |
-
)
|
120 |
-
|
121 |
-
demo.launch()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/AchyuthGamer/OpenGPT-Chat-UI/src/routes/conversation/[id]/worker.js
DELETED
@@ -1,252 +0,0 @@
|
|
1 |
-
import { pipeline, env } from "@xenova/transformers";
|
2 |
-
import init, { Model } from "./phi/m.js";
|
3 |
-
import URI from "urijs"
|
4 |
-
|
5 |
-
// Shamelessly stolen from Transformers.js
|
6 |
-
|
7 |
-
export async function tryCache(cache, ...names) {
|
8 |
-
for (let name of names) {
|
9 |
-
try {
|
10 |
-
console.log(name)
|
11 |
-
let result = await cache.match(name);
|
12 |
-
if (result) return result;
|
13 |
-
} catch (e) {
|
14 |
-
continue;
|
15 |
-
}
|
16 |
-
}
|
17 |
-
return undefined;
|
18 |
-
}
|
19 |
-
|
20 |
-
async function read_stream(url, response) {
|
21 |
-
const reader = response.body.getReader();
|
22 |
-
const contentLength = +response.headers.get('Content-Length');
|
23 |
-
let receivedLength = 0;
|
24 |
-
let chunks = [];
|
25 |
-
let uri = new URI(url)
|
26 |
-
|
27 |
-
while(true) {
|
28 |
-
const {done, value} = await reader.read();
|
29 |
-
if (done) {
|
30 |
-
break;
|
31 |
-
}
|
32 |
-
chunks.push(value);
|
33 |
-
receivedLength += value.length;
|
34 |
-
let percent = (receivedLength / contentLength) * 100
|
35 |
-
self.postMessage({ status: "progress", file: uri.filename(), progress: percent });
|
36 |
-
}
|
37 |
-
|
38 |
-
let chunksAll = new Uint8Array(receivedLength);
|
39 |
-
let position = 0;
|
40 |
-
for(let chunk of chunks) {
|
41 |
-
chunksAll.set(chunk, position);
|
42 |
-
position += chunk.length;
|
43 |
-
}
|
44 |
-
return chunksAll
|
45 |
-
}
|
46 |
-
|
47 |
-
async function fetchArrayBuffer(url) {
|
48 |
-
let cache = await caches.open('transformers-cache');
|
49 |
-
|
50 |
-
const response = await tryCache(cache, url);
|
51 |
-
if (response != undefined) {
|
52 |
-
console.log(url)
|
53 |
-
let res = await read_stream(url, response)
|
54 |
-
cache.put(url, new Response(res, {
|
55 |
-
headers: response.headers
|
56 |
-
}));
|
57 |
-
return new Uint8Array(res);
|
58 |
-
}
|
59 |
-
else {
|
60 |
-
const response = await fetch(url);
|
61 |
-
let res = await read_stream(url, response)
|
62 |
-
cache.put(url, new Response(res, {
|
63 |
-
headers: response.headers,
|
64 |
-
}));
|
65 |
-
return new Uint8Array(res);
|
66 |
-
}
|
67 |
-
|
68 |
-
|
69 |
-
}
|
70 |
-
|
71 |
-
class Phi {
|
72 |
-
static instance = {};
|
73 |
-
|
74 |
-
static async getInstance(weightsURL, modelID, tokenizerURL, quantized) {
|
75 |
-
// load individual modelID only once
|
76 |
-
if (!this.instance[modelID]) {
|
77 |
-
await init();
|
78 |
-
|
79 |
-
self.postMessage({ status: "loading", message: "Loading Model" });
|
80 |
-
|
81 |
-
const [weightsArrayU8, tokenizerArrayU8] = await Promise.all([
|
82 |
-
fetchArrayBuffer(weightsURL),
|
83 |
-
fetchArrayBuffer(tokenizerURL),
|
84 |
-
]);
|
85 |
-
|
86 |
-
self.postMessage({ status: "init_model" });
|
87 |
-
|
88 |
-
this.instance[modelID] = new Model(
|
89 |
-
weightsArrayU8,
|
90 |
-
tokenizerArrayU8,
|
91 |
-
quantized
|
92 |
-
);
|
93 |
-
self.postMessage({ status: "ready", model: "phi-1_5" });
|
94 |
-
}
|
95 |
-
return this.instance[modelID];
|
96 |
-
}
|
97 |
-
}
|
98 |
-
|
99 |
-
export class FlanPipeline {
|
100 |
-
static curr_model = "";
|
101 |
-
static instance = null;
|
102 |
-
|
103 |
-
static async getInstance(progress_callback = null, model, task) {
|
104 |
-
if (this.instance === null) {
|
105 |
-
this.instance = pipeline(task, model, { progress_callback });
|
106 |
-
this.curr_model = model;
|
107 |
-
} else {
|
108 |
-
if (this.curr_model != model) {
|
109 |
-
this.instance = pipeline(task, model, { progress_callback });
|
110 |
-
this.curr_model = model;
|
111 |
-
}
|
112 |
-
}
|
113 |
-
return this.instance;
|
114 |
-
}
|
115 |
-
}
|
116 |
-
|
117 |
-
let controller = null;
|
118 |
-
let phi_model = null;
|
119 |
-
|
120 |
-
// Listen for messages from the main thread
|
121 |
-
self.addEventListener("message", async (event) => {
|
122 |
-
if (event.data.command != "abort") {
|
123 |
-
if (event.data.is_phi) {
|
124 |
-
controller = new AbortController();
|
125 |
-
generate_phi(event.data);
|
126 |
-
}
|
127 |
-
else {
|
128 |
-
let pipe = await FlanPipeline.getInstance(
|
129 |
-
(x) => {
|
130 |
-
self.postMessage(x);
|
131 |
-
},
|
132 |
-
event.data.model,
|
133 |
-
event.data.task
|
134 |
-
);
|
135 |
-
|
136 |
-
let output = await pipe(event.data.text, {
|
137 |
-
max_new_tokens: event.data.max_new_tokens,
|
138 |
-
temperature: event.data.temperature,
|
139 |
-
callback_function: (x) => {
|
140 |
-
self.postMessage({
|
141 |
-
status: "update",
|
142 |
-
output: pipe.tokenizer.decode(x[0].output_token_ids, { skip_special_tokens: true }),
|
143 |
-
id_now: event.data.id_now,
|
144 |
-
});
|
145 |
-
},
|
146 |
-
});
|
147 |
-
|
148 |
-
// Send the output back to the main thread
|
149 |
-
self.postMessage({
|
150 |
-
status: "complete",
|
151 |
-
output: output,
|
152 |
-
searchID: event.data.searchID,
|
153 |
-
id_now: event.data.id_now,
|
154 |
-
});
|
155 |
-
}
|
156 |
-
}
|
157 |
-
else {
|
158 |
-
if (controller != null)
|
159 |
-
controller.abort();
|
160 |
-
}
|
161 |
-
});
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
async function generate_phi(data) {
|
166 |
-
const tokenizerURL = "https://huggingface.co/microsoft/phi-1_5/raw/main/tokenizer.json";
|
167 |
-
const weightsURL = "https://huggingface.co/lmz/candle-quantized-phi/resolve/main/model-q4k.gguf";
|
168 |
-
let prompt = data.text
|
169 |
-
let maxSeqLen = data.max_new_tokens
|
170 |
-
let temp = data.temperature
|
171 |
-
let modelID = 0;
|
172 |
-
let quantized = true;
|
173 |
-
let top_p = 1;
|
174 |
-
let repeatPenalty = 1.1;
|
175 |
-
let seed = 299792458;
|
176 |
-
|
177 |
-
self.postMessage({ status: "initiate", file: "tokenizer.json", name: "phi-1_5" }); // Fake init
|
178 |
-
|
179 |
-
try {
|
180 |
-
const model = await Phi.getInstance(
|
181 |
-
weightsURL,
|
182 |
-
modelID,
|
183 |
-
tokenizerURL,
|
184 |
-
quantized
|
185 |
-
);
|
186 |
-
|
187 |
-
const firstToken = model.init_with_prompt(
|
188 |
-
prompt,
|
189 |
-
temp,
|
190 |
-
top_p,
|
191 |
-
repeatPenalty,
|
192 |
-
64,
|
193 |
-
BigInt(seed)
|
194 |
-
);
|
195 |
-
const seq_len = 2048;
|
196 |
-
|
197 |
-
let sentence = firstToken;
|
198 |
-
let maxTokens = maxSeqLen ? maxSeqLen : seq_len - prompt.length - 1;
|
199 |
-
let startTime = performance.now();
|
200 |
-
let tokensCount = 0;
|
201 |
-
|
202 |
-
while (tokensCount < maxTokens) {
|
203 |
-
await new Promise(async (resolve) => {
|
204 |
-
if (controller && controller.signal.aborted) {
|
205 |
-
self.postMessage({
|
206 |
-
status: "aborted",
|
207 |
-
message: "Aborted",
|
208 |
-
output: sentence,
|
209 |
-
searchID: data.searchID,
|
210 |
-
id_now: data.id_now,
|
211 |
-
});
|
212 |
-
return;
|
213 |
-
}
|
214 |
-
const token = await model.next_token();
|
215 |
-
if (token === "<|endoftext|>") {
|
216 |
-
self.postMessage({
|
217 |
-
status: "complete",
|
218 |
-
output: sentence,
|
219 |
-
searchID: data.searchID,
|
220 |
-
id_now: data.id_now,
|
221 |
-
});
|
222 |
-
return;
|
223 |
-
}
|
224 |
-
const tokensSec =
|
225 |
-
((tokensCount + 1) / (performance.now() - startTime)) * 1000;
|
226 |
-
|
227 |
-
sentence += token;
|
228 |
-
self.postMessage({
|
229 |
-
status: "update",
|
230 |
-
message: "Generating token",
|
231 |
-
token: token,
|
232 |
-
output: sentence,
|
233 |
-
totalTime: performance.now() - startTime,
|
234 |
-
tokensSec,
|
235 |
-
prompt: prompt,
|
236 |
-
id_now: data.id_now,
|
237 |
-
});
|
238 |
-
setTimeout(resolve, 0);
|
239 |
-
});
|
240 |
-
tokensCount++;
|
241 |
-
}
|
242 |
-
self.postMessage({
|
243 |
-
status: "complete",
|
244 |
-
output: sentence,
|
245 |
-
searchID: data.searchID,
|
246 |
-
id_now: data.id_now,
|
247 |
-
});
|
248 |
-
} catch (e) {
|
249 |
-
console.log(e)
|
250 |
-
self.postMessage({ error: e });
|
251 |
-
}
|
252 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/AchyuthGamer/OpenGPT/g4f/Provider/Ails.py
DELETED
@@ -1,106 +0,0 @@
|
|
1 |
-
from __future__ import annotations
|
2 |
-
|
3 |
-
import hashlib
|
4 |
-
import time
|
5 |
-
import uuid
|
6 |
-
import json
|
7 |
-
from datetime import datetime
|
8 |
-
from aiohttp import ClientSession
|
9 |
-
|
10 |
-
from ..typing import SHA256, AsyncGenerator
|
11 |
-
from .base_provider import AsyncGeneratorProvider
|
12 |
-
|
13 |
-
|
14 |
-
class Ails(AsyncGeneratorProvider):
|
15 |
-
url: str = "https://ai.ls"
|
16 |
-
working = True
|
17 |
-
supports_gpt_35_turbo = True
|
18 |
-
|
19 |
-
@staticmethod
|
20 |
-
async def create_async_generator(
|
21 |
-
model: str,
|
22 |
-
messages: list[dict[str, str]],
|
23 |
-
stream: bool,
|
24 |
-
proxy: str = None,
|
25 |
-
**kwargs
|
26 |
-
) -> AsyncGenerator:
|
27 |
-
headers = {
|
28 |
-
"authority": "api.caipacity.com",
|
29 |
-
"accept": "*/*",
|
30 |
-
"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",
|
31 |
-
"authorization": "Bearer free",
|
32 |
-
"client-id": str(uuid.uuid4()),
|
33 |
-
"client-v": "0.1.278",
|
34 |
-
"content-type": "application/json",
|
35 |
-
"origin": "https://ai.ls",
|
36 |
-
"referer": "https://ai.ls/",
|
37 |
-
"sec-ch-ua": '"Not.A/Brand";v="8", "Chromium";v="114", "Google Chrome";v="114"',
|
38 |
-
"sec-ch-ua-mobile": "?0",
|
39 |
-
"sec-ch-ua-platform": '"Windows"',
|
40 |
-
"sec-fetch-dest": "empty",
|
41 |
-
"sec-fetch-mode": "cors",
|
42 |
-
"sec-fetch-site": "cross-site",
|
43 |
-
"user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36",
|
44 |
-
"from-url": "https://ai.ls/?chat=1"
|
45 |
-
}
|
46 |
-
async with ClientSession(
|
47 |
-
headers=headers
|
48 |
-
) as session:
|
49 |
-
timestamp = _format_timestamp(int(time.time() * 1000))
|
50 |
-
json_data = {
|
51 |
-
"model": "gpt-3.5-turbo",
|
52 |
-
"temperature": kwargs.get("temperature", 0.6),
|
53 |
-
"stream": True,
|
54 |
-
"messages": messages,
|
55 |
-
"d": datetime.now().strftime("%Y-%m-%d"),
|
56 |
-
"t": timestamp,
|
57 |
-
"s": _hash({"t": timestamp, "m": messages[-1]["content"]}),
|
58 |
-
}
|
59 |
-
async with session.post(
|
60 |
-
"https://api.caipacity.com/v1/chat/completions",
|
61 |
-
proxy=proxy,
|
62 |
-
json=json_data
|
63 |
-
) as response:
|
64 |
-
response.raise_for_status()
|
65 |
-
start = "data: "
|
66 |
-
async for line in response.content:
|
67 |
-
line = line.decode('utf-8')
|
68 |
-
if line.startswith(start) and line != "data: [DONE]":
|
69 |
-
line = line[len(start):-1]
|
70 |
-
line = json.loads(line)
|
71 |
-
token = line["choices"][0]["delta"].get("content")
|
72 |
-
if token:
|
73 |
-
if "ai.ls" in token or "ai.ci" in token:
|
74 |
-
raise Exception("Response Error: " + token)
|
75 |
-
yield token
|
76 |
-
|
77 |
-
|
78 |
-
@classmethod
|
79 |
-
@property
|
80 |
-
def params(cls):
|
81 |
-
params = [
|
82 |
-
("model", "str"),
|
83 |
-
("messages", "list[dict[str, str]]"),
|
84 |
-
("stream", "bool"),
|
85 |
-
("temperature", "float"),
|
86 |
-
]
|
87 |
-
param = ", ".join([": ".join(p) for p in params])
|
88 |
-
return f"g4f.provider.{cls.__name__} supports: ({param})"
|
89 |
-
|
90 |
-
|
91 |
-
def _hash(json_data: dict[str, str]) -> SHA256:
|
92 |
-
base_string: str = "%s:%s:%s:%s" % (
|
93 |
-
json_data["t"],
|
94 |
-
json_data["m"],
|
95 |
-
"WI,2rU#_r:r~aF4aJ36[.Z(/8Rv93Rf",
|
96 |
-
len(json_data["m"]),
|
97 |
-
)
|
98 |
-
|
99 |
-
return SHA256(hashlib.sha256(base_string.encode()).hexdigest())
|
100 |
-
|
101 |
-
|
102 |
-
def _format_timestamp(timestamp: int) -> str:
|
103 |
-
e = timestamp
|
104 |
-
n = e % 10
|
105 |
-
r = n + 1 if n % 2 == 0 else n
|
106 |
-
return str(e - n + r)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Al-Chan/Vits_League_of_Legends_Yuumi_TTS/utils.py
DELETED
@@ -1,400 +0,0 @@
|
|
1 |
-
import os
|
2 |
-
import glob
|
3 |
-
import sys
|
4 |
-
import argparse
|
5 |
-
import logging
|
6 |
-
import json
|
7 |
-
import subprocess
|
8 |
-
import numpy as np
|
9 |
-
from scipy.io.wavfile import read
|
10 |
-
import torch
|
11 |
-
import regex as re
|
12 |
-
|
13 |
-
MATPLOTLIB_FLAG = False
|
14 |
-
|
15 |
-
logging.basicConfig(stream=sys.stdout, level=logging.DEBUG)
|
16 |
-
logger = logging
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
zh_pattern = re.compile(r'[\u4e00-\u9fa5]')
|
21 |
-
en_pattern = re.compile(r'[a-zA-Z]')
|
22 |
-
jp_pattern = re.compile(r'[\u3040-\u30ff\u31f0-\u31ff]')
|
23 |
-
kr_pattern = re.compile(r'[\uac00-\ud7af\u1100-\u11ff\u3130-\u318f\ua960-\ua97f]')
|
24 |
-
num_pattern=re.compile(r'[0-9]')
|
25 |
-
comma=r"(?<=[.。!!??;;,,、::'\"‘“”’()()《》「」~——])" #向前匹配但固定长度
|
26 |
-
tags={'ZH':'[ZH]','EN':'[EN]','JP':'[JA]','KR':'[KR]'}
|
27 |
-
|
28 |
-
def tag_cjke(text):
|
29 |
-
'''为中英日韩加tag,中日正则分不开,故先分句分离中日再识别,以应对大部分情况'''
|
30 |
-
sentences = re.split(r"([.。!!??;;,,、::'\"‘“”’()()【】《》「」~——]+ *(?![0-9]))", text) #分句,排除小数点
|
31 |
-
sentences.append("")
|
32 |
-
sentences = ["".join(i) for i in zip(sentences[0::2],sentences[1::2])]
|
33 |
-
# print(sentences)
|
34 |
-
prev_lang=None
|
35 |
-
tagged_text = ""
|
36 |
-
for s in sentences:
|
37 |
-
#全为符号跳过
|
38 |
-
nu = re.sub(r'[\s\p{P}]+', '', s, flags=re.U).strip()
|
39 |
-
if len(nu)==0:
|
40 |
-
continue
|
41 |
-
s = re.sub(r'[()()《》「」【】‘“”’]+', '', s)
|
42 |
-
jp=re.findall(jp_pattern, s)
|
43 |
-
#本句含日语字符判断为日语
|
44 |
-
if len(jp)>0:
|
45 |
-
prev_lang,tagged_jke=tag_jke(s,prev_lang)
|
46 |
-
tagged_text +=tagged_jke
|
47 |
-
else:
|
48 |
-
prev_lang,tagged_cke=tag_cke(s,prev_lang)
|
49 |
-
tagged_text +=tagged_cke
|
50 |
-
return tagged_text
|
51 |
-
|
52 |
-
def tag_jke(text,prev_sentence=None):
|
53 |
-
'''为英日韩加tag'''
|
54 |
-
# 初始化标记变量
|
55 |
-
tagged_text = ""
|
56 |
-
prev_lang = None
|
57 |
-
tagged=0
|
58 |
-
# 遍历文本
|
59 |
-
for char in text:
|
60 |
-
# 判断当前字符属于哪种语言
|
61 |
-
if jp_pattern.match(char):
|
62 |
-
lang = "JP"
|
63 |
-
elif zh_pattern.match(char):
|
64 |
-
lang = "JP"
|
65 |
-
elif kr_pattern.match(char):
|
66 |
-
lang = "KR"
|
67 |
-
elif en_pattern.match(char):
|
68 |
-
lang = "EN"
|
69 |
-
# elif num_pattern.match(char):
|
70 |
-
# lang = prev_sentence
|
71 |
-
else:
|
72 |
-
lang = None
|
73 |
-
tagged_text += char
|
74 |
-
continue
|
75 |
-
# 如果当前语言与上一个语言不同,就添加标记
|
76 |
-
if lang != prev_lang:
|
77 |
-
tagged=1
|
78 |
-
if prev_lang==None: # 开头
|
79 |
-
tagged_text =tags[lang]+tagged_text
|
80 |
-
else:
|
81 |
-
tagged_text =tagged_text+tags[prev_lang]+tags[lang]
|
82 |
-
|
83 |
-
# 重置标记变量
|
84 |
-
prev_lang = lang
|
85 |
-
|
86 |
-
# 添加当前字符到标记文本中
|
87 |
-
tagged_text += char
|
88 |
-
|
89 |
-
# 在最后一个语言的结尾添加对应的标记
|
90 |
-
if prev_lang:
|
91 |
-
tagged_text += tags[prev_lang]
|
92 |
-
if not tagged:
|
93 |
-
prev_lang=prev_sentence
|
94 |
-
tagged_text =tags[prev_lang]+tagged_text+tags[prev_lang]
|
95 |
-
|
96 |
-
return prev_lang,tagged_text
|
97 |
-
|
98 |
-
def tag_cke(text,prev_sentence=None):
|
99 |
-
'''为中英韩加tag'''
|
100 |
-
# 初始化标记变量
|
101 |
-
tagged_text = ""
|
102 |
-
prev_lang = None
|
103 |
-
# 是否全略过未标签
|
104 |
-
tagged=0
|
105 |
-
|
106 |
-
# 遍历文本
|
107 |
-
for char in text:
|
108 |
-
# 判断当前字符属于哪种语言
|
109 |
-
if zh_pattern.match(char):
|
110 |
-
lang = "ZH"
|
111 |
-
elif kr_pattern.match(char):
|
112 |
-
lang = "KR"
|
113 |
-
elif en_pattern.match(char):
|
114 |
-
lang = "EN"
|
115 |
-
# elif num_pattern.match(char):
|
116 |
-
# lang = prev_sentence
|
117 |
-
else:
|
118 |
-
# 略过
|
119 |
-
lang = None
|
120 |
-
tagged_text += char
|
121 |
-
continue
|
122 |
-
|
123 |
-
# 如果当前语言与上一个语言不同,添加标记
|
124 |
-
if lang != prev_lang:
|
125 |
-
tagged=1
|
126 |
-
if prev_lang==None: # 开头
|
127 |
-
tagged_text =tags[lang]+tagged_text
|
128 |
-
else:
|
129 |
-
tagged_text =tagged_text+tags[prev_lang]+tags[lang]
|
130 |
-
|
131 |
-
# 重置标记变量
|
132 |
-
prev_lang = lang
|
133 |
-
|
134 |
-
# 添加当前字符到标记文本中
|
135 |
-
tagged_text += char
|
136 |
-
|
137 |
-
# 在最后一个语言的结尾添加对应的标记
|
138 |
-
if prev_lang:
|
139 |
-
tagged_text += tags[prev_lang]
|
140 |
-
# 未标签则继承上一句标签
|
141 |
-
if tagged==0:
|
142 |
-
prev_lang=prev_sentence
|
143 |
-
tagged_text =tags[prev_lang]+tagged_text+tags[prev_lang]
|
144 |
-
return prev_lang,tagged_text
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
def load_checkpoint(checkpoint_path, model, optimizer=None, drop_speaker_emb=False):
|
149 |
-
assert os.path.isfile(checkpoint_path)
|
150 |
-
checkpoint_dict = torch.load(checkpoint_path, map_location='cpu')
|
151 |
-
iteration = checkpoint_dict['iteration']
|
152 |
-
learning_rate = checkpoint_dict['learning_rate']
|
153 |
-
if optimizer is not None:
|
154 |
-
optimizer.load_state_dict(checkpoint_dict['optimizer'])
|
155 |
-
saved_state_dict = checkpoint_dict['model']
|
156 |
-
if hasattr(model, 'module'):
|
157 |
-
state_dict = model.module.state_dict()
|
158 |
-
else:
|
159 |
-
state_dict = model.state_dict()
|
160 |
-
new_state_dict = {}
|
161 |
-
for k, v in state_dict.items():
|
162 |
-
try:
|
163 |
-
if k == 'emb_g.weight':
|
164 |
-
if drop_speaker_emb:
|
165 |
-
new_state_dict[k] = v
|
166 |
-
continue
|
167 |
-
v[:saved_state_dict[k].shape[0], :] = saved_state_dict[k]
|
168 |
-
new_state_dict[k] = v
|
169 |
-
else:
|
170 |
-
new_state_dict[k] = saved_state_dict[k]
|
171 |
-
except:
|
172 |
-
logger.info("%s is not in the checkpoint" % k)
|
173 |
-
new_state_dict[k] = v
|
174 |
-
if hasattr(model, 'module'):
|
175 |
-
model.module.load_state_dict(new_state_dict)
|
176 |
-
else:
|
177 |
-
model.load_state_dict(new_state_dict)
|
178 |
-
logger.info("Loaded checkpoint '{}' (iteration {})".format(
|
179 |
-
checkpoint_path, iteration))
|
180 |
-
return model, optimizer, learning_rate, iteration
|
181 |
-
|
182 |
-
|
183 |
-
def save_checkpoint(model, optimizer, learning_rate, iteration, checkpoint_path):
|
184 |
-
logger.info("Saving model and optimizer state at iteration {} to {}".format(
|
185 |
-
iteration, checkpoint_path))
|
186 |
-
if hasattr(model, 'module'):
|
187 |
-
state_dict = model.module.state_dict()
|
188 |
-
else:
|
189 |
-
state_dict = model.state_dict()
|
190 |
-
torch.save({'model': state_dict,
|
191 |
-
'iteration': iteration,
|
192 |
-
'optimizer': optimizer.state_dict() if optimizer is not None else None,
|
193 |
-
'learning_rate': learning_rate}, checkpoint_path)
|
194 |
-
|
195 |
-
|
196 |
-
def summarize(writer, global_step, scalars={}, histograms={}, images={}, audios={}, audio_sampling_rate=22050):
|
197 |
-
for k, v in scalars.items():
|
198 |
-
writer.add_scalar(k, v, global_step)
|
199 |
-
for k, v in histograms.items():
|
200 |
-
writer.add_histogram(k, v, global_step)
|
201 |
-
for k, v in images.items():
|
202 |
-
writer.add_image(k, v, global_step, dataformats='HWC')
|
203 |
-
for k, v in audios.items():
|
204 |
-
writer.add_audio(k, v, global_step, audio_sampling_rate)
|
205 |
-
|
206 |
-
|
207 |
-
def latest_checkpoint_path(dir_path, regex="G_*.pth"):
|
208 |
-
f_list = glob.glob(os.path.join(dir_path, regex))
|
209 |
-
f_list.sort(key=lambda f: int("".join(filter(str.isdigit, f))))
|
210 |
-
x = f_list[-1]
|
211 |
-
print(x)
|
212 |
-
return x
|
213 |
-
|
214 |
-
|
215 |
-
def plot_spectrogram_to_numpy(spectrogram):
|
216 |
-
global MATPLOTLIB_FLAG
|
217 |
-
if not MATPLOTLIB_FLAG:
|
218 |
-
import matplotlib
|
219 |
-
matplotlib.use("Agg")
|
220 |
-
MATPLOTLIB_FLAG = True
|
221 |
-
mpl_logger = logging.getLogger('matplotlib')
|
222 |
-
mpl_logger.setLevel(logging.WARNING)
|
223 |
-
import matplotlib.pylab as plt
|
224 |
-
import numpy as np
|
225 |
-
|
226 |
-
fig, ax = plt.subplots(figsize=(10, 2))
|
227 |
-
im = ax.imshow(spectrogram, aspect="auto", origin="lower",
|
228 |
-
interpolation='none')
|
229 |
-
plt.colorbar(im, ax=ax)
|
230 |
-
plt.xlabel("Frames")
|
231 |
-
plt.ylabel("Channels")
|
232 |
-
plt.tight_layout()
|
233 |
-
|
234 |
-
fig.canvas.draw()
|
235 |
-
data = np.fromstring(fig.canvas.tostring_rgb(), dtype=np.uint8, sep='')
|
236 |
-
data = data.reshape(fig.canvas.get_width_height()[::-1] + (3,))
|
237 |
-
plt.close()
|
238 |
-
return data
|
239 |
-
|
240 |
-
|
241 |
-
def plot_alignment_to_numpy(alignment, info=None):
|
242 |
-
global MATPLOTLIB_FLAG
|
243 |
-
if not MATPLOTLIB_FLAG:
|
244 |
-
import matplotlib
|
245 |
-
matplotlib.use("Agg")
|
246 |
-
MATPLOTLIB_FLAG = True
|
247 |
-
mpl_logger = logging.getLogger('matplotlib')
|
248 |
-
mpl_logger.setLevel(logging.WARNING)
|
249 |
-
import matplotlib.pylab as plt
|
250 |
-
import numpy as np
|
251 |
-
|
252 |
-
fig, ax = plt.subplots(figsize=(6, 4))
|
253 |
-
im = ax.imshow(alignment.transpose(), aspect='auto', origin='lower',
|
254 |
-
interpolation='none')
|
255 |
-
fig.colorbar(im, ax=ax)
|
256 |
-
xlabel = 'Decoder timestep'
|
257 |
-
if info is not None:
|
258 |
-
xlabel += '\n\n' + info
|
259 |
-
plt.xlabel(xlabel)
|
260 |
-
plt.ylabel('Encoder timestep')
|
261 |
-
plt.tight_layout()
|
262 |
-
|
263 |
-
fig.canvas.draw()
|
264 |
-
data = np.fromstring(fig.canvas.tostring_rgb(), dtype=np.uint8, sep='')
|
265 |
-
data = data.reshape(fig.canvas.get_width_height()[::-1] + (3,))
|
266 |
-
plt.close()
|
267 |
-
return data
|
268 |
-
|
269 |
-
|
270 |
-
def load_wav_to_torch(full_path):
|
271 |
-
sampling_rate, data = read(full_path)
|
272 |
-
return torch.FloatTensor(data.astype(np.float32)), sampling_rate
|
273 |
-
|
274 |
-
|
275 |
-
def load_filepaths_and_text(filename, split="|"):
|
276 |
-
with open(filename, encoding='utf-8') as f:
|
277 |
-
filepaths_and_text = [line.strip().split(split) for line in f]
|
278 |
-
return filepaths_and_text
|
279 |
-
|
280 |
-
|
281 |
-
def get_hparams(init=True):
|
282 |
-
parser = argparse.ArgumentParser()
|
283 |
-
parser.add_argument('-c', '--config', type=str, default="./configs/modified_finetune_speaker.json",
|
284 |
-
help='JSON file for configuration')
|
285 |
-
parser.add_argument('-m', '--model', type=str, default="pretrained_models",
|
286 |
-
help='Model name')
|
287 |
-
parser.add_argument('-n', '--max_epochs', type=int, default=50,
|
288 |
-
help='finetune epochs')
|
289 |
-
parser.add_argument('--drop_speaker_embed', type=bool, default=False, help='whether to drop existing characters')
|
290 |
-
|
291 |
-
args = parser.parse_args()
|
292 |
-
model_dir = os.path.join("./", args.model)
|
293 |
-
|
294 |
-
if not os.path.exists(model_dir):
|
295 |
-
os.makedirs(model_dir)
|
296 |
-
|
297 |
-
config_path = args.config
|
298 |
-
config_save_path = os.path.join(model_dir, "config.json")
|
299 |
-
if init:
|
300 |
-
with open(config_path, "r") as f:
|
301 |
-
data = f.read()
|
302 |
-
with open(config_save_path, "w") as f:
|
303 |
-
f.write(data)
|
304 |
-
else:
|
305 |
-
with open(config_save_path, "r") as f:
|
306 |
-
data = f.read()
|
307 |
-
config = json.loads(data)
|
308 |
-
|
309 |
-
hparams = HParams(**config)
|
310 |
-
hparams.model_dir = model_dir
|
311 |
-
hparams.max_epochs = args.max_epochs
|
312 |
-
hparams.drop_speaker_embed = args.drop_speaker_embed
|
313 |
-
return hparams
|
314 |
-
|
315 |
-
|
316 |
-
def get_hparams_from_dir(model_dir):
|
317 |
-
config_save_path = os.path.join(model_dir, "config.json")
|
318 |
-
with open(config_save_path, "r") as f:
|
319 |
-
data = f.read()
|
320 |
-
config = json.loads(data)
|
321 |
-
|
322 |
-
hparams = HParams(**config)
|
323 |
-
hparams.model_dir = model_dir
|
324 |
-
return hparams
|
325 |
-
|
326 |
-
|
327 |
-
def get_hparams_from_file(config_path):
|
328 |
-
with open(config_path, "r", encoding="utf-8") as f:
|
329 |
-
data = f.read()
|
330 |
-
config = json.loads(data)
|
331 |
-
|
332 |
-
hparams = HParams(**config)
|
333 |
-
return hparams
|
334 |
-
|
335 |
-
|
336 |
-
def check_git_hash(model_dir):
|
337 |
-
source_dir = os.path.dirname(os.path.realpath(__file__))
|
338 |
-
if not os.path.exists(os.path.join(source_dir, ".git")):
|
339 |
-
logger.warn("{} is not a git repository, therefore hash value comparison will be ignored.".format(
|
340 |
-
source_dir
|
341 |
-
))
|
342 |
-
return
|
343 |
-
|
344 |
-
cur_hash = subprocess.getoutput("git rev-parse HEAD")
|
345 |
-
|
346 |
-
path = os.path.join(model_dir, "githash")
|
347 |
-
if os.path.exists(path):
|
348 |
-
saved_hash = open(path).read()
|
349 |
-
if saved_hash != cur_hash:
|
350 |
-
logger.warn("git hash values are different. {}(saved) != {}(current)".format(
|
351 |
-
saved_hash[:8], cur_hash[:8]))
|
352 |
-
else:
|
353 |
-
open(path, "w").write(cur_hash)
|
354 |
-
|
355 |
-
|
356 |
-
def get_logger(model_dir, filename="train.log"):
|
357 |
-
global logger
|
358 |
-
logger = logging.getLogger(os.path.basename(model_dir))
|
359 |
-
logger.setLevel(logging.DEBUG)
|
360 |
-
|
361 |
-
formatter = logging.Formatter("%(asctime)s\t%(name)s\t%(levelname)s\t%(message)s")
|
362 |
-
if not os.path.exists(model_dir):
|
363 |
-
os.makedirs(model_dir)
|
364 |
-
h = logging.FileHandler(os.path.join(model_dir, filename))
|
365 |
-
h.setLevel(logging.DEBUG)
|
366 |
-
h.setFormatter(formatter)
|
367 |
-
logger.addHandler(h)
|
368 |
-
return logger
|
369 |
-
|
370 |
-
|
371 |
-
class HParams():
|
372 |
-
def __init__(self, **kwargs):
|
373 |
-
for k, v in kwargs.items():
|
374 |
-
if type(v) == dict:
|
375 |
-
v = HParams(**v)
|
376 |
-
self[k] = v
|
377 |
-
|
378 |
-
def keys(self):
|
379 |
-
return self.__dict__.keys()
|
380 |
-
|
381 |
-
def items(self):
|
382 |
-
return self.__dict__.items()
|
383 |
-
|
384 |
-
def values(self):
|
385 |
-
return self.__dict__.values()
|
386 |
-
|
387 |
-
def __len__(self):
|
388 |
-
return len(self.__dict__)
|
389 |
-
|
390 |
-
def __getitem__(self, key):
|
391 |
-
return getattr(self, key)
|
392 |
-
|
393 |
-
def __setitem__(self, key, value):
|
394 |
-
return setattr(self, key, value)
|
395 |
-
|
396 |
-
def __contains__(self, key):
|
397 |
-
return key in self.__dict__
|
398 |
-
|
399 |
-
def __repr__(self):
|
400 |
-
return self.__dict__.__repr__()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/AlexKoff88/stable_diffusion/README.md
DELETED
@@ -1,13 +0,0 @@
|
|
1 |
-
---
|
2 |
-
title: Stable Diffusion
|
3 |
-
emoji: 🐨
|
4 |
-
colorFrom: green
|
5 |
-
colorTo: yellow
|
6 |
-
sdk: gradio
|
7 |
-
sdk_version: 3.28.0
|
8 |
-
app_file: app.py
|
9 |
-
pinned: false
|
10 |
-
license: apache-2.0
|
11 |
-
---
|
12 |
-
|
13 |
-
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/AlexWang/lama/bin/predict.py
DELETED
@@ -1,89 +0,0 @@
|
|
1 |
-
#!/usr/bin/env python3
|
2 |
-
|
3 |
-
# Example command:
|
4 |
-
# ./bin/predict.py \
|
5 |
-
# model.path=<path to checkpoint, prepared by make_checkpoint.py> \
|
6 |
-
# indir=<path to input data> \
|
7 |
-
# outdir=<where to store predicts>
|
8 |
-
|
9 |
-
import logging
|
10 |
-
import os
|
11 |
-
import sys
|
12 |
-
import traceback
|
13 |
-
|
14 |
-
from saicinpainting.evaluation.utils import move_to_device
|
15 |
-
|
16 |
-
os.environ['OMP_NUM_THREADS'] = '1'
|
17 |
-
os.environ['OPENBLAS_NUM_THREADS'] = '1'
|
18 |
-
os.environ['MKL_NUM_THREADS'] = '1'
|
19 |
-
os.environ['VECLIB_MAXIMUM_THREADS'] = '1'
|
20 |
-
os.environ['NUMEXPR_NUM_THREADS'] = '1'
|
21 |
-
|
22 |
-
import cv2
|
23 |
-
import hydra
|
24 |
-
import numpy as np
|
25 |
-
import torch
|
26 |
-
import tqdm
|
27 |
-
import yaml
|
28 |
-
from omegaconf import OmegaConf
|
29 |
-
from torch.utils.data._utils.collate import default_collate
|
30 |
-
|
31 |
-
from saicinpainting.training.data.datasets import make_default_val_dataset
|
32 |
-
from saicinpainting.training.trainers import load_checkpoint
|
33 |
-
from saicinpainting.utils import register_debug_signal_handlers
|
34 |
-
|
35 |
-
LOGGER = logging.getLogger(__name__)
|
36 |
-
|
37 |
-
|
38 |
-
@hydra.main(config_path='../configs/prediction', config_name='default.yaml')
|
39 |
-
def main(predict_config: OmegaConf):
|
40 |
-
try:
|
41 |
-
register_debug_signal_handlers() # kill -10 <pid> will result in traceback dumped into log
|
42 |
-
|
43 |
-
device = torch.device(predict_config.device)
|
44 |
-
|
45 |
-
train_config_path = os.path.join(predict_config.model.path, 'config.yaml')
|
46 |
-
with open(train_config_path, 'r') as f:
|
47 |
-
train_config = OmegaConf.create(yaml.safe_load(f))
|
48 |
-
|
49 |
-
train_config.training_model.predict_only = True
|
50 |
-
|
51 |
-
out_ext = predict_config.get('out_ext', '.png')
|
52 |
-
|
53 |
-
checkpoint_path = os.path.join(predict_config.model.path,
|
54 |
-
'models',
|
55 |
-
predict_config.model.checkpoint)
|
56 |
-
model = load_checkpoint(train_config, checkpoint_path, strict=False, map_location='cpu')
|
57 |
-
model.freeze()
|
58 |
-
model.to(device)
|
59 |
-
|
60 |
-
if not predict_config.indir.endswith('/'):
|
61 |
-
predict_config.indir += '/'
|
62 |
-
|
63 |
-
dataset = make_default_val_dataset(predict_config.indir, **predict_config.dataset)
|
64 |
-
with torch.no_grad():
|
65 |
-
for img_i in tqdm.trange(len(dataset)):
|
66 |
-
mask_fname = dataset.mask_filenames[img_i]
|
67 |
-
cur_out_fname = os.path.join(
|
68 |
-
predict_config.outdir,
|
69 |
-
os.path.splitext(mask_fname[len(predict_config.indir):])[0] + out_ext
|
70 |
-
)
|
71 |
-
os.makedirs(os.path.dirname(cur_out_fname), exist_ok=True)
|
72 |
-
|
73 |
-
batch = move_to_device(default_collate([dataset[img_i]]), device)
|
74 |
-
batch['mask'] = (batch['mask'] > 0) * 1
|
75 |
-
batch = model(batch)
|
76 |
-
cur_res = batch[predict_config.out_key][0].permute(1, 2, 0).detach().cpu().numpy()
|
77 |
-
|
78 |
-
cur_res = np.clip(cur_res * 255, 0, 255).astype('uint8')
|
79 |
-
cur_res = cv2.cvtColor(cur_res, cv2.COLOR_RGB2BGR)
|
80 |
-
cv2.imwrite(cur_out_fname, cur_res)
|
81 |
-
except KeyboardInterrupt:
|
82 |
-
LOGGER.warning('Interrupted by user')
|
83 |
-
except Exception as ex:
|
84 |
-
LOGGER.critical(f'Prediction failed due to {ex}:\n{traceback.format_exc()}')
|
85 |
-
sys.exit(1)
|
86 |
-
|
87 |
-
|
88 |
-
if __name__ == '__main__':
|
89 |
-
main()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Amrrs/DragGan-Inversion/PTI/models/StyleCLIP/mapper/training/train_utils.py
DELETED
@@ -1,13 +0,0 @@
|
|
1 |
-
|
2 |
-
def aggregate_loss_dict(agg_loss_dict):
|
3 |
-
mean_vals = {}
|
4 |
-
for output in agg_loss_dict:
|
5 |
-
for key in output:
|
6 |
-
mean_vals[key] = mean_vals.setdefault(key, []) + [output[key]]
|
7 |
-
for key in mean_vals:
|
8 |
-
if len(mean_vals[key]) > 0:
|
9 |
-
mean_vals[key] = sum(mean_vals[key]) / len(mean_vals[key])
|
10 |
-
else:
|
11 |
-
print('{} has no value'.format(key))
|
12 |
-
mean_vals[key] = 0
|
13 |
-
return mean_vals
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Andy1621/IAT_enhancement/README.md
DELETED
@@ -1,13 +0,0 @@
|
|
1 |
-
---
|
2 |
-
title: IAT Enhancement
|
3 |
-
emoji: 🐢
|
4 |
-
colorFrom: purple
|
5 |
-
colorTo: yellow
|
6 |
-
sdk: gradio
|
7 |
-
sdk_version: 3.5
|
8 |
-
app_file: app.py
|
9 |
-
pinned: false
|
10 |
-
license: mit
|
11 |
-
---
|
12 |
-
|
13 |
-
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Andy1621/uniformer_image_detection/configs/mask_rcnn/mask_rcnn_r101_fpn_1x_coco.py
DELETED
@@ -1,2 +0,0 @@
|
|
1 |
-
_base_ = './mask_rcnn_r50_fpn_1x_coco.py'
|
2 |
-
model = dict(pretrained='torchvision://resnet101', backbone=dict(depth=101))
|
|
|
|
|
|
spaces/Andy1621/uniformer_image_detection/configs/tridentnet/tridentnet_r50_caffe_mstrain_1x_coco.py
DELETED
@@ -1,22 +0,0 @@
|
|
1 |
-
_base_ = 'tridentnet_r50_caffe_1x_coco.py'
|
2 |
-
|
3 |
-
# use caffe img_norm
|
4 |
-
img_norm_cfg = dict(
|
5 |
-
mean=[103.530, 116.280, 123.675], std=[1.0, 1.0, 1.0], to_rgb=False)
|
6 |
-
train_pipeline = [
|
7 |
-
dict(type='LoadImageFromFile'),
|
8 |
-
dict(type='LoadAnnotations', with_bbox=True),
|
9 |
-
dict(
|
10 |
-
type='Resize',
|
11 |
-
img_scale=[(1333, 640), (1333, 672), (1333, 704), (1333, 736),
|
12 |
-
(1333, 768), (1333, 800)],
|
13 |
-
multiscale_mode='value',
|
14 |
-
keep_ratio=True),
|
15 |
-
dict(type='RandomFlip', flip_ratio=0.5),
|
16 |
-
dict(type='Normalize', **img_norm_cfg),
|
17 |
-
dict(type='Pad', size_divisor=32),
|
18 |
-
dict(type='DefaultFormatBundle'),
|
19 |
-
dict(type='Collect', keys=['img', 'gt_bboxes', 'gt_labels'])
|
20 |
-
]
|
21 |
-
|
22 |
-
data = dict(train=dict(pipeline=train_pipeline))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Andy1621/uniformer_image_detection/mmdet/models/roi_heads/sparse_roi_head.py
DELETED
@@ -1,311 +0,0 @@
|
|
1 |
-
import torch
|
2 |
-
|
3 |
-
from mmdet.core import bbox2result, bbox2roi, bbox_xyxy_to_cxcywh
|
4 |
-
from mmdet.core.bbox.samplers import PseudoSampler
|
5 |
-
from ..builder import HEADS
|
6 |
-
from .cascade_roi_head import CascadeRoIHead
|
7 |
-
|
8 |
-
|
9 |
-
@HEADS.register_module()
|
10 |
-
class SparseRoIHead(CascadeRoIHead):
|
11 |
-
r"""The RoIHead for `Sparse R-CNN: End-to-End Object Detection with
|
12 |
-
Learnable Proposals <https://arxiv.org/abs/2011.12450>`_
|
13 |
-
|
14 |
-
Args:
|
15 |
-
num_stages (int): Number of stage whole iterative process.
|
16 |
-
Defaults to 6.
|
17 |
-
stage_loss_weights (Tuple[float]): The loss
|
18 |
-
weight of each stage. By default all stages have
|
19 |
-
the same weight 1.
|
20 |
-
bbox_roi_extractor (dict): Config of box roi extractor.
|
21 |
-
bbox_head (dict): Config of box head.
|
22 |
-
train_cfg (dict, optional): Configuration information in train stage.
|
23 |
-
Defaults to None.
|
24 |
-
test_cfg (dict, optional): Configuration information in test stage.
|
25 |
-
Defaults to None.
|
26 |
-
|
27 |
-
"""
|
28 |
-
|
29 |
-
def __init__(self,
|
30 |
-
num_stages=6,
|
31 |
-
stage_loss_weights=(1, 1, 1, 1, 1, 1),
|
32 |
-
proposal_feature_channel=256,
|
33 |
-
bbox_roi_extractor=dict(
|
34 |
-
type='SingleRoIExtractor',
|
35 |
-
roi_layer=dict(
|
36 |
-
type='RoIAlign', output_size=7, sampling_ratio=2),
|
37 |
-
out_channels=256,
|
38 |
-
featmap_strides=[4, 8, 16, 32]),
|
39 |
-
bbox_head=dict(
|
40 |
-
type='DIIHead',
|
41 |
-
num_classes=80,
|
42 |
-
num_fcs=2,
|
43 |
-
num_heads=8,
|
44 |
-
num_cls_fcs=1,
|
45 |
-
num_reg_fcs=3,
|
46 |
-
feedforward_channels=2048,
|
47 |
-
hidden_channels=256,
|
48 |
-
dropout=0.0,
|
49 |
-
roi_feat_size=7,
|
50 |
-
ffn_act_cfg=dict(type='ReLU', inplace=True)),
|
51 |
-
train_cfg=None,
|
52 |
-
test_cfg=None):
|
53 |
-
assert bbox_roi_extractor is not None
|
54 |
-
assert bbox_head is not None
|
55 |
-
assert len(stage_loss_weights) == num_stages
|
56 |
-
self.num_stages = num_stages
|
57 |
-
self.stage_loss_weights = stage_loss_weights
|
58 |
-
self.proposal_feature_channel = proposal_feature_channel
|
59 |
-
super(SparseRoIHead, self).__init__(
|
60 |
-
num_stages,
|
61 |
-
stage_loss_weights,
|
62 |
-
bbox_roi_extractor=bbox_roi_extractor,
|
63 |
-
bbox_head=bbox_head,
|
64 |
-
train_cfg=train_cfg,
|
65 |
-
test_cfg=test_cfg)
|
66 |
-
# train_cfg would be None when run the test.py
|
67 |
-
if train_cfg is not None:
|
68 |
-
for stage in range(num_stages):
|
69 |
-
assert isinstance(self.bbox_sampler[stage], PseudoSampler), \
|
70 |
-
'Sparse R-CNN only support `PseudoSampler`'
|
71 |
-
|
72 |
-
def _bbox_forward(self, stage, x, rois, object_feats, img_metas):
|
73 |
-
"""Box head forward function used in both training and testing. Returns
|
74 |
-
all regression, classification results and a intermediate feature.
|
75 |
-
|
76 |
-
Args:
|
77 |
-
stage (int): The index of current stage in
|
78 |
-
iterative process.
|
79 |
-
x (List[Tensor]): List of FPN features
|
80 |
-
rois (Tensor): Rois in total batch. With shape (num_proposal, 5).
|
81 |
-
the last dimension 5 represents (img_index, x1, y1, x2, y2).
|
82 |
-
object_feats (Tensor): The object feature extracted from
|
83 |
-
the previous stage.
|
84 |
-
img_metas (dict): meta information of images.
|
85 |
-
|
86 |
-
Returns:
|
87 |
-
dict[str, Tensor]: a dictionary of bbox head outputs,
|
88 |
-
Containing the following results:
|
89 |
-
|
90 |
-
- cls_score (Tensor): The score of each class, has
|
91 |
-
shape (batch_size, num_proposals, num_classes)
|
92 |
-
when use focal loss or
|
93 |
-
(batch_size, num_proposals, num_classes+1)
|
94 |
-
otherwise.
|
95 |
-
- decode_bbox_pred (Tensor): The regression results
|
96 |
-
with shape (batch_size, num_proposal, 4).
|
97 |
-
The last dimension 4 represents
|
98 |
-
[tl_x, tl_y, br_x, br_y].
|
99 |
-
- object_feats (Tensor): The object feature extracted
|
100 |
-
from current stage
|
101 |
-
- detach_cls_score_list (list[Tensor]): The detached
|
102 |
-
classification results, length is batch_size, and
|
103 |
-
each tensor has shape (num_proposal, num_classes).
|
104 |
-
- detach_proposal_list (list[tensor]): The detached
|
105 |
-
regression results, length is batch_size, and each
|
106 |
-
tensor has shape (num_proposal, 4). The last
|
107 |
-
dimension 4 represents [tl_x, tl_y, br_x, br_y].
|
108 |
-
"""
|
109 |
-
num_imgs = len(img_metas)
|
110 |
-
bbox_roi_extractor = self.bbox_roi_extractor[stage]
|
111 |
-
bbox_head = self.bbox_head[stage]
|
112 |
-
bbox_feats = bbox_roi_extractor(x[:bbox_roi_extractor.num_inputs],
|
113 |
-
rois)
|
114 |
-
cls_score, bbox_pred, object_feats = bbox_head(bbox_feats,
|
115 |
-
object_feats)
|
116 |
-
proposal_list = self.bbox_head[stage].refine_bboxes(
|
117 |
-
rois,
|
118 |
-
rois.new_zeros(len(rois)), # dummy arg
|
119 |
-
bbox_pred.view(-1, bbox_pred.size(-1)),
|
120 |
-
[rois.new_zeros(object_feats.size(1)) for _ in range(num_imgs)],
|
121 |
-
img_metas)
|
122 |
-
bbox_results = dict(
|
123 |
-
cls_score=cls_score,
|
124 |
-
decode_bbox_pred=torch.cat(proposal_list),
|
125 |
-
object_feats=object_feats,
|
126 |
-
# detach then use it in label assign
|
127 |
-
detach_cls_score_list=[
|
128 |
-
cls_score[i].detach() for i in range(num_imgs)
|
129 |
-
],
|
130 |
-
detach_proposal_list=[item.detach() for item in proposal_list])
|
131 |
-
|
132 |
-
return bbox_results
|
133 |
-
|
134 |
-
def forward_train(self,
|
135 |
-
x,
|
136 |
-
proposal_boxes,
|
137 |
-
proposal_features,
|
138 |
-
img_metas,
|
139 |
-
gt_bboxes,
|
140 |
-
gt_labels,
|
141 |
-
gt_bboxes_ignore=None,
|
142 |
-
imgs_whwh=None,
|
143 |
-
gt_masks=None):
|
144 |
-
"""Forward function in training stage.
|
145 |
-
|
146 |
-
Args:
|
147 |
-
x (list[Tensor]): list of multi-level img features.
|
148 |
-
proposals (Tensor): Decoded proposal bboxes, has shape
|
149 |
-
(batch_size, num_proposals, 4)
|
150 |
-
proposal_features (Tensor): Expanded proposal
|
151 |
-
features, has shape
|
152 |
-
(batch_size, num_proposals, proposal_feature_channel)
|
153 |
-
img_metas (list[dict]): list of image info dict where
|
154 |
-
each dict has: 'img_shape', 'scale_factor', 'flip',
|
155 |
-
and may also contain 'filename', 'ori_shape',
|
156 |
-
'pad_shape', and 'img_norm_cfg'. For details on the
|
157 |
-
values of these keys see
|
158 |
-
`mmdet/datasets/pipelines/formatting.py:Collect`.
|
159 |
-
gt_bboxes (list[Tensor]): Ground truth bboxes for each image with
|
160 |
-
shape (num_gts, 4) in [tl_x, tl_y, br_x, br_y] format.
|
161 |
-
gt_labels (list[Tensor]): class indices corresponding to each box
|
162 |
-
gt_bboxes_ignore (None | list[Tensor]): specify which bounding
|
163 |
-
boxes can be ignored when computing the loss.
|
164 |
-
imgs_whwh (Tensor): Tensor with shape (batch_size, 4),
|
165 |
-
the dimension means
|
166 |
-
[img_width,img_height, img_width, img_height].
|
167 |
-
gt_masks (None | Tensor) : true segmentation masks for each box
|
168 |
-
used if the architecture supports a segmentation task.
|
169 |
-
|
170 |
-
Returns:
|
171 |
-
dict[str, Tensor]: a dictionary of loss components of all stage.
|
172 |
-
"""
|
173 |
-
|
174 |
-
num_imgs = len(img_metas)
|
175 |
-
num_proposals = proposal_boxes.size(1)
|
176 |
-
imgs_whwh = imgs_whwh.repeat(1, num_proposals, 1)
|
177 |
-
all_stage_bbox_results = []
|
178 |
-
proposal_list = [proposal_boxes[i] for i in range(len(proposal_boxes))]
|
179 |
-
object_feats = proposal_features
|
180 |
-
all_stage_loss = {}
|
181 |
-
for stage in range(self.num_stages):
|
182 |
-
rois = bbox2roi(proposal_list)
|
183 |
-
bbox_results = self._bbox_forward(stage, x, rois, object_feats,
|
184 |
-
img_metas)
|
185 |
-
all_stage_bbox_results.append(bbox_results)
|
186 |
-
if gt_bboxes_ignore is None:
|
187 |
-
# TODO support ignore
|
188 |
-
gt_bboxes_ignore = [None for _ in range(num_imgs)]
|
189 |
-
sampling_results = []
|
190 |
-
cls_pred_list = bbox_results['detach_cls_score_list']
|
191 |
-
proposal_list = bbox_results['detach_proposal_list']
|
192 |
-
for i in range(num_imgs):
|
193 |
-
normalize_bbox_ccwh = bbox_xyxy_to_cxcywh(proposal_list[i] /
|
194 |
-
imgs_whwh[i])
|
195 |
-
assign_result = self.bbox_assigner[stage].assign(
|
196 |
-
normalize_bbox_ccwh, cls_pred_list[i], gt_bboxes[i],
|
197 |
-
gt_labels[i], img_metas[i])
|
198 |
-
sampling_result = self.bbox_sampler[stage].sample(
|
199 |
-
assign_result, proposal_list[i], gt_bboxes[i])
|
200 |
-
sampling_results.append(sampling_result)
|
201 |
-
bbox_targets = self.bbox_head[stage].get_targets(
|
202 |
-
sampling_results, gt_bboxes, gt_labels, self.train_cfg[stage],
|
203 |
-
True)
|
204 |
-
cls_score = bbox_results['cls_score']
|
205 |
-
decode_bbox_pred = bbox_results['decode_bbox_pred']
|
206 |
-
|
207 |
-
single_stage_loss = self.bbox_head[stage].loss(
|
208 |
-
cls_score.view(-1, cls_score.size(-1)),
|
209 |
-
decode_bbox_pred.view(-1, 4),
|
210 |
-
*bbox_targets,
|
211 |
-
imgs_whwh=imgs_whwh)
|
212 |
-
for key, value in single_stage_loss.items():
|
213 |
-
all_stage_loss[f'stage{stage}_{key}'] = value * \
|
214 |
-
self.stage_loss_weights[stage]
|
215 |
-
object_feats = bbox_results['object_feats']
|
216 |
-
|
217 |
-
return all_stage_loss
|
218 |
-
|
219 |
-
def simple_test(self,
|
220 |
-
x,
|
221 |
-
proposal_boxes,
|
222 |
-
proposal_features,
|
223 |
-
img_metas,
|
224 |
-
imgs_whwh,
|
225 |
-
rescale=False):
|
226 |
-
"""Test without augmentation.
|
227 |
-
|
228 |
-
Args:
|
229 |
-
x (list[Tensor]): list of multi-level img features.
|
230 |
-
proposal_boxes (Tensor): Decoded proposal bboxes, has shape
|
231 |
-
(batch_size, num_proposals, 4)
|
232 |
-
proposal_features (Tensor): Expanded proposal
|
233 |
-
features, has shape
|
234 |
-
(batch_size, num_proposals, proposal_feature_channel)
|
235 |
-
img_metas (dict): meta information of images.
|
236 |
-
imgs_whwh (Tensor): Tensor with shape (batch_size, 4),
|
237 |
-
the dimension means
|
238 |
-
[img_width,img_height, img_width, img_height].
|
239 |
-
rescale (bool): If True, return boxes in original image
|
240 |
-
space. Defaults to False.
|
241 |
-
|
242 |
-
Returns:
|
243 |
-
bbox_results (list[tuple[np.ndarray]]): \
|
244 |
-
[[cls1_det, cls2_det, ...], ...]. \
|
245 |
-
The outer list indicates images, and the inner \
|
246 |
-
list indicates per-class detected bboxes. The \
|
247 |
-
np.ndarray has shape (num_det, 5) and the last \
|
248 |
-
dimension 5 represents (x1, y1, x2, y2, score).
|
249 |
-
"""
|
250 |
-
assert self.with_bbox, 'Bbox head must be implemented.'
|
251 |
-
# Decode initial proposals
|
252 |
-
num_imgs = len(img_metas)
|
253 |
-
proposal_list = [proposal_boxes[i] for i in range(num_imgs)]
|
254 |
-
object_feats = proposal_features
|
255 |
-
for stage in range(self.num_stages):
|
256 |
-
rois = bbox2roi(proposal_list)
|
257 |
-
bbox_results = self._bbox_forward(stage, x, rois, object_feats,
|
258 |
-
img_metas)
|
259 |
-
object_feats = bbox_results['object_feats']
|
260 |
-
cls_score = bbox_results['cls_score']
|
261 |
-
proposal_list = bbox_results['detach_proposal_list']
|
262 |
-
|
263 |
-
num_classes = self.bbox_head[-1].num_classes
|
264 |
-
det_bboxes = []
|
265 |
-
det_labels = []
|
266 |
-
|
267 |
-
if self.bbox_head[-1].loss_cls.use_sigmoid:
|
268 |
-
cls_score = cls_score.sigmoid()
|
269 |
-
else:
|
270 |
-
cls_score = cls_score.softmax(-1)[..., :-1]
|
271 |
-
|
272 |
-
for img_id in range(num_imgs):
|
273 |
-
cls_score_per_img = cls_score[img_id]
|
274 |
-
scores_per_img, topk_indices = cls_score_per_img.flatten(
|
275 |
-
0, 1).topk(
|
276 |
-
self.test_cfg.max_per_img, sorted=False)
|
277 |
-
labels_per_img = topk_indices % num_classes
|
278 |
-
bbox_pred_per_img = proposal_list[img_id][topk_indices //
|
279 |
-
num_classes]
|
280 |
-
if rescale:
|
281 |
-
scale_factor = img_metas[img_id]['scale_factor']
|
282 |
-
bbox_pred_per_img /= bbox_pred_per_img.new_tensor(scale_factor)
|
283 |
-
det_bboxes.append(
|
284 |
-
torch.cat([bbox_pred_per_img, scores_per_img[:, None]], dim=1))
|
285 |
-
det_labels.append(labels_per_img)
|
286 |
-
|
287 |
-
bbox_results = [
|
288 |
-
bbox2result(det_bboxes[i], det_labels[i], num_classes)
|
289 |
-
for i in range(num_imgs)
|
290 |
-
]
|
291 |
-
|
292 |
-
return bbox_results
|
293 |
-
|
294 |
-
def aug_test(self, features, proposal_list, img_metas, rescale=False):
|
295 |
-
raise NotImplementedError('Sparse R-CNN does not support `aug_test`')
|
296 |
-
|
297 |
-
def forward_dummy(self, x, proposal_boxes, proposal_features, img_metas):
|
298 |
-
"""Dummy forward function when do the flops computing."""
|
299 |
-
all_stage_bbox_results = []
|
300 |
-
proposal_list = [proposal_boxes[i] for i in range(len(proposal_boxes))]
|
301 |
-
object_feats = proposal_features
|
302 |
-
if self.with_bbox:
|
303 |
-
for stage in range(self.num_stages):
|
304 |
-
rois = bbox2roi(proposal_list)
|
305 |
-
bbox_results = self._bbox_forward(stage, x, rois, object_feats,
|
306 |
-
img_metas)
|
307 |
-
|
308 |
-
all_stage_bbox_results.append(bbox_results)
|
309 |
-
proposal_list = bbox_results['detach_proposal_list']
|
310 |
-
object_feats = bbox_results['object_feats']
|
311 |
-
return all_stage_bbox_results
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Anon4review/HIPTDemo/app.py
DELETED
@@ -1,310 +0,0 @@
|
|
1 |
-
import gradio as gr
|
2 |
-
import torch
|
3 |
-
import os
|
4 |
-
import sys
|
5 |
-
import cv2
|
6 |
-
import matplotlib
|
7 |
-
import matplotlib.pyplot as plt
|
8 |
-
import numpy as np
|
9 |
-
from PIL import Image
|
10 |
-
from PIL import ImageFont
|
11 |
-
from PIL import ImageDraw
|
12 |
-
from scipy.stats import rankdata
|
13 |
-
|
14 |
-
import torch
|
15 |
-
import torch.nn as nn
|
16 |
-
import torchvision
|
17 |
-
from torchvision import transforms as pth_transforms
|
18 |
-
import torchvision.transforms as transforms
|
19 |
-
from einops import rearrange, repeat
|
20 |
-
import vision_transformer as vits
|
21 |
-
|
22 |
-
def get_vit256(pretrained_weights, arch='vit_small', device=torch.device('cpu')):
|
23 |
-
r"""
|
24 |
-
Builds ViT-256 Model.
|
25 |
-
|
26 |
-
Args:
|
27 |
-
- pretrained_weights (str): Path to ViT-256 Model Checkpoint.
|
28 |
-
- arch (str): Which model architecture.
|
29 |
-
- device (torch): Torch device to save model.
|
30 |
-
|
31 |
-
Returns:
|
32 |
-
- model256 (torch.nn): Initialized model.
|
33 |
-
"""
|
34 |
-
|
35 |
-
checkpoint_key = 'teacher'
|
36 |
-
device = torch.device("cpu") if torch.cuda.is_available() else torch.device("cpu")
|
37 |
-
model256 = vits.__dict__[arch](patch_size=16, num_classes=0)
|
38 |
-
for p in model256.parameters():
|
39 |
-
p.requires_grad = False
|
40 |
-
model256.eval()
|
41 |
-
model256.to(device)
|
42 |
-
|
43 |
-
if os.path.isfile(pretrained_weights):
|
44 |
-
state_dict = torch.load(pretrained_weights, map_location="cpu")
|
45 |
-
if checkpoint_key is not None and checkpoint_key in state_dict:
|
46 |
-
print(f"Take key {checkpoint_key} in provided checkpoint dict")
|
47 |
-
state_dict = state_dict[checkpoint_key]
|
48 |
-
# remove `module.` prefix
|
49 |
-
state_dict = {k.replace("module.", ""): v for k, v in state_dict.items()}
|
50 |
-
# remove `backbone.` prefix induced by multicrop wrapper
|
51 |
-
state_dict = {k.replace("backbone.", ""): v for k, v in state_dict.items()}
|
52 |
-
msg = model256.load_state_dict(state_dict, strict=False)
|
53 |
-
print('Pretrained weights found at {} and loaded with msg: {}'.format(pretrained_weights, msg))
|
54 |
-
return model256
|
55 |
-
|
56 |
-
def cmap_map(function, cmap):
|
57 |
-
r"""
|
58 |
-
Applies function (which should operate on vectors of shape 3: [r, g, b]), on colormap cmap.
|
59 |
-
This routine will break any discontinuous points in a colormap.
|
60 |
-
|
61 |
-
Args:
|
62 |
-
- function (function)
|
63 |
-
- cmap (matplotlib.colormap)
|
64 |
-
|
65 |
-
Returns:
|
66 |
-
- matplotlib.colormap
|
67 |
-
"""
|
68 |
-
cdict = cmap._segmentdata
|
69 |
-
step_dict = {}
|
70 |
-
# Firt get the list of points where the segments start or end
|
71 |
-
for key in ('red', 'green', 'blue'):
|
72 |
-
step_dict[key] = list(map(lambda x: x[0], cdict[key]))
|
73 |
-
step_list = sum(step_dict.values(), [])
|
74 |
-
step_list = np.array(list(set(step_list)))
|
75 |
-
# Then compute the LUT, and apply the function to the LUT
|
76 |
-
reduced_cmap = lambda step : np.array(cmap(step)[0:3])
|
77 |
-
old_LUT = np.array(list(map(reduced_cmap, step_list)))
|
78 |
-
new_LUT = np.array(list(map(function, old_LUT)))
|
79 |
-
# Now try to make a minimal segment definition of the new LUT
|
80 |
-
cdict = {}
|
81 |
-
for i, key in enumerate(['red','green','blue']):
|
82 |
-
this_cdict = {}
|
83 |
-
for j, step in enumerate(step_list):
|
84 |
-
if step in step_dict[key]:
|
85 |
-
this_cdict[step] = new_LUT[j, i]
|
86 |
-
elif new_LUT[j,i] != old_LUT[j, i]:
|
87 |
-
this_cdict[step] = new_LUT[j, i]
|
88 |
-
colorvector = list(map(lambda x: x + (x[1], ), this_cdict.items()))
|
89 |
-
colorvector.sort()
|
90 |
-
cdict[key] = colorvector
|
91 |
-
|
92 |
-
return matplotlib.colors.LinearSegmentedColormap('colormap',cdict,1024)
|
93 |
-
|
94 |
-
|
95 |
-
def identity(x):
|
96 |
-
r"""
|
97 |
-
Identity Function.
|
98 |
-
|
99 |
-
Args:
|
100 |
-
- x:
|
101 |
-
|
102 |
-
Returns:
|
103 |
-
- x
|
104 |
-
"""
|
105 |
-
return x
|
106 |
-
|
107 |
-
def tensorbatch2im(input_image, imtype=np.uint8):
|
108 |
-
r""""
|
109 |
-
Converts a Tensor array into a numpy image array.
|
110 |
-
|
111 |
-
Args:
|
112 |
-
- input_image (torch.Tensor): (B, C, W, H) Torch Tensor.
|
113 |
-
- imtype (type): the desired type of the converted numpy array
|
114 |
-
|
115 |
-
Returns:
|
116 |
-
- image_numpy (np.array): (B, W, H, C) Numpy Array.
|
117 |
-
"""
|
118 |
-
if not isinstance(input_image, np.ndarray):
|
119 |
-
image_numpy = input_image.cpu().float().numpy() # convert it into a numpy array
|
120 |
-
#if image_numpy.shape[0] == 1: # grayscale to RGB
|
121 |
-
# image_numpy = np.tile(image_numpy, (3, 1, 1))
|
122 |
-
image_numpy = (np.transpose(image_numpy, (0, 2, 3, 1)) + 1) / 2.0 * 255.0 # post-processing: tranpose and scaling
|
123 |
-
else: # if it is a numpy array, do nothing
|
124 |
-
image_numpy = input_image
|
125 |
-
return image_numpy.astype(imtype)
|
126 |
-
|
127 |
-
def getConcatImage(imgs, how='horizontal', gap=0):
|
128 |
-
r"""
|
129 |
-
Function to concatenate list of images (vertical or horizontal).
|
130 |
-
|
131 |
-
Args:
|
132 |
-
- imgs (list of PIL.Image): List of PIL Images to concatenate.
|
133 |
-
- how (str): How the images are concatenated (either 'horizontal' or 'vertical')
|
134 |
-
- gap (int): Gap (in px) between images
|
135 |
-
|
136 |
-
Return:
|
137 |
-
- dst (PIL.Image): Concatenated image result.
|
138 |
-
"""
|
139 |
-
gap_dist = (len(imgs)-1)*gap
|
140 |
-
|
141 |
-
if how == 'vertical':
|
142 |
-
w, h = np.max([img.width for img in imgs]), np.sum([img.height for img in imgs])
|
143 |
-
h += gap_dist
|
144 |
-
curr_h = 0
|
145 |
-
dst = Image.new('RGBA', (w, h), color=(255, 255, 255, 0))
|
146 |
-
for img in imgs:
|
147 |
-
dst.paste(img, (0, curr_h))
|
148 |
-
curr_h += img.height + gap
|
149 |
-
|
150 |
-
elif how == 'horizontal':
|
151 |
-
w, h = np.sum([img.width for img in imgs]), np.min([img.height for img in imgs])
|
152 |
-
w += gap_dist
|
153 |
-
curr_w = 0
|
154 |
-
dst = Image.new('RGBA', (w, h), color=(255, 255, 255, 0))
|
155 |
-
|
156 |
-
for idx, img in enumerate(imgs):
|
157 |
-
dst.paste(img, (curr_w, 0))
|
158 |
-
curr_w += img.width + gap
|
159 |
-
|
160 |
-
return dst
|
161 |
-
|
162 |
-
|
163 |
-
def add_margin(pil_img, top, right, bottom, left, color):
|
164 |
-
r"""
|
165 |
-
Adds custom margin to PIL.Image.
|
166 |
-
"""
|
167 |
-
width, height = pil_img.size
|
168 |
-
new_width = width + right + left
|
169 |
-
new_height = height + top + bottom
|
170 |
-
result = Image.new(pil_img.mode, (new_width, new_height), color)
|
171 |
-
result.paste(pil_img, (left, top))
|
172 |
-
return result
|
173 |
-
|
174 |
-
|
175 |
-
def concat_scores256(attns, size=(256,256)):
|
176 |
-
r"""
|
177 |
-
"""
|
178 |
-
rank = lambda v: rankdata(v)*100/len(v)
|
179 |
-
color_block = [rank(attn.flatten()).reshape(size) for attn in attns]
|
180 |
-
color_hm = np.concatenate([
|
181 |
-
np.concatenate(color_block[i:(i+16)], axis=1)
|
182 |
-
for i in range(0,256,16)
|
183 |
-
])
|
184 |
-
return color_hm
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
def get_scores256(attns, size=(256,256)):
|
189 |
-
r"""
|
190 |
-
"""
|
191 |
-
rank = lambda v: rankdata(v)*100/len(v)
|
192 |
-
color_block = [rank(attn.flatten()).reshape(size) for attn in attns][0]
|
193 |
-
return color_block
|
194 |
-
|
195 |
-
|
196 |
-
def get_patch_attention_scores(patch, model256, scale=1, device256=torch.device('cpu')):
|
197 |
-
t = transforms.Compose([
|
198 |
-
transforms.ToTensor(),
|
199 |
-
transforms.Normalize(
|
200 |
-
[0.5, 0.5, 0.5], [0.5, 0.5, 0.5]
|
201 |
-
)
|
202 |
-
])
|
203 |
-
|
204 |
-
with torch.no_grad():
|
205 |
-
batch_256 = t(patch).unsqueeze(0)
|
206 |
-
batch_256 = batch_256.to(device256, non_blocking=True)
|
207 |
-
features_256 = model256(batch_256)
|
208 |
-
|
209 |
-
attention_256 = model256.get_last_selfattention(batch_256)
|
210 |
-
nh = attention_256.shape[1] # number of head
|
211 |
-
attention_256 = attention_256[:, :, 0, 1:].reshape(256, nh, -1)
|
212 |
-
attention_256 = attention_256.reshape(1, nh, 16, 16)
|
213 |
-
attention_256 = nn.functional.interpolate(attention_256, scale_factor=int(16/scale), mode="nearest").cpu().numpy()
|
214 |
-
|
215 |
-
if scale != 1:
|
216 |
-
batch_256 = nn.functional.interpolate(batch_256, scale_factor=(1/scale), mode="nearest")
|
217 |
-
|
218 |
-
return tensorbatch2im(batch_256), attention_256
|
219 |
-
|
220 |
-
|
221 |
-
def create_patch_heatmaps_concat(patch, model256, output_dir=None, fname=None, threshold=None,
|
222 |
-
offset=16, alpha=0.5, cmap=plt.get_cmap('coolwarm')):
|
223 |
-
r"""
|
224 |
-
Creates patch heatmaps (concatenated for easy comparison)
|
225 |
-
|
226 |
-
Args:
|
227 |
-
- patch (PIL.Image): 256 x 256 Image
|
228 |
-
- model256 (torch.nn): 256-Level ViT
|
229 |
-
- output_dir (str): Save directory / subdirectory
|
230 |
-
- fname (str): Naming structure of files
|
231 |
-
- offset (int): How much to offset (from top-left corner with zero-padding) the region by for blending
|
232 |
-
- alpha (float): Image blending factor for cv2.addWeighted
|
233 |
-
- cmap (matplotlib.pyplot): Colormap for creating heatmaps
|
234 |
-
|
235 |
-
Returns:
|
236 |
-
- None
|
237 |
-
"""
|
238 |
-
patch1 = patch.copy()
|
239 |
-
patch2 = add_margin(patch.crop((16,16,256,256)), top=0, left=0, bottom=16, right=16, color=(255,255,255))
|
240 |
-
b256_1, a256_1 = get_patch_attention_scores(patch1, model256)
|
241 |
-
b256_1, a256_2 = get_patch_attention_scores(patch2, model256)
|
242 |
-
save_region = np.array(patch.copy())
|
243 |
-
s = 256
|
244 |
-
offset_2 = offset
|
245 |
-
|
246 |
-
if threshold != None:
|
247 |
-
ths = []
|
248 |
-
for i in range(6):
|
249 |
-
score256_1 = get_scores256(a256_1[:,i,:,:], size=(s,)*2)
|
250 |
-
score256_2 = get_scores256(a256_2[:,i,:,:], size=(s,)*2)
|
251 |
-
new_score256_2 = np.zeros_like(score256_2)
|
252 |
-
new_score256_2[offset_2:s, offset_2:s] = score256_2[:(s-offset_2), :(s-offset_2)]
|
253 |
-
overlay256 = np.ones_like(score256_2)*100
|
254 |
-
overlay256[offset_2:s, offset_2:s] += 100
|
255 |
-
score256 = (score256_1+new_score256_2)/overlay256
|
256 |
-
|
257 |
-
mask256 = score256.copy()
|
258 |
-
mask256[mask256 < threshold] = 0
|
259 |
-
mask256[mask256 > threshold] = 0.95
|
260 |
-
|
261 |
-
color_block256 = (cmap(mask256)*255)[:,:,:3].astype(np.uint8)
|
262 |
-
region256_hm = cv2.addWeighted(color_block256, alpha, save_region.copy(), 1-alpha, 0, save_region.copy())
|
263 |
-
region256_hm[mask256==0] = 0
|
264 |
-
img_inverse = save_region.copy()
|
265 |
-
img_inverse[mask256 == 0.95] = 0
|
266 |
-
ths.append(region256_hm+img_inverse)
|
267 |
-
|
268 |
-
ths = [Image.fromarray(img) for img in ths]
|
269 |
-
|
270 |
-
getConcatImage([getConcatImage(ths[0:3]),
|
271 |
-
getConcatImage(ths[4:6])], how='vertical').save(os.path.join(output_dir, '%s_256th.png' % (fname)))
|
272 |
-
|
273 |
-
|
274 |
-
hms = []
|
275 |
-
for i in range(6):
|
276 |
-
score256_1 = get_scores256(a256_1[:,i,:,:], size=(s,)*2)
|
277 |
-
score256_2 = get_scores256(a256_2[:,i,:,:], size=(s,)*2)
|
278 |
-
new_score256_2 = np.zeros_like(score256_2)
|
279 |
-
new_score256_2[offset_2:s, offset_2:s] = score256_2[:(s-offset_2), :(s-offset_2)]
|
280 |
-
overlay256 = np.ones_like(score256_2)*100
|
281 |
-
overlay256[offset_2:s, offset_2:s] += 100
|
282 |
-
score256 = (score256_1+new_score256_2)/overlay256
|
283 |
-
color_block256 = (cmap(score256)*255)[:,:,:3].astype(np.uint8)
|
284 |
-
region256_hm = cv2.addWeighted(color_block256, alpha, save_region.copy(), 1-alpha, 0, save_region.copy())
|
285 |
-
hms.append(region256_hm)
|
286 |
-
|
287 |
-
hms = [Image.fromarray(img) for img in hms]
|
288 |
-
return getConcatImage([getConcatImage(hms[0:3], how='horizontal', gap=10),
|
289 |
-
getConcatImage(hms[4:6], how='horizontal', gap=10)], how='vertical', gap=10)
|
290 |
-
|
291 |
-
def demo_patch_heatmaps(input_image):
|
292 |
-
light_jet = cmap_map(lambda x: x/2 + 0.5, matplotlib.cm.jet)
|
293 |
-
model256 = get_vit256(pretrained_weights=pretrained_weights256)
|
294 |
-
demo_heatmap = create_patch_heatmaps_concat(input_image, model256, cmap=light_jet)
|
295 |
-
return demo_heatmap
|
296 |
-
|
297 |
-
|
298 |
-
pretrained_weights256 = './model.pt'
|
299 |
-
|
300 |
-
title = "Demo for 11604"
|
301 |
-
description = "To use, upload a 256 x 256 patch (20X magnification). \
|
302 |
-
The output will generate attention results from 6 attention heads."
|
303 |
-
|
304 |
-
iface = gr.Interface(fn=demo_patch_heatmaps,
|
305 |
-
inputs=gr.inputs.Image(type='pil'),
|
306 |
-
outputs="image",
|
307 |
-
title=title,
|
308 |
-
description=description,
|
309 |
-
allow_flagging=False)
|
310 |
-
iface.launch()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Anonymous-sub/Rerender/ControlNet/annotator/uniformer/mmcv/runner/base_module.py
DELETED
@@ -1,195 +0,0 @@
|
|
1 |
-
# Copyright (c) OpenMMLab. All rights reserved.
|
2 |
-
import copy
|
3 |
-
import warnings
|
4 |
-
from abc import ABCMeta
|
5 |
-
from collections import defaultdict
|
6 |
-
from logging import FileHandler
|
7 |
-
|
8 |
-
import torch.nn as nn
|
9 |
-
|
10 |
-
from annotator.uniformer.mmcv.runner.dist_utils import master_only
|
11 |
-
from annotator.uniformer.mmcv.utils.logging import get_logger, logger_initialized, print_log
|
12 |
-
|
13 |
-
|
14 |
-
class BaseModule(nn.Module, metaclass=ABCMeta):
|
15 |
-
"""Base module for all modules in openmmlab.
|
16 |
-
|
17 |
-
``BaseModule`` is a wrapper of ``torch.nn.Module`` with additional
|
18 |
-
functionality of parameter initialization. Compared with
|
19 |
-
``torch.nn.Module``, ``BaseModule`` mainly adds three attributes.
|
20 |
-
|
21 |
-
- ``init_cfg``: the config to control the initialization.
|
22 |
-
- ``init_weights``: The function of parameter
|
23 |
-
initialization and recording initialization
|
24 |
-
information.
|
25 |
-
- ``_params_init_info``: Used to track the parameter
|
26 |
-
initialization information. This attribute only
|
27 |
-
exists during executing the ``init_weights``.
|
28 |
-
|
29 |
-
Args:
|
30 |
-
init_cfg (dict, optional): Initialization config dict.
|
31 |
-
"""
|
32 |
-
|
33 |
-
def __init__(self, init_cfg=None):
|
34 |
-
"""Initialize BaseModule, inherited from `torch.nn.Module`"""
|
35 |
-
|
36 |
-
# NOTE init_cfg can be defined in different levels, but init_cfg
|
37 |
-
# in low levels has a higher priority.
|
38 |
-
|
39 |
-
super(BaseModule, self).__init__()
|
40 |
-
# define default value of init_cfg instead of hard code
|
41 |
-
# in init_weights() function
|
42 |
-
self._is_init = False
|
43 |
-
|
44 |
-
self.init_cfg = copy.deepcopy(init_cfg)
|
45 |
-
|
46 |
-
# Backward compatibility in derived classes
|
47 |
-
# if pretrained is not None:
|
48 |
-
# warnings.warn('DeprecationWarning: pretrained is a deprecated \
|
49 |
-
# key, please consider using init_cfg')
|
50 |
-
# self.init_cfg = dict(type='Pretrained', checkpoint=pretrained)
|
51 |
-
|
52 |
-
@property
|
53 |
-
def is_init(self):
|
54 |
-
return self._is_init
|
55 |
-
|
56 |
-
def init_weights(self):
|
57 |
-
"""Initialize the weights."""
|
58 |
-
|
59 |
-
is_top_level_module = False
|
60 |
-
# check if it is top-level module
|
61 |
-
if not hasattr(self, '_params_init_info'):
|
62 |
-
# The `_params_init_info` is used to record the initialization
|
63 |
-
# information of the parameters
|
64 |
-
# the key should be the obj:`nn.Parameter` of model and the value
|
65 |
-
# should be a dict containing
|
66 |
-
# - init_info (str): The string that describes the initialization.
|
67 |
-
# - tmp_mean_value (FloatTensor): The mean of the parameter,
|
68 |
-
# which indicates whether the parameter has been modified.
|
69 |
-
# this attribute would be deleted after all parameters
|
70 |
-
# is initialized.
|
71 |
-
self._params_init_info = defaultdict(dict)
|
72 |
-
is_top_level_module = True
|
73 |
-
|
74 |
-
# Initialize the `_params_init_info`,
|
75 |
-
# When detecting the `tmp_mean_value` of
|
76 |
-
# the corresponding parameter is changed, update related
|
77 |
-
# initialization information
|
78 |
-
for name, param in self.named_parameters():
|
79 |
-
self._params_init_info[param][
|
80 |
-
'init_info'] = f'The value is the same before and ' \
|
81 |
-
f'after calling `init_weights` ' \
|
82 |
-
f'of {self.__class__.__name__} '
|
83 |
-
self._params_init_info[param][
|
84 |
-
'tmp_mean_value'] = param.data.mean()
|
85 |
-
|
86 |
-
# pass `params_init_info` to all submodules
|
87 |
-
# All submodules share the same `params_init_info`,
|
88 |
-
# so it will be updated when parameters are
|
89 |
-
# modified at any level of the model.
|
90 |
-
for sub_module in self.modules():
|
91 |
-
sub_module._params_init_info = self._params_init_info
|
92 |
-
|
93 |
-
# Get the initialized logger, if not exist,
|
94 |
-
# create a logger named `mmcv`
|
95 |
-
logger_names = list(logger_initialized.keys())
|
96 |
-
logger_name = logger_names[0] if logger_names else 'mmcv'
|
97 |
-
|
98 |
-
from ..cnn import initialize
|
99 |
-
from ..cnn.utils.weight_init import update_init_info
|
100 |
-
module_name = self.__class__.__name__
|
101 |
-
if not self._is_init:
|
102 |
-
if self.init_cfg:
|
103 |
-
print_log(
|
104 |
-
f'initialize {module_name} with init_cfg {self.init_cfg}',
|
105 |
-
logger=logger_name)
|
106 |
-
initialize(self, self.init_cfg)
|
107 |
-
if isinstance(self.init_cfg, dict):
|
108 |
-
# prevent the parameters of
|
109 |
-
# the pre-trained model
|
110 |
-
# from being overwritten by
|
111 |
-
# the `init_weights`
|
112 |
-
if self.init_cfg['type'] == 'Pretrained':
|
113 |
-
return
|
114 |
-
|
115 |
-
for m in self.children():
|
116 |
-
if hasattr(m, 'init_weights'):
|
117 |
-
m.init_weights()
|
118 |
-
# users may overload the `init_weights`
|
119 |
-
update_init_info(
|
120 |
-
m,
|
121 |
-
init_info=f'Initialized by '
|
122 |
-
f'user-defined `init_weights`'
|
123 |
-
f' in {m.__class__.__name__} ')
|
124 |
-
|
125 |
-
self._is_init = True
|
126 |
-
else:
|
127 |
-
warnings.warn(f'init_weights of {self.__class__.__name__} has '
|
128 |
-
f'been called more than once.')
|
129 |
-
|
130 |
-
if is_top_level_module:
|
131 |
-
self._dump_init_info(logger_name)
|
132 |
-
|
133 |
-
for sub_module in self.modules():
|
134 |
-
del sub_module._params_init_info
|
135 |
-
|
136 |
-
@master_only
|
137 |
-
def _dump_init_info(self, logger_name):
|
138 |
-
"""Dump the initialization information to a file named
|
139 |
-
`initialization.log.json` in workdir.
|
140 |
-
|
141 |
-
Args:
|
142 |
-
logger_name (str): The name of logger.
|
143 |
-
"""
|
144 |
-
|
145 |
-
logger = get_logger(logger_name)
|
146 |
-
|
147 |
-
with_file_handler = False
|
148 |
-
# dump the information to the logger file if there is a `FileHandler`
|
149 |
-
for handler in logger.handlers:
|
150 |
-
if isinstance(handler, FileHandler):
|
151 |
-
handler.stream.write(
|
152 |
-
'Name of parameter - Initialization information\n')
|
153 |
-
for name, param in self.named_parameters():
|
154 |
-
handler.stream.write(
|
155 |
-
f'\n{name} - {param.shape}: '
|
156 |
-
f"\n{self._params_init_info[param]['init_info']} \n")
|
157 |
-
handler.stream.flush()
|
158 |
-
with_file_handler = True
|
159 |
-
if not with_file_handler:
|
160 |
-
for name, param in self.named_parameters():
|
161 |
-
print_log(
|
162 |
-
f'\n{name} - {param.shape}: '
|
163 |
-
f"\n{self._params_init_info[param]['init_info']} \n ",
|
164 |
-
logger=logger_name)
|
165 |
-
|
166 |
-
def __repr__(self):
|
167 |
-
s = super().__repr__()
|
168 |
-
if self.init_cfg:
|
169 |
-
s += f'\ninit_cfg={self.init_cfg}'
|
170 |
-
return s
|
171 |
-
|
172 |
-
|
173 |
-
class Sequential(BaseModule, nn.Sequential):
|
174 |
-
"""Sequential module in openmmlab.
|
175 |
-
|
176 |
-
Args:
|
177 |
-
init_cfg (dict, optional): Initialization config dict.
|
178 |
-
"""
|
179 |
-
|
180 |
-
def __init__(self, *args, init_cfg=None):
|
181 |
-
BaseModule.__init__(self, init_cfg)
|
182 |
-
nn.Sequential.__init__(self, *args)
|
183 |
-
|
184 |
-
|
185 |
-
class ModuleList(BaseModule, nn.ModuleList):
|
186 |
-
"""ModuleList in openmmlab.
|
187 |
-
|
188 |
-
Args:
|
189 |
-
modules (iterable, optional): an iterable of modules to add.
|
190 |
-
init_cfg (dict, optional): Initialization config dict.
|
191 |
-
"""
|
192 |
-
|
193 |
-
def __init__(self, modules=None, init_cfg=None):
|
194 |
-
BaseModule.__init__(self, init_cfg)
|
195 |
-
nn.ModuleList.__init__(self, modules)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Ariharasudhan/YoloV5/utils/loggers/clearml/hpo.py
DELETED
@@ -1,84 +0,0 @@
|
|
1 |
-
from clearml import Task
|
2 |
-
# Connecting ClearML with the current process,
|
3 |
-
# from here on everything is logged automatically
|
4 |
-
from clearml.automation import HyperParameterOptimizer, UniformParameterRange
|
5 |
-
from clearml.automation.optuna import OptimizerOptuna
|
6 |
-
|
7 |
-
task = Task.init(project_name='Hyper-Parameter Optimization',
|
8 |
-
task_name='YOLOv5',
|
9 |
-
task_type=Task.TaskTypes.optimizer,
|
10 |
-
reuse_last_task_id=False)
|
11 |
-
|
12 |
-
# Example use case:
|
13 |
-
optimizer = HyperParameterOptimizer(
|
14 |
-
# This is the experiment we want to optimize
|
15 |
-
base_task_id='<your_template_task_id>',
|
16 |
-
# here we define the hyper-parameters to optimize
|
17 |
-
# Notice: The parameter name should exactly match what you see in the UI: <section_name>/<parameter>
|
18 |
-
# For Example, here we see in the base experiment a section Named: "General"
|
19 |
-
# under it a parameter named "batch_size", this becomes "General/batch_size"
|
20 |
-
# If you have `argparse` for example, then arguments will appear under the "Args" section,
|
21 |
-
# and you should instead pass "Args/batch_size"
|
22 |
-
hyper_parameters=[
|
23 |
-
UniformParameterRange('Hyperparameters/lr0', min_value=1e-5, max_value=1e-1),
|
24 |
-
UniformParameterRange('Hyperparameters/lrf', min_value=0.01, max_value=1.0),
|
25 |
-
UniformParameterRange('Hyperparameters/momentum', min_value=0.6, max_value=0.98),
|
26 |
-
UniformParameterRange('Hyperparameters/weight_decay', min_value=0.0, max_value=0.001),
|
27 |
-
UniformParameterRange('Hyperparameters/warmup_epochs', min_value=0.0, max_value=5.0),
|
28 |
-
UniformParameterRange('Hyperparameters/warmup_momentum', min_value=0.0, max_value=0.95),
|
29 |
-
UniformParameterRange('Hyperparameters/warmup_bias_lr', min_value=0.0, max_value=0.2),
|
30 |
-
UniformParameterRange('Hyperparameters/box', min_value=0.02, max_value=0.2),
|
31 |
-
UniformParameterRange('Hyperparameters/cls', min_value=0.2, max_value=4.0),
|
32 |
-
UniformParameterRange('Hyperparameters/cls_pw', min_value=0.5, max_value=2.0),
|
33 |
-
UniformParameterRange('Hyperparameters/obj', min_value=0.2, max_value=4.0),
|
34 |
-
UniformParameterRange('Hyperparameters/obj_pw', min_value=0.5, max_value=2.0),
|
35 |
-
UniformParameterRange('Hyperparameters/iou_t', min_value=0.1, max_value=0.7),
|
36 |
-
UniformParameterRange('Hyperparameters/anchor_t', min_value=2.0, max_value=8.0),
|
37 |
-
UniformParameterRange('Hyperparameters/fl_gamma', min_value=0.0, max_value=4.0),
|
38 |
-
UniformParameterRange('Hyperparameters/hsv_h', min_value=0.0, max_value=0.1),
|
39 |
-
UniformParameterRange('Hyperparameters/hsv_s', min_value=0.0, max_value=0.9),
|
40 |
-
UniformParameterRange('Hyperparameters/hsv_v', min_value=0.0, max_value=0.9),
|
41 |
-
UniformParameterRange('Hyperparameters/degrees', min_value=0.0, max_value=45.0),
|
42 |
-
UniformParameterRange('Hyperparameters/translate', min_value=0.0, max_value=0.9),
|
43 |
-
UniformParameterRange('Hyperparameters/scale', min_value=0.0, max_value=0.9),
|
44 |
-
UniformParameterRange('Hyperparameters/shear', min_value=0.0, max_value=10.0),
|
45 |
-
UniformParameterRange('Hyperparameters/perspective', min_value=0.0, max_value=0.001),
|
46 |
-
UniformParameterRange('Hyperparameters/flipud', min_value=0.0, max_value=1.0),
|
47 |
-
UniformParameterRange('Hyperparameters/fliplr', min_value=0.0, max_value=1.0),
|
48 |
-
UniformParameterRange('Hyperparameters/mosaic', min_value=0.0, max_value=1.0),
|
49 |
-
UniformParameterRange('Hyperparameters/mixup', min_value=0.0, max_value=1.0),
|
50 |
-
UniformParameterRange('Hyperparameters/copy_paste', min_value=0.0, max_value=1.0)],
|
51 |
-
# this is the objective metric we want to maximize/minimize
|
52 |
-
objective_metric_title='metrics',
|
53 |
-
objective_metric_series='mAP_0.5',
|
54 |
-
# now we decide if we want to maximize it or minimize it (accuracy we maximize)
|
55 |
-
objective_metric_sign='max',
|
56 |
-
# let us limit the number of concurrent experiments,
|
57 |
-
# this in turn will make sure we do dont bombard the scheduler with experiments.
|
58 |
-
# if we have an auto-scaler connected, this, by proxy, will limit the number of machine
|
59 |
-
max_number_of_concurrent_tasks=1,
|
60 |
-
# this is the optimizer class (actually doing the optimization)
|
61 |
-
# Currently, we can choose from GridSearch, RandomSearch or OptimizerBOHB (Bayesian optimization Hyper-Band)
|
62 |
-
optimizer_class=OptimizerOptuna,
|
63 |
-
# If specified only the top K performing Tasks will be kept, the others will be automatically archived
|
64 |
-
save_top_k_tasks_only=5, # 5,
|
65 |
-
compute_time_limit=None,
|
66 |
-
total_max_jobs=20,
|
67 |
-
min_iteration_per_job=None,
|
68 |
-
max_iteration_per_job=None,
|
69 |
-
)
|
70 |
-
|
71 |
-
# report every 10 seconds, this is way too often, but we are testing here
|
72 |
-
optimizer.set_report_period(10 / 60)
|
73 |
-
# You can also use the line below instead to run all the optimizer tasks locally, without using queues or agent
|
74 |
-
# an_optimizer.start_locally(job_complete_callback=job_complete_callback)
|
75 |
-
# set the time limit for the optimization process (2 hours)
|
76 |
-
optimizer.set_time_limit(in_minutes=120.0)
|
77 |
-
# Start the optimization process in the local environment
|
78 |
-
optimizer.start_locally()
|
79 |
-
# wait until process is done (notice we are controlling the optimization process in the background)
|
80 |
-
optimizer.wait()
|
81 |
-
# make sure background optimization stopped
|
82 |
-
optimizer.stop()
|
83 |
-
|
84 |
-
print('We are done, good bye')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Ataturk-Chatbot/HuggingFaceChat/venv/lib/python3.11/site-packages/pip/_vendor/urllib3/packages/backports/makefile.py
DELETED
@@ -1,51 +0,0 @@
|
|
1 |
-
# -*- coding: utf-8 -*-
|
2 |
-
"""
|
3 |
-
backports.makefile
|
4 |
-
~~~~~~~~~~~~~~~~~~
|
5 |
-
|
6 |
-
Backports the Python 3 ``socket.makefile`` method for use with anything that
|
7 |
-
wants to create a "fake" socket object.
|
8 |
-
"""
|
9 |
-
import io
|
10 |
-
from socket import SocketIO
|
11 |
-
|
12 |
-
|
13 |
-
def backport_makefile(
|
14 |
-
self, mode="r", buffering=None, encoding=None, errors=None, newline=None
|
15 |
-
):
|
16 |
-
"""
|
17 |
-
Backport of ``socket.makefile`` from Python 3.5.
|
18 |
-
"""
|
19 |
-
if not set(mode) <= {"r", "w", "b"}:
|
20 |
-
raise ValueError("invalid mode %r (only r, w, b allowed)" % (mode,))
|
21 |
-
writing = "w" in mode
|
22 |
-
reading = "r" in mode or not writing
|
23 |
-
assert reading or writing
|
24 |
-
binary = "b" in mode
|
25 |
-
rawmode = ""
|
26 |
-
if reading:
|
27 |
-
rawmode += "r"
|
28 |
-
if writing:
|
29 |
-
rawmode += "w"
|
30 |
-
raw = SocketIO(self, rawmode)
|
31 |
-
self._makefile_refs += 1
|
32 |
-
if buffering is None:
|
33 |
-
buffering = -1
|
34 |
-
if buffering < 0:
|
35 |
-
buffering = io.DEFAULT_BUFFER_SIZE
|
36 |
-
if buffering == 0:
|
37 |
-
if not binary:
|
38 |
-
raise ValueError("unbuffered streams must be binary")
|
39 |
-
return raw
|
40 |
-
if reading and writing:
|
41 |
-
buffer = io.BufferedRWPair(raw, raw, buffering)
|
42 |
-
elif reading:
|
43 |
-
buffer = io.BufferedReader(raw, buffering)
|
44 |
-
else:
|
45 |
-
assert writing
|
46 |
-
buffer = io.BufferedWriter(raw, buffering)
|
47 |
-
if binary:
|
48 |
-
return buffer
|
49 |
-
text = io.TextIOWrapper(buffer, encoding, errors, newline)
|
50 |
-
text.mode = mode
|
51 |
-
return text
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Ataturk-Chatbot/HuggingFaceChat/venv/lib/python3.11/site-packages/pkg_resources/_vendor/pyparsing/util.py
DELETED
@@ -1,235 +0,0 @@
|
|
1 |
-
# util.py
|
2 |
-
import warnings
|
3 |
-
import types
|
4 |
-
import collections
|
5 |
-
import itertools
|
6 |
-
from functools import lru_cache
|
7 |
-
from typing import List, Union, Iterable
|
8 |
-
|
9 |
-
_bslash = chr(92)
|
10 |
-
|
11 |
-
|
12 |
-
class __config_flags:
|
13 |
-
"""Internal class for defining compatibility and debugging flags"""
|
14 |
-
|
15 |
-
_all_names: List[str] = []
|
16 |
-
_fixed_names: List[str] = []
|
17 |
-
_type_desc = "configuration"
|
18 |
-
|
19 |
-
@classmethod
|
20 |
-
def _set(cls, dname, value):
|
21 |
-
if dname in cls._fixed_names:
|
22 |
-
warnings.warn(
|
23 |
-
"{}.{} {} is {} and cannot be overridden".format(
|
24 |
-
cls.__name__,
|
25 |
-
dname,
|
26 |
-
cls._type_desc,
|
27 |
-
str(getattr(cls, dname)).upper(),
|
28 |
-
)
|
29 |
-
)
|
30 |
-
return
|
31 |
-
if dname in cls._all_names:
|
32 |
-
setattr(cls, dname, value)
|
33 |
-
else:
|
34 |
-
raise ValueError("no such {} {!r}".format(cls._type_desc, dname))
|
35 |
-
|
36 |
-
enable = classmethod(lambda cls, name: cls._set(name, True))
|
37 |
-
disable = classmethod(lambda cls, name: cls._set(name, False))
|
38 |
-
|
39 |
-
|
40 |
-
@lru_cache(maxsize=128)
|
41 |
-
def col(loc: int, strg: str) -> int:
|
42 |
-
"""
|
43 |
-
Returns current column within a string, counting newlines as line separators.
|
44 |
-
The first column is number 1.
|
45 |
-
|
46 |
-
Note: the default parsing behavior is to expand tabs in the input string
|
47 |
-
before starting the parsing process. See
|
48 |
-
:class:`ParserElement.parseString` for more
|
49 |
-
information on parsing strings containing ``<TAB>`` s, and suggested
|
50 |
-
methods to maintain a consistent view of the parsed string, the parse
|
51 |
-
location, and line and column positions within the parsed string.
|
52 |
-
"""
|
53 |
-
s = strg
|
54 |
-
return 1 if 0 < loc < len(s) and s[loc - 1] == "\n" else loc - s.rfind("\n", 0, loc)
|
55 |
-
|
56 |
-
|
57 |
-
@lru_cache(maxsize=128)
|
58 |
-
def lineno(loc: int, strg: str) -> int:
|
59 |
-
"""Returns current line number within a string, counting newlines as line separators.
|
60 |
-
The first line is number 1.
|
61 |
-
|
62 |
-
Note - the default parsing behavior is to expand tabs in the input string
|
63 |
-
before starting the parsing process. See :class:`ParserElement.parseString`
|
64 |
-
for more information on parsing strings containing ``<TAB>`` s, and
|
65 |
-
suggested methods to maintain a consistent view of the parsed string, the
|
66 |
-
parse location, and line and column positions within the parsed string.
|
67 |
-
"""
|
68 |
-
return strg.count("\n", 0, loc) + 1
|
69 |
-
|
70 |
-
|
71 |
-
@lru_cache(maxsize=128)
|
72 |
-
def line(loc: int, strg: str) -> str:
|
73 |
-
"""
|
74 |
-
Returns the line of text containing loc within a string, counting newlines as line separators.
|
75 |
-
"""
|
76 |
-
last_cr = strg.rfind("\n", 0, loc)
|
77 |
-
next_cr = strg.find("\n", loc)
|
78 |
-
return strg[last_cr + 1 : next_cr] if next_cr >= 0 else strg[last_cr + 1 :]
|
79 |
-
|
80 |
-
|
81 |
-
class _UnboundedCache:
|
82 |
-
def __init__(self):
|
83 |
-
cache = {}
|
84 |
-
cache_get = cache.get
|
85 |
-
self.not_in_cache = not_in_cache = object()
|
86 |
-
|
87 |
-
def get(_, key):
|
88 |
-
return cache_get(key, not_in_cache)
|
89 |
-
|
90 |
-
def set_(_, key, value):
|
91 |
-
cache[key] = value
|
92 |
-
|
93 |
-
def clear(_):
|
94 |
-
cache.clear()
|
95 |
-
|
96 |
-
self.size = None
|
97 |
-
self.get = types.MethodType(get, self)
|
98 |
-
self.set = types.MethodType(set_, self)
|
99 |
-
self.clear = types.MethodType(clear, self)
|
100 |
-
|
101 |
-
|
102 |
-
class _FifoCache:
|
103 |
-
def __init__(self, size):
|
104 |
-
self.not_in_cache = not_in_cache = object()
|
105 |
-
cache = collections.OrderedDict()
|
106 |
-
cache_get = cache.get
|
107 |
-
|
108 |
-
def get(_, key):
|
109 |
-
return cache_get(key, not_in_cache)
|
110 |
-
|
111 |
-
def set_(_, key, value):
|
112 |
-
cache[key] = value
|
113 |
-
while len(cache) > size:
|
114 |
-
cache.popitem(last=False)
|
115 |
-
|
116 |
-
def clear(_):
|
117 |
-
cache.clear()
|
118 |
-
|
119 |
-
self.size = size
|
120 |
-
self.get = types.MethodType(get, self)
|
121 |
-
self.set = types.MethodType(set_, self)
|
122 |
-
self.clear = types.MethodType(clear, self)
|
123 |
-
|
124 |
-
|
125 |
-
class LRUMemo:
|
126 |
-
"""
|
127 |
-
A memoizing mapping that retains `capacity` deleted items
|
128 |
-
|
129 |
-
The memo tracks retained items by their access order; once `capacity` items
|
130 |
-
are retained, the least recently used item is discarded.
|
131 |
-
"""
|
132 |
-
|
133 |
-
def __init__(self, capacity):
|
134 |
-
self._capacity = capacity
|
135 |
-
self._active = {}
|
136 |
-
self._memory = collections.OrderedDict()
|
137 |
-
|
138 |
-
def __getitem__(self, key):
|
139 |
-
try:
|
140 |
-
return self._active[key]
|
141 |
-
except KeyError:
|
142 |
-
self._memory.move_to_end(key)
|
143 |
-
return self._memory[key]
|
144 |
-
|
145 |
-
def __setitem__(self, key, value):
|
146 |
-
self._memory.pop(key, None)
|
147 |
-
self._active[key] = value
|
148 |
-
|
149 |
-
def __delitem__(self, key):
|
150 |
-
try:
|
151 |
-
value = self._active.pop(key)
|
152 |
-
except KeyError:
|
153 |
-
pass
|
154 |
-
else:
|
155 |
-
while len(self._memory) >= self._capacity:
|
156 |
-
self._memory.popitem(last=False)
|
157 |
-
self._memory[key] = value
|
158 |
-
|
159 |
-
def clear(self):
|
160 |
-
self._active.clear()
|
161 |
-
self._memory.clear()
|
162 |
-
|
163 |
-
|
164 |
-
class UnboundedMemo(dict):
|
165 |
-
"""
|
166 |
-
A memoizing mapping that retains all deleted items
|
167 |
-
"""
|
168 |
-
|
169 |
-
def __delitem__(self, key):
|
170 |
-
pass
|
171 |
-
|
172 |
-
|
173 |
-
def _escape_regex_range_chars(s: str) -> str:
|
174 |
-
# escape these chars: ^-[]
|
175 |
-
for c in r"\^-[]":
|
176 |
-
s = s.replace(c, _bslash + c)
|
177 |
-
s = s.replace("\n", r"\n")
|
178 |
-
s = s.replace("\t", r"\t")
|
179 |
-
return str(s)
|
180 |
-
|
181 |
-
|
182 |
-
def _collapse_string_to_ranges(
|
183 |
-
s: Union[str, Iterable[str]], re_escape: bool = True
|
184 |
-
) -> str:
|
185 |
-
def is_consecutive(c):
|
186 |
-
c_int = ord(c)
|
187 |
-
is_consecutive.prev, prev = c_int, is_consecutive.prev
|
188 |
-
if c_int - prev > 1:
|
189 |
-
is_consecutive.value = next(is_consecutive.counter)
|
190 |
-
return is_consecutive.value
|
191 |
-
|
192 |
-
is_consecutive.prev = 0
|
193 |
-
is_consecutive.counter = itertools.count()
|
194 |
-
is_consecutive.value = -1
|
195 |
-
|
196 |
-
def escape_re_range_char(c):
|
197 |
-
return "\\" + c if c in r"\^-][" else c
|
198 |
-
|
199 |
-
def no_escape_re_range_char(c):
|
200 |
-
return c
|
201 |
-
|
202 |
-
if not re_escape:
|
203 |
-
escape_re_range_char = no_escape_re_range_char
|
204 |
-
|
205 |
-
ret = []
|
206 |
-
s = "".join(sorted(set(s)))
|
207 |
-
if len(s) > 3:
|
208 |
-
for _, chars in itertools.groupby(s, key=is_consecutive):
|
209 |
-
first = last = next(chars)
|
210 |
-
last = collections.deque(
|
211 |
-
itertools.chain(iter([last]), chars), maxlen=1
|
212 |
-
).pop()
|
213 |
-
if first == last:
|
214 |
-
ret.append(escape_re_range_char(first))
|
215 |
-
else:
|
216 |
-
sep = "" if ord(last) == ord(first) + 1 else "-"
|
217 |
-
ret.append(
|
218 |
-
"{}{}{}".format(
|
219 |
-
escape_re_range_char(first), sep, escape_re_range_char(last)
|
220 |
-
)
|
221 |
-
)
|
222 |
-
else:
|
223 |
-
ret = [escape_re_range_char(c) for c in s]
|
224 |
-
|
225 |
-
return "".join(ret)
|
226 |
-
|
227 |
-
|
228 |
-
def _flatten(ll: list) -> list:
|
229 |
-
ret = []
|
230 |
-
for i in ll:
|
231 |
-
if isinstance(i, list):
|
232 |
-
ret.extend(_flatten(i))
|
233 |
-
else:
|
234 |
-
ret.append(i)
|
235 |
-
return ret
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Audio-AGI/AudioSep/models/CLAP/open_clip/linear_probe.py
DELETED
@@ -1,66 +0,0 @@
|
|
1 |
-
import numpy as np
|
2 |
-
import torch.nn.functional as F
|
3 |
-
from torch import nn
|
4 |
-
from .model import MLPLayers
|
5 |
-
|
6 |
-
|
7 |
-
class LinearProbe(nn.Module):
|
8 |
-
def __init__(self, model, mlp, freeze, in_ch, out_ch, act=None):
|
9 |
-
"""
|
10 |
-
Args:
|
11 |
-
model: nn.Module
|
12 |
-
mlp: bool, if True, then use the MLP layer as the linear probe module
|
13 |
-
freeze: bool, if Ture, then freeze all the CLAP model's layers when training the linear probe
|
14 |
-
in_ch: int, the output channel from CLAP model
|
15 |
-
out_ch: int, the output channel from linear probe (class_num)
|
16 |
-
act: torch.nn.functional, the activation function before the loss function
|
17 |
-
"""
|
18 |
-
super().__init__()
|
19 |
-
in_ch = 512
|
20 |
-
self.clap_model = model
|
21 |
-
self.clap_model.text_branch = None # to save memory
|
22 |
-
self.freeze = freeze
|
23 |
-
if mlp:
|
24 |
-
self.lp_layer = MLPLayers(units=[in_ch, in_ch * 2, out_ch])
|
25 |
-
else:
|
26 |
-
self.lp_layer = nn.Linear(in_ch, out_ch)
|
27 |
-
|
28 |
-
if self.freeze:
|
29 |
-
for param in self.clap_model.parameters():
|
30 |
-
param.requires_grad = False
|
31 |
-
|
32 |
-
if act == "None":
|
33 |
-
self.act = None
|
34 |
-
elif act == "relu":
|
35 |
-
self.act = nn.ReLU()
|
36 |
-
elif act == "elu":
|
37 |
-
self.act = nn.ELU()
|
38 |
-
elif act == "prelu":
|
39 |
-
self.act = nn.PReLU(num_parameters=in_ch)
|
40 |
-
elif act == "softmax":
|
41 |
-
self.act = nn.Softmax(dim=-1)
|
42 |
-
elif act == "sigmoid":
|
43 |
-
self.act = nn.Sigmoid()
|
44 |
-
|
45 |
-
def forward(self, x, mix_lambda=None, device=None):
|
46 |
-
"""
|
47 |
-
Args:
|
48 |
-
x: waveform, torch.tensor [batch, t_samples] / batch of mel_spec and longer list
|
49 |
-
mix_lambda: torch.tensor [batch], the mixup lambda
|
50 |
-
Returns:
|
51 |
-
class_prob: torch.tensor [batch, class_num]
|
52 |
-
|
53 |
-
"""
|
54 |
-
# batchnorm cancel grandient
|
55 |
-
if self.freeze:
|
56 |
-
self.clap_model.eval()
|
57 |
-
|
58 |
-
x = self.clap_model.audio_projection(
|
59 |
-
self.clap_model.audio_branch(x, mixup_lambda=mix_lambda, device=device)[
|
60 |
-
"embedding"
|
61 |
-
]
|
62 |
-
)
|
63 |
-
out = self.lp_layer(x)
|
64 |
-
if self.act is not None:
|
65 |
-
out = self.act(out)
|
66 |
-
return out
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/AutoLLM/AutoAgents/autoagents/tools/tools.py
DELETED
@@ -1,65 +0,0 @@
|
|
1 |
-
import os
|
2 |
-
|
3 |
-
from duckpy import Client
|
4 |
-
from langchain import PromptTemplate, OpenAI, LLMChain
|
5 |
-
from langchain.agents import Tool
|
6 |
-
from langchain.base_language import BaseLanguageModel
|
7 |
-
|
8 |
-
|
9 |
-
MAX_SEARCH_RESULTS = 20 # Number of search results to observe at a time
|
10 |
-
|
11 |
-
search_description = """ Useful for when you need to ask with search. Use direct language and be
|
12 |
-
EXPLICIT in what you want to search.
|
13 |
-
|
14 |
-
## Examples of incorrect use
|
15 |
-
1. Action: Search
|
16 |
-
Action Input: "[name of bagel shop] menu"
|
17 |
-
|
18 |
-
The Action Input cannot be None or empty.
|
19 |
-
"""
|
20 |
-
|
21 |
-
notepad_description = """ Useful for when you need to note-down specific
|
22 |
-
information for later reference. Please provide full information you want to
|
23 |
-
note-down in the Action Input and all future prompts will remember it.
|
24 |
-
This is the mandatory tool after using the search tool.
|
25 |
-
Using Notepad does not always lead to a final answer.
|
26 |
-
|
27 |
-
## Exampels of using notepad tool
|
28 |
-
Action: Notepad
|
29 |
-
Action Input: the information you want to note-down
|
30 |
-
"""
|
31 |
-
|
32 |
-
async def ddg(query: str):
|
33 |
-
if query is None or query.lower().strip().strip('"') == "none" or query.lower().strip().strip('"') == "null":
|
34 |
-
x = "The action input field is empty. Please provide a search query."
|
35 |
-
return [x]
|
36 |
-
else:
|
37 |
-
client = Client()
|
38 |
-
return client.search(query)[:MAX_SEARCH_RESULTS]
|
39 |
-
|
40 |
-
|
41 |
-
async def notepad(x: str) -> str:
|
42 |
-
return f"{[x]}"
|
43 |
-
|
44 |
-
|
45 |
-
search_tool = Tool(name="Search",
|
46 |
-
func=lambda x: x,
|
47 |
-
coroutine=ddg,
|
48 |
-
description=search_description)
|
49 |
-
|
50 |
-
note_tool = Tool(name="Notepad",
|
51 |
-
func=lambda x: x,
|
52 |
-
coroutine=notepad,
|
53 |
-
description=notepad_description)
|
54 |
-
|
55 |
-
|
56 |
-
def rewrite_search_query(q: str, search_history, llm: BaseLanguageModel) -> str:
|
57 |
-
history_string = '\n'.join(search_history)
|
58 |
-
template ="""We are using the Search tool.
|
59 |
-
# Previous queries:
|
60 |
-
{history_string}. \n\n Rewrite query {action_input} to be
|
61 |
-
different from the previous ones."""
|
62 |
-
prompt = PromptTemplate(template=template,
|
63 |
-
input_variables=["action_input", "history_string"])
|
64 |
-
llm_chain = LLMChain(prompt=prompt, llm=llm)
|
65 |
-
return llm_chain.predict(action_input=q, history_string=history_string)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Banjoo/What_The_Bun/app.py
DELETED
@@ -1,22 +0,0 @@
|
|
1 |
-
__all__ = ['pet_wild', 'learn', 'classify_image', 'categories', 'image', 'label', 'examples', 'intf']
|
2 |
-
|
3 |
-
from fastai.vision.all import *
|
4 |
-
import gradio as gr
|
5 |
-
|
6 |
-
def pet_wild(x): return x[0].isupper()
|
7 |
-
|
8 |
-
learn = load_learner('export.pkl')
|
9 |
-
|
10 |
-
categories = ("Domestic", "Wild")
|
11 |
-
|
12 |
-
def classify_image(img):
|
13 |
-
pred, idx, probs = learn.predict(img)
|
14 |
-
return dict(zip(categories, map(float, probs)))
|
15 |
-
|
16 |
-
image = gr.inputs.Image(shape=(192,192))
|
17 |
-
label = gr.outputs.Label()
|
18 |
-
examples = ['lion_head.jpg', 'tan_bun.jpg', 'wild_bun.jpg']
|
19 |
-
|
20 |
-
intf = gr.Interface(fn=classify_image, inputs=image, outputs=label, examples=examples)
|
21 |
-
|
22 |
-
intf.launch(inline=False)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Benson/text-generation/Examples/Barra De Bar De Hasrate Mp3 Cancin.md
DELETED
@@ -1,66 +0,0 @@
|
|
1 |
-
<br />
|
2 |
-
<h1>Descarga de un documento: ¿Qué es y cómo hacerlo</h1>
|
3 |
-
<p>¿Alguna vez ha encontrado un archivo doc en la web y se preguntó qué es y cómo descargarlo? Si es así, no está solo. Un archivo doc es un tipo común de archivo de documento que puede contener texto, imágenes, tablas, gráficos y otros elementos. En este artículo, explicaremos qué es un archivo doc, cuáles son sus beneficios y desventajas, y cómo descargar un archivo doc desde la web utilizando diferentes métodos. </p>
|
4 |
-
<h2>¿Qué es un archivo Doc? </h2>
|
5 |
-
<p>Un archivo doc es un formato de archivo de documento que fue creado por Microsoft para su software de procesamiento de textos, Microsoft Word. Un archivo doc puede almacenar texto formateado, imágenes, tablas, gráficos y otros elementos que se pueden editar e imprimir. Un archivo doc tiene la extensión . doc o . docx, dependiendo de la versión de Microsoft Word utilizada para crearlo. Un archivo doc puede ser abierto por varias aplicaciones, como Microsoft Word, Google Docs, LibreOffice Writer, y otros. </p>
|
6 |
-
<h2>barra de bar de hasrate mp3 canción</h2><br /><p><b><b>Download File</b> 🌟 <a href="https://bltlly.com/2v6MGE">https://bltlly.com/2v6MGE</a></b></p><br /><br />
|
7 |
-
<h3>Los beneficios de usar archivos Doc</h3>
|
8 |
-
<p>Algunos de los beneficios de usar archivos doc son:</p>
|
9 |
-
<ul>
|
10 |
-
<li> Son ampliamente utilizados y compatibles con muchas aplicaciones y plataformas. </li>
|
11 |
-
<li> Pueden almacenar contenido complejo y rico que se puede editar y formatear fácilmente. </li>
|
12 |
-
<li> Se pueden proteger con contraseñas y cifrado para evitar el acceso no autorizado o modificación. </li>
|
13 |
-
<li> Se pueden comprimir para reducir su tamaño y ahorrar espacio de almacenamiento. </li>
|
14 |
-
</ul>
|
15 |
-
<h3>Los inconvenientes de usar archivos Doc</h3>
|
16 |
-
<p>Algunos de los inconvenientes de usar archivos doc son:</p>
|
17 |
-
<ul>
|
18 |
-
<li>Pueden estar dañados o infectados por virus o malware que pueden dañar o eliminar su contenido. </li>
|
19 |
-
<li>Pueden tener problemas de compatibilidad cuando se abren por diferentes aplicaciones o versiones de Microsoft Word.</li>
|
20 |
-
<li>Pueden perder algún formato o características cuando se convierten a otros formatos de archivo. </li>
|
21 |
-
<li>Pueden ser de gran tamaño y tardar más en descargarse o cargarse. </li>
|
22 |
-
</ul>
|
23 |
-
<h2>Cómo descargar un archivo Doc desde la Web</h2>
|
24 |
-
|
25 |
-
<h3>Usando Google Docs</h3>
|
26 |
-
<p>Google Docs es un editor de documentos en línea que te permite crear, editar y colaborar en documentos en tiempo real. También puede usar Google Docs para descargar un archivo doc desde la web. Estos son los pasos:</p>
|
27 |
-
<h4>Paso 1: Abrir Google Docs e iniciar sesión</h4>
|
28 |
-
<p>Para usar Google Docs, necesitas tener una cuenta de Google. Si no tienes una, puedes crear una gratis. Una vez que tenga una cuenta, vaya a <a href="( 1 )">https://www.google.com/docs/about/</a> e inicie sesión con sus credenciales. </p>
|
29 |
-
<h4>Paso 2: Abra el documento que desea descargar</h4>
|
30 |
-
<p>Si tiene la URL del documento que desea descargar, puede pegarlo en la barra de direcciones de su navegador y presionar Enter. Esto abrirá el documento en Google Docs. Alternativamente, puede hacer clic en el icono Abrir selector de archivos en la esquina superior derecha de Google Docs y elegir Cargar en el menú. A continuación, puede navegar por su ordenador y seleccionar el documento que desea descargar. </p>
|
31 |
-
<h4>Paso 3: Ir al archivo > Descargar y elegir un formato</h4>
|
32 |
-
<p>Una vez que haya abierto el documento en Google Docs, puede descargarlo en su computadora en diferentes formatos. Para ello, vaya a Archivo > Descargar y elija el formato que prefiera. Puede descargar el documento como archivo docx, pdf, odt, rtf, txt, html o epub. El documento se descargará en la carpeta de descarga predeterminada. </p>
|
33 |
-
<h3>Usando Microsoft Word para la Web</h3>
|
34 |
-
<p>Microsoft Word para la Web es una versión en línea de Microsoft Word que le permite crear, editar y compartir documentos en línea. También puede usar Microsoft Word para la Web para descargar un archivo doc desde la web. Estos son los pasos:</p>
|
35 |
-
<p></p>
|
36 |
-
<h4>Paso 1: Abra Microsoft Word para la Web e inicie sesión</h4>
|
37 |
-
<p>Para usar Microsoft Word para la Web, necesita tener una cuenta de Microsoft. Si no tiene una, puede crear una gratis. Una vez que tenga una cuenta, vaya a <a href="">https://www.office.com/launch/word</a> e inicie sesión con sus credenciales. </p>
|
38 |
-
|
39 |
-
<p>Si tiene la URL del documento que desea descargar, puede pegarlo en la barra de direcciones de su navegador y presionar Enter. Esto abrirá el documento en Microsoft Word para la Web. Alternativamente, puede hacer clic en el icono Abrir en la esquina superior izquierda de Microsoft Word para la Web y elegir Cargar y Abrir desde el menú. A continuación, puede navegar por su ordenador y seleccionar el documento que desea descargar. </p>
|
40 |
-
<h4>Paso 3: Ir al archivo > Guardar como > Descargar una copia</h4>
|
41 |
-
<p>Una vez que haya abierto el documento en Microsoft Word para la Web, puede descargarlo en su computadora como un archivo docx. Para hacerlo, vaya a Archivo > Guardar como > Descargar una copia. El documento se descargará en la carpeta de descarga predeterminada. </p>
|
42 |
-
<h3>Uso de una herramienta de descarga de documentos</h3>
|
43 |
-
<p>Si no desea utilizar Google Docs o Microsoft Word para la Web, también puede utilizar una herramienta de descarga de documentos para descargar un archivo doc desde la web. Una herramienta de descarga de documentos es un servicio basado en la web que le permite descargar documentos de varias fuentes y formatos. Estos son los pasos:</p>
|
44 |
-
<h4>Paso 1: Encuentre una herramienta confiable y segura para descargar documentos</h4>
|
45 |
-
<p>Hay muchas herramientas de descarga de documentos disponibles en la web, pero no todas son confiables y seguras. Algunos de ellos pueden contener virus o malware que pueden dañar su computadora o robar su información personal. Por lo tanto, usted debe hacer un poco de investigación y encontrar una herramienta de descarga de documentos de buena reputación y confiable que tiene buenas críticas y calificaciones de otros usuarios. Por ejemplo, puede usar <a href=">https://www.docdownloader.com/</a>, que es un servicio gratuito y fácil de usar que admite varios formatos y fuentes de documentos. </p>
|
46 |
-
<h4>Paso 2: Copie y pegue la URL del documento que desea descargar</h4>
|
47 |
-
|
48 |
-
<h4>Paso 3: Elija un formato y haga clic en Descargar</h4>
|
49 |
-
<p>Después de haber introducido la URL del documento que desea descargar, puede elegir un formato que desea guardar como. Puede elegir entre formatos docx, pdf, odt, rtf, txt, html o epub. Luego, haga clic en el botón Descargar y espere a que se complete el proceso. El documento se descargará en la carpeta de descarga predeterminada. </p>
|
50 |
-
<h2>Conclusión</h2>
|
51 |
-
<p>Un archivo doc es un tipo común de archivo de documento que puede contener texto, imágenes, tablas, gráficos y otros elementos. Tiene muchos beneficios y desventajas cuando se utiliza en la web. Si desea descargar un archivo doc desde la web, puede usar Google Docs, Microsoft Word para la Web o una herramienta de descarga de documentos como se explica en este artículo. Esperamos que este artículo te haya ayudado a entender qué es una descarga de documentos y cómo hacerlo. </p>
|
52 |
-
<h2>Preguntas frecuentes</h2>
|
53 |
-
<ol>
|
54 |
-
<li><b>¿Cuál es la diferencia entre los archivos doc y docx? </b></li>
|
55 |
-
<li>Un archivo doc es una versión anterior del formato de archivo de documento de Microsoft Word que se introdujo en 1983 y tiene la extensión .doc. Un archivo docx es una versión más reciente del formato de archivo de documento de Microsoft Word que se introdujo en 2007 y tiene la extensión .docx. Un archivo docx se basa en XML y es más compatible, seguro y eficiente que un archivo doc. </li>
|
56 |
-
<li><b>¿Cómo puedo abrir un archivo doc sin Microsoft Word? </b></li>
|
57 |
-
<li>Si no tiene Microsoft Word instalado en su computadora, aún puede abrir un archivo doc usando otras aplicaciones o servicios en línea. Algunas de las alternativas son Google Docs, LibreOffice Writer, WPS Office, Zoho Writer y Microsoft Word para la Web.</li>
|
58 |
-
<li><b>¿Cómo puedo convertir un archivo doc a otro formato de archivo? </b></li>
|
59 |
-
|
60 |
-
<li><b>¿Cómo puedo proteger un archivo doc de acceso no autorizado o modificación? </b></li>
|
61 |
-
<li>Si desea proteger un archivo doc de acceso no autorizado o modificación, puede usar una función de contraseña o cifrado que está disponible en algunas aplicaciones que pueden abrir o crear archivos doc. Por ejemplo, en Microsoft Word, puede ir a Archivo > Información > Proteger documento y elegir Cifrar con contraseña o Restringir edición. En Google Docs, puedes ir a Archivo > Compartir y elegir Personas restringidas o específicas.</li>
|
62 |
-
<li><b>¿Cómo puedo reducir el tamaño de un archivo doc? </b></li>
|
63 |
-
<li>Si desea reducir el tamaño de un archivo doc, puede usar una función de compresión que está disponible en algunas aplicaciones que pueden abrir o crear archivos doc. Por ejemplo, en Microsoft Word, puede ir a Archivo > Guardar como > Herramientas > Comprimir imágenes y elegir una opción que se adapte a sus necesidades. En Google Docs, puedes ir a Archivo > Descargar y elegir un formato que tenga un tamaño más pequeño que docx, como pdf o txt.</li>
|
64 |
-
</ol></p> 64aa2da5cf<br />
|
65 |
-
<br />
|
66 |
-
<br />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/BernardoOlisan/vqganclip/taming-transformers/taming/data/utils.py
DELETED
@@ -1,114 +0,0 @@
|
|
1 |
-
import os
|
2 |
-
import numpy as np
|
3 |
-
import urllib
|
4 |
-
import tarfile, zipfile
|
5 |
-
from pathlib import Path
|
6 |
-
from tqdm import tqdm
|
7 |
-
|
8 |
-
|
9 |
-
def unpack(path):
|
10 |
-
if path.endswith("tar.gz"):
|
11 |
-
with tarfile.open(path, "r:gz") as tar:
|
12 |
-
tar.extractall(path=os.path.split(path)[0])
|
13 |
-
elif path.endswith("tar"):
|
14 |
-
with tarfile.open(path, "r:") as tar:
|
15 |
-
tar.extractall(path=os.path.split(path)[0])
|
16 |
-
elif path.endswith("zip"):
|
17 |
-
with zipfile.ZipFile(path, "r") as f:
|
18 |
-
f.extractall(path=os.path.split(path)[0])
|
19 |
-
else:
|
20 |
-
raise NotImplementedError(
|
21 |
-
"Unknown file extension: {}".format(os.path.splitext(path)[1])
|
22 |
-
)
|
23 |
-
|
24 |
-
|
25 |
-
def reporthook(bar):
|
26 |
-
"""tqdm progress bar for downloads."""
|
27 |
-
|
28 |
-
def hook(b=1, bsize=1, tsize=None):
|
29 |
-
if tsize is not None:
|
30 |
-
bar.total = tsize
|
31 |
-
bar.update(b * bsize - bar.n)
|
32 |
-
|
33 |
-
return hook
|
34 |
-
|
35 |
-
|
36 |
-
def get_root(name):
|
37 |
-
base = "data/"
|
38 |
-
root = os.path.join(base, name)
|
39 |
-
os.makedirs(root, exist_ok=True)
|
40 |
-
return root
|
41 |
-
|
42 |
-
|
43 |
-
def is_prepared(root):
|
44 |
-
return Path(root).joinpath(".ready").exists()
|
45 |
-
|
46 |
-
|
47 |
-
def mark_prepared(root):
|
48 |
-
Path(root).joinpath(".ready").touch()
|
49 |
-
|
50 |
-
|
51 |
-
def prompt_download(file_, source, target_dir, content_dir=None):
|
52 |
-
targetpath = os.path.join(target_dir, file_)
|
53 |
-
while not os.path.exists(targetpath):
|
54 |
-
if content_dir is not None and os.path.exists(
|
55 |
-
os.path.join(target_dir, content_dir)
|
56 |
-
):
|
57 |
-
break
|
58 |
-
print(
|
59 |
-
"Please download '{}' from '{}' to '{}'.".format(file_, source, targetpath)
|
60 |
-
)
|
61 |
-
if content_dir is not None:
|
62 |
-
print(
|
63 |
-
"Or place its content into '{}'.".format(
|
64 |
-
os.path.join(target_dir, content_dir)
|
65 |
-
)
|
66 |
-
)
|
67 |
-
input("Press Enter when done...")
|
68 |
-
return targetpath
|
69 |
-
|
70 |
-
|
71 |
-
def download_url(file_, url, target_dir):
|
72 |
-
targetpath = os.path.join(target_dir, file_)
|
73 |
-
os.makedirs(target_dir, exist_ok=True)
|
74 |
-
with tqdm(
|
75 |
-
unit="B", unit_scale=True, unit_divisor=1024, miniters=1, desc=file_
|
76 |
-
) as bar:
|
77 |
-
urllib.request.urlretrieve(url, targetpath, reporthook=reporthook(bar))
|
78 |
-
return targetpath
|
79 |
-
|
80 |
-
|
81 |
-
def download_urls(urls, target_dir):
|
82 |
-
paths = dict()
|
83 |
-
for fname, url in urls.items():
|
84 |
-
outpath = download_url(fname, url, target_dir)
|
85 |
-
paths[fname] = outpath
|
86 |
-
return paths
|
87 |
-
|
88 |
-
|
89 |
-
def quadratic_crop(x, bbox, alpha=1.0):
|
90 |
-
"""bbox is xmin, ymin, xmax, ymax"""
|
91 |
-
im_h, im_w = x.shape[:2]
|
92 |
-
bbox = np.array(bbox, dtype=np.float32)
|
93 |
-
bbox = np.clip(bbox, 0, max(im_h, im_w))
|
94 |
-
center = 0.5 * (bbox[0] + bbox[2]), 0.5 * (bbox[1] + bbox[3])
|
95 |
-
w = bbox[2] - bbox[0]
|
96 |
-
h = bbox[3] - bbox[1]
|
97 |
-
l = int(alpha * max(w, h))
|
98 |
-
l = max(l, 2)
|
99 |
-
|
100 |
-
required_padding = -1 * min(
|
101 |
-
center[0] - l, center[1] - l, im_w - (center[0] + l), im_h - (center[1] + l)
|
102 |
-
)
|
103 |
-
required_padding = int(np.ceil(required_padding))
|
104 |
-
if required_padding > 0:
|
105 |
-
padding = [
|
106 |
-
[required_padding, required_padding],
|
107 |
-
[required_padding, required_padding],
|
108 |
-
]
|
109 |
-
padding += [[0, 0]] * (len(x.shape) - 2)
|
110 |
-
x = np.pad(x, padding, "reflect")
|
111 |
-
center = center[0] + required_padding, center[1] + required_padding
|
112 |
-
xmin = int(center[0] - l / 2)
|
113 |
-
ymin = int(center[1] - l / 2)
|
114 |
-
return np.array(x[ymin : ymin + l, xmin : xmin + l, ...])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/BilalSardar/QuestionAndAnswer/README.md
DELETED
@@ -1,12 +0,0 @@
|
|
1 |
-
---
|
2 |
-
title: QuestionAndAnswer
|
3 |
-
emoji: 👀
|
4 |
-
colorFrom: gray
|
5 |
-
colorTo: purple
|
6 |
-
sdk: gradio
|
7 |
-
sdk_version: 3.1.7
|
8 |
-
app_file: app.py
|
9 |
-
pinned: false
|
10 |
-
---
|
11 |
-
|
12 |
-
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/BramVanroy/spacey_conll/utils.py
DELETED
@@ -1,68 +0,0 @@
|
|
1 |
-
import base64
|
2 |
-
from io import BytesIO
|
3 |
-
from typing import Optional, Union
|
4 |
-
|
5 |
-
import pandas as pd
|
6 |
-
import spacy
|
7 |
-
from spacy import Language
|
8 |
-
from spacy_conll.utils import SpacyPretokenizedTokenizer
|
9 |
-
import streamlit as st
|
10 |
-
|
11 |
-
|
12 |
-
@st.cache_resource(show_spinner=False)
|
13 |
-
def load_nlp(model_name: str, is_tokenized: bool = False, disable_sbd: bool = False) -> Optional[Language]:
|
14 |
-
"""Load a spaCy model, download it if it has not been installed yet.
|
15 |
-
:param disable_sbd: whether to disable sentence segmentation (also disables tokenization)
|
16 |
-
:param is_tokenized: whether to disable tokenization
|
17 |
-
:param model_name: the model name, e.g., en_core_web_sm
|
18 |
-
"""
|
19 |
-
exclude = ["senter", "sentencizer"] if disable_sbd or is_tokenized else []
|
20 |
-
nlp = spacy.load(model_name, exclude=exclude)
|
21 |
-
if is_tokenized:
|
22 |
-
nlp.tokenizer = SpacyPretokenizedTokenizer(nlp.vocab)
|
23 |
-
if disable_sbd or is_tokenized:
|
24 |
-
nlp.add_pipe("disable_sbd", before="parser")
|
25 |
-
nlp.add_pipe("conll_formatter", last=True)
|
26 |
-
return nlp
|
27 |
-
|
28 |
-
|
29 |
-
def create_download_link(data: Union[str, pd.DataFrame], filename: str, link_text: str = "Download"):
|
30 |
-
if isinstance(data, pd.DataFrame):
|
31 |
-
# Write the DataFrame to an in-memory bytes object
|
32 |
-
bytes_io = BytesIO()
|
33 |
-
with pd.ExcelWriter(bytes_io, "xlsxwriter") as writer:
|
34 |
-
data.to_excel(writer, index=False)
|
35 |
-
|
36 |
-
# Retrieve the bytes from the bytes object
|
37 |
-
b64 = base64.b64encode(bytes_io.getvalue()).decode("utf-8")
|
38 |
-
return f'<a download="{filename}" href="data:application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;base64,{b64}" title="Download">{link_text}</a>'
|
39 |
-
elif isinstance(data, str):
|
40 |
-
b64 = base64.b64encode(data.encode("utf-8")).decode("utf-8")
|
41 |
-
return f'<a download="{filename}" href="data:file/txt;base64,{b64}" title="Download">{link_text}</a>'
|
42 |
-
|
43 |
-
|
44 |
-
MODEL_MAP = {
|
45 |
-
"Catalan": "ca_core_news_sm",
|
46 |
-
"Chinese": "zh_core_web_sm",
|
47 |
-
"Danish": "da_core_news_sm",
|
48 |
-
"Dutch": "nl_core_news_sm",
|
49 |
-
"English": "en_core_web_sm",
|
50 |
-
"Finnish": "fi_core_news_sm",
|
51 |
-
"French": "fr_core_news_sm",
|
52 |
-
"German": "de_core_news_sm",
|
53 |
-
"Greek": "el_core_news_sm",
|
54 |
-
"Italian": "it_core_news_sm",
|
55 |
-
"Japanese": "ja_core_news_sm",
|
56 |
-
"Korean": "ko_core_news_sm",
|
57 |
-
"Lithuanian": "lt_core_news_sm",
|
58 |
-
"Macedonian": "mk_core_news_sm",
|
59 |
-
"Multi-language": "xx_ent_wiki_sm",
|
60 |
-
"Norwegian Bokmål": "nb_core_news_sm",
|
61 |
-
"Polish": "pl_core_news_sm",
|
62 |
-
"Portuguese": "pt_core_news_sm",
|
63 |
-
"Romanian": "ro_core_news_sm",
|
64 |
-
"Russian": "ru_core_news_sm",
|
65 |
-
"Spanish": "es_core_news_sm",
|
66 |
-
"Swedish": "sv_core_news_sm",
|
67 |
-
"Ukrainian": "uk_core_news_sm",
|
68 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/CMU-80100/80-100-Pre-Writing-Chatbot-Section-H/prompts.py
DELETED
@@ -1,17 +0,0 @@
|
|
1 |
-
debate_prompt_1 = """
|
2 |
-
You assist in students prewriting tasks for philosophy short essays on Karl Popper's claim that theories cannot be confirmed by successful predictions using the theory but can be proven false by even a single false prediction make using the theory in his book "The Logic of Scientific Discovery," Part I: Introduction to the Logic of Science.
|
3 |
-
|
4 |
-
Tell the student you are going to assist them on the topic and give a detailed explanation of the essay subject below when they start interacting. Tell the user both and so they know the passages.
|
5 |
-
|
6 |
-
Here’s the essay subject:
|
7 |
-
Do you think Popper’s claim that corroboration (wide and varied testing of predictions) of a hypothesis or theory based on it not being falsified by that testing is insufficient for warranting that hypothesis as true or even as “probable,” while, in contrast, a failed prediction from a theory warrants rejecting it as “false.” Justify your position. (This question calls on you to evaluate Popper’s arguments for there being an asymmetry between the strengths of the evidence supporting the truth or falsity of a hypothesis or theory by a successful prediction from that hypothesis or theory and that provided by an unsuccessful prediction from that hypothesis or theory.)
|
8 |
-
|
9 |
-
Tell the students this passage to get them started:
|
10 |
-
Popper says that a hypothesis that has survived repeated attempted falsifications can be considered “corroborated.” (See also Footnote 6 in the reading.) and therefore can be tentatively accepted as working knowledge but can’t be accepted with certainty. His exact words from the reading (where the “decision” refers to comparison of a prediction to what is actually observed) are: “If this decision is positive, that is, if the singular conclusions turn out to be acceptable, or verified, then the theory has, for the time being, passed its test: we have found no reason to discard it.”
|
11 |
-
|
12 |
-
On the other hand, he claims that if a prediction of a theory proves false, there’s an end to the matter – the theory is without doubt false and cannot be considered scientific knowledge. His exact words from the reading are: “negative decisions may always overthrow it (the theory).” The asymmetry in the epistemological judgments based on the difference between a theory’s predictions succeeding and failing has struck many philosophers as odd.
|
13 |
-
|
14 |
-
In your role, you only want to refer to this subject and not outside information. You do not provide samples of essays or papers. Do no revise papers for students. Only provide sentence level advice. Do not restructure papers or essays. Do not provide paragraph examples. Always provide original excerpts from the paper when possible so the student are exposed to the original text.
|
15 |
-
|
16 |
-
|
17 |
-
"""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/CVPR/LIVE/pybind11/tests/test_sequences_and_iterators.cpp
DELETED
@@ -1,358 +0,0 @@
|
|
1 |
-
/*
|
2 |
-
tests/test_sequences_and_iterators.cpp -- supporting Pythons' sequence protocol, iterators,
|
3 |
-
etc.
|
4 |
-
|
5 |
-
Copyright (c) 2016 Wenzel Jakob <[email protected]>
|
6 |
-
|
7 |
-
All rights reserved. Use of this source code is governed by a
|
8 |
-
BSD-style license that can be found in the LICENSE file.
|
9 |
-
*/
|
10 |
-
|
11 |
-
#include "pybind11_tests.h"
|
12 |
-
#include "constructor_stats.h"
|
13 |
-
#include <pybind11/operators.h>
|
14 |
-
#include <pybind11/stl.h>
|
15 |
-
|
16 |
-
#include <algorithm>
|
17 |
-
|
18 |
-
template<typename T>
|
19 |
-
class NonZeroIterator {
|
20 |
-
const T* ptr_;
|
21 |
-
public:
|
22 |
-
NonZeroIterator(const T* ptr) : ptr_(ptr) {}
|
23 |
-
const T& operator*() const { return *ptr_; }
|
24 |
-
NonZeroIterator& operator++() { ++ptr_; return *this; }
|
25 |
-
};
|
26 |
-
|
27 |
-
class NonZeroSentinel {};
|
28 |
-
|
29 |
-
template<typename A, typename B>
|
30 |
-
bool operator==(const NonZeroIterator<std::pair<A, B>>& it, const NonZeroSentinel&) {
|
31 |
-
return !(*it).first || !(*it).second;
|
32 |
-
}
|
33 |
-
|
34 |
-
template <typename PythonType>
|
35 |
-
py::list test_random_access_iterator(PythonType x) {
|
36 |
-
if (x.size() < 5)
|
37 |
-
throw py::value_error("Please provide at least 5 elements for testing.");
|
38 |
-
|
39 |
-
auto checks = py::list();
|
40 |
-
auto assert_equal = [&checks](py::handle a, py::handle b) {
|
41 |
-
auto result = PyObject_RichCompareBool(a.ptr(), b.ptr(), Py_EQ);
|
42 |
-
if (result == -1) { throw py::error_already_set(); }
|
43 |
-
checks.append(result != 0);
|
44 |
-
};
|
45 |
-
|
46 |
-
auto it = x.begin();
|
47 |
-
assert_equal(x[0], *it);
|
48 |
-
assert_equal(x[0], it[0]);
|
49 |
-
assert_equal(x[1], it[1]);
|
50 |
-
|
51 |
-
assert_equal(x[1], *(++it));
|
52 |
-
assert_equal(x[1], *(it++));
|
53 |
-
assert_equal(x[2], *it);
|
54 |
-
assert_equal(x[3], *(it += 1));
|
55 |
-
assert_equal(x[2], *(--it));
|
56 |
-
assert_equal(x[2], *(it--));
|
57 |
-
assert_equal(x[1], *it);
|
58 |
-
assert_equal(x[0], *(it -= 1));
|
59 |
-
|
60 |
-
assert_equal(it->attr("real"), x[0].attr("real"));
|
61 |
-
assert_equal((it + 1)->attr("real"), x[1].attr("real"));
|
62 |
-
|
63 |
-
assert_equal(x[1], *(it + 1));
|
64 |
-
assert_equal(x[1], *(1 + it));
|
65 |
-
it += 3;
|
66 |
-
assert_equal(x[1], *(it - 2));
|
67 |
-
|
68 |
-
checks.append(static_cast<std::size_t>(x.end() - x.begin()) == x.size());
|
69 |
-
checks.append((x.begin() + static_cast<std::ptrdiff_t>(x.size())) == x.end());
|
70 |
-
checks.append(x.begin() < x.end());
|
71 |
-
|
72 |
-
return checks;
|
73 |
-
}
|
74 |
-
|
75 |
-
TEST_SUBMODULE(sequences_and_iterators, m) {
|
76 |
-
// test_sliceable
|
77 |
-
class Sliceable{
|
78 |
-
public:
|
79 |
-
Sliceable(int n): size(n) {}
|
80 |
-
int start,stop,step;
|
81 |
-
int size;
|
82 |
-
};
|
83 |
-
py::class_<Sliceable>(m,"Sliceable")
|
84 |
-
.def(py::init<int>())
|
85 |
-
.def("__getitem__",[](const Sliceable &s, py::slice slice) {
|
86 |
-
ssize_t start, stop, step, slicelength;
|
87 |
-
if (!slice.compute(s.size, &start, &stop, &step, &slicelength))
|
88 |
-
throw py::error_already_set();
|
89 |
-
int istart = static_cast<int>(start);
|
90 |
-
int istop = static_cast<int>(stop);
|
91 |
-
int istep = static_cast<int>(step);
|
92 |
-
return std::make_tuple(istart,istop,istep);
|
93 |
-
})
|
94 |
-
;
|
95 |
-
|
96 |
-
// test_sequence
|
97 |
-
class Sequence {
|
98 |
-
public:
|
99 |
-
Sequence(size_t size) : m_size(size) {
|
100 |
-
print_created(this, "of size", m_size);
|
101 |
-
m_data = new float[size];
|
102 |
-
memset(m_data, 0, sizeof(float) * size);
|
103 |
-
}
|
104 |
-
Sequence(const std::vector<float> &value) : m_size(value.size()) {
|
105 |
-
print_created(this, "of size", m_size, "from std::vector");
|
106 |
-
m_data = new float[m_size];
|
107 |
-
memcpy(m_data, &value[0], sizeof(float) * m_size);
|
108 |
-
}
|
109 |
-
Sequence(const Sequence &s) : m_size(s.m_size) {
|
110 |
-
print_copy_created(this);
|
111 |
-
m_data = new float[m_size];
|
112 |
-
memcpy(m_data, s.m_data, sizeof(float)*m_size);
|
113 |
-
}
|
114 |
-
Sequence(Sequence &&s) : m_size(s.m_size), m_data(s.m_data) {
|
115 |
-
print_move_created(this);
|
116 |
-
s.m_size = 0;
|
117 |
-
s.m_data = nullptr;
|
118 |
-
}
|
119 |
-
|
120 |
-
~Sequence() { print_destroyed(this); delete[] m_data; }
|
121 |
-
|
122 |
-
Sequence &operator=(const Sequence &s) {
|
123 |
-
if (&s != this) {
|
124 |
-
delete[] m_data;
|
125 |
-
m_size = s.m_size;
|
126 |
-
m_data = new float[m_size];
|
127 |
-
memcpy(m_data, s.m_data, sizeof(float)*m_size);
|
128 |
-
}
|
129 |
-
print_copy_assigned(this);
|
130 |
-
return *this;
|
131 |
-
}
|
132 |
-
|
133 |
-
Sequence &operator=(Sequence &&s) {
|
134 |
-
if (&s != this) {
|
135 |
-
delete[] m_data;
|
136 |
-
m_size = s.m_size;
|
137 |
-
m_data = s.m_data;
|
138 |
-
s.m_size = 0;
|
139 |
-
s.m_data = nullptr;
|
140 |
-
}
|
141 |
-
print_move_assigned(this);
|
142 |
-
return *this;
|
143 |
-
}
|
144 |
-
|
145 |
-
bool operator==(const Sequence &s) const {
|
146 |
-
if (m_size != s.size()) return false;
|
147 |
-
for (size_t i = 0; i < m_size; ++i)
|
148 |
-
if (m_data[i] != s[i])
|
149 |
-
return false;
|
150 |
-
return true;
|
151 |
-
}
|
152 |
-
bool operator!=(const Sequence &s) const { return !operator==(s); }
|
153 |
-
|
154 |
-
float operator[](size_t index) const { return m_data[index]; }
|
155 |
-
float &operator[](size_t index) { return m_data[index]; }
|
156 |
-
|
157 |
-
bool contains(float v) const {
|
158 |
-
for (size_t i = 0; i < m_size; ++i)
|
159 |
-
if (v == m_data[i])
|
160 |
-
return true;
|
161 |
-
return false;
|
162 |
-
}
|
163 |
-
|
164 |
-
Sequence reversed() const {
|
165 |
-
Sequence result(m_size);
|
166 |
-
for (size_t i = 0; i < m_size; ++i)
|
167 |
-
result[m_size - i - 1] = m_data[i];
|
168 |
-
return result;
|
169 |
-
}
|
170 |
-
|
171 |
-
size_t size() const { return m_size; }
|
172 |
-
|
173 |
-
const float *begin() const { return m_data; }
|
174 |
-
const float *end() const { return m_data+m_size; }
|
175 |
-
|
176 |
-
private:
|
177 |
-
size_t m_size;
|
178 |
-
float *m_data;
|
179 |
-
};
|
180 |
-
py::class_<Sequence>(m, "Sequence")
|
181 |
-
.def(py::init<size_t>())
|
182 |
-
.def(py::init<const std::vector<float>&>())
|
183 |
-
/// Bare bones interface
|
184 |
-
.def("__getitem__", [](const Sequence &s, size_t i) {
|
185 |
-
if (i >= s.size()) throw py::index_error();
|
186 |
-
return s[i];
|
187 |
-
})
|
188 |
-
.def("__setitem__", [](Sequence &s, size_t i, float v) {
|
189 |
-
if (i >= s.size()) throw py::index_error();
|
190 |
-
s[i] = v;
|
191 |
-
})
|
192 |
-
.def("__len__", &Sequence::size)
|
193 |
-
/// Optional sequence protocol operations
|
194 |
-
.def("__iter__", [](const Sequence &s) { return py::make_iterator(s.begin(), s.end()); },
|
195 |
-
py::keep_alive<0, 1>() /* Essential: keep object alive while iterator exists */)
|
196 |
-
.def("__contains__", [](const Sequence &s, float v) { return s.contains(v); })
|
197 |
-
.def("__reversed__", [](const Sequence &s) -> Sequence { return s.reversed(); })
|
198 |
-
/// Slicing protocol (optional)
|
199 |
-
.def("__getitem__", [](const Sequence &s, py::slice slice) -> Sequence* {
|
200 |
-
size_t start, stop, step, slicelength;
|
201 |
-
if (!slice.compute(s.size(), &start, &stop, &step, &slicelength))
|
202 |
-
throw py::error_already_set();
|
203 |
-
Sequence *seq = new Sequence(slicelength);
|
204 |
-
for (size_t i = 0; i < slicelength; ++i) {
|
205 |
-
(*seq)[i] = s[start]; start += step;
|
206 |
-
}
|
207 |
-
return seq;
|
208 |
-
})
|
209 |
-
.def("__setitem__", [](Sequence &s, py::slice slice, const Sequence &value) {
|
210 |
-
size_t start, stop, step, slicelength;
|
211 |
-
if (!slice.compute(s.size(), &start, &stop, &step, &slicelength))
|
212 |
-
throw py::error_already_set();
|
213 |
-
if (slicelength != value.size())
|
214 |
-
throw std::runtime_error("Left and right hand size of slice assignment have different sizes!");
|
215 |
-
for (size_t i = 0; i < slicelength; ++i) {
|
216 |
-
s[start] = value[i]; start += step;
|
217 |
-
}
|
218 |
-
})
|
219 |
-
/// Comparisons
|
220 |
-
.def(py::self == py::self)
|
221 |
-
.def(py::self != py::self)
|
222 |
-
// Could also define py::self + py::self for concatenation, etc.
|
223 |
-
;
|
224 |
-
|
225 |
-
// test_map_iterator
|
226 |
-
// Interface of a map-like object that isn't (directly) an unordered_map, but provides some basic
|
227 |
-
// map-like functionality.
|
228 |
-
class StringMap {
|
229 |
-
public:
|
230 |
-
StringMap() = default;
|
231 |
-
StringMap(std::unordered_map<std::string, std::string> init)
|
232 |
-
: map(std::move(init)) {}
|
233 |
-
|
234 |
-
void set(std::string key, std::string val) { map[key] = val; }
|
235 |
-
std::string get(std::string key) const { return map.at(key); }
|
236 |
-
size_t size() const { return map.size(); }
|
237 |
-
private:
|
238 |
-
std::unordered_map<std::string, std::string> map;
|
239 |
-
public:
|
240 |
-
decltype(map.cbegin()) begin() const { return map.cbegin(); }
|
241 |
-
decltype(map.cend()) end() const { return map.cend(); }
|
242 |
-
};
|
243 |
-
py::class_<StringMap>(m, "StringMap")
|
244 |
-
.def(py::init<>())
|
245 |
-
.def(py::init<std::unordered_map<std::string, std::string>>())
|
246 |
-
.def("__getitem__", [](const StringMap &map, std::string key) {
|
247 |
-
try { return map.get(key); }
|
248 |
-
catch (const std::out_of_range&) {
|
249 |
-
throw py::key_error("key '" + key + "' does not exist");
|
250 |
-
}
|
251 |
-
})
|
252 |
-
.def("__setitem__", &StringMap::set)
|
253 |
-
.def("__len__", &StringMap::size)
|
254 |
-
.def("__iter__", [](const StringMap &map) { return py::make_key_iterator(map.begin(), map.end()); },
|
255 |
-
py::keep_alive<0, 1>())
|
256 |
-
.def("items", [](const StringMap &map) { return py::make_iterator(map.begin(), map.end()); },
|
257 |
-
py::keep_alive<0, 1>())
|
258 |
-
;
|
259 |
-
|
260 |
-
// test_generalized_iterators
|
261 |
-
class IntPairs {
|
262 |
-
public:
|
263 |
-
IntPairs(std::vector<std::pair<int, int>> data) : data_(std::move(data)) {}
|
264 |
-
const std::pair<int, int>* begin() const { return data_.data(); }
|
265 |
-
private:
|
266 |
-
std::vector<std::pair<int, int>> data_;
|
267 |
-
};
|
268 |
-
py::class_<IntPairs>(m, "IntPairs")
|
269 |
-
.def(py::init<std::vector<std::pair<int, int>>>())
|
270 |
-
.def("nonzero", [](const IntPairs& s) {
|
271 |
-
return py::make_iterator(NonZeroIterator<std::pair<int, int>>(s.begin()), NonZeroSentinel());
|
272 |
-
}, py::keep_alive<0, 1>())
|
273 |
-
.def("nonzero_keys", [](const IntPairs& s) {
|
274 |
-
return py::make_key_iterator(NonZeroIterator<std::pair<int, int>>(s.begin()), NonZeroSentinel());
|
275 |
-
}, py::keep_alive<0, 1>())
|
276 |
-
;
|
277 |
-
|
278 |
-
|
279 |
-
#if 0
|
280 |
-
// Obsolete: special data structure for exposing custom iterator types to python
|
281 |
-
// kept here for illustrative purposes because there might be some use cases which
|
282 |
-
// are not covered by the much simpler py::make_iterator
|
283 |
-
|
284 |
-
struct PySequenceIterator {
|
285 |
-
PySequenceIterator(const Sequence &seq, py::object ref) : seq(seq), ref(ref) { }
|
286 |
-
|
287 |
-
float next() {
|
288 |
-
if (index == seq.size())
|
289 |
-
throw py::stop_iteration();
|
290 |
-
return seq[index++];
|
291 |
-
}
|
292 |
-
|
293 |
-
const Sequence &seq;
|
294 |
-
py::object ref; // keep a reference
|
295 |
-
size_t index = 0;
|
296 |
-
};
|
297 |
-
|
298 |
-
py::class_<PySequenceIterator>(seq, "Iterator")
|
299 |
-
.def("__iter__", [](PySequenceIterator &it) -> PySequenceIterator& { return it; })
|
300 |
-
.def("__next__", &PySequenceIterator::next);
|
301 |
-
|
302 |
-
On the actual Sequence object, the iterator would be constructed as follows:
|
303 |
-
.def("__iter__", [](py::object s) { return PySequenceIterator(s.cast<const Sequence &>(), s); })
|
304 |
-
#endif
|
305 |
-
|
306 |
-
// test_python_iterator_in_cpp
|
307 |
-
m.def("object_to_list", [](py::object o) {
|
308 |
-
auto l = py::list();
|
309 |
-
for (auto item : o) {
|
310 |
-
l.append(item);
|
311 |
-
}
|
312 |
-
return l;
|
313 |
-
});
|
314 |
-
|
315 |
-
m.def("iterator_to_list", [](py::iterator it) {
|
316 |
-
auto l = py::list();
|
317 |
-
while (it != py::iterator::sentinel()) {
|
318 |
-
l.append(*it);
|
319 |
-
++it;
|
320 |
-
}
|
321 |
-
return l;
|
322 |
-
});
|
323 |
-
|
324 |
-
// test_sequence_length: check that Python sequences can be converted to py::sequence.
|
325 |
-
m.def("sequence_length", [](py::sequence seq) { return seq.size(); });
|
326 |
-
|
327 |
-
// Make sure that py::iterator works with std algorithms
|
328 |
-
m.def("count_none", [](py::object o) {
|
329 |
-
return std::count_if(o.begin(), o.end(), [](py::handle h) { return h.is_none(); });
|
330 |
-
});
|
331 |
-
|
332 |
-
m.def("find_none", [](py::object o) {
|
333 |
-
auto it = std::find_if(o.begin(), o.end(), [](py::handle h) { return h.is_none(); });
|
334 |
-
return it->is_none();
|
335 |
-
});
|
336 |
-
|
337 |
-
m.def("count_nonzeros", [](py::dict d) {
|
338 |
-
return std::count_if(d.begin(), d.end(), [](std::pair<py::handle, py::handle> p) {
|
339 |
-
return p.second.cast<int>() != 0;
|
340 |
-
});
|
341 |
-
});
|
342 |
-
|
343 |
-
m.def("tuple_iterator", &test_random_access_iterator<py::tuple>);
|
344 |
-
m.def("list_iterator", &test_random_access_iterator<py::list>);
|
345 |
-
m.def("sequence_iterator", &test_random_access_iterator<py::sequence>);
|
346 |
-
|
347 |
-
// test_iterator_passthrough
|
348 |
-
// #181: iterator passthrough did not compile
|
349 |
-
m.def("iterator_passthrough", [](py::iterator s) -> py::iterator {
|
350 |
-
return py::make_iterator(std::begin(s), std::end(s));
|
351 |
-
});
|
352 |
-
|
353 |
-
// test_iterator_rvp
|
354 |
-
// #388: Can't make iterators via make_iterator() with different r/v policies
|
355 |
-
static std::vector<int> list = { 1, 2, 3 };
|
356 |
-
m.def("make_iterator_1", []() { return py::make_iterator<py::return_value_policy::copy>(list); });
|
357 |
-
m.def("make_iterator_2", []() { return py::make_iterator<py::return_value_policy::automatic>(list); });
|
358 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/CVPR/LIVE/thrust/thrust/detail/config/deprecated.h
DELETED
@@ -1,33 +0,0 @@
|
|
1 |
-
/*
|
2 |
-
* Copyright 2018-2020 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 |
-
/*! \file deprecated.h
|
18 |
-
* \brief Defines the THRUST_DEPRECATED macro
|
19 |
-
*/
|
20 |
-
|
21 |
-
#pragma once
|
22 |
-
|
23 |
-
#include <thrust/detail/config/compiler.h>
|
24 |
-
|
25 |
-
#if THRUST_HOST_COMPILER == THRUST_HOST_COMPILER_MSVC
|
26 |
-
# define THRUST_DEPRECATED __declspec(deprecated)
|
27 |
-
#elif THRUST_HOST_COMPILER == THRUST_HOST_COMPILER_CLANG
|
28 |
-
# define THRUST_DEPRECATED __attribute__((deprecated))
|
29 |
-
#elif THRUST_HOST_COMPILER == THRUST_HOST_COMPILER_GCC
|
30 |
-
# define THRUST_DEPRECATED __attribute__((deprecated))
|
31 |
-
#else
|
32 |
-
# define THRUST_DEPRECATED
|
33 |
-
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/CVPR/LIVE/thrust/thrust/system/cpp/detail/swap_ranges.h
DELETED
@@ -1,22 +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 |
-
// cpp has no special swap_ranges
|
22 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/CVPR/WALT/configs/_base_/datasets/parking_instance.py
DELETED
@@ -1,48 +0,0 @@
|
|
1 |
-
dataset_type = 'ParkingDataset'
|
2 |
-
data_root = 'data/parking/'
|
3 |
-
img_norm_cfg = dict(
|
4 |
-
mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_rgb=True)
|
5 |
-
train_pipeline = [
|
6 |
-
dict(type='LoadImageFromFile'),
|
7 |
-
dict(type='LoadAnnotations', with_bbox=True, with_mask=True),
|
8 |
-
dict(type='Resize', img_scale=(1333, 800), keep_ratio=True),
|
9 |
-
dict(type='RandomFlip', flip_ratio=0.5),
|
10 |
-
dict(type='Normalize', **img_norm_cfg),
|
11 |
-
dict(type='Pad', size_divisor=32),
|
12 |
-
dict(type='DefaultFormatBundle'),
|
13 |
-
dict(type='Collect', keys=['img', 'gt_bboxes', 'gt_labels', 'gt_bboxes_3d','gt_bboxes_3d_proj']),
|
14 |
-
]
|
15 |
-
test_pipeline = [
|
16 |
-
dict(type='LoadImageFromFile'),
|
17 |
-
dict(
|
18 |
-
type='MultiScaleFlipAug',
|
19 |
-
img_scale=(1333, 800),
|
20 |
-
flip=False,
|
21 |
-
transforms=[
|
22 |
-
dict(type='Resize', keep_ratio=True),
|
23 |
-
dict(type='RandomFlip'),
|
24 |
-
dict(type='Normalize', **img_norm_cfg),
|
25 |
-
dict(type='Pad', size_divisor=32),
|
26 |
-
dict(type='ImageToTensor', keys=['img']),
|
27 |
-
dict(type='Collect', keys=['img']),
|
28 |
-
])
|
29 |
-
]
|
30 |
-
data = dict(
|
31 |
-
samples_per_gpu=1,
|
32 |
-
workers_per_gpu=1,
|
33 |
-
train=dict(
|
34 |
-
type=dataset_type,
|
35 |
-
ann_file=data_root + 'GT_data/',
|
36 |
-
img_prefix=data_root + 'images/',
|
37 |
-
pipeline=train_pipeline),
|
38 |
-
val=dict(
|
39 |
-
type=dataset_type,
|
40 |
-
ann_file=data_root + 'GT_data/',
|
41 |
-
img_prefix=data_root + 'images/',
|
42 |
-
pipeline=test_pipeline),
|
43 |
-
test=dict(
|
44 |
-
type=dataset_type,
|
45 |
-
ann_file=data_root + 'GT_data/',
|
46 |
-
img_prefix=data_root + 'images/',
|
47 |
-
pipeline=test_pipeline))
|
48 |
-
evaluation = dict(metric=['bbox'])#, 'segm'])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/CVPR/regionclip-demo/detectron2/modeling/meta_arch/build.py
DELETED
@@ -1,25 +0,0 @@
|
|
1 |
-
# Copyright (c) Facebook, Inc. and its affiliates.
|
2 |
-
import torch
|
3 |
-
|
4 |
-
from detectron2.utils.logger import _log_api_usage
|
5 |
-
from detectron2.utils.registry import Registry
|
6 |
-
|
7 |
-
META_ARCH_REGISTRY = Registry("META_ARCH") # noqa F401 isort:skip
|
8 |
-
META_ARCH_REGISTRY.__doc__ = """
|
9 |
-
Registry for meta-architectures, i.e. the whole model.
|
10 |
-
|
11 |
-
The registered object will be called with `obj(cfg)`
|
12 |
-
and expected to return a `nn.Module` object.
|
13 |
-
"""
|
14 |
-
|
15 |
-
|
16 |
-
def build_model(cfg):
|
17 |
-
"""
|
18 |
-
Build the whole model architecture, defined by ``cfg.MODEL.META_ARCHITECTURE``.
|
19 |
-
Note that it does not load any weights from ``cfg``.
|
20 |
-
"""
|
21 |
-
meta_arch = cfg.MODEL.META_ARCHITECTURE
|
22 |
-
model = META_ARCH_REGISTRY.get(meta_arch)(cfg)
|
23 |
-
model.to(torch.device(cfg.MODEL.DEVICE))
|
24 |
-
_log_api_usage("modeling.meta_arch." + meta_arch)
|
25 |
-
return model
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/CharyWind/webui-docker/Dockerfile
DELETED
@@ -1,43 +0,0 @@
|
|
1 |
-
# Dockerfile Private Nightly CPU
|
2 |
-
|
3 |
-
# https://gitlab.com/nvidia/container-images/cuda/-/blob/master/dist/11.7.1/ubuntu2204/devel/cudnn8/Dockerfile
|
4 |
-
FROM nvidia/cuda:11.7.1-cudnn8-devel-ubuntu22.04
|
5 |
-
ENV DEBIAN_FRONTEND noninteractive
|
6 |
-
|
7 |
-
WORKDIR /content
|
8 |
-
|
9 |
-
RUN apt-get update -y && apt-get upgrade -y && apt-get install -y libgl1 libglib2.0-0 wget git git-lfs python3-pip python-is-python3 && pip3 install --upgrade pip
|
10 |
-
RUN pip install https://github.com/camenduru/stable-diffusion-webui-colab/releases/download/0.0.16/xformers-0.0.16+814314d.d20230118-cp310-cp310-linux_x86_64.whl
|
11 |
-
RUN pip install --pre triton
|
12 |
-
RUN pip install numexpr
|
13 |
-
|
14 |
-
RUN git clone https://github.com/camenduru/stable-diffusion-webui
|
15 |
-
RUN sed -i -e 's/ start()/ #start()/g' /content/stable-diffusion-webui/launch.py
|
16 |
-
RUN cd stable-diffusion-webui && python launch.py --skip-torch-cuda-test
|
17 |
-
|
18 |
-
# ----------------------------Delete this block if you don't want to see the extra header----------------------------
|
19 |
-
ADD https://github.com/camenduru/webui-docker/raw/main/env_patch.py /content/env_patch.py
|
20 |
-
RUN sed -i -e '/import image_from_url_text/r /content/env_patch.py' /content/stable-diffusion-webui/modules/ui.py
|
21 |
-
ADD https://github.com/camenduru/webui-docker/raw/main/header_patch.py /content/header_patch.py
|
22 |
-
RUN sed -i -e '/demo:/r /content/header_patch.py' /content/stable-diffusion-webui/modules/ui.py
|
23 |
-
# -------------------------------------------------------------------------------------------------------------------
|
24 |
-
|
25 |
-
ADD https://raw.githubusercontent.com/camenduru/stable-diffusion-webui-scripts/main/run_n_times.py /content/stable-diffusion-webui/scripts/run_n_times.py
|
26 |
-
RUN git clone https://github.com/deforum-art/deforum-for-automatic1111-webui /content/stable-diffusion-webui/extensions/deforum-for-automatic1111-webui
|
27 |
-
RUN git clone https://github.com/yfszzx/stable-diffusion-webui-images-browser /content/stable-diffusion-webui/extensions/stable-diffusion-webui-images-browser
|
28 |
-
RUN git clone https://github.com/camenduru/stable-diffusion-webui-huggingface /content/stable-diffusion-webui/extensions/stable-diffusion-webui-huggingface
|
29 |
-
|
30 |
-
COPY config.json /content/config.json
|
31 |
-
COPY ui-config.json /content/ui-config.json
|
32 |
-
|
33 |
-
ADD https://huggingface.co/andite/anything-v4.0/resolve/main/anything-v4.5-pruned.ckpt /content/stable-diffusion-webui/models/Stable-diffusion/anything-v4.5-pruned.ckpt
|
34 |
-
ADD https://huggingface.co/andite/anything-v4.0/resolve/main/anything-v4.0.vae.pt /content/stable-diffusion-webui/models/Stable-diffusion/anything-v4.5-pruned.vae.pt
|
35 |
-
|
36 |
-
RUN adduser --disabled-password --gecos '' user
|
37 |
-
RUN chown -R user:user /content
|
38 |
-
RUN chmod -R 777 /content
|
39 |
-
USER user
|
40 |
-
|
41 |
-
EXPOSE 7860
|
42 |
-
|
43 |
-
CMD cd /content/stable-diffusion-webui && python webui.py --use-cpu all --no-half --listen --disable-console-progressbars --ui-config-file /content/ui-config.json --ui-settings-file /content/config.json
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/CjangCjengh/Sanskrit-TTS/app.py
DELETED
@@ -1,114 +0,0 @@
|
|
1 |
-
import torch
|
2 |
-
import librosa
|
3 |
-
import commons
|
4 |
-
import utils
|
5 |
-
from models import SynthesizerTrn
|
6 |
-
from text import text_to_sequence
|
7 |
-
import numpy as np
|
8 |
-
from mel_processing import spectrogram_torch
|
9 |
-
import gradio as gr
|
10 |
-
from indic_transliteration import sanscript
|
11 |
-
|
12 |
-
|
13 |
-
SCRIPT_DICT={
|
14 |
-
'Devanagari':sanscript.DEVANAGARI,
|
15 |
-
'IAST':sanscript.IAST,
|
16 |
-
'SLP1':sanscript.SLP1,
|
17 |
-
'HK':sanscript.HK
|
18 |
-
}
|
19 |
-
|
20 |
-
DEFAULT_TEXT='संस्कृतम् जगतः एकतमा अतिप्राचीना समृद्धा शास्त्रीया च भाषासु वर्तते । संस्कृतं भारतस्य जगत: वा भाषासु एकतमा प्राचीनतमा ।'
|
21 |
-
|
22 |
-
|
23 |
-
def get_text(text, hps, cleaned=False):
|
24 |
-
if cleaned:
|
25 |
-
text_norm = text_to_sequence(text, hps.symbols, [])
|
26 |
-
else:
|
27 |
-
text_norm = text_to_sequence(text, hps.symbols, hps.data.text_cleaners)
|
28 |
-
if hps.data.add_blank:
|
29 |
-
text_norm = commons.intersperse(text_norm, 0)
|
30 |
-
text_norm = torch.LongTensor(text_norm)
|
31 |
-
return text_norm
|
32 |
-
|
33 |
-
|
34 |
-
def default_text(script):
|
35 |
-
if script=='Devanagari':
|
36 |
-
return DEFAULT_TEXT
|
37 |
-
else:
|
38 |
-
return sanscript.transliterate(DEFAULT_TEXT,sanscript.DEVANAGARI,SCRIPT_DICT[script])
|
39 |
-
|
40 |
-
|
41 |
-
def speech_synthesize(text,script, speaker_id, length_scale):
|
42 |
-
text=text.replace('\n','')
|
43 |
-
if script!='Devanagari':
|
44 |
-
text=sanscript.transliterate(text,SCRIPT_DICT[script],sanscript.DEVANAGARI)
|
45 |
-
print(text)
|
46 |
-
stn_tst = get_text(text, hps_ms)
|
47 |
-
with torch.no_grad():
|
48 |
-
x_tst = stn_tst.unsqueeze(0)
|
49 |
-
x_tst_lengths = torch.LongTensor([stn_tst.size(0)])
|
50 |
-
sid = torch.LongTensor([speaker_id])
|
51 |
-
audio = net_g_ms.infer(x_tst, x_tst_lengths, sid=sid, noise_scale=0.667, noise_scale_w=0.8, length_scale=length_scale)[0][0,0].data.cpu().float().numpy()
|
52 |
-
return (hps_ms.data.sampling_rate, audio)
|
53 |
-
|
54 |
-
|
55 |
-
def voice_convert(audio,origin_id,target_id):
|
56 |
-
sampling_rate, audio = audio
|
57 |
-
audio = (audio / np.iinfo(audio.dtype).max).astype(np.float32)
|
58 |
-
if len(audio.shape) > 1:
|
59 |
-
audio = librosa.to_mono(audio.transpose(1, 0))
|
60 |
-
if sampling_rate != hps_ms.data.sampling_rate:
|
61 |
-
audio = librosa.resample(audio, orig_sr=sampling_rate, target_sr=hps_ms.data.sampling_rate)
|
62 |
-
|
63 |
-
with torch.no_grad():
|
64 |
-
y = torch.FloatTensor(audio).unsqueeze(0)
|
65 |
-
spec = spectrogram_torch(y, hps_ms.data.filter_length,
|
66 |
-
hps_ms.data.sampling_rate, hps_ms.data.hop_length, hps_ms.data.win_length,
|
67 |
-
center=False)
|
68 |
-
spec_lengths = torch.LongTensor([spec.size(-1)])
|
69 |
-
sid_src = torch.LongTensor([origin_id])
|
70 |
-
sid_tgt = torch.LongTensor([target_id])
|
71 |
-
audio = net_g_ms.voice_conversion(spec, spec_lengths, sid_src=sid_src, sid_tgt=sid_tgt)[0][0,0].data.cpu().float().numpy()
|
72 |
-
return (hps_ms.data.sampling_rate, audio)
|
73 |
-
|
74 |
-
|
75 |
-
if __name__=='__main__':
|
76 |
-
hps_ms = utils.get_hparams_from_file('model/config.json')
|
77 |
-
n_speakers = hps_ms.data.n_speakers
|
78 |
-
n_symbols = len(hps_ms.symbols)
|
79 |
-
speakers = hps_ms.speakers
|
80 |
-
|
81 |
-
net_g_ms = SynthesizerTrn(
|
82 |
-
n_symbols,
|
83 |
-
hps_ms.data.filter_length // 2 + 1,
|
84 |
-
hps_ms.train.segment_size // hps_ms.data.hop_length,
|
85 |
-
n_speakers=n_speakers,
|
86 |
-
**hps_ms.model)
|
87 |
-
_ = net_g_ms.eval()
|
88 |
-
utils.load_checkpoint('model/model.pth', net_g_ms)
|
89 |
-
|
90 |
-
with gr.Blocks() as app:
|
91 |
-
gr.Markdown('# Sanskrit Text to Speech\n'
|
92 |
-
'')
|
93 |
-
with gr.Tab('Text to Speech'):
|
94 |
-
text_script=gr.Radio(['Devanagari','IAST','SLP1','HK'],label='Script',interactive=True,value='Devanagari')
|
95 |
-
text_input = gr.TextArea(label='Text', placeholder='Type your text here',value=DEFAULT_TEXT)
|
96 |
-
speaker_id=gr.Dropdown(speakers,label='Speaker',type='index',interactive=True,value=speakers[0])
|
97 |
-
length_scale=gr.Slider(0.5,2,1,step=0.1,label='Speaking Speed',interactive=True)
|
98 |
-
tts_button = gr.Button('Synthesize')
|
99 |
-
audio_output = gr.Audio(label='Speech Synthesized')
|
100 |
-
text_script.change(default_text,[text_script],[text_input])
|
101 |
-
tts_button.click(speech_synthesize,[text_input,text_script,speaker_id,length_scale],[audio_output])
|
102 |
-
with gr.Tab('Voice Conversion'):
|
103 |
-
audio_input = gr.Audio(label='Audio',interactive=True)
|
104 |
-
speaker_input = gr.Dropdown(speakers, label='Original Speaker',type='index',interactive=True, value=speakers[0])
|
105 |
-
speaker_output = gr.Dropdown(speakers, label='Target Speaker',type='index',interactive=True, value=speakers[0])
|
106 |
-
vc_button = gr.Button('Convert')
|
107 |
-
audio_output_vc = gr.Audio(label='Voice Converted')
|
108 |
-
vc_button.click(voice_convert,[audio_input,speaker_input,speaker_output],[audio_output_vc])
|
109 |
-
gr.Markdown('## Based on\n'
|
110 |
-
'- [VITS](https://github.com/jaywalnut310/vits)\n\n'
|
111 |
-
'## Dataset\n'
|
112 |
-
'- [Vāksañcayaḥ](https://www.cse.iitb.ac.in/~asr/)')
|
113 |
-
|
114 |
-
app.launch()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Cyril666/ContourNet-ABI/maskrcnn_benchmark/solver/lr_scheduler.py
DELETED
@@ -1,52 +0,0 @@
|
|
1 |
-
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
|
2 |
-
from bisect import bisect_right
|
3 |
-
|
4 |
-
import torch
|
5 |
-
|
6 |
-
|
7 |
-
# FIXME ideally this would be achieved with a CombinedLRScheduler,
|
8 |
-
# separating MultiStepLR with WarmupLR
|
9 |
-
# but the current LRScheduler design doesn't allow it
|
10 |
-
class WarmupMultiStepLR(torch.optim.lr_scheduler._LRScheduler):
|
11 |
-
def __init__(
|
12 |
-
self,
|
13 |
-
optimizer,
|
14 |
-
milestones,
|
15 |
-
gamma=0.1,
|
16 |
-
warmup_factor=1.0 / 3,
|
17 |
-
warmup_iters=500,
|
18 |
-
warmup_method="linear",
|
19 |
-
last_epoch=-1,
|
20 |
-
):
|
21 |
-
if not list(milestones) == sorted(milestones):
|
22 |
-
raise ValueError(
|
23 |
-
"Milestones should be a list of" " increasing integers. Got {}",
|
24 |
-
milestones,
|
25 |
-
)
|
26 |
-
|
27 |
-
if warmup_method not in ("constant", "linear"):
|
28 |
-
raise ValueError(
|
29 |
-
"Only 'constant' or 'linear' warmup_method accepted"
|
30 |
-
"got {}".format(warmup_method)
|
31 |
-
)
|
32 |
-
self.milestones = milestones
|
33 |
-
self.gamma = gamma
|
34 |
-
self.warmup_factor = warmup_factor
|
35 |
-
self.warmup_iters = warmup_iters
|
36 |
-
self.warmup_method = warmup_method
|
37 |
-
super(WarmupMultiStepLR, self).__init__(optimizer, last_epoch)
|
38 |
-
|
39 |
-
def get_lr(self):
|
40 |
-
warmup_factor = 1
|
41 |
-
if self.last_epoch < self.warmup_iters:
|
42 |
-
if self.warmup_method == "constant":
|
43 |
-
warmup_factor = self.warmup_factor
|
44 |
-
elif self.warmup_method == "linear":
|
45 |
-
alpha = float(self.last_epoch) / self.warmup_iters
|
46 |
-
warmup_factor = self.warmup_factor * (1 - alpha) + alpha
|
47 |
-
return [
|
48 |
-
base_lr
|
49 |
-
* warmup_factor
|
50 |
-
* self.gamma ** bisect_right(self.milestones, self.last_epoch)
|
51 |
-
for base_lr in self.base_lrs
|
52 |
-
]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|