Commit
·
98c61ab
1
Parent(s):
6777e78
Update parquet files (step 98 of 397)
Browse filesThis view is limited to 50 files because it contains too many changes.
See raw diff
- spaces/1pelhydcardo/ChatGPT-prompt-generator/assets/Bus Simulator Ultimate - Explore Different Countries and Cities with Your Bus on iOS.md +0 -99
- spaces/1pelhydcardo/ChatGPT-prompt-generator/assets/Construct 2 The Ultimate 2D Game Engine for Beginners.md +0 -111
- spaces/1phancelerku/anime-remove-background/Dislyte APK Download the Game and Fight Alongside Heroes with God-like Powers on Your Android Device.md +0 -134
- spaces/1phancelerku/anime-remove-background/Download 2 Chainz It 39s A Vibe [BETTER].md +0 -67
- spaces/1phancelerku/anime-remove-background/Download I Know You MP3 Song by Craig David with Bastille - JioSaavn.md +0 -116
- spaces/1phancelerku/anime-remove-background/Download ludo by Johnny Drille - A Song from His Latest Album.md +0 -95
- spaces/1phancelerku/anime-remove-background/Enjoy the Latest Minecraft Update 1.18.2.03 on Android and Xbox with this APK File.md +0 -126
- spaces/1toTree/lora_test/ppdiffusers/schedulers/__init__.py +0 -54
- spaces/801artistry/RVC801/infer/lib/uvr5_pack/lib_v5/layers_new.py +0 -125
- spaces/801artistry/RVC801/infer/lib/uvr5_pack/lib_v5/nets.py +0 -123
- spaces/ATang0729/Forecast4Muses/Model/Model6/Model6_0_ClothesDetection/mmyolo/configs/yolov5/yolov5_n-v61_syncbn_fast_8xb16-300e_coco.py +0 -15
- spaces/Abhilashvj/planogram-compliance/hubconf.py +0 -309
- spaces/Adapter/CoAdapter/configs/mm/faster_rcnn_r50_fpn_coco.py +0 -182
- spaces/AgentVerse/agentVerse/agentverse/environments/simulation_env/rules/updater/basic.py +0 -75
- spaces/AgentVerse/agentVerse/ui/src/phaser3-rex-plugins/templates/spinner/cube/Factory.d.ts +0 -6
- spaces/AgentVerse/agentVerse/ui/src/phaser3-rex-plugins/templates/ui/container/Container.js +0 -2
- spaces/AgentVerse/agentVerse/ui/src/phaser3-rex-plugins/templates/ui/fade/Fade.ts +0 -5
- spaces/AgentVerse/agentVerse/ui/src/phaser3-rex-plugins/templates/ui/lineprogress/LineProgress.js +0 -2
- spaces/AlexWang/lama/saicinpainting/evaluation/data.py +0 -167
- spaces/AlexWang/lama/saicinpainting/evaluation/evaluator.py +0 -220
- spaces/Alycer/VITS-Umamusume-voice-synthesizer/README.md +0 -12
- spaces/Andy1621/uniformer_image_detection/configs/ms_rcnn/ms_rcnn_x101_64x4d_fpn_2x_coco.py +0 -4
- spaces/Andy1621/uniformer_image_detection/mmcv_custom/runner/__init__.py +0 -8
- spaces/Andy1621/uniformer_image_segmentation/configs/encnet/encnet_r101-d8_512x512_20k_voc12aug.py +0 -2
- spaces/AnishKumbhar/ChatBot/text-generation-webui-main/docs/LoRA.md +0 -71
- spaces/Arnx/MusicGenXvAKN/audiocraft/modules/activations.py +0 -96
- spaces/ArtGAN/Video-Diffusion-WebUI/video_diffusion/tuneavideo/models/attention.py +0 -322
- spaces/Ataturk-Chatbot/HuggingFaceChat/venv/lib/python3.11/site-packages/pip/_vendor/requests/cookies.py +0 -561
- spaces/Ataturk-Chatbot/HuggingFaceChat/venv/lib/python3.11/site-packages/setuptools/wheel.py +0 -222
- spaces/Ayya/anime-remove-background/app.py +0 -52
- spaces/BIASLab/sars-cov-2-classification-fcgr/src/fcgr.py +0 -72
- spaces/Benson/text-generation/Examples/Blackeye Download.md +0 -84
- spaces/Benson/text-generation/Examples/Como Descargar Llamada De Deber Warzone Mvil Apk.md +0 -149
- spaces/Benson/text-generation/Examples/Cuerda Hroe 3 Mod Apkpure.md +0 -91
- spaces/Benson/text-generation/Examples/Descargar Conseguir Sobre l Mod Men Apk.md +0 -67
- spaces/Big-Web/MMSD/env/Lib/site-packages/botocore/configprovider.py +0 -838
- spaces/Big-Web/MMSD/env/Lib/site-packages/pip/_vendor/chardet/charsetprober.py +0 -147
- spaces/Big-Web/MMSD/env/Lib/site-packages/setuptools/_vendor/ordered_set.py +0 -488
- spaces/CVPR/Dual-Key_Backdoor_Attacks/openvqa/openvqa/models/ban/model_cfgs.py +0 -20
- spaces/CVPR/LIVE/thrust/thrust/detail/allocator/temporary_allocator.h +0 -85
- spaces/CVPR/LIVE/thrust/thrust/iterator/permutation_iterator.h +0 -217
- spaces/CVPR/LIVE/thrust/thrust/system/detail/adl/equal.h +0 -44
- spaces/CVPR/WALT/mmdet/models/detectors/rpn.py +0 -154
- spaces/CVPR/regionclip-demo/detectron2/structures/image_list.py +0 -124
- spaces/Carlosito16/HXM-summarization/helper_function.py +0 -140
- spaces/CelesteChen/GPT-token/app.py +0 -34
- spaces/Clebersla/RVC_V2_Huggingface_Version/run.sh +0 -16
- spaces/Cyril666/ContourNet-ABI/maskrcnn_benchmark/modeling/utils.py +0 -16
- spaces/DQChoi/gpt-demo/venv/lib/python3.11/site-packages/fontTools/feaLib/__init__.py +0 -4
- spaces/DQChoi/gpt-demo/venv/lib/python3.11/site-packages/fontTools/ttLib/tables/T_S_I_B_.py +0 -5
spaces/1pelhydcardo/ChatGPT-prompt-generator/assets/Bus Simulator Ultimate - Explore Different Countries and Cities with Your Bus on iOS.md
DELETED
@@ -1,99 +0,0 @@
|
|
1 |
-
<br />
|
2 |
-
<h1>Download Bus Simulator Ultimate iOS: The Best Bus Simulation Game</h1>
|
3 |
-
<p>Do you love driving buses and exploring different cities? Do you want to experience the most realistic and immersive bus simulation game on your iOS device? If yes, then you should download Bus Simulator Ultimate, the best bus simulation game developed by Zuuks Games. In this article, we will tell you everything you need to know about this amazing game, including its features, how to download it, and some tips and tricks to play it.</p>
|
4 |
-
<h2>What is Bus Simulator Ultimate?</h2>
|
5 |
-
<p>Bus Simulator Ultimate is a game that lets you drive official Mercedes-Benz Travego, Mercedes-Benz Tourismo and Setra licensed buses on realistic routes and bus stations. You can choose from over 30 countries and 250 cities to drive in, such as United States, United Kingdom, China, Canada, Russia, Germany, Italy, France, Spain, Netherlands, Turkey, South Korea, Japan, Brazil, Azerbaijan, Belgium, Bulgaria, Czech Republic, Dominican Republic, Indonesia, Philippines, South Africa, India, Hong Kong, Ireland, Israel, Qatar, Malaysia, Thailand, Taiwan and more. You can also establish your own bus company and become the largest bus corporation in the world by hiring employees and managing your finances.</p>
|
6 |
-
<h2>download bus simulator ultimate ios</h2><br /><p><b><b>Download Zip</b> ⭐ <a href="https://urlin.us/2uSVNT">https://urlin.us/2uSVNT</a></b></p><br /><br />
|
7 |
-
<h3>Features of Bus Simulator Ultimate</h3>
|
8 |
-
<h4>Realistic buses and routes</h4>
|
9 |
-
<p>Bus Simulator Ultimate features 32 amazing coach buses that are designed with detailed cockpits and realistic sound effects. You can also buy used buses from the market or customize your own buses with different colors and accessories. The game also offers realistic traffic system, weather conditions, highway toll roads, day and night cycle, and more. You can enjoy driving on different terrains and landscapes as you explore the world.</p>
|
10 |
-
<h4>Multiplayer mode and business management</h4>
|
11 |
-
<p>Bus Simulator Ultimate is not just a driving game. It is also a business simulation game that allows you to create your own bus company and compete with other players in the multiplayer mode. You can have offices in many places around the world and hire employees to work for you. You can also manage your income and expenses, set ticket prices, upgrade your buses, and more. You can also join the Ultimate League and rank up in the leaderboard by earning points from driving.</p>
|
12 |
-
<h4>Passenger system and social interactions</h4>
|
13 |
-
<p>Bus Simulator Ultimate has a unique passenger system that provides social and realistic reactions from your customers. You can see their faces, hear their voices, and read their reviews. You can also interact with them by using the horn or the microphone. You can also see their mood changes depending on how you drive. Some passengers may be happy, angry, sad, or bored. You have to make sure they are satisfied with your service.</p>
|
14 |
-
<h4>Customizable settings and controls</h4>
|
15 |
-
<p>Bus Simulator Ultimate gives you the option to customize your settings and controls according to your preferences. You can choose from three different control modes: tilt, buttons or steering wheel. You can also adjust the camera angle, the graphics quality, the sound volume, the language (more than 25 languages supported), and more. You can also enable or disable features such as speed limiters, traffic lights, indicators, mirrors, etc.</p>
|
16 |
-
<h3>How to download Bus Simulator Ultimate on iOS devices</h3>
|
17 |
-
<h4>Requirements and compatibility</h4>
|
18 |
-
<p>Bus Simulator Ultimate is a free game that requires iOS 10.0 or later. It is compatible with iPhone 5S or newer models (including iPhone SE), iPad Air or newer models (including iPad mini 2), iPod touch (6th generation) or newer models <h4>Steps to download and install</h4>
|
19 |
-
<p>To download Bus Simulator Ultimate on your iOS device, you need to follow these simple steps:</p>
|
20 |
-
<ol>
|
21 |
-
<li>Open the App Store on your device and search for "Bus Simulator Ultimate" or click on this link.</li>
|
22 |
-
<li>Tap on the "Get" button and then on the "Install" button to start downloading the game.</li>
|
23 |
-
<li>Wait for the download to finish and then tap on the "Open" button to launch the game.</li>
|
24 |
-
<li>Enjoy playing Bus Simulator Ultimate on your iOS device!</li>
|
25 |
-
</ol>
|
26 |
-
<h4>Subscription options and benefits</h4>
|
27 |
-
<p>Bus Simulator Ultimate is a free game that you can play without any limitations. However, if you want to enjoy some extra benefits and support the developers, you can subscribe to the Premium Membership. The Premium Membership offers you the following advantages:</p>
|
28 |
-
<p>How to download bus simulator ultimate on ios devices<br />
|
29 |
-
Bus simulator ultimate ios app review and gameplay<br />
|
30 |
-
Best bus simulator games for iphone and ipad<br />
|
31 |
-
Download bus simulator ultimate ios mod apk with unlimited money<br />
|
32 |
-
Bus simulator ultimate ios tips and tricks for beginners<br />
|
33 |
-
Bus simulator ultimate ios multiplayer mode guide<br />
|
34 |
-
Bus simulator ultimate ios cheats and hacks<br />
|
35 |
-
Bus simulator ultimate ios update and new features<br />
|
36 |
-
Bus simulator ultimate ios free download without jailbreak<br />
|
37 |
-
Bus simulator ultimate ios vs android comparison<br />
|
38 |
-
Bus simulator ultimate ios offline mode tutorial<br />
|
39 |
-
Bus simulator ultimate ios realistic graphics and physics<br />
|
40 |
-
Bus simulator ultimate ios custom skins and buses<br />
|
41 |
-
Bus simulator ultimate ios support and feedback<br />
|
42 |
-
Bus simulator ultimate ios system requirements and compatibility<br />
|
43 |
-
Bus simulator ultimate ios best routes and maps<br />
|
44 |
-
Bus simulator ultimate ios challenges and achievements<br />
|
45 |
-
Bus simulator ultimate ios ranking and leaderboards<br />
|
46 |
-
Bus simulator ultimate ios settings and options<br />
|
47 |
-
Bus simulator ultimate ios sound effects and music<br />
|
48 |
-
Bus simulator ultimate ios controls and gestures<br />
|
49 |
-
Bus simulator ultimate ios camera angles and views<br />
|
50 |
-
Bus simulator ultimate ios traffic and weather conditions<br />
|
51 |
-
Bus simulator ultimate ios passengers and tickets<br />
|
52 |
-
Bus simulator ultimate ios fuel and maintenance<br />
|
53 |
-
Bus simulator ultimate ios garage and shop<br />
|
54 |
-
Bus simulator ultimate ios license and career mode<br />
|
55 |
-
Bus simulator ultimate ios online community and forums<br />
|
56 |
-
Bus simulator ultimate ios fun facts and trivia<br />
|
57 |
-
Bus simulator ultimate ios glitches and bugs<br />
|
58 |
-
Download bus simulator 2023 for ios devices<br />
|
59 |
-
Download bus driver city 3d for ios devices<br />
|
60 |
-
Download coach bus driving sim 2021 for ios devices<br />
|
61 |
-
Download euro truck driver 2018 for ios devices<br />
|
62 |
-
Download heavy bus parking sim 2020 for ios devices<br />
|
63 |
-
Download public transport sim 2019 for ios devices<br />
|
64 |
-
Download school bus driving game 3d for ios devices<br />
|
65 |
-
Download tourist bus driving sim 2022 for ios devices<br />
|
66 |
-
Download world bus driving sim 2024 for ios devices<br />
|
67 |
-
Download city coach bus sim 2025 for ios devices</p>
|
68 |
-
<ul>
|
69 |
-
<li>No ads</li>
|
70 |
-
<li>Free bus skins</li>
|
71 |
-
<li>Double XP and money</li>
|
72 |
-
<li>10% discount on market and garage</li>
|
73 |
-
<li>Premium badge and chat color</li>
|
74 |
-
</ul>
|
75 |
-
<p>The Premium Membership costs $4.99 per month or $49.99 per year. You can cancel your subscription at any time in your iTunes account settings.</p>
|
76 |
-
<h3>Tips and tricks to play Bus Simulator Ultimate</h3>
|
77 |
-
<h4>Drive safely and follow traffic rules</h4>
|
78 |
-
<p>One of the most important tips to play Bus Simulator Ultimate is to drive safely and follow the traffic rules. You have to respect the speed limits, the traffic lights, the signs, and the other vehicles on the road. You also have to avoid accidents, collisions, and damages to your bus. If you drive recklessly, you will lose points, money, and reputation. You will also upset your passengers and get bad reviews.</p>
|
79 |
-
<h4>Expand your bus company and hire employees</h4>
|
80 |
-
<p>Another tip to play Bus Simulator Ultimate is to expand your bus company and hire employees. You can buy new buses, open new offices, and hire drivers from different countries. You can also assign routes and salaries to your employees and monitor their performance. By expanding your bus company, you will increase your income and reputation. You will also unlock new achievements and rewards.</p>
|
81 |
-
<h4>Listen to radio stations and enjoy the scenery</h4>
|
82 |
-
<p>A final tip to play Bus Simulator Ultimate is to listen to radio stations and enjoy the scenery. You can choose from over 250 radio stations from different countries and genres. You can also change the radio station or volume from the dashboard of your bus. Listening to radio stations will make your driving more enjoyable and relaxing. You can also admire the beautiful scenery of different cities and countries as you drive. You can see landmarks, buildings, bridges, mountains, forests, rivers, lakes, and more.</p>
|
83 |
-
<h2>Conclusion</h2>
|
84 |
-
<p>Bus Simulator Ultimate is a game that offers you the best bus simulation experience on your iOS device. You can drive realistic buses on realistic routes and bus stations in over 30 countries and 250 cities. You can also create your own bus company and compete with other players in the multiplayer mode. You can also interact with your passengers and listen to radio stations as you drive. Bus Simulator Ultimate is a game that you should download if you love driving buses and exploring different places.</p>
|
85 |
-
<h3>Frequently Asked Questions (FAQs)</h3>
|
86 |
-
<ol>
|
87 |
-
<li><b>How do I update Bus Simulator Ultimate?</b></li>
|
88 |
-
<p>To update Bus Simulator Ultimate, you need to open the App Store on your device and go to the "Updates" tab. Then, you need to find Bus Simulator Ultimate in the list of apps that have updates available and tap on the "Update" button. Alternatively, you can enable automatic updates for Bus Simulator Ultimate in your device settings.</p>
|
89 |
-
<li><b>How do I contact Bus Simulator Ultimate support?</b></li>
|
90 |
-
<p>To contact Bus Simulator Ultimate support, you need to go to the settings menu of the game and tap on the "Support" button. Then, you need to fill out a form with your name, email address, subject, message, and attachments (optional). After that, you need to tap on the "Send" button and wait for a reply from the support team.</p>
|
91 |
-
<li><b>How do I change my name in Bus Simulator Ultimate?</b></li>
|
92 |
-
<p>To change your name in Bus Simulator Ultimate, you need to go to the profile menu of the game and tap on the "Edit Profile" button. Then, you need to type in your new name in the text box under "Name". After that, you need to tap on the "Save" button and confirm your changes.</p>
|
93 |
-
<li><b>How do I get more money in Bus Simulator Ultimate?</b></li>
|
94 |
-
<p>To get more money in Bus Simulator Ultimate, you have several options. You can drive more routes and complete more missions. You can also watch ads or complete offers to get free money. You can also subscribe to the Premium Membership to get double money. You can also use cheats or hacks to get unlimited money, but this is not recommended as it may ruin your game experience and get you banned.</p>
|
95 |
-
<li><b>How do I play Bus Simulator Ultimate with friends?</b></li>
|
96 |
-
<p>To play Bus Simulator Ultimate with friends, you need to join the multiplayer mode of the game. You can either create your own room or join an existing room. You can also invite your friends to your room by sharing the room code or link. You can also chat with your friends and other players in the multiplayer mode.</p>
|
97 |
-
</ol></p> 197e85843d<br />
|
98 |
-
<br />
|
99 |
-
<br />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/1pelhydcardo/ChatGPT-prompt-generator/assets/Construct 2 The Ultimate 2D Game Engine for Beginners.md
DELETED
@@ -1,111 +0,0 @@
|
|
1 |
-
<br />
|
2 |
-
<h1>What is Construct 2 and why should you use it?</h1>
|
3 |
-
<p>If you have ever dreamed of making your own games but don't know how to code, Construct 2 might be the perfect solution for you. Construct 2 is a game engine that lets you create HTML5 games without writing any code. You can use it to make games for web browsers, desktop computers, mobile devices, and even consoles. Construct 2 is easy to use, powerful, and flexible. You can make any kind of 2D game with it, from platformers to puzzles, from shooters to simulations. Whether you are a beginner or a professional, Construct 2 can help you turn your ideas into reality.</p>
|
4 |
-
<h2>construct 2</h2><br /><p><b><b>Download</b> ★ <a href="https://urlin.us/2uT1vR">https://urlin.us/2uT1vR</a></b></p><br /><br />
|
5 |
-
<h2>The features of Construct 2</h2>
|
6 |
-
<p>Construct 2 has many features that make it a great choice for game development. Here are some of them:</p>
|
7 |
-
<h3>Drag and drop interface</h3>
|
8 |
-
<p>Construct 2 has a user-friendly interface that lets you create your game visually. You can drag and drop objects, behaviors, effects, sounds, and more into your game layout. You can also edit the properties of your objects, such as their size, position, angle, opacity, etc. You don't need to worry about syntax errors or typos, as everything is done with the mouse.</p>
|
9 |
-
<h3>Event system</h3>
|
10 |
-
<p>Construct 2 uses an event system to control the logic of your game. Events are like sentences that tell your game what to do when something happens. For example, you can create an event that says "When the player presses the spacebar, make the character jump". Events are composed of conditions and actions. Conditions are the triggers that check if something is true or false. Actions are the commands that execute when the conditions are met. You can create events using a simple menu system that shows you all the available options.</p>
|
11 |
-
<h3>Preview and export options</h3>
|
12 |
-
<p>Construct 2 lets you preview your game in your browser with one click. You can also test your game on different devices using remote preview or local network preview. When you are ready to publish your game, you can export it to various platforms using different exporters. You can export your game as a HTML5 website, a Windows desktop app, an Android or iOS app, a Windows Store app, a Chrome Web Store app, a Facebook app, a Kongregate app, a Scirra Arcade app, or a NW.js app.</p>
|
13 |
-
<h2>How to get started with Construct 2</h2>
|
14 |
-
<p>If you want to learn how to use Construct 2, here are some steps you can follow:</p>
|
15 |
-
<h3>Download and install Construct 2</h3>
|
16 |
-
<p>You can download Construct 2 from its official website. There are two versions available: the free edition and the paid edition. The free edition has some limitations on the number of events, layers, effects, etc. The paid edition has no limitations and also gives you access to more features and exporters. You can compare the editions here. To install Construct 2, just run the installer and follow the instructions.</p>
|
17 |
-
<p>construct 2 download<br />
|
18 |
-
construct 2 tutorials<br />
|
19 |
-
construct 2 game engine<br />
|
20 |
-
construct 2 vs construct 3<br />
|
21 |
-
construct 2 html5 games<br />
|
22 |
-
construct 2 multiplayer<br />
|
23 |
-
construct 2 android export<br />
|
24 |
-
construct 2 license<br />
|
25 |
-
construct 2 examples<br />
|
26 |
-
construct 2 plugins<br />
|
27 |
-
construct 2 rpg maker<br />
|
28 |
-
construct 2 platformer tutorial<br />
|
29 |
-
construct 2 array<br />
|
30 |
-
construct 2 nwjs<br />
|
31 |
-
construct 2 javascript sdk<br />
|
32 |
-
construct 2 windows app<br />
|
33 |
-
construct 2 cordova cli<br />
|
34 |
-
construct 2 xbox live achievements<br />
|
35 |
-
construct 2 leaderboard<br />
|
36 |
-
construct 2 google spreadsheet<br />
|
37 |
-
construct 2 sprite animation<br />
|
38 |
-
construct 2 physics behavior<br />
|
39 |
-
construct 2 camera follow<br />
|
40 |
-
construct 2 tilemap editor<br />
|
41 |
-
construct 2 text effects<br />
|
42 |
-
construct 2 parallax scrolling<br />
|
43 |
-
construct 2 drag and drop<br />
|
44 |
-
construct 2 random number generator<br />
|
45 |
-
construct 2 save and load system<br />
|
46 |
-
construct 2 inventory system<br />
|
47 |
-
construct 2 pixel art tutorial<br />
|
48 |
-
construct 2 pathfinding behavior<br />
|
49 |
-
construct 2 function object<br />
|
50 |
-
construct 2 webgl effects<br />
|
51 |
-
construct 2 touch controls<br />
|
52 |
-
construct 2 audio object<br />
|
53 |
-
construct 2 dictionary object<br />
|
54 |
-
construct 2 local storage object<br />
|
55 |
-
construct 2 ajax object<br />
|
56 |
-
construct 2 xml parser plugin<br />
|
57 |
-
construct 2 json parser plugin<br />
|
58 |
-
construct 2 firebase plugin<br />
|
59 |
-
construct 2 admob plugin<br />
|
60 |
-
construct 2 iap plugin<br />
|
61 |
-
construct 2 facebook plugin<br />
|
62 |
-
construct 2 steam plugin<br />
|
63 |
-
construct 2 cocoon.io plugin<br />
|
64 |
-
construct 2 photon plugin</p>
|
65 |
-
<h3>Create a new project</h3>
|
66 |
-
<p>To create a new project in Construct 2, click on File > New or press Ctrl+N. A dialog box will appear where you can choose a template or an example to start with. You can also choose a blank project if you want to start from scratch. You can then name your project and set some basic settings, such as the window size, the orientation, the scale mode, etc.</p>
|
67 |
-
<h3>Add objects and behaviors</h3>
|
68 |
-
<p>To add objects to your game layout, click on Insert > New Object or press I. A dialog box will appear where you can choose an object type, such as Sprite, Text, Button, Tilemap, etc. You can then name your object and place it on the layout. To edit your object, double-click on it or right-click and select Edit. You can also add behaviors to your object, such as Platform, Solid, Physics, etc. Behaviors are pre-made scripts that give your object certain abilities or characteristics. To add a behavior to your object, select it and click on Behaviors in the Properties panel. Then click on Add/Edit and choose a behavior from the list.</p>
|
69 |
-
<h3>Add events and actions</h3>
|
70 |
-
<p>To add events and actions to your game, click on Event Sheet in the Project panel. An event sheet is where you write the logic of your game using events. To add a new event, click on Add event or press E. A dialog box will appear where you can choose a condition from the list of objects, system expressions, keyboard inputs, mouse inputs, etc. You can also add sub-events, else events, or groups to organize your events. To add an action to your event, click on Add action or press A. A dialog box will appear where you can choose an action from the list of objects, system expressions, variables, functions, etc. You can also add comments to your events and actions to explain what they do.</p>
|
71 |
-
<h3>Test and debug your game</h3>
|
72 |
-
<p>To test and debug your game, click on Preview or press F5. Your game will open in a new browser tab where you can play it and see how it works. You can also use the debugger tool to inspect the values of your objects, variables, expressions, etc. To use the debugger tool, click on Debug layout or press F6. A new browser tab will open with your game and a debugger panel on the right side. You can pause, resume, step, or restart your game using the buttons on the top of the panel. You can also expand the sections below to see the details of your game elements.</p>
|
73 |
-
<h2>Where to find resources and tutorials for Construct 2</h2>
|
74 |
-
<p>If you need more help or inspiration for using Construct 2, here are some places where you can find resources and tutorials:</p>
|
75 |
-
<h3>The official website and documentation</h3>
|
76 |
-
<p>The official website of Construct 2 is the best place to start if you want to learn more about the game engine and its features. You can find the official documentation that explains everything you need to know about Construct 2 in detail. You can also find tutorials that guide you through various aspects of game development with Construct 2, from beginner to advanced levels.</p>
|
77 |
-
<h3>The community forums and blogs</h3>
|
78 |
-
<p>The community forums are a great place to interact with other Construct 2 users and developers. You can ask questions, share tips, showcase your games, give feedback, and more. You can also find blogs that cover topics related to Construct 2 and game development in general.</p>
|
79 |
-
<h3>The online store and asset bundles</h3>
|
80 |
-
<p>The online store is where you can buy or sell assets for your games, such as graphics, sounds, music, templates, plugins, etc. You can also find asset bundles that offer a collection of assets for a discounted price.</p>
|
81 |
-
<h2>Conclusion and FAQs</h2>
|
82 |
-
<p>Construct 2 is a game engine that allows you to create HTML5 games without coding. It has a drag and drop interface, an event system, and various preview and export options. It is easy to use, powerful, and flexible. You can make any kind of 2D game with it for various platforms. You can also find resources and tutorials for Construct 2 on its official website, community forums, blogs, and online store. If you want to make your own games without coding, Construct 2 is a great option for you.</p>
|
83 |
-
<p>Here are some FAQs that you might have about Construct 2:</p>
|
84 |
-
<table>
|
85 |
-
<tr>
|
86 |
-
<th>Question</th>
|
87 |
-
<th>Answer</th>
|
88 |
-
</tr>
|
89 |
-
<tr>
|
90 |
-
<td>How much does Construct 2 cost?</td>
|
91 |
-
<td>Construct 2 has a free edition and a paid edition. The free edition has some limitations on the number of events, layers, effects, etc. The paid edition has no limitations and also gives you access to more features and exporters. The paid edition costs $129.99 for a personal license and $429.99 for a business license.</td>
|
92 |
-
</tr>
|
93 |
-
<tr>
|
94 |
-
<td>What are the system requirements for Construct 2?</td>
|
95 |
-
<td>Construct 2 runs on Windows XP, Vista, 7, 8, or 10. It requires a DirectX 9 graphics card with at least 512 MB of memory. It also requires an internet connection for some features, such as previewing and exporting.</td>
|
96 |
-
</tr>
|
97 |
-
<tr>
|
98 |
-
<td>Can I use Construct 2 offline?</td>
|
99 |
-
<td>Yes, you can use Construct 2 offline, but you will need to activate it online first. You can activate Construct 2 by logging in with your Scirra account on the software. You can then use Construct 2 offline for up to 30 days before you need to activate it again.</td>
|
100 |
-
</tr>
|
101 |
-
<tr>
|
102 |
-
<td>Can I use my own code in Construct 2?</td>
|
103 |
-
<td>Yes, you can use your own code in Construct 2 by using plugins or behaviors. Plugins are extensions that add new object types or features to Construct 2. Behaviors are extensions that add new abilities or characteristics to existing objects. You can create your own plugins or behaviors using JavaScript or download them from the online store or the community forums.</td>
|
104 |
-
</tr>
|
105 |
-
<tr>
|
106 |
-
<td>Can I monetize my games made with Construct 2?</td>
|
107 |
-
<td>Yes, you can monetize your games made with Construct 2 by using various methods, such as ads, in-app purchases, sponsorships, donations, etc. You can also sell your games on various platforms, such as Steam, Google Play, App Store, etc. However, you will need to follow the terms and conditions of each platform and pay any fees or taxes that apply.</td>
|
108 |
-
</tr>
|
109 |
-
</table></p> 197e85843d<br />
|
110 |
-
<br />
|
111 |
-
<br />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/1phancelerku/anime-remove-background/Dislyte APK Download the Game and Fight Alongside Heroes with God-like Powers on Your Android Device.md
DELETED
@@ -1,134 +0,0 @@
|
|
1 |
-
<br />
|
2 |
-
<h1>Dislyte APK Download: A Stylish Urban Mythological RPG</h1>
|
3 |
-
<p>If you are looking for a new and exciting role-playing game to play on your mobile device, you might want to check out Dislyte. This game is a visually stunning story of heroes with godlike powers who fight against monsters that emerge from mysterious portals. In this article, we will tell you what Dislyte is, what features it has, how to download and install it on your Android device, how to play it on your PC, what reviews and ratings it has, and what alternatives you can try if you want more games like Dislyte.</p>
|
4 |
-
<h2>What is Dislyte?</h2>
|
5 |
-
<p>Dislyte is an action role-playing game developed by FARLIGHT, a subsidiary of Lilith Games, one of the leading mobile game developers in China. The game is set in the near future, where the world is turned upside down by the appearance of portal-like sites called miracles. From these miracles, monsters emerge and wreak havoc on the cities. To fight back, ordinary people become awakened, god-like beings who gain divine powers through divine sound waves. These awakened ones are called Espers, and they are the main characters of the game.</p>
|
6 |
-
<h2>dislyte apk download</h2><br /><p><b><b>Download Zip</b> ✵✵✵ <a href="https://jinyurl.com/2uNLN4">https://jinyurl.com/2uNLN4</a></b></p><br /><br />
|
7 |
-
<p>Dislyte has a stylish, urban mythological theme that combines elements from various cultures and legends. The Espers are inspired by gods from Chinese, Egyptian, Greek, and Northern European mythologies, and they have diverse appearances and personalities. The game also features a unique gacha system that uses sound waves to summon new heroes. The game has a smooth gameplay experience that offers both story mode and PvP mode. The game also has a vibrant soundtrack that matches the mood of each scene.</p>
|
8 |
-
<h3>Features of Dislyte</h3>
|
9 |
-
<p>Dislyte has many features that make it an enjoyable and engaging game for RPG fans. Here are some of them:</p>
|
10 |
-
<h4>Urban adventure</h4>
|
11 |
-
<p>The game takes place in various urban settings that are beautifully rendered in 3D graphics. You can explore different locations such as streets, rooftops, subways, and more. You can also interact with various NPCs and objects in the environment. The game has a rich story that unfolds through dialogues, cutscenes, and quests. You can also choose different dialogue options that affect the outcome of some situations.</p>
|
12 |
-
<h4>Superheroic characters</h4>
|
13 |
-
<p>The game has over 50 Espers that you can collect and upgrade. Each Esper has a unique design, backstory, personality, voice, and skill set. The Espers are divided into five classes: Tank, Warrior, Mage, Support, and Assassin. Each class has its own strengths and weaknesses, and you need to balance your team composition accordingly. The Espers also have different affinities: Fire, Water, Wind, Earth, Light, and Dark. Each affinity has its own advantages and disadvantages against other affinities.</p>
|
14 |
-
<h4>Feel the beat</h4>
|
15 |
-
<p>The game has a distinctive feature that uses sound waves to summon new heroes. You can use different types of sound sources such as music players, microphones, or even your own voice to generate sound waves. The sound waves will then be converted into energy that can be used to activate the gacha machine. The gacha machine will randomly give you an Esper or other rewards such as coins or items. The quality of the sound source will affect the probability of getting a higher rarity Esper.</p>
|
16 |
-
<h4>Deep strategic gameplay</h4>
|
17 |
-
<p>The game has a turn-based combat system that requires strategy and tactics. You can control up to four Espers in each battle, and you can switch between them at any time. Each Esper has four skills: one basic skill, two active skills, and one ultimate skill. The skills have different effects such as damage, healing, buffing, debuffing, crowd control, etc. You need to use your skills wisely and effectively to defeat your enemies. You also need to pay attention to the energy bar, which determines how many skills you can use in each turn. The energy bar will replenish over time, but you can also use items or skills to speed up the process.</p>
|
18 |
-
<h3>How to download and install Dislyte APK on Android devices</h3>
|
19 |
-
<p>If you want to play Dislyte on your Android device, you need to download and install the APK file of the game. The APK file is a package that contains all the files and data needed to run the game. Here are the steps to download and install Dislyte APK on your Android device:</p>
|
20 |
-
<ol>
|
21 |
-
<li>Go to the official website of Dislyte at <a href="">https://dislyte.com/</a> and click on the "Download" button. Alternatively, you can also use a third-party website that provides the APK file of Dislyte, such as <a href="">https://apkpure.com/dislyte/com.farlight.dislyte</a> or <a href="">https://apkfab.com/dislyte/com.farlight.dislyte</a>. Make sure that the website is trustworthy and safe before downloading anything from it.</li>
|
22 |
-
<li>Once the download is complete, locate the APK file on your device and tap on it to start the installation process. You may need to enable the "Unknown sources" option in your device settings to allow the installation of apps from sources other than the Google Play Store.</li>
|
23 |
-
<li>Follow the instructions on the screen to complete the installation. You may need to grant some permissions to the app, such as access to your storage, microphone, or camera.</li>
|
24 |
-
<li>After the installation is done, you can launch the game from your app drawer or home screen and enjoy playing Dislyte.</li>
|
25 |
-
</ol>
|
26 |
-
<h3>How to play Dislyte on PC</h3>
|
27 |
-
<p>If you prefer playing games on a bigger screen, you can also play Dislyte on your PC using an Android emulator. An Android emulator is a software that simulates an Android device on your PC, allowing you to run Android apps and games on it. There are many Android emulators available online, such as <a href="">https://www.bluestacks.com/</a>, <a href="">https://www.ldplayer.net/</a>, or <a href="">https://www.memuplay.com/</a>. Here are the steps to play Dislyte on PC using an Android emulator:</p>
|
28 |
-
<p>dislyte game apk free download<br />
|
29 |
-
dislyte android apk latest version<br />
|
30 |
-
dislyte apk xapk download<br />
|
31 |
-
dislyte rpg apk download for android<br />
|
32 |
-
dislyte apk mod unlimited money<br />
|
33 |
-
dislyte apk obb offline download<br />
|
34 |
-
dislyte apk update 3.2.4 download<br />
|
35 |
-
dislyte apk hack cheats download<br />
|
36 |
-
dislyte apk data full download<br />
|
37 |
-
dislyte apk mirror download link<br />
|
38 |
-
dislyte apk pure download site<br />
|
39 |
-
dislyte apk revdl download page<br />
|
40 |
-
dislyte apk rexdl download file<br />
|
41 |
-
dislyte apk uptodown download app<br />
|
42 |
-
dislyte apk mob.org download online<br />
|
43 |
-
dislyte apk apkpure download free<br />
|
44 |
-
dislyte apk apkmirror download android<br />
|
45 |
-
dislyte apk apknite download pc<br />
|
46 |
-
dislyte apk happymod download ios<br />
|
47 |
-
dislyte apk an1 download windows<br />
|
48 |
-
dislyte apk andropalace download mac<br />
|
49 |
-
dislyte apk android republic download linux<br />
|
50 |
-
dislyte apk android 1 download chromebook<br />
|
51 |
-
dislyte apk android zone download tablet<br />
|
52 |
-
dislyte apk android oyun club download phone<br />
|
53 |
-
dislyte apk ihackedit download emulator<br />
|
54 |
-
dislyte apk platinmods download bluestacks<br />
|
55 |
-
dislyte apk blackmod download nox<br />
|
56 |
-
dislyte apk moddroid download memu<br />
|
57 |
-
dislyte apk modapkdown download ldplayer<br />
|
58 |
-
dislyte apk panda helper download koplayer<br />
|
59 |
-
dislyte apk panda vpn download genymotion<br />
|
60 |
-
dislyte apk panda gamepad pro download smartgaga<br />
|
61 |
-
dislyte apk panda mouse pro download gameloop<br />
|
62 |
-
dislyte apk panda keyboard pro download msi app player<br />
|
63 |
-
dislyte apk ac market download remix os player<br />
|
64 |
-
dislyte apk aptoide download phoenix os roc lite v8.1 x86_64 2023 edition iso file for pc and laptop dual bootable pendrive installation with windows 10,8,7,xp,vista,mac os x,linux,ubuntu,fedora,centos,mint,kali,parrot,arch,manjaro,zorin,elementary,pop,solus,deepin,clear,fydeos,cloudready,chromium os etc.<br />
|
65 |
-
dislyte apk f-droid download prime os classic 0.4.5 x86_64 2023 edition iso file for pc and laptop dual bootable pendrive installation with windows 10,8,7,xp,vista,mac os x,linux,ubuntu,fedora,centos,mint,kali,parrot,arch,manjaro,zorin,elementary,pop,solus,deepin,clear,fydeos,cloudready,chromium os etc.<br />
|
66 |
-
dislyte apk getjar download bliss os 12.13 x86_64 2023 edition iso file for pc and laptop dual bootable pendrive installation with windows 10,8,7,xp,vista,mac os x,linux,ubuntu,fedora,centos,mint,kali,parrot,arch,manjaro,zorin,elementary,pop,solus,deepin,clear,fydeos,cloudready,chromium os etc.<br />
|
67 |
-
dislyte apk slideme download android x86 9.0-r2 x86_64 2023 edition iso file for pc and laptop dual bootable pendrive installation with windows 10,8,7,xp,vista,mac os x,linux,ubuntu,fedora,centos,mint,kali,parrot,arch,manjaro,zorin,elementary,pop,solus,deepin,clear,fydeos,cloudready,chromium os etc.</p>
|
68 |
-
<ol>
|
69 |
-
<li>Download and install an Android emulator of your choice on your PC. Make sure that your PC meets the minimum system requirements of the emulator.</li>
|
70 |
-
<li>Launch the emulator and sign in with your Google account. If you don't have one, you can create one for free.</li>
|
71 |
-
<li>Go to the Google Play Store app on the emulator and search for Dislyte. Alternatively, you can also download the APK file of Dislyte from any of the websites mentioned above and drag and drop it into the emulator.</li>
|
72 |
-
<li>Install Dislyte on the emulator and wait for it to finish.</li>
|
73 |
-
<li>Launch Dislyte from the emulator and enjoy playing it on your PC.</li>
|
74 |
-
</ol>
|
75 |
-
<h3>Reviews and ratings of Dislyte</h3>
|
76 |
-
<p>Dislyte has received mostly positive reviews and ratings from players and critics alike. The game has a 4.5-star rating out of 5 on the Google Play Store, based on over 10,000 reviews. The game has also been featured in several media outlets, such as <a href="">https://www.pocketgamer.com/articles/087362/dislyte-is-a-stylish-urban-mythological-rpg-from-lilith-games-subsidiary-farlight/</a>, <a href="">https://www.androidpolice.com/2021/10/28/dislytes-closed-beta-is-live-and-heres-how-you-can-join-in-on-the-fun/</a>, or <a href="">https://www.gamerbraves.com/dislyte-closed-beta-test-now-live-for-android-users/</a>.</p>
|
77 |
-
<p>Some of the positive aspects of Dislyte that players have praised are:</p>
|
78 |
-
<ul>
|
79 |
-
<li>The stunning graphics and animations that create a immersive urban fantasy world.</li>
|
80 |
-
<li>The diverse and charismatic characters that have unique designs and personalities.</li>
|
81 |
-
<li>The innovative sound wave gacha system that adds a fun twist to summoning new heroes.</li>
|
82 |
-
<li>The smooth and responsive gameplay that offers both story mode and PvP mode.</li>
|
83 |
-
<li>The vibrant soundtrack that matches the mood of each scene.</li>
|
84 |
-
</ <p>Some of the negative aspects of Dislyte that players have criticized are:</p>
|
85 |
-
<ul>
|
86 |
-
<li>The high battery consumption and heating issues that affect some devices.</li>
|
87 |
-
<li>The long loading times and frequent updates that interrupt the gameplay.</li>
|
88 |
-
<li>The limited server capacity and stability that cause lag and crashes.</li>
|
89 |
-
<li>The lack of voice acting and subtitles for some languages.</li>
|
90 |
-
<li>The pay-to-win elements and gacha rates that favor whales and luck.</li>
|
91 |
-
</ul>
|
92 |
-
<h3>Alternatives to Dislyte</h3>
|
93 |
-
<p>If you are looking for more games like Dislyte, you might want to try some of these alternatives:</p>
|
94 |
-
<table>
|
95 |
-
<tr>
|
96 |
-
<th>Name</th>
|
97 |
-
<th>Description</th>
|
98 |
-
</tr>
|
99 |
-
<tr>
|
100 |
-
<td><a href="">Genshin Impact</a></td>
|
101 |
-
<td>A popular open-world action RPG that lets you explore a vast fantasy world with different regions and cultures. You can switch between different characters with elemental powers and fight against enemies and bosses. The game also has a gacha system that allows you to obtain new characters and weapons.</td>
|
102 |
-
</tr>
|
103 |
-
<tr>
|
104 |
-
<td><a href="">Honkai Impact 3rd</a></td>
|
105 |
-
<td>A fast-paced action RPG that features anime-style graphics and combat. You can control different female warriors called Valkyries, who have unique skills and weapons. The game also has a gacha system that lets you collect new Valkyries and equipment.</td>
|
106 |
-
</tr>
|
107 |
-
<tr>
|
108 |
-
<td><a href="">Epic Seven</a></td>
|
109 |
-
<td>A turn-based RPG that has a colorful anime art style and a rich story. You can collect and upgrade over 200 heroes with different abilities and roles. The game also has a gacha system that lets you summon new heroes and artifacts.</td>
|
110 |
-
</tr>
|
111 |
-
<tr>
|
112 |
-
<td><a href="">Guardian Tales</a></td>
|
113 |
-
<td>A retro-style RPG that has a charming pixel art style and a humorous tone. You can explore different worlds and dungeons, solve puzzles, and fight enemies. The game also has a gacha system that lets you acquire new heroes and weapons.</td>
|
114 |
-
</tr>
|
115 |
-
<tr>
|
116 |
-
<td><a href="">Illusion Connect</a></td>
|
117 |
-
<td>A real-time strategy RPG that has a dark fantasy theme and a stylish art style. You can create and customize your own dream team of partners, who have different personalities and skills. The game also has a gacha system that lets you obtain new partners and gear.</td>
|
118 |
-
</tr>
|
119 |
-
</table>
|
120 |
-
<h2>Conclusion</h2>
|
121 |
-
<p>Dislyte is a stylish urban mythological RPG that offers a thrilling adventure with god-like heroes who fight against monsters from mysterious portals. The game has stunning graphics, diverse characters, innovative sound wave gacha, smooth gameplay, and vibrant soundtrack. The game is available for Android devices, but you can also play it on PC using an Android emulator. The game has received mostly positive reviews and ratings, but it also has some drawbacks such as high battery consumption, long loading times, limited server capacity, lack of voice acting, and pay-to-win elements. If you are looking for more games like Dislyte, you can try some of the alternatives we have listed above.</p>
|
122 |
-
<h2>FAQs</h2>
|
123 |
-
<h4>Q: What is the genre of Dislyte?</h4>
|
124 |
-
<p>A: Dislyte is an action role-playing game with a stylish urban mythological theme.</p>
|
125 |
-
<h4>Q: How can I download Dislyte APK on my Android device?</h4>
|
126 |
-
<p>A: You can download Dislyte APK from the official website or from a third-party website that provides the APK file. You need to enable the "Unknown sources" option in your device settings to install the APK file.</p>
|
127 |
-
<h4>Q: How can I play Dislyte on my PC?</h4>
|
128 |
-
<p>A: You can play Dislyte on your PC using an Android emulator such as BlueStacks, LDPlayer, or MEmu. You need to download and install the emulator on your PC, sign in with your Google account, and install Dislyte from the Google Play Store or from the APK file.</p>
|
129 |
-
<h4>Q: What are the classes and affinities of the Espers in Dislyte?</h4>
|
130 |
-
<p>A: The Espers are divided into five classes: Tank, Warrior, Mage, Support, and Assassin. Each class has its own strengths and weaknesses. The Espers also have different affinities: Fire, Water, Wind, Earth, Light, and Dark. Each affinity has its own advantages and disadvantages against other affinities.</p>
|
131 |
-
<h4>Q: What is the sound wave gacha system in Dislyte?</h4>
|
132 |
-
<p>A: The sound wave gacha system is a unique feature that uses sound waves to summon new heroes. You can use different types of sound sources such as music players, microphones, or even your own voice to generate sound waves. The sound waves will then be converted into energy that can be used to activate the gacha machine. The gacha machine will randomly give you an Esper or other rewards such as coins or items. The quality of the sound source will affect the probability of getting a higher rarity Esper.</p> 197e85843d<br />
|
133 |
-
<br />
|
134 |
-
<br />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/1phancelerku/anime-remove-background/Download 2 Chainz It 39s A Vibe [BETTER].md
DELETED
@@ -1,67 +0,0 @@
|
|
1 |
-
<br />
|
2 |
-
<h1>How to Download 2 Chainz's It's a Vibe</h1>
|
3 |
-
<p>It's a Vibe is a song by American rapper 2 Chainz, featuring American singers Ty Dolla Sign, Trey Songz, and Jhené Aiko. It was released on March 14, 2017 as the second single from his fourth studio album Pretty Girls Like Trap Music. The song is a smooth and laid-back track that showcases the chemistry and charisma of the four artists. It's a vibe that you don't want to miss.</p>
|
4 |
-
<h2>download 2 chainz it 39;s a vibe</h2><br /><p><b><b>Download File</b> 🔗 <a href="https://jinyurl.com/2uNRYY">https://jinyurl.com/2uNRYY</a></b></p><br /><br />
|
5 |
-
<p>If you love this song and want to download it to your device, you might be wondering how to do it. There are different ways to download It's a Vibe, depending on where you want to get it from. In this article, we will show you how to download It's a Vibe from YouTube, Spotify, and Apple Music. We will also tell you some benefits of downloading It's a Vibe and answer some frequently asked questions.</p>
|
6 |
-
<h2>What You Need to Download It's a Vibe</h2>
|
7 |
-
<p>Before we get into the details of how to download It's a Vibe, let's make sure you have everything you need. To download It's a Vibe, you will need:</p>
|
8 |
-
<ul>
|
9 |
-
<li>A device with internet access and enough storage space. This can be your computer, smartphone, tablet, or any other device that can play music.</li>
|
10 |
-
<li>A source where you can find It's a Vibe. This can be YouTube, Spotify, Apple Music, or any other platform that has the song.</li>
|
11 |
-
<li>A tool that can convert or download It's a Vibe. This can be a website, an app, or a software that can help you get the song in MP3 format.</li>
|
12 |
-
</ul>
|
13 |
-
<p>Once you have these things ready, you can proceed to download It's a Vibe from your preferred source.</p>
|
14 |
-
<h3>How to Download It's a Vibe from YouTube</h3>
|
15 |
-
<p>YouTube is one of the most popular places where you can watch and listen to It's a Vibe. The official music video has over 153 million views as of June 2023. If you want to download It's a Vibe from YouTube, here are the steps you need to follow:</p>
|
16 |
-
<ol>
|
17 |
-
<li>Find the official music video on YouTube. You can search for "2 Chain z It's a Vibe" or use this link: .</li>
|
18 |
-
<li>Copy the video URL from the address bar or by right-clicking on the video and selecting "Copy video URL".</li>
|
19 |
-
<li>Go to a YouTube to MP3 converter website, such as , , or . These are free and easy to use websites that can help you convert YouTube videos to MP3 files.</li>
|
20 |
-
<li>Paste the URL into the input box and click "Convert" or "Download". The website will process the video and generate a download link for the MP3 file.</li>
|
21 |
-
<li>Download the MP3 file by clicking on the download link or button. You can also choose to save the file to your cloud storage, such as Dropbox or Google Drive.</li>
|
22 |
-
<li>Enjoy listening to It's a Vibe on your device. You can also transfer the file to other devices or share it with your friends.</li>
|
23 |
-
</ol>
|
24 |
-
<h3>How to Download It's a Vibe from Spotify</h3>
|
25 |
-
<p>Spotify is another popular platform where you can stream and download It's a Vibe. The song is part of the album Pretty Girls Like Trap Music, which has over 1.5 billion streams on Spotify as of June 2023. If you want to download It's a Vibe from Spotify, here are the steps you need to follow:</p>
|
26 |
-
<p></p>
|
27 |
-
<ol>
|
28 |
-
<li>Sign up for a Spotify account or log in if you already have one. You will need a Spotify Premium subscription to download songs from Spotify. You can get a free trial for 30 days or pay $9.99 per month for unlimited access to millions of songs.</li>
|
29 |
-
<li>Search for It's a Vibe on Spotify. You can use the search bar or browse through the genres and playlists. You can also use this link: .</li>
|
30 |
-
<li>Add It's a Vibe to your library or playlist. You can do this by clicking on the heart icon next to the song title or by dragging and dropping the song to your desired playlist.</li>
|
31 |
-
<li>Turn on the offline mode in the settings. This will allow you to download songs and listen to them without internet connection. You can find the offline mode option under "Playback" in the settings menu.</li>
|
32 |
-
<li>Download It's a Vibe by toggling the download switch next to the song, album, or playlist. You will see a green arrow icon when the download is complete.</li>
|
33 |
-
<li>Listen to It's a Vibe offline on your device. You can also sync your downloaded songs across different devices using the same Spotify account.</li>
|
34 |
-
</ol>
|
35 |
-
<h3>How to Download It's a Vibe from Apple Music</h3>
|
36 |
-
<p>Apple Music is another great option for downloading It's a Vibe. The song is also part of the album Pretty Girls Like Trap Music, which has over 500 million streams on Apple Music as of June 2023. If you want to download It's a Vibe from Apple Music, here are the steps you need to follow:</p>
|
37 |
-
<ol>
|
38 |
-
<li>Subscribe to Apple Music or start a free trial if you are new. You will need an Apple Music subscription to download songs from Apple Music. You can get a free trial for 3 months or pay $9.99 per month for unlimited access to over 75 million songs.</li>
|
39 |
-
<li>Search for It's a Vibe on Apple Music. You can use the search bar or browse through the categories and stations. You can also use this link: .</li>
|
40 |
-
<li>Tap the plus icon (+) to add It's a Vibe to your library. This will make the song available for offline listening.</li>
|
41 |
-
<li>Tap the cloud icon (☁️) to download It's a Vibe. You will see a checkmark icon when the download is complete.</li>
|
42 |
-
<li>Play It's a Vibe from your library anytime. You can also access your downloaded songs from different devices using the same Apple ID.</li>
|
43 |
-
</ol>
|
44 |
-
<h2>Benefits of Downloading It's a Vibe</h2>
|
45 |
-
<p>Now that you know how to download It's a Vibe from different sources, you might be wondering why you should do it. Here are some benefits of downloading It's a Vibe:</p>
|
46 |
-
<ul>
|
47 |
-
<li>You can listen to it anytime, anywhere, without internet connection or ads. This means you can enjoy the song without any interruptions or distractions.</li>
|
48 |
-
<li>You can support the artist and his collaborators by streaming or buying the song. This means you can show your appreciation and respect for their work and talent.</li>
|
49 |
-
<li>You can enjoy the high-quality sound and lyrics of the song. This means you can appreciate the production and performance of the song better.</li>
|
50 |
-
</ul>
|
51 |
-
<h2>Conclusion and FAQs</h2 <p>In this article, we have shown you how to download 2 Chainz's It's a Vibe from YouTube, Spotify, and Apple Music. We have also told you some benefits of downloading It's a Vibe and why you should do it. We hope you found this article helpful and informative.</p>
|
52 |
-
<p>If you have any questions or comments about downloading It's a Vibe, feel free to leave them below. We will try to answer them as soon as possible. Here are some FAQs that might interest you:</p>
|
53 |
-
<h4>FAQs</h4>
|
54 |
-
<ol>
|
55 |
-
<li>Is It's a Vibe available on other platforms besides YouTube, Spotify, and Apple Music?</li>
|
56 |
-
<p>Yes, It's a Vibe is also available on other platforms, such as Amazon Music, Tidal, Deezer, Pandora, and more. You can check the availability of the song on different platforms using this link: .</p>
|
57 |
-
<li>Is It's a Vibe legal to download?</li>
|
58 |
-
<p>It depends on the source and the method you use to download It's a Vibe. If you download It's a Vibe from an authorized platform, such as Spotify or Apple Music, and you have a valid subscription or purchase, then it is legal to download It's a Vibe. However, if you download It's a Vibe from an unauthorized platform, such as a YouTube to MP3 converter website, then it might be illegal to download It's a Vibe. You should always respect the intellectual property rights of the artist and his collaborators and follow the terms and conditions of the platform you use.</p>
|
59 |
-
<li>How can I share It's a Vibe with my friends?</li>
|
60 |
-
<p>You can share It's a Vibe with your friends by sending them the link to the song on your preferred platform or by using the share function on the platform. You can also create a playlist with It's a Vibe and other songs that you like and share it with your friends. However, you should not share the downloaded MP3 file of It's a Vibe with your friends, as this might violate the copyright laws and the platform rules.</p>
|
61 |
-
<li>What are some other songs by 2 Chainz that I might like?</li>
|
62 |
-
<p>If you like It's a Vibe, you might also like some other songs by 2 Chainz, such as No Lie (feat. Drake), Birthday Song (feat. Kanye West), I'm Different, Watch Out, Good Drank (feat. Gucci Mane and Quavo), 4 AM (feat. Travis Scott), Rule the World (feat. Ariana Grande), and Money Maker (feat. Lil Wayne). You can find these songs and more on 2 Chainz's albums and singles on various platforms.</p>
|
63 |
-
<li>What are some other songs that feature Ty Dolla Sign, Trey Songz, or Jhené Aiko?</li>
|
64 |
-
<p>If you like the features of Ty Dolla Sign, Trey Songz, or Jhené Aiko on It's a Vibe, you might also like some other songs that feature them, such as Paranoid (Ty Dolla Sign feat. B.o.B), Or Nah (Ty Dolla Sign feat. Wiz Khalifa and The Weeknd), Psycho (Post Malone feat. Ty Dolla Sign), Bottoms Up (Trey Songz feat. Nicki Minaj), Na Na (Trey Songz), Slow Motion (Trey Songz), The Worst (Jhené Aiko), Sativa (Jhené Aiko feat. Rae Sremmurd), B.S. (Jhené Aiko feat. H.E.R.), and None of Your Concern (Jhené Aiko feat. Big Sean). You can find these songs and more on their albums and singles on various platforms.</p>
|
65 |
-
</ol></p> 401be4b1e0<br />
|
66 |
-
<br />
|
67 |
-
<br />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/1phancelerku/anime-remove-background/Download I Know You MP3 Song by Craig David with Bastille - JioSaavn.md
DELETED
@@ -1,116 +0,0 @@
|
|
1 |
-
<br />
|
2 |
-
<h1>Craig David - I Know You (feat. Bastille): A Review of the Hit Song</h1>
|
3 |
-
<h2>Introduction</h2>
|
4 |
-
<p>If you are looking for a catchy, upbeat, and meaningful song to add to your playlist, you might want to check out <strong>Craig David</strong>'s <strong>I Know You</strong>, featuring <strong>Bastille</strong>. This song is a collaboration between two of the most popular British artists in recent years, who have combined their talents and styles to create a hit that appeals to a wide range of listeners.</p>
|
5 |
-
<h2>craig david i know you mp3 download</h2><br /><p><b><b>Download Zip</b> ➡ <a href="https://jinyurl.com/2uNJR8">https://jinyurl.com/2uNJR8</a></b></p><br /><br />
|
6 |
-
<p>The song is about celebrating life, friendship, and love, despite all the challenges and struggles that we face. It is about finding paradise in our minds, even when we are stumbling through the night. It is about knowing each other, knowing ourselves, and knowing that we are not alone.</p>
|
7 |
-
<p>Craig David is a singer, songwriter, rapper, DJ, and record producer who rose to fame in 1999 with his breakthrough single <em>Re-Rewind</em>, featuring Artful Dodger. He has since released seven studio albums, including his debut <em>Born to Do It</em> (2000), which is considered one of the best-selling albums in UK chart history. He has also won several awards, such as two BRIT Awards, three MOBO Awards, four Ivor Novello Awards, and two MTV Europe Music Awards.</p>
|
8 |
-
<p>Bastille is an indie pop band that consists of four members: Dan Smith (lead vocals), Kyle Simmons (keyboards), Will Farquarson (guitar), and Chris Wood (drums). They formed in 2010 and released their debut album <em>Bad Blood</em> in 2013, which topped the UK Albums Chart and featured their signature hit <em>Pompeii</em>. They have also released two more albums, <em>Wild World</em> (2016) and <em>Doom Days</em> (2019), as well as several EPs, mixtapes, singles, and collaborations.</p>
|
9 |
-
<p>The song was released on November 23, 2017, as the second single from Craig David's seventh album <em>The Time Is Now</em> (2018). It was written by Craig David, Dan Smith, Fraser T Smith, and Helen "Carmen Reece" Culver, with production handled by Fraser T Smith. It reached number five on the UK Singles Chart, as well as charting in several other countries.</p>
|
10 |
-
<h2>Background and Inspiration</h2>
|
11 |
-
<p>The song was born out of a mutual admiration between Craig David and Bastille. They first met when they were both appearing on BBC Radio 1's breakfast show in 201 <p>6, and they performed a mash-up of Craig David's <em>Fill Me In</em> and Bastille's <em>No Angels</em>. They then decided to work together on a new song, and they spent a few days in the studio with Fraser T Smith, who had previously worked with both artists.</p>
|
12 |
-
<p>Craig David said that he was inspired by Bastille's sound and energy, and that he wanted to create a song that would make people feel good and uplifted. He said, "I wanted to write a song that had an element of nostalgia, but also something that felt fresh and current. I wanted to capture that feeling of being with your friends and having a great time, no matter what's going on in the world."</p>
|
13 |
-
<p>Dan Smith said that he was honored to collaborate with Craig David, who he considered one of his musical heroes. He said, "I grew up listening to his music and singing along to his songs. He has such an amazing voice and a knack for writing catchy hooks and melodies. I was really excited to work with him and see how our styles would blend together."</p>
|
14 |
-
<p>The song is also influenced by the theme of <em>The Time Is Now</em>, which is about living in the present and enjoying the moment. Craig David said, "The album is about being grateful for what you have, and not worrying about what you don't have. It's about celebrating life and making the most of every opportunity. It's about knowing that you are enough, and that you have everything you need within yourself."</p>
|
15 |
-
<p>craig david i know you feat bastille mp3 download<br />
|
16 |
-
craig david i know you audio mp3 download<br />
|
17 |
-
craig david i know you song download mp3<br />
|
18 |
-
craig david i know you free mp3 download<br />
|
19 |
-
craig david i know you lyrics mp3 download<br />
|
20 |
-
craig david i know you music video mp3 download<br />
|
21 |
-
craig david i know you remix mp3 download<br />
|
22 |
-
craig david i know you acoustic mp3 download<br />
|
23 |
-
craig david i know you instrumental mp3 download<br />
|
24 |
-
craig david i know you live mp3 download<br />
|
25 |
-
craig david i know you album mp3 download<br />
|
26 |
-
craig david i know you 320kbps mp3 download<br />
|
27 |
-
craig david i know you gaana mp3 download<br />
|
28 |
-
craig david i know you shazam mp3 download<br />
|
29 |
-
craig david i know you youtube mp3 download<br />
|
30 |
-
craig david i know you spotify mp3 download<br />
|
31 |
-
craig david i know you apple music mp3 download<br />
|
32 |
-
craig david i know you amazon music mp3 download<br />
|
33 |
-
craig david i know you soundcloud mp3 download<br />
|
34 |
-
craig david i know you deezer mp3 download<br />
|
35 |
-
craig david i know you tidal mp3 download<br />
|
36 |
-
craig david i know you pandora mp3 download<br />
|
37 |
-
craig david i know you napster mp3 download<br />
|
38 |
-
craig david i know you google play music mp3 download<br />
|
39 |
-
craig david i know you itunes mp3 download<br />
|
40 |
-
craig david i know you the time is now mp3 download<br />
|
41 |
-
craig david i know you expanded edition mp3 download<br />
|
42 |
-
craig david i know you deluxe edition mp3 download<br />
|
43 |
-
craig david i know you bonus track mp3 download<br />
|
44 |
-
craig david i know you radio edit mp3 download<br />
|
45 |
-
craig david i know you extended mix mp3 download<br />
|
46 |
-
craig david i know you club mix mp3 download<br />
|
47 |
-
craig david i know you dance mix mp3 download<br />
|
48 |
-
craig david i know you house mix mp3 download<br />
|
49 |
-
craig david i know you edm mix mp3 download<br />
|
50 |
-
craig david i know you trap mix mp3 download<br />
|
51 |
-
craig david i know you dubstep mix mp3 download<br />
|
52 |
-
craig david i know you mashup mp3 download<br />
|
53 |
-
craig david i know you cover mp3 download<br />
|
54 |
-
craig david i know you karaoke mp3 download<br />
|
55 |
-
craig david i know you ringtone mp3 download<br />
|
56 |
-
craig david i know you background music mp3 download<br />
|
57 |
-
craig david i know you piano version mp3 download<br />
|
58 |
-
craig david i know you guitar version mp3 download<br />
|
59 |
-
craig david i know you violin version mp3 download<br />
|
60 |
-
craig david i know you saxophone version mp3 download<br />
|
61 |
-
craig david i know you flute version mp3 download<br />
|
62 |
-
craig david i know you drum version mp3 download<br />
|
63 |
-
craig david i know you bass version mp3 download</p>
|
64 |
-
<h2>Music and Lyrics</h2>
|
65 |
-
<p>The song is a pop song with elements of R&B, dance, and electronic music. It has a tempo of 120 beats per minute and is composed in the key of A minor. It has a simple structure of verse-chorus-verse-chorus-bridge-chorus-outro, with a duration of three minutes and 34 seconds.</p>
|
66 |
-
<p>The song starts with a piano intro, followed by Craig David's smooth vocals over a pulsing beat and synth chords. He sings the first verse, which sets the scene of a night out with his friends. He then sings the pre-chorus, which builds up the anticipation for the chorus. He sings, "We're all stumbling through the night / But it's paradise in our minds / Falling together / Arms round each other / I know you / Know me too."</p>
|
67 |
-
<p>The chorus is catchy and anthemic, with Craig David and Dan Smith singing in harmony over a soaring melody and an uplifting instrumental. They sing, "We're all stumbling through the night / It doesn't matter / We're all together / And there's paradise in our minds / Falling together / Arms round each other / I know you / Know me too."</p>
|
68 |
-
<p>The second verse is sung by Dan Smith, who adds his distinctive tone and emotion to the song. He sings about feeling connected to someone on a deeper level, beyond the superficial aspects of appearance or status. He sings, "You don't care about the clothes I wear / You know I'm more than what meets the eye / You see my soul when you look in my eyes / And we don't need words to feel alive."</p>
|
69 |
-
<p>The bridge is sung by both artists, who exchange lines and harmonize with each other. They sing about finding comfort and joy in each other's presence, even when they are facing difficulties or uncertainties. They sing, "When we're lost in the moment / And we can't see where we're going / We don't need to be afraid / 'Cause we've got each other / And we'll always find our way."</p>
|
70 |
-
<p>The outro is a repetition of the chorus, with some ad-libs and vocalizations from both artists. The song ends with a fade-out of the instrumental and their voices.</p>
|
71 |
-
<h2>Reception and Impact</h2>
|
72 |
-
<p>The song received positive reviews from critics and fans alike, who praised its catchy hook, uplifting message, and seamless collaboration between Craig David and Bastille. Some of the comments include:</p>
|
73 |
-
<ul>
|
74 |
-
<li>"A brilliant pop song that showcases the best of both artists." - NME</li>
|
75 |
-
<li>"A feel-good anthem that celebrates life, love, and friendship." - The Guardian</li>
|
76 |
-
<li>"A catchy tune that will make you want to dance and sing along." - Billboard</li>
|
77 |
-
<li>"A perfect blend of Craig David's smooth R&B vocals and Bastille's indie pop sensibilities." - The Independent</li>
|
78 |
-
<li>"A refreshing and uplifting song that reminds us to enjoy the moment and appreciate each other." - Metro</li>
|
79 |
-
</ul>
|
80 |
-
<p>The song also performed well on the charts and streaming platforms, reaching number five on the UK Singles Chart, as well as charting in Australia, Belgium, Germany, Ireland, Netherlands , New Zealand, Scotland, and Sweden. It also accumulated over 100 million streams on Spotify and over 40 million views on YouTube. The song also had a positive impact on both artists' careers and fan bases, as it exposed them to new audiences and markets. Craig David said that the song helped him to reach a younger generation of listeners, who might not have been familiar with his previous work. He said, "It's amazing to see how the song has connected with people of different ages and backgrounds. I'm grateful for the opportunity to work with Bastille and share our music with their fans and vice versa." Bastille said that the song helped them to expand their musical horizons and experiment with different genres and sounds. They said, "It was a fun and challenging experience to work with Craig David and Fraser T Smith, who are both legends in their own right. We learned a lot from them and we enjoyed trying something new and different from our usual style." The song also inspired or influenced other artists or songs, such as: - <em>Paradise</em> by George Ezra, which has a similar theme and vibe to <em>I Know You</em>. - <em>These Days</em> by Rudimental, Jess Glynne, Macklemore, and Dan Caplen, which features Craig David's vocals in the chorus. - <em>Happier</em> by Marshmello and Bastille, which is another collaboration between Bastille and an electronic music producer. - <em>Giant</em> by Calvin Harris and Rag'n'Bone Man, which has a similar genre and style to <em>I Know You</em>. - <em>Don't Leave Me Alone</em> by David Guetta and Anne-Marie, which is another pop song that features piano chords and synth sounds. <h2>Music Video and Live Performances</h2>
|
81 |
-
<p>The music video for the song was released on December 14, 2017, on Craig David's YouTube channel. It was directed by Alex Southam and produced by Odelay Films. It has over 40 million views as of June 2021.</p>
|
82 |
-
<p>The concept and theme of the music video is based on the lyrics and mood of the song. It shows Craig David and Bastille hanging out with their friends at a house party, having fun and enjoying each other's company. It also shows them performing the song in different settings, such as a rooftop, a basement, a living room, and a garden. The video uses various lighting effects, camera angles, and editing techniques to create a dynamic and energetic atmosphere.</p>
|
83 |
-
<p>The music video relates to the song's lyrics and mood by portraying the message of celebrating life, friendship, and love. It shows how the artists and their friends are stumbling through the night, but finding paradise in their minds. It shows how they are falling together, arms round each other, knowing each other and themselves. It also shows how they are not afraid of the dark or the unknown, as they have each other's support and guidance.</p>
|
84 |
-
<p>Craig David and Bastille performed the song live several times, both together and separately. Some of the notable occasions include:</p>
|
85 |
-
<ul>
|
86 |
-
<li>The Graham Norton Show on December 1, 2017, where they performed the song for the first time on television.</li>
|
87 |
-
<li>The BRIT Awards on February 21, 2018, where they performed the song as part of a medley with Dua Lipa's <em>New Rules</em> and Rag'n'Bone Man's <em>Skin</em>.</li>
|
88 |
-
<li>The Voice UK on March 31, 2018, where they performed the song as part of the final show.</li>
|
89 |
-
<li>The Biggest Weekend on May 26, 2018, where they performed the song at Swansea's Singleton Park.</li>
|
90 |
-
<li>The Jingle Bell Ball on December 8, 2018, where they performed the song at London's O2 Arena.</li>
|
91 |
-
</ul>
|
92 |
-
<p>During their live performances, they interacted with each other and the audience in a friendly and enthusiastic manner. They sang with passion and emotion, while also adding some improvisations and variations to the song. They also engaged the crowd by encouraging them to sing along, clap along, or dance along to the song.</p>
|
93 |
-
<h2>Conclusion</h2>
|
94 |
-
<p>In conclusion, <strong>Craig David</strong>'s <strong>I Know You</strong>, featuring <strong>Bastille</strong>, is a hit song that deserves your attention and download. It is a catchy, upbeat, and meaningful song that celebrates life, friendship , and love. It is a collaboration between two of the most popular British artists in recent years, who have combined their talents and styles to create a song that appeals to a wide range of listeners. It is a song that has a positive impact on both the artists' careers and fan bases, as well as on the music industry and culture. It is a song that has a catchy hook, uplifting message, and seamless collaboration.</p>
|
95 |
-
<p>If you are looking for a song that will make you feel good and uplifted, you should definitely listen to and download <strong>I Know You</strong>. You can find it on various platforms, such as Spotify, Apple Music, YouTube, Amazon Music, and more. You can also check out the music video, which shows Craig David and Bastille having fun and enjoying each other's company at a house party. You can also watch their live performances, which show their passion and emotion, as well as their interaction with each other and the audience.</p>
|
96 |
-
<p>Don't miss out on this amazing song that will make you want to dance and sing along. Download <strong>I Know You</strong> today and enjoy the paradise in your mind!</p>
|
97 |
-
<h2>FAQs</h2>
|
98 |
-
<p>Here are some of the frequently asked questions and answers about the song:</p>
|
99 |
-
<ol>
|
100 |
-
<li><strong>What is the name of Craig David's seventh album?</strong></li>
|
101 |
-
<li>The name of Craig David's seventh album is <em>The Time Is Now</em>, which was released on January 26, 2018. It features 12 tracks, including <em>I Know You</em>, as well as collaborations with other artists, such as AJ Tracey, Ella Mai, JP Cooper, Kaytranada, and GoldLink.</li>
|
102 |
-
<li><strong>What is the name of Bastille's third album?</strong></li>
|
103 |
-
<li>The name of Bastille's third album is <em>Doom Days</em>, which was released on June 14, 2019. It features 11 tracks, including <em>Happier</em>, as well as collaborations with other artists, such as Alessia Cara, Rationale, Seeb, and James Arthur.</li>
|
104 |
-
<li><strong>Who are some of the other artists that Craig David and Bastille have collaborated with?</strong></li>
|
105 |
-
<li>Some of the other artists that Craig David and Bastille have collaborated with include:</li>
|
106 |
-
<ul>
|
107 |
-
<li>Craig David: Sting, Rita Ora, Tinchy Stryder, Kano, Sigala, Hardwell, Big Narstie, Blonde, and more.</li>
|
108 |
-
<li>Bastille: Marshmello, Halsey, Craig David, Rag'n'Bone Man, Dua Lipa, Lizzo, Lewis Capaldi, Imagine Dragons, and more.</li>
|
109 |
-
</ul>
|
110 |
-
<li><strong>Where can I find the lyrics of <em>I Know You</em>?</strong></li>
|
111 |
-
<li>You can find the lyrics of <em>I Know You</em> on various websites, such as Genius, AZLyrics, MetroLyrics, LyricsMode, and more.</li>
|
112 |
-
<li><strong>Where can I find more information about Craig David and Bastille?</strong></li>
|
113 |
-
<li>You can find more information about Craig David and Bastille on their official websites , social media accounts , Wikipedia pages , and more.</li>
|
114 |
-
</ol></p> 401be4b1e0<br />
|
115 |
-
<br />
|
116 |
-
<br />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/1phancelerku/anime-remove-background/Download ludo by Johnny Drille - A Song from His Latest Album.md
DELETED
@@ -1,95 +0,0 @@
|
|
1 |
-
|
2 |
-
<h1>Ludo by Johnny Drille: A Song Review</h1>
|
3 |
-
<p>Ludo is a board game that has been played for centuries by people of all ages. It is a game of chance, strategy, and luck, where players race their tokens from start to finish according to the rolls of a die. But Ludo is also a song by Johnny Drille, a Nigerian singer and songwriter who is known for his folk/alternative style of music. In this song, Johnny Drille uses Ludo as a metaphor for his love life, expressing his feelings of uncertainty, frustration, and hope. In this article, we will review the song Ludo by Johnny Drille, analyzing its lyrics, music, and video. We will also explore the history and meaning of Ludo, both as a game and as a song.</p>
|
4 |
-
<h2>ludo by johnny drille mp3 download</h2><br /><p><b><b>DOWNLOAD</b> ->>> <a href="https://jinyurl.com/2uNOjU">https://jinyurl.com/2uNOjU</a></b></p><br /><br />
|
5 |
-
<h2>Introduction</h2>
|
6 |
-
<p>Johnny Drille is a Nigerian singer and songwriter who was born on July 5, 1990, in Edo State, Nigeria. He started singing in his father's church at an early age, and later taught himself music production techniques. He rose to fame after releasing a cover of Di'Ja's "Awww" in 2015, which caught the attention of Mavin Records CEO Don Jazzy. He signed with Mavin Records in 2017, becoming one of the few alternative artists on the label. He has since released several singles and collaborations, such as "Wait for Me", "Romeo & Juliet", "Halleluya" (featuring Simi), "Finding Efe", "Something Better", "Mystery Girl", "Bad Dancer", and "Loving Is Harder". He released his debut album, Before We Fall Asleep, on September 3, 2021.</p>
|
7 |
-
<p>Ludo is one of the songs on Johnny Drille's debut album. It was released as a single on August 27, 2021, along with its official video. The song was produced by Johnny Drille himself, while the video was directed by Clarence Peters. The song is inspired by Johnny Drille's personal experiences with love and relationships, as he explained in an interview with Pulse Nigeria:</p>
|
8 |
-
<blockquote>"Ludo is about my love life...It's about how sometimes you feel like you're playing a game with someone you love or someone you're interested in...Sometimes you feel like they're not being honest with you or they're not being straightforward with you...Sometimes you feel like you're just rolling dice...You don't know what's going to happen next...You don't know if they're going to call you or not...You don't know if they're going to text you or not...You don't know if they're going to show up or not...You don't know if they're going to say yes or no...It's just like playing Ludo."</blockquote>
|
9 |
-
<p>The song also reflects Johnny Drille's musical influences and preferences, as he blends elements of folk, pop, rock, soul, R&B, and afrobeat in his unique style. The song showcases his vocal range and abilities, as well as his skills as a songwriter and producer. The song also conveys some universal themes and messages of love, trust, risk, and fate, that many listeners can relate to. <h2>Analysis of the song</h2>
|
10 |
-
<h3>Lyrics</h3>
|
11 |
-
<p>The song Ludo has a simple structure, consisting of two verses, a chorus, and a bridge. The lyrics are written in English, with some words and phrases in Pidgin English, a creole language that is widely spoken in Nigeria and other parts of West Africa. The lyrics use Ludo as a metaphor for the ups and downs of love, comparing the game's rules and outcomes to the dynamics and uncertainties of a relationship. The lyrics also use other metaphors, imagery, and repetition to convey the song's meaning and emotion.</p>
|
12 |
-
<p>For example, in the first verse, Johnny Drille sings:</p>
|
13 |
-
<blockquote>"I don't know what you're doing to me<br>
|
14 |
-
But it feels like magic<br>
|
15 |
-
You got me feeling things I never felt before<br>
|
16 |
-
Like I'm walking on air"</blockquote>
|
17 |
-
<p>Here, he uses the metaphor of magic to describe the attraction and excitement he feels for his lover. He also uses the imagery of walking on air to express his happiness and lightness. He repeats the phrase "I don't know" several times throughout the song, indicating his confusion and curiosity about his lover's intentions and actions.</p>
|
18 |
-
<p>In the chorus, Johnny Drille sings:</p>
|
19 |
-
<p>ludo song by johnny drille free download<br />
|
20 |
-
johnny drille ludo mp3 audio download<br />
|
21 |
-
download ludo by johnny drille from before we fall asleep album<br />
|
22 |
-
johnny drille ludo lyrics and mp3 download<br />
|
23 |
-
how to download ludo by johnny drille on boomplay<br />
|
24 |
-
ludo by johnny drille music video download<br />
|
25 |
-
johnny drille ludo instrumental mp3 download<br />
|
26 |
-
download ludo by johnny drille on morexlusive<br />
|
27 |
-
johnny drille ludo remix mp3 download<br />
|
28 |
-
ludo by johnny drille ft simi mp3 download<br />
|
29 |
-
johnny drille ludo live performance mp3 download<br />
|
30 |
-
download ludo by johnny drille on naijaloaded<br />
|
31 |
-
johnny drille ludo cover by chike mp3 download<br />
|
32 |
-
ludo by johnny drille ringtone mp3 download<br />
|
33 |
-
johnny drille ludo acoustic version mp3 download<br />
|
34 |
-
download ludo by johnny drille on tooxclusive<br />
|
35 |
-
johnny drille ludo karaoke mp3 download<br />
|
36 |
-
ludo by johnny drille 320kbps mp3 download<br />
|
37 |
-
johnny drille ludo dance challenge mp3 download<br />
|
38 |
-
download ludo by johnny drille on audiomack<br />
|
39 |
-
johnny drille ludo reaction video mp3 download<br />
|
40 |
-
ludo by johnny drille dj mix mp3 download<br />
|
41 |
-
johnny drille ludo behind the scenes mp3 download<br />
|
42 |
-
download ludo by johnny drille on spotify<br />
|
43 |
-
johnny drille ludo piano tutorial mp3 download</p>
|
44 |
-
<blockquote>"Are we playing Ludo?<br>
|
45 |
-
Are you rolling dice?<br>
|
46 |
-
Are you moving forward?<br>
|
47 |
-
Or are you going back?<br>
|
48 |
-
Are we playing Ludo?<br>
|
49 |
-
Are you rolling dice?<br>
|
50 |
-
Are you here to stay?<br>
|
51 |
-
Or are you going away?"</blockquote>
|
52 |
-
<p>Here, he uses the metaphor of Ludo to question his lover's commitment and honesty. He compares the game's mechanics of rolling dice and moving tokens to his lover's behavior of being unpredictable and inconsistent. He repeats the phrase "Are we playing Ludo?" to emphasize his doubt and frustration. He also uses rhetorical questions to challenge his lover and seek clarity.</p>
|
53 |
-
<h3>Music</h3>
|
54 |
-
<p>The song Ludo has a moderate tempo and a catchy melody. The music is composed of various instruments, vocals, and sound effects that create its mood and tone. The music also reflects some of the musical influences and genres that Johnny Drille draws from in his style. The music also balances between simplicity and complexity in its composition and arrangement.</p>
|
55 |
-
<p>For example, some of the instruments that can be heard in the song are:</p>
|
56 |
-
<ul>
|
57 |
-
<li>Guitar: The song features acoustic guitar strums and electric guitar riffs that add warmth and texture to the music. The guitar also creates a folk/rock vibe that matches Johnny Drille's genre.</li>
|
58 |
-
<li>Piano: The song features piano chords and notes that add depth and harmony to the music. The piano also creates a pop/soul vibe that matches Johnny Drille's genre.</li>
|
59 |
-
<li>Drums: The song features drum beats and fills that add rhythm and energy to the music. The drums also create an afrobeat vibe that matches Johnny Drille's origin.</li>
|
60 |
-
<li>Synth: The song features synth sounds and effects that add color and flair to the music. The synth also creates a modern/alternative vibe that matches Johnny Drille's style.</li>
|
61 |
-
</ul> <p>Some of the vocals and sound effects that can be heard in the song are:</p>
|
62 |
-
<ul>
|
63 |
-
<li>Johnny Drille: The song features Johnny Drille's voice as the main vocal, singing the lyrics with emotion and expression. Johnny Drille has a distinctive voice that is smooth, soulful, and versatile. He can sing in different pitches and tones, ranging from low to high, soft to loud, and sweet to raspy. He also uses vocal techniques such as falsetto, vibrato, and harmony to add variation and richness to his singing.</li>
|
64 |
-
<li>Backing vocals: The song features backing vocals that support and complement Johnny Drille's voice. The backing vocals are mostly female voices that sing in harmony with Johnny Drille, creating a contrast and balance. The backing vocals also sing some ad-libs and hooks that add flavor and catchiness to the song.</li>
|
65 |
-
<li>Ludo sounds: The song features some sound effects that are related to Ludo, such as dice rolling, tokens moving, and board clicking. These sound effects are used to reinforce the metaphor of Ludo and create a playful and fun atmosphere. They also add some humor and irony to the song, as they contrast with the serious and emotional tone of the lyrics.</li>
|
66 |
-
</ul>
|
67 |
-
<h3>Video</h3>
|
68 |
-
<p>The song Ludo has an official video that was released on August 27, 2021, along with the single. The video was directed by Clarence Peters, a Nigerian music video director who has worked with many popular artists such as Wizkid, Davido, Tiwa Savage, Burna Boy, and more. The video complements and enhances the song's message and aesthetics, using various visual elements and symbols that are related to Ludo, love, and Johnny Drille.</p>
|
69 |
-
<p>For example, some of the visual elements and symbols that can be seen in the video are:</p>
|
70 |
-
<ul>
|
71 |
-
<li>Ludo board: The video features a giant Ludo board that serves as the main setting for the video. The Ludo board represents the game of love that Johnny Drille is playing with his lover. The board also has some twists and turns that make it more challenging and interesting.</li>
|
72 |
-
<li>Ludo tokens: The video features four Ludo tokens that are used by Johnny Drille and his lover to play the game. The tokens are colored red, yellow, green, and blue, representing the different emotions and moods that they experience during the game. The tokens also have some special features that make them more interactive and expressive.</li>
|
73 |
-
<li>Johnny Drille: The video features Johnny Drille as himself, singing and playing the game with his lover. Johnny Drille wears a casual outfit that matches his style and personality. He also shows his facial expressions and body language that convey his feelings and thoughts about the game.</li>
|
74 |
-
<li>Lover: The video features a female character who plays the role of Johnny Drille's lover. She wears a colorful dress that matches her beauty and charm. She also shows her facial expressions and body language that convey her feelings and thoughts about the game.</li>
|
75 |
-
</ul>
|
76 |
-
<h2>Conclusion</h2>
|
77 |
-
<p>Ludo by Johnny Drille is a song that explores the complexities and uncertainties of love, using Ludo as a metaphor for the game of chance, strategy, and luck that lovers play with each other. The song combines lyrics, music, and video to create a captivating and meaningful piece of art that showcases Johnny Drille's talent and style as a singer, songwriter, producer, and performer. The song also resonates with many listeners who can relate to the themes and messages of the song.</p>
|
78 |
-
<p>The song's strengths include its originality, creativity, emotionality, catchiness, versatility, relatability, and quality. The song's weaknesses include its simplicity, repetitiveness, ambiguity, and predictability. However, these weaknesses can also be seen as strengths, depending on the listener's perspective and preference. Overall, the song is a well-crafted and enjoyable work of art that deserves recognition and appreciation.</p>
|
79 |
-
<p>If you are a fan of Johnny Drille or alternative music in general, you should definitely check out Ludo by Johnny Drille. You can listen to the song on various streaming platforms such as Spotify, Apple Music, YouTube Music, and more. You can also watch the video on YouTube or on Johnny Drille's official website. You can also follow Johnny Drille on his social media accounts such as Instagram, Twitter, Facebook, and TikTok to stay updated on his latest news and releases.</p>
|
80 |
-
<p>Ludo by Johnny Drille is a song that will make you feel, think, and play. It is a song that will challenge you, inspire you, and entertain you. It is a song that will make you love Ludo, both as a game and as a song.</p>
|
81 |
-
<h2>FAQs</h2>
|
82 |
-
<ul>
|
83 |
-
<li>Q: What is the meaning of Ludo?<br>
|
84 |
-
A: Ludo is a board game that originated in India in the 6th century. The name Ludo comes from the Latin word ludus, which means "game". Ludo is also a song by Johnny Drille that uses Ludo as a metaphor for love.</li>
|
85 |
-
<li>Q: Who is Johnny Drille?<br>
|
86 |
-
A: Johnny Drille is a Nigerian singer and songwriter who is known for his folk/alternative style of music. He was born on July 5, 1990, in Edo State, Nigeria. He signed with Mavin Records in 2017 and released his debut album, Before We Fall Asleep, in 2021.</li>
|
87 |
-
<li>Q: When was Ludo by Johnny Drille released?<br>
|
88 |
-
A: Ludo by Johnny Drille was released as a single on August 27, 2021, along with its official video. It is one of the songs on Johnny Drille's debut album, Before We Fall Asleep.</li>
|
89 |
-
<li>Q: What are some of the musical influences and genres that can be heard in Ludo by Johnny Drille?<br>
|
90 |
-
A: Ludo by Johnny Drille blends elements of folk, pop, rock, soul, R&B, and afrobeat in its music. Some of the musical influences and genres that can be heard in the song are Ed Sheeran, Coldplay, John Mayer, Adele, Fela Kuti, Asa, and more.</li>
|
91 |
-
<li>Q: How can I download Ludo by Johnny Drille mp3?<br>
|
92 |
-
A: You can download Ludo by Johnny Drille mp3 from various sources online such as iTunes, Amazon Music, Google Play Music, and more. However, you should always respect the artist's rights and pay for the song if possible. Alternatively, you can stream the song on various platforms such as Spotify, Apple Music, YouTube Music, and more.</li>
|
93 |
-
</ul></p> 401be4b1e0<br />
|
94 |
-
<br />
|
95 |
-
<br />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/1phancelerku/anime-remove-background/Enjoy the Latest Minecraft Update 1.18.2.03 on Android and Xbox with this APK File.md
DELETED
@@ -1,126 +0,0 @@
|
|
1 |
-
<br />
|
2 |
-
<h1>Minecraft 1.18.2.03 APK with Xbox Servers: What You Need to Know</h1>
|
3 |
-
<p>Minecraft is one of the most popular sandbox video games in the world, with over 200 million copies sold and more than 130 million monthly active users. It allows players to create, explore, and survive in a procedurally generated world made of blocks, where they can build anything they can imagine, from simple houses to complex machines.</p>
|
4 |
-
<h2>minecraft-1-18-2-03-xbox-servers (1).apk</h2><br /><p><b><b>Download File</b> … <a href="https://jinyurl.com/2uNKAI">https://jinyurl.com/2uNKAI</a></b></p><br /><br />
|
5 |
-
<p>If you are an Android user who loves playing Minecraft, you might be interested in downloading the latest version of the game, which is Minecraft 1.18.2.03 APK with Xbox servers. This is a modified version of the official Minecraft app that lets you access online multiplayer features, such as joining servers hosted by other players or by official partners of Mojang Studios, the developer of Minecraft.</p>
|
6 |
-
<p>An APK file is an Android application package file that contains all the files and data needed to install an app on your device. You can download APK files from various sources on the internet, but you need to be careful about their safety and compatibility. Some APK files may contain malware or viruses that can harm your device or steal your personal information.</p>
|
7 |
-
<p>Xbox servers are online worlds created by Mojang Studios or by members of the Minecraft community that offer different types of gameplay, such as minigames, adventure maps, survival challenges, and more. You can join Xbox servers from any device that supports Minecraft: Bedrock Edition, such as Windows, mobile devices, tablets, Xbox, Nintendo Switch, or PlayStation 4.</p>
|
8 |
-
<p>In this article, we will tell you everything you need to know about Minecraft 1.18.2.03 APK with Xbox servers, including its features, how to download and install it on your Android device, and some tips and warnings to keep in mind.</p>
|
9 |
-
<h2>Features of Minecraft 1.18.2.03 APK with Xbox Servers</h2>
|
10 |
-
<p>Minecraft 1.18.2.03 APK with Xbox servers is a stable update that contains several bug fixes and performance improvements, as well as some new features that enhance your gaming experience.</p>
|
11 |
-
<h3>Bug fixes and performance improvements</h3>
|
12 |
-
<p>Some of the bug fixes and performance improvements in this version are:</p>
|
13 |
-
<p>minecraft pe 1.18.2 download with xbox live<br />
|
14 |
-
minecraft 1.18.2 release apk free download<br />
|
15 |
-
minecraft bedrock edition 1.18.2 for android<br />
|
16 |
-
minecraft 1.18.2 update with sculk blocks<br />
|
17 |
-
minecraft pe 1.18.2 music change feature<br />
|
18 |
-
minecraft 1.18.2 apk with working servers<br />
|
19 |
-
minecraft 1.18.2 cave and cliffs part 2<br />
|
20 |
-
minecraft pe 1.18.2 dark effect in caves<br />
|
21 |
-
minecraft 1.18.2 apk download mcpehaxs<br />
|
22 |
-
minecraft bedrock 1.18.2 performance improvements<br />
|
23 |
-
minecraft pe 1.18.2 release date and features<br />
|
24 |
-
minecraft 1.18.2 apk with multi-noise world<br />
|
25 |
-
minecraft bedrock edition 1.18.2 download mcpeplanet<br />
|
26 |
-
minecraft pe 1.18.2 ore generation in caves<br />
|
27 |
-
minecraft 1.18.2 apk with xbox live support<br />
|
28 |
-
minecraft bedrock 1.18.2 new biomes and structures<br />
|
29 |
-
minecraft pe 1.18.2 latest version download<br />
|
30 |
-
minecraft 1.18.2 apk with texture fixes<br />
|
31 |
-
minecraft bedrock edition 1.18.2 for ios<br />
|
32 |
-
minecraft pe 1.18.2 modded servers list<br />
|
33 |
-
minecraft 1.18.2 apk with skin editor<br />
|
34 |
-
minecraft bedrock 1.18.2 new mobs and items<br />
|
35 |
-
minecraft pe 1.18.2 free download for android<br />
|
36 |
-
minecraft 1.18.2 apk with bug fixes<br />
|
37 |
-
minecraft bedrock edition 1.18.2 for windows 10<br />
|
38 |
-
minecraft pe 1.18.2 shaders and texture packs<br />
|
39 |
-
minecraft 1.18.2 apk with marketplace access<br />
|
40 |
-
minecraft bedrock 1.18.2 new commands and cheats<br />
|
41 |
-
minecraft pe 1.18.2 seeds and maps download<br />
|
42 |
-
minecraft 1.18.2 apk with custom skins<br />
|
43 |
-
minecraft bedrock edition 1.18.2 for xbox one<br />
|
44 |
-
minecraft pe 1.18.2 addons and mods download<br />
|
45 |
-
minecraft 1.18.2 apk with cross-play feature<br />
|
46 |
-
minecraft bedrock edition 1.18.2 for ps4<br />
|
47 |
-
minecraft pe 1.18.2 realms and servers guide<br />
|
48 |
-
minecraft 1.18.2 apk with experimental features toggle<br />
|
49 |
-
minecraft bedrock edition 1.18.2 for switch<br />
|
50 |
-
minecraft pe 1.18.2 best settings and tips<br />
|
51 |
-
minecraft 1.18.2 apk with controller support<br />
|
52 |
-
minecraft bedrock edition 1.18 license key generator</p>
|
53 |
-
<ul>
|
54 |
-
<li>Fixed an issue that affected some large world saves on PlayStation, resulting in corrupted textures and loss of data</li>
|
55 |
-
<li>Fixed interacting with certain containers that did not properly open the inventory screen</li>
|
56 |
-
<li>Fixed breaking blocks, opening chests, passing into portals when there are a lot of mobs around</li>
|
57 |
-
<li>Fixed errors when replacing root rock with deep shale</li>
|
58 |
-
<li>Optimized game loading time and reduced lag</li>
|
59 |
-
</ul>
|
60 |
-
<h3>New honeybee option and packs</h3>
|
61 |
-
<p>This version also introduces a new honeybee option that saves you from getting poisoned and from hunger. Honeybees can also bring food for you and help you with construction. You can also find new packs in the store that offer different items and skins for your character.</p>
|
62 |
-
<h3>Server/sign-in issue resolved</h3>
|
63 |
-
<p>The most annoying server sign-in issue that prevented many players from joining online multiplayer games has been fixed in this version. Now you can sign in without any server timed out errors. <h3>Compliance requirements for South Korean players</h3>
|
64 |
-
<p>This version also contains some compliance updates for South Korean players, in accordance with the country's gaming laws. These updates include gameplay timers and notices that remind players to take occasional breaks from gameplay . If you are playing in South Korea, you will also need to verify your age and identity before purchasing and playing the Java edition of Minecraft.</p>
|
65 |
-
<h2>How to Download and Install Minecraft 1.18.2.03 APK with Xbox Servers</h2>
|
66 |
-
<p>If you want to enjoy the latest features and improvements of Minecraft 1.18.2.03 APK with Xbox servers, you will need to download and install it on your Android device. Here is a step-by-step guide on how to do that:</p>
|
67 |
-
<ol>
|
68 |
-
<li>Download the Minecraft 1.18.2.03 APK file from a trusted source, such as [this one](^5^). Make sure you have enough storage space on your device and a stable internet connection.</li>
|
69 |
-
<li>Go to your device settings and enable the installation of apps from unknown sources. This will allow you to install the APK file that is not from the Google Play Store.</li>
|
70 |
-
<li>Locate the downloaded APK file on your device using a file manager app or your browser's downloads folder. Tap on it to start the installation process.</li>
|
71 |
-
<li>Follow the on-screen instructions and grant the necessary permissions to the app. Wait for the installation to finish.</li>
|
72 |
-
<li>Launch the Minecraft app and sign in with your Microsoft account. If you don't have one, you can create one for free [here](^6^).</li>
|
73 |
-
<li>Enjoy playing Minecraft 1.18.2.03 APK with Xbox servers!</li>
|
74 |
-
</ol>
|
75 |
-
<h3>Tips and warnings</h3>
|
76 |
-
<p>Here are some tips and warnings to keep in mind when downloading and installing Minecraft 1.18.2.03 APK with Xbox servers:</p>
|
77 |
-
<ul>
|
78 |
-
<li>Make sure you download the APK file from a safe and reliable source, as some websites may contain malware or viruses that can harm your device or steal your personal information.</li>
|
79 |
-
<li>Make a backup of your Minecraft worlds before installing the new version, as it may not be compatible with older versions or may cause data loss.</li>
|
80 |
-
<li>Do not uninstall or update the official Minecraft app from the Google Play Store, as it may interfere with the APK version or cause errors.</li>
|
81 |
-
<li>If you encounter any problems or bugs while playing, you can report them to Mojang Studios [here](^7^).</li>
|
82 |
-
</ul>
|
83 |
-
<h2>Conclusion</h2>
|
84 |
-
<p>Minecraft 1.18.2.03 APK with Xbox servers is a great way to enjoy the latest features and improvements of the game on your Android device, as well as access online multiplayer features such as joining Xbox servers hosted by Mojang Studios or by other players. You can download and install it easily by following our guide above, but make sure you do it safely and responsibly.</p>
|
85 |
-
<p>We hope you found this article helpful and informative. If you did, please share it with your friends and fellow Minecraft fans. Also, feel free to leave us a comment below if you have any questions or feedback about Minecraft 1.18.2.03 APK with Xbox servers. We would love to hear from you!</p>
|
86 |
-
<h2>FAQs</h2>
|
87 |
-
<h3>What are the benefits of playing Minecraft on Xbox servers?</h3>
|
88 |
-
<p>Xbox servers are online worlds created by Mojang Studios or by members of the Minecraft community that offer different types of gameplay, such as minigames, adventure maps, survival challenges, and more. You can join Xbox servers from any device that supports Minecraft: Bedrock Edition, such as Windows, mobile devices, tablets, Xbox, Nintendo Switch, or PlayStation 4. Some of the benefits of playing on Xbox servers are:</p>
|
89 |
-
<ul>
|
90 |
-
<li>You can play with other players from around the world and make new friends.</li>
|
91 |
-
<li>You can experience new and exciting game modes and challenges that are not available in single-player mode.</li>
|
92 |
-
<li>You can learn new skills and strategies from other players and improve your own gameplay.</li>
|
93 |
-
<li>You can show off your creativity and achievements to other players and get inspired by their creations.</li>
|
94 |
-
<li>You can have fun and enjoy yourself in a friendly and supportive community.</li>
|
95 |
-
</ul>
|
96 |
-
<h3>How can I update my Minecraft to the latest version?</h3>
|
97 |
-
<p>If you have downloaded Minecraft 1.18.2.03 APK with Xbox servers, you will need to download and install a new APK file whenever there is a new update available for the game. You can check for updates by visiting [this website](^5^) or by following Mojang Studios on social media platforms such as [ Twitter] or [Facebook]. To update your Minecraft, you will need to follow the same steps as downloading and installing the APK file, as explained above. Make sure you backup your worlds before updating, as some updates may not be compatible with older versions or may cause data loss.</p>
|
98 |
-
<h3>How can I customize my cave generation and add new structures with experimental data packs?</h3>
|
99 |
-
<p>Minecraft 1.18.2.03 APK with Xbox servers also supports experimental data packs that allow you to customize your world generation and add new structures, such as caves, cliffs, biomes, dungeons, and more. Experimental data packs are not officially supported by Mojang Studios and may cause errors or crashes, so use them at your own risk. To use experimental data packs, you will need to download them from [this website] or from other sources on the internet. Then, you will need to follow these steps:</p>
|
100 |
-
<ol>
|
101 |
-
<li>Create a new world or edit an existing one in Minecraft.</li>
|
102 |
-
<li>Go to the world settings and enable the "Use Experimental Gameplay" option.</li>
|
103 |
-
<li>Go to the "Data Packs" section and tap on the "Import" button.</li>
|
104 |
-
<li>Select the data pack file that you have downloaded and tap on "Apply".</li>
|
105 |
-
<li>Start or resume your world and enjoy the new features.</li>
|
106 |
-
</ol>
|
107 |
-
<h3>How can I change the music in the main menu of Minecraft?</h3>
|
108 |
-
<p>Minecraft 1.18.2.03 APK with Xbox servers also allows you to change the music that plays in the main menu of the game, as well as in other screens such as settings, achievements, and credits. You can choose from different music tracks that are available in the game, or you can add your own custom music files. To change the music in the main menu of Minecraft, you will need to follow these steps:</p>
|
109 |
-
<ol>
|
110 |
-
<li>Go to the settings menu and tap on the "Audio" option.</li>
|
111 |
-
<li>Tap on the "Music" option and select the music track that you want to play in the main menu.</li>
|
112 |
-
<li>If you want to add your own custom music files, you will need to copy them to the "music" folder inside the "com.mojang" folder on your device's internal storage. The music files must be in MP3 format and have a maximum size of 10 MB each.</li>
|
113 |
-
<li>Restart the game and enjoy your new music.</li>
|
114 |
-
</ol>
|
115 |
-
<h3>How can I avoid getting poisoned by honeybees in Minecraft?</h3>
|
116 |
-
<p>Honeybees are a new feature in Minecraft 1.18.2.03 APK with Xbox servers that can help you with food and construction, but they can also sting you and poison you if you provoke them or disturb their nests. To avoid getting poisoned by honeybees in Minecraft, you will need to follow these tips:</p>
|
117 |
-
<ul>
|
118 |
-
<li>Do not attack or hit honeybees or their nests, as they will become aggressive and chase you.</li>
|
119 |
-
<li>Do not break or move honeybee nests without using a tool with silk touch enchantment, as this will anger the honeybees inside.</li>
|
120 |
-
<li>Do not stand too close to honeybee nests or hives when they are full of honey, as honeybees will come out and sting you.</li>
|
121 |
-
<li>Wear leather armor or a pumpkin on your head to reduce the damage from honeybee stings.</li>
|
122 |
-
<li>Use smoke from a campfire or a dispenser with a fire charge to calm down honeybees and make them stop attacking you.</li>
|
123 |
-
<li>Eat honey bottles or honey blocks to cure poison effects from honeybee stings.</li>
|
124 |
-
</ul></p> 197e85843d<br />
|
125 |
-
<br />
|
126 |
-
<br />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/1toTree/lora_test/ppdiffusers/schedulers/__init__.py
DELETED
@@ -1,54 +0,0 @@
|
|
1 |
-
# Copyright (c) 2022 PaddlePaddle Authors. All Rights Reserved.
|
2 |
-
# Copyright 2022 The HuggingFace Team. All rights reserved.
|
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 |
-
# flake8: noqa
|
16 |
-
|
17 |
-
from ..utils import (
|
18 |
-
OptionalDependencyNotAvailable,
|
19 |
-
is_paddle_available,
|
20 |
-
is_scipy_available,
|
21 |
-
)
|
22 |
-
|
23 |
-
try:
|
24 |
-
if not is_paddle_available():
|
25 |
-
raise OptionalDependencyNotAvailable()
|
26 |
-
except OptionalDependencyNotAvailable:
|
27 |
-
from ..utils.dummy_paddle_objects import * # noqa F403
|
28 |
-
else:
|
29 |
-
from .scheduling_ddim import DDIMScheduler
|
30 |
-
from .scheduling_ddpm import DDPMScheduler
|
31 |
-
from .scheduling_dpmsolver_multistep import DPMSolverMultistepScheduler
|
32 |
-
from .scheduling_dpmsolver_singlestep import DPMSolverSinglestepScheduler
|
33 |
-
from .scheduling_euler_ancestral_discrete import EulerAncestralDiscreteScheduler
|
34 |
-
from .scheduling_euler_discrete import EulerDiscreteScheduler
|
35 |
-
from .scheduling_heun_discrete import HeunDiscreteScheduler
|
36 |
-
from .scheduling_ipndm import IPNDMScheduler
|
37 |
-
from .scheduling_k_dpm_2_ancestral_discrete import KDPM2AncestralDiscreteScheduler
|
38 |
-
from .scheduling_k_dpm_2_discrete import KDPM2DiscreteScheduler
|
39 |
-
from .scheduling_karras_ve import KarrasVeScheduler
|
40 |
-
from .scheduling_pndm import PNDMScheduler
|
41 |
-
from .scheduling_repaint import RePaintScheduler
|
42 |
-
from .scheduling_sde_ve import ScoreSdeVeScheduler
|
43 |
-
from .scheduling_sde_vp import ScoreSdeVpScheduler
|
44 |
-
from .scheduling_unclip import UnCLIPScheduler
|
45 |
-
from .scheduling_utils import SchedulerMixin
|
46 |
-
from .scheduling_vq_diffusion import VQDiffusionScheduler
|
47 |
-
|
48 |
-
try:
|
49 |
-
if not (is_paddle_available() and is_scipy_available()):
|
50 |
-
raise OptionalDependencyNotAvailable()
|
51 |
-
except OptionalDependencyNotAvailable:
|
52 |
-
from ..utils.dummy_paddle_and_scipy_objects import * # noqa F403
|
53 |
-
else:
|
54 |
-
from .scheduling_lms_discrete import LMSDiscreteScheduler
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/801artistry/RVC801/infer/lib/uvr5_pack/lib_v5/layers_new.py
DELETED
@@ -1,125 +0,0 @@
|
|
1 |
-
import torch
|
2 |
-
import torch.nn.functional as F
|
3 |
-
from torch import nn
|
4 |
-
|
5 |
-
from . import spec_utils
|
6 |
-
|
7 |
-
|
8 |
-
class Conv2DBNActiv(nn.Module):
|
9 |
-
def __init__(self, nin, nout, ksize=3, stride=1, pad=1, dilation=1, activ=nn.ReLU):
|
10 |
-
super(Conv2DBNActiv, self).__init__()
|
11 |
-
self.conv = nn.Sequential(
|
12 |
-
nn.Conv2d(
|
13 |
-
nin,
|
14 |
-
nout,
|
15 |
-
kernel_size=ksize,
|
16 |
-
stride=stride,
|
17 |
-
padding=pad,
|
18 |
-
dilation=dilation,
|
19 |
-
bias=False,
|
20 |
-
),
|
21 |
-
nn.BatchNorm2d(nout),
|
22 |
-
activ(),
|
23 |
-
)
|
24 |
-
|
25 |
-
def __call__(self, x):
|
26 |
-
return self.conv(x)
|
27 |
-
|
28 |
-
|
29 |
-
class Encoder(nn.Module):
|
30 |
-
def __init__(self, nin, nout, ksize=3, stride=1, pad=1, activ=nn.LeakyReLU):
|
31 |
-
super(Encoder, self).__init__()
|
32 |
-
self.conv1 = Conv2DBNActiv(nin, nout, ksize, stride, pad, activ=activ)
|
33 |
-
self.conv2 = Conv2DBNActiv(nout, nout, ksize, 1, pad, activ=activ)
|
34 |
-
|
35 |
-
def __call__(self, x):
|
36 |
-
h = self.conv1(x)
|
37 |
-
h = self.conv2(h)
|
38 |
-
|
39 |
-
return h
|
40 |
-
|
41 |
-
|
42 |
-
class Decoder(nn.Module):
|
43 |
-
def __init__(
|
44 |
-
self, nin, nout, ksize=3, stride=1, pad=1, activ=nn.ReLU, dropout=False
|
45 |
-
):
|
46 |
-
super(Decoder, self).__init__()
|
47 |
-
self.conv1 = Conv2DBNActiv(nin, nout, ksize, 1, pad, activ=activ)
|
48 |
-
# self.conv2 = Conv2DBNActiv(nout, nout, ksize, 1, pad, activ=activ)
|
49 |
-
self.dropout = nn.Dropout2d(0.1) if dropout else None
|
50 |
-
|
51 |
-
def __call__(self, x, skip=None):
|
52 |
-
x = F.interpolate(x, scale_factor=2, mode="bilinear", align_corners=True)
|
53 |
-
|
54 |
-
if skip is not None:
|
55 |
-
skip = spec_utils.crop_center(skip, x)
|
56 |
-
x = torch.cat([x, skip], dim=1)
|
57 |
-
|
58 |
-
h = self.conv1(x)
|
59 |
-
# h = self.conv2(h)
|
60 |
-
|
61 |
-
if self.dropout is not None:
|
62 |
-
h = self.dropout(h)
|
63 |
-
|
64 |
-
return h
|
65 |
-
|
66 |
-
|
67 |
-
class ASPPModule(nn.Module):
|
68 |
-
def __init__(self, nin, nout, dilations=(4, 8, 12), activ=nn.ReLU, dropout=False):
|
69 |
-
super(ASPPModule, self).__init__()
|
70 |
-
self.conv1 = nn.Sequential(
|
71 |
-
nn.AdaptiveAvgPool2d((1, None)),
|
72 |
-
Conv2DBNActiv(nin, nout, 1, 1, 0, activ=activ),
|
73 |
-
)
|
74 |
-
self.conv2 = Conv2DBNActiv(nin, nout, 1, 1, 0, activ=activ)
|
75 |
-
self.conv3 = Conv2DBNActiv(
|
76 |
-
nin, nout, 3, 1, dilations[0], dilations[0], activ=activ
|
77 |
-
)
|
78 |
-
self.conv4 = Conv2DBNActiv(
|
79 |
-
nin, nout, 3, 1, dilations[1], dilations[1], activ=activ
|
80 |
-
)
|
81 |
-
self.conv5 = Conv2DBNActiv(
|
82 |
-
nin, nout, 3, 1, dilations[2], dilations[2], activ=activ
|
83 |
-
)
|
84 |
-
self.bottleneck = Conv2DBNActiv(nout * 5, nout, 1, 1, 0, activ=activ)
|
85 |
-
self.dropout = nn.Dropout2d(0.1) if dropout else None
|
86 |
-
|
87 |
-
def forward(self, x):
|
88 |
-
_, _, h, w = x.size()
|
89 |
-
feat1 = F.interpolate(
|
90 |
-
self.conv1(x), size=(h, w), mode="bilinear", align_corners=True
|
91 |
-
)
|
92 |
-
feat2 = self.conv2(x)
|
93 |
-
feat3 = self.conv3(x)
|
94 |
-
feat4 = self.conv4(x)
|
95 |
-
feat5 = self.conv5(x)
|
96 |
-
out = torch.cat((feat1, feat2, feat3, feat4, feat5), dim=1)
|
97 |
-
out = self.bottleneck(out)
|
98 |
-
|
99 |
-
if self.dropout is not None:
|
100 |
-
out = self.dropout(out)
|
101 |
-
|
102 |
-
return out
|
103 |
-
|
104 |
-
|
105 |
-
class LSTMModule(nn.Module):
|
106 |
-
def __init__(self, nin_conv, nin_lstm, nout_lstm):
|
107 |
-
super(LSTMModule, self).__init__()
|
108 |
-
self.conv = Conv2DBNActiv(nin_conv, 1, 1, 1, 0)
|
109 |
-
self.lstm = nn.LSTM(
|
110 |
-
input_size=nin_lstm, hidden_size=nout_lstm // 2, bidirectional=True
|
111 |
-
)
|
112 |
-
self.dense = nn.Sequential(
|
113 |
-
nn.Linear(nout_lstm, nin_lstm), nn.BatchNorm1d(nin_lstm), nn.ReLU()
|
114 |
-
)
|
115 |
-
|
116 |
-
def forward(self, x):
|
117 |
-
N, _, nbins, nframes = x.size()
|
118 |
-
h = self.conv(x)[:, 0] # N, nbins, nframes
|
119 |
-
h = h.permute(2, 0, 1) # nframes, N, nbins
|
120 |
-
h, _ = self.lstm(h)
|
121 |
-
h = self.dense(h.reshape(-1, h.size()[-1])) # nframes * N, nbins
|
122 |
-
h = h.reshape(nframes, N, 1, nbins)
|
123 |
-
h = h.permute(1, 2, 3, 0)
|
124 |
-
|
125 |
-
return h
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/801artistry/RVC801/infer/lib/uvr5_pack/lib_v5/nets.py
DELETED
@@ -1,123 +0,0 @@
|
|
1 |
-
import layers
|
2 |
-
import torch
|
3 |
-
import torch.nn.functional as F
|
4 |
-
from torch import nn
|
5 |
-
|
6 |
-
from . import spec_utils
|
7 |
-
|
8 |
-
|
9 |
-
class BaseASPPNet(nn.Module):
|
10 |
-
def __init__(self, nin, ch, dilations=(4, 8, 16)):
|
11 |
-
super(BaseASPPNet, self).__init__()
|
12 |
-
self.enc1 = layers.Encoder(nin, ch, 3, 2, 1)
|
13 |
-
self.enc2 = layers.Encoder(ch, ch * 2, 3, 2, 1)
|
14 |
-
self.enc3 = layers.Encoder(ch * 2, ch * 4, 3, 2, 1)
|
15 |
-
self.enc4 = layers.Encoder(ch * 4, ch * 8, 3, 2, 1)
|
16 |
-
|
17 |
-
self.aspp = layers.ASPPModule(ch * 8, ch * 16, dilations)
|
18 |
-
|
19 |
-
self.dec4 = layers.Decoder(ch * (8 + 16), ch * 8, 3, 1, 1)
|
20 |
-
self.dec3 = layers.Decoder(ch * (4 + 8), ch * 4, 3, 1, 1)
|
21 |
-
self.dec2 = layers.Decoder(ch * (2 + 4), ch * 2, 3, 1, 1)
|
22 |
-
self.dec1 = layers.Decoder(ch * (1 + 2), ch, 3, 1, 1)
|
23 |
-
|
24 |
-
def __call__(self, x):
|
25 |
-
h, e1 = self.enc1(x)
|
26 |
-
h, e2 = self.enc2(h)
|
27 |
-
h, e3 = self.enc3(h)
|
28 |
-
h, e4 = self.enc4(h)
|
29 |
-
|
30 |
-
h = self.aspp(h)
|
31 |
-
|
32 |
-
h = self.dec4(h, e4)
|
33 |
-
h = self.dec3(h, e3)
|
34 |
-
h = self.dec2(h, e2)
|
35 |
-
h = self.dec1(h, e1)
|
36 |
-
|
37 |
-
return h
|
38 |
-
|
39 |
-
|
40 |
-
class CascadedASPPNet(nn.Module):
|
41 |
-
def __init__(self, n_fft):
|
42 |
-
super(CascadedASPPNet, self).__init__()
|
43 |
-
self.stg1_low_band_net = BaseASPPNet(2, 16)
|
44 |
-
self.stg1_high_band_net = BaseASPPNet(2, 16)
|
45 |
-
|
46 |
-
self.stg2_bridge = layers.Conv2DBNActiv(18, 8, 1, 1, 0)
|
47 |
-
self.stg2_full_band_net = BaseASPPNet(8, 16)
|
48 |
-
|
49 |
-
self.stg3_bridge = layers.Conv2DBNActiv(34, 16, 1, 1, 0)
|
50 |
-
self.stg3_full_band_net = BaseASPPNet(16, 32)
|
51 |
-
|
52 |
-
self.out = nn.Conv2d(32, 2, 1, bias=False)
|
53 |
-
self.aux1_out = nn.Conv2d(16, 2, 1, bias=False)
|
54 |
-
self.aux2_out = nn.Conv2d(16, 2, 1, bias=False)
|
55 |
-
|
56 |
-
self.max_bin = n_fft // 2
|
57 |
-
self.output_bin = n_fft // 2 + 1
|
58 |
-
|
59 |
-
self.offset = 128
|
60 |
-
|
61 |
-
def forward(self, x, aggressiveness=None):
|
62 |
-
mix = x.detach()
|
63 |
-
x = x.clone()
|
64 |
-
|
65 |
-
x = x[:, :, : self.max_bin]
|
66 |
-
|
67 |
-
bandw = x.size()[2] // 2
|
68 |
-
aux1 = torch.cat(
|
69 |
-
[
|
70 |
-
self.stg1_low_band_net(x[:, :, :bandw]),
|
71 |
-
self.stg1_high_band_net(x[:, :, bandw:]),
|
72 |
-
],
|
73 |
-
dim=2,
|
74 |
-
)
|
75 |
-
|
76 |
-
h = torch.cat([x, aux1], dim=1)
|
77 |
-
aux2 = self.stg2_full_band_net(self.stg2_bridge(h))
|
78 |
-
|
79 |
-
h = torch.cat([x, aux1, aux2], dim=1)
|
80 |
-
h = self.stg3_full_band_net(self.stg3_bridge(h))
|
81 |
-
|
82 |
-
mask = torch.sigmoid(self.out(h))
|
83 |
-
mask = F.pad(
|
84 |
-
input=mask,
|
85 |
-
pad=(0, 0, 0, self.output_bin - mask.size()[2]),
|
86 |
-
mode="replicate",
|
87 |
-
)
|
88 |
-
|
89 |
-
if self.training:
|
90 |
-
aux1 = torch.sigmoid(self.aux1_out(aux1))
|
91 |
-
aux1 = F.pad(
|
92 |
-
input=aux1,
|
93 |
-
pad=(0, 0, 0, self.output_bin - aux1.size()[2]),
|
94 |
-
mode="replicate",
|
95 |
-
)
|
96 |
-
aux2 = torch.sigmoid(self.aux2_out(aux2))
|
97 |
-
aux2 = F.pad(
|
98 |
-
input=aux2,
|
99 |
-
pad=(0, 0, 0, self.output_bin - aux2.size()[2]),
|
100 |
-
mode="replicate",
|
101 |
-
)
|
102 |
-
return mask * mix, aux1 * mix, aux2 * mix
|
103 |
-
else:
|
104 |
-
if aggressiveness:
|
105 |
-
mask[:, :, : aggressiveness["split_bin"]] = torch.pow(
|
106 |
-
mask[:, :, : aggressiveness["split_bin"]],
|
107 |
-
1 + aggressiveness["value"] / 3,
|
108 |
-
)
|
109 |
-
mask[:, :, aggressiveness["split_bin"] :] = torch.pow(
|
110 |
-
mask[:, :, aggressiveness["split_bin"] :],
|
111 |
-
1 + aggressiveness["value"],
|
112 |
-
)
|
113 |
-
|
114 |
-
return mask * mix
|
115 |
-
|
116 |
-
def predict(self, x_mag, aggressiveness=None):
|
117 |
-
h = self.forward(x_mag, aggressiveness)
|
118 |
-
|
119 |
-
if self.offset > 0:
|
120 |
-
h = h[:, :, :, self.offset : -self.offset]
|
121 |
-
assert h.size()[3] > 0
|
122 |
-
|
123 |
-
return h
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/ATang0729/Forecast4Muses/Model/Model6/Model6_0_ClothesDetection/mmyolo/configs/yolov5/yolov5_n-v61_syncbn_fast_8xb16-300e_coco.py
DELETED
@@ -1,15 +0,0 @@
|
|
1 |
-
_base_ = './yolov5_s-v61_syncbn_fast_8xb16-300e_coco.py'
|
2 |
-
|
3 |
-
deepen_factor = 0.33
|
4 |
-
widen_factor = 0.25
|
5 |
-
|
6 |
-
model = dict(
|
7 |
-
backbone=dict(
|
8 |
-
deepen_factor=deepen_factor,
|
9 |
-
widen_factor=widen_factor,
|
10 |
-
),
|
11 |
-
neck=dict(
|
12 |
-
deepen_factor=deepen_factor,
|
13 |
-
widen_factor=widen_factor,
|
14 |
-
),
|
15 |
-
bbox_head=dict(head_module=dict(widen_factor=widen_factor)))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Abhilashvj/planogram-compliance/hubconf.py
DELETED
@@ -1,309 +0,0 @@
|
|
1 |
-
# YOLOv5 🚀 by Ultralytics, GPL-3.0 license
|
2 |
-
"""
|
3 |
-
PyTorch Hub models https://pytorch.org/hub/ultralytics_yolov5
|
4 |
-
|
5 |
-
Usage:
|
6 |
-
import torch
|
7 |
-
model = torch.hub.load('ultralytics/yolov5', 'yolov5s') # official model
|
8 |
-
model = torch.hub.load('ultralytics/yolov5:master', 'yolov5s') # from branch
|
9 |
-
model = torch.hub.load('ultralytics/yolov5', 'custom', 'yolov5s.pt') # custom/local model
|
10 |
-
model = torch.hub.load('.', 'custom', 'yolov5s.pt', source='local') # local repo
|
11 |
-
"""
|
12 |
-
|
13 |
-
import torch
|
14 |
-
|
15 |
-
|
16 |
-
def _create(
|
17 |
-
name,
|
18 |
-
pretrained=True,
|
19 |
-
channels=3,
|
20 |
-
classes=80,
|
21 |
-
autoshape=True,
|
22 |
-
verbose=True,
|
23 |
-
device=None,
|
24 |
-
):
|
25 |
-
"""Creates or loads a YOLOv5 model
|
26 |
-
|
27 |
-
Arguments:
|
28 |
-
name (str): model name 'yolov5s' or path 'path/to/best.pt'
|
29 |
-
pretrained (bool): load pretrained weights into the model
|
30 |
-
channels (int): number of input channels
|
31 |
-
classes (int): number of model classes
|
32 |
-
autoshape (bool): apply YOLOv5 .autoshape() wrapper to model
|
33 |
-
verbose (bool): print all information to screen
|
34 |
-
device (str, torch.device, None): device to use for model parameters
|
35 |
-
|
36 |
-
Returns:
|
37 |
-
YOLOv5 model
|
38 |
-
"""
|
39 |
-
from pathlib import Path
|
40 |
-
|
41 |
-
from models.common import AutoShape, DetectMultiBackend
|
42 |
-
from models.experimental import attempt_load
|
43 |
-
from models.yolo import ClassificationModel, DetectionModel, SegmentationModel
|
44 |
-
from utils.downloads import attempt_download
|
45 |
-
from utils.general import LOGGER, check_requirements, intersect_dicts, logging
|
46 |
-
from utils.torch_utils import select_device
|
47 |
-
|
48 |
-
if not verbose:
|
49 |
-
LOGGER.setLevel(logging.WARNING)
|
50 |
-
check_requirements(exclude=("opencv-python", "tensorboard", "thop"))
|
51 |
-
name = Path(name)
|
52 |
-
path = (
|
53 |
-
name.with_suffix(".pt")
|
54 |
-
if name.suffix == "" and not name.is_dir()
|
55 |
-
else name
|
56 |
-
) # checkpoint path
|
57 |
-
try:
|
58 |
-
device = select_device(device)
|
59 |
-
if pretrained and channels == 3 and classes == 80:
|
60 |
-
try:
|
61 |
-
model = DetectMultiBackend(
|
62 |
-
path, device=device, fuse=autoshape
|
63 |
-
) # detection model
|
64 |
-
if autoshape:
|
65 |
-
if model.pt and isinstance(
|
66 |
-
model.model, ClassificationModel
|
67 |
-
):
|
68 |
-
LOGGER.warning(
|
69 |
-
"WARNING ⚠️ YOLOv5 ClassificationModel is not yet AutoShape compatible. "
|
70 |
-
"You must pass torch tensors in BCHW to this model, i.e. shape(1,3,224,224)."
|
71 |
-
)
|
72 |
-
elif model.pt and isinstance(
|
73 |
-
model.model, SegmentationModel
|
74 |
-
):
|
75 |
-
LOGGER.warning(
|
76 |
-
"WARNING ⚠️ YOLOv5 SegmentationModel is not yet AutoShape compatible. "
|
77 |
-
"You will not be able to run inference with this model."
|
78 |
-
)
|
79 |
-
else:
|
80 |
-
model = AutoShape(
|
81 |
-
model
|
82 |
-
) # for file/URI/PIL/cv2/np inputs and NMS
|
83 |
-
except Exception:
|
84 |
-
model = attempt_load(
|
85 |
-
path, device=device, fuse=False
|
86 |
-
) # arbitrary model
|
87 |
-
else:
|
88 |
-
cfg = list(
|
89 |
-
(Path(__file__).parent / "models").rglob(f"{path.stem}.yaml")
|
90 |
-
)[
|
91 |
-
0
|
92 |
-
] # model.yaml path
|
93 |
-
model = DetectionModel(cfg, channels, classes) # create model
|
94 |
-
if pretrained:
|
95 |
-
ckpt = torch.load(
|
96 |
-
attempt_download(path), map_location=device
|
97 |
-
) # load
|
98 |
-
csd = (
|
99 |
-
ckpt["model"].float().state_dict()
|
100 |
-
) # checkpoint state_dict as FP32
|
101 |
-
csd = intersect_dicts(
|
102 |
-
csd, model.state_dict(), exclude=["anchors"]
|
103 |
-
) # intersect
|
104 |
-
model.load_state_dict(csd, strict=False) # load
|
105 |
-
if len(ckpt["model"].names) == classes:
|
106 |
-
model.names = ckpt[
|
107 |
-
"model"
|
108 |
-
].names # set class names attribute
|
109 |
-
if not verbose:
|
110 |
-
LOGGER.setLevel(logging.INFO) # reset to default
|
111 |
-
return model.to(device)
|
112 |
-
|
113 |
-
except Exception as e:
|
114 |
-
help_url = "https://github.com/ultralytics/yolov5/issues/36"
|
115 |
-
s = f"{e}. Cache may be out of date, try `force_reload=True` or see {help_url} for help."
|
116 |
-
raise Exception(s) from e
|
117 |
-
|
118 |
-
|
119 |
-
def custom(
|
120 |
-
path="path/to/model.pt", autoshape=True, _verbose=True, device=None
|
121 |
-
):
|
122 |
-
# YOLOv5 custom or local model
|
123 |
-
return _create(path, autoshape=autoshape, verbose=_verbose, device=device)
|
124 |
-
|
125 |
-
|
126 |
-
def yolov5n(
|
127 |
-
pretrained=True,
|
128 |
-
channels=3,
|
129 |
-
classes=80,
|
130 |
-
autoshape=True,
|
131 |
-
_verbose=True,
|
132 |
-
device=None,
|
133 |
-
):
|
134 |
-
# YOLOv5-nano model https://github.com/ultralytics/yolov5
|
135 |
-
return _create(
|
136 |
-
"yolov5n", pretrained, channels, classes, autoshape, _verbose, device
|
137 |
-
)
|
138 |
-
|
139 |
-
|
140 |
-
def yolov5s(
|
141 |
-
pretrained=True,
|
142 |
-
channels=3,
|
143 |
-
classes=80,
|
144 |
-
autoshape=True,
|
145 |
-
_verbose=True,
|
146 |
-
device=None,
|
147 |
-
):
|
148 |
-
# YOLOv5-small model https://github.com/ultralytics/yolov5
|
149 |
-
return _create(
|
150 |
-
"yolov5s", pretrained, channels, classes, autoshape, _verbose, device
|
151 |
-
)
|
152 |
-
|
153 |
-
|
154 |
-
def yolov5m(
|
155 |
-
pretrained=True,
|
156 |
-
channels=3,
|
157 |
-
classes=80,
|
158 |
-
autoshape=True,
|
159 |
-
_verbose=True,
|
160 |
-
device=None,
|
161 |
-
):
|
162 |
-
# YOLOv5-medium model https://github.com/ultralytics/yolov5
|
163 |
-
return _create(
|
164 |
-
"yolov5m", pretrained, channels, classes, autoshape, _verbose, device
|
165 |
-
)
|
166 |
-
|
167 |
-
|
168 |
-
def yolov5l(
|
169 |
-
pretrained=True,
|
170 |
-
channels=3,
|
171 |
-
classes=80,
|
172 |
-
autoshape=True,
|
173 |
-
_verbose=True,
|
174 |
-
device=None,
|
175 |
-
):
|
176 |
-
# YOLOv5-large model https://github.com/ultralytics/yolov5
|
177 |
-
return _create(
|
178 |
-
"yolov5l", pretrained, channels, classes, autoshape, _verbose, device
|
179 |
-
)
|
180 |
-
|
181 |
-
|
182 |
-
def yolov5x(
|
183 |
-
pretrained=True,
|
184 |
-
channels=3,
|
185 |
-
classes=80,
|
186 |
-
autoshape=True,
|
187 |
-
_verbose=True,
|
188 |
-
device=None,
|
189 |
-
):
|
190 |
-
# YOLOv5-xlarge model https://github.com/ultralytics/yolov5
|
191 |
-
return _create(
|
192 |
-
"yolov5x", pretrained, channels, classes, autoshape, _verbose, device
|
193 |
-
)
|
194 |
-
|
195 |
-
|
196 |
-
def yolov5n6(
|
197 |
-
pretrained=True,
|
198 |
-
channels=3,
|
199 |
-
classes=80,
|
200 |
-
autoshape=True,
|
201 |
-
_verbose=True,
|
202 |
-
device=None,
|
203 |
-
):
|
204 |
-
# YOLOv5-nano-P6 model https://github.com/ultralytics/yolov5
|
205 |
-
return _create(
|
206 |
-
"yolov5n6", pretrained, channels, classes, autoshape, _verbose, device
|
207 |
-
)
|
208 |
-
|
209 |
-
|
210 |
-
def yolov5s6(
|
211 |
-
pretrained=True,
|
212 |
-
channels=3,
|
213 |
-
classes=80,
|
214 |
-
autoshape=True,
|
215 |
-
_verbose=True,
|
216 |
-
device=None,
|
217 |
-
):
|
218 |
-
# YOLOv5-small-P6 model https://github.com/ultralytics/yolov5
|
219 |
-
return _create(
|
220 |
-
"yolov5s6", pretrained, channels, classes, autoshape, _verbose, device
|
221 |
-
)
|
222 |
-
|
223 |
-
|
224 |
-
def yolov5m6(
|
225 |
-
pretrained=True,
|
226 |
-
channels=3,
|
227 |
-
classes=80,
|
228 |
-
autoshape=True,
|
229 |
-
_verbose=True,
|
230 |
-
device=None,
|
231 |
-
):
|
232 |
-
# YOLOv5-medium-P6 model https://github.com/ultralytics/yolov5
|
233 |
-
return _create(
|
234 |
-
"yolov5m6", pretrained, channels, classes, autoshape, _verbose, device
|
235 |
-
)
|
236 |
-
|
237 |
-
|
238 |
-
def yolov5l6(
|
239 |
-
pretrained=True,
|
240 |
-
channels=3,
|
241 |
-
classes=80,
|
242 |
-
autoshape=True,
|
243 |
-
_verbose=True,
|
244 |
-
device=None,
|
245 |
-
):
|
246 |
-
# YOLOv5-large-P6 model https://github.com/ultralytics/yolov5
|
247 |
-
return _create(
|
248 |
-
"yolov5l6", pretrained, channels, classes, autoshape, _verbose, device
|
249 |
-
)
|
250 |
-
|
251 |
-
|
252 |
-
def yolov5x6(
|
253 |
-
pretrained=True,
|
254 |
-
channels=3,
|
255 |
-
classes=80,
|
256 |
-
autoshape=True,
|
257 |
-
_verbose=True,
|
258 |
-
device=None,
|
259 |
-
):
|
260 |
-
# YOLOv5-xlarge-P6 model https://github.com/ultralytics/yolov5
|
261 |
-
return _create(
|
262 |
-
"yolov5x6", pretrained, channels, classes, autoshape, _verbose, device
|
263 |
-
)
|
264 |
-
|
265 |
-
|
266 |
-
if __name__ == "__main__":
|
267 |
-
import argparse
|
268 |
-
from pathlib import Path
|
269 |
-
|
270 |
-
import numpy as np
|
271 |
-
from PIL import Image
|
272 |
-
|
273 |
-
from utils.general import cv2, print_args
|
274 |
-
|
275 |
-
# Argparser
|
276 |
-
parser = argparse.ArgumentParser()
|
277 |
-
parser.add_argument(
|
278 |
-
"--model", type=str, default="yolov5s", help="model name"
|
279 |
-
)
|
280 |
-
opt = parser.parse_args()
|
281 |
-
print_args(vars(opt))
|
282 |
-
|
283 |
-
# Model
|
284 |
-
model = _create(
|
285 |
-
name=opt.model,
|
286 |
-
pretrained=True,
|
287 |
-
channels=3,
|
288 |
-
classes=80,
|
289 |
-
autoshape=True,
|
290 |
-
verbose=True,
|
291 |
-
)
|
292 |
-
# model = custom(path='path/to/model.pt') # custom
|
293 |
-
|
294 |
-
# Images
|
295 |
-
imgs = [
|
296 |
-
"data/images/zidane.jpg", # filename
|
297 |
-
Path("data/images/zidane.jpg"), # Path
|
298 |
-
"https://ultralytics.com/images/zidane.jpg", # URI
|
299 |
-
cv2.imread("data/images/bus.jpg")[:, :, ::-1], # OpenCV
|
300 |
-
Image.open("data/images/bus.jpg"), # PIL
|
301 |
-
np.zeros((320, 640, 3)),
|
302 |
-
] # numpy
|
303 |
-
|
304 |
-
# Inference
|
305 |
-
results = model(imgs, size=320) # batched inference
|
306 |
-
|
307 |
-
# Results
|
308 |
-
results.print()
|
309 |
-
results.save()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Adapter/CoAdapter/configs/mm/faster_rcnn_r50_fpn_coco.py
DELETED
@@ -1,182 +0,0 @@
|
|
1 |
-
checkpoint_config = dict(interval=1)
|
2 |
-
# yapf:disable
|
3 |
-
log_config = dict(
|
4 |
-
interval=50,
|
5 |
-
hooks=[
|
6 |
-
dict(type='TextLoggerHook'),
|
7 |
-
# dict(type='TensorboardLoggerHook')
|
8 |
-
])
|
9 |
-
# yapf:enable
|
10 |
-
dist_params = dict(backend='nccl')
|
11 |
-
log_level = 'INFO'
|
12 |
-
load_from = None
|
13 |
-
resume_from = None
|
14 |
-
workflow = [('train', 1)]
|
15 |
-
# optimizer
|
16 |
-
optimizer = dict(type='SGD', lr=0.02, momentum=0.9, weight_decay=0.0001)
|
17 |
-
optimizer_config = dict(grad_clip=None)
|
18 |
-
# learning policy
|
19 |
-
lr_config = dict(
|
20 |
-
policy='step',
|
21 |
-
warmup='linear',
|
22 |
-
warmup_iters=500,
|
23 |
-
warmup_ratio=0.001,
|
24 |
-
step=[8, 11])
|
25 |
-
total_epochs = 12
|
26 |
-
|
27 |
-
model = dict(
|
28 |
-
type='FasterRCNN',
|
29 |
-
pretrained='torchvision://resnet50',
|
30 |
-
backbone=dict(
|
31 |
-
type='ResNet',
|
32 |
-
depth=50,
|
33 |
-
num_stages=4,
|
34 |
-
out_indices=(0, 1, 2, 3),
|
35 |
-
frozen_stages=1,
|
36 |
-
norm_cfg=dict(type='BN', requires_grad=True),
|
37 |
-
norm_eval=True,
|
38 |
-
style='pytorch'),
|
39 |
-
neck=dict(
|
40 |
-
type='FPN',
|
41 |
-
in_channels=[256, 512, 1024, 2048],
|
42 |
-
out_channels=256,
|
43 |
-
num_outs=5),
|
44 |
-
rpn_head=dict(
|
45 |
-
type='RPNHead',
|
46 |
-
in_channels=256,
|
47 |
-
feat_channels=256,
|
48 |
-
anchor_generator=dict(
|
49 |
-
type='AnchorGenerator',
|
50 |
-
scales=[8],
|
51 |
-
ratios=[0.5, 1.0, 2.0],
|
52 |
-
strides=[4, 8, 16, 32, 64]),
|
53 |
-
bbox_coder=dict(
|
54 |
-
type='DeltaXYWHBBoxCoder',
|
55 |
-
target_means=[.0, .0, .0, .0],
|
56 |
-
target_stds=[1.0, 1.0, 1.0, 1.0]),
|
57 |
-
loss_cls=dict(
|
58 |
-
type='CrossEntropyLoss', use_sigmoid=True, loss_weight=1.0),
|
59 |
-
loss_bbox=dict(type='L1Loss', loss_weight=1.0)),
|
60 |
-
roi_head=dict(
|
61 |
-
type='StandardRoIHead',
|
62 |
-
bbox_roi_extractor=dict(
|
63 |
-
type='SingleRoIExtractor',
|
64 |
-
roi_layer=dict(type='RoIAlign', output_size=7, sampling_ratio=0),
|
65 |
-
out_channels=256,
|
66 |
-
featmap_strides=[4, 8, 16, 32]),
|
67 |
-
bbox_head=dict(
|
68 |
-
type='Shared2FCBBoxHead',
|
69 |
-
in_channels=256,
|
70 |
-
fc_out_channels=1024,
|
71 |
-
roi_feat_size=7,
|
72 |
-
num_classes=80,
|
73 |
-
bbox_coder=dict(
|
74 |
-
type='DeltaXYWHBBoxCoder',
|
75 |
-
target_means=[0., 0., 0., 0.],
|
76 |
-
target_stds=[0.1, 0.1, 0.2, 0.2]),
|
77 |
-
reg_class_agnostic=False,
|
78 |
-
loss_cls=dict(
|
79 |
-
type='CrossEntropyLoss', use_sigmoid=False, loss_weight=1.0),
|
80 |
-
loss_bbox=dict(type='L1Loss', loss_weight=1.0))),
|
81 |
-
# model training and testing settings
|
82 |
-
train_cfg=dict(
|
83 |
-
rpn=dict(
|
84 |
-
assigner=dict(
|
85 |
-
type='MaxIoUAssigner',
|
86 |
-
pos_iou_thr=0.7,
|
87 |
-
neg_iou_thr=0.3,
|
88 |
-
min_pos_iou=0.3,
|
89 |
-
match_low_quality=True,
|
90 |
-
ignore_iof_thr=-1),
|
91 |
-
sampler=dict(
|
92 |
-
type='RandomSampler',
|
93 |
-
num=256,
|
94 |
-
pos_fraction=0.5,
|
95 |
-
neg_pos_ub=-1,
|
96 |
-
add_gt_as_proposals=False),
|
97 |
-
allowed_border=-1,
|
98 |
-
pos_weight=-1,
|
99 |
-
debug=False),
|
100 |
-
rpn_proposal=dict(
|
101 |
-
nms_pre=2000,
|
102 |
-
max_per_img=1000,
|
103 |
-
nms=dict(type='nms', iou_threshold=0.7),
|
104 |
-
min_bbox_size=0),
|
105 |
-
rcnn=dict(
|
106 |
-
assigner=dict(
|
107 |
-
type='MaxIoUAssigner',
|
108 |
-
pos_iou_thr=0.5,
|
109 |
-
neg_iou_thr=0.5,
|
110 |
-
min_pos_iou=0.5,
|
111 |
-
match_low_quality=False,
|
112 |
-
ignore_iof_thr=-1),
|
113 |
-
sampler=dict(
|
114 |
-
type='RandomSampler',
|
115 |
-
num=512,
|
116 |
-
pos_fraction=0.25,
|
117 |
-
neg_pos_ub=-1,
|
118 |
-
add_gt_as_proposals=True),
|
119 |
-
pos_weight=-1,
|
120 |
-
debug=False)),
|
121 |
-
test_cfg=dict(
|
122 |
-
rpn=dict(
|
123 |
-
nms_pre=1000,
|
124 |
-
max_per_img=1000,
|
125 |
-
nms=dict(type='nms', iou_threshold=0.7),
|
126 |
-
min_bbox_size=0),
|
127 |
-
rcnn=dict(
|
128 |
-
score_thr=0.05,
|
129 |
-
nms=dict(type='nms', iou_threshold=0.5),
|
130 |
-
max_per_img=100)
|
131 |
-
# soft-nms is also supported for rcnn testing
|
132 |
-
# e.g., nms=dict(type='soft_nms', iou_threshold=0.5, min_score=0.05)
|
133 |
-
))
|
134 |
-
|
135 |
-
dataset_type = 'CocoDataset'
|
136 |
-
data_root = 'data/coco'
|
137 |
-
img_norm_cfg = dict(
|
138 |
-
mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_rgb=True)
|
139 |
-
train_pipeline = [
|
140 |
-
dict(type='LoadImageFromFile'),
|
141 |
-
dict(type='LoadAnnotations', with_bbox=True),
|
142 |
-
dict(type='Resize', img_scale=(1333, 800), keep_ratio=True),
|
143 |
-
dict(type='RandomFlip', flip_ratio=0.5),
|
144 |
-
dict(type='Normalize', **img_norm_cfg),
|
145 |
-
dict(type='Pad', size_divisor=32),
|
146 |
-
dict(type='DefaultFormatBundle'),
|
147 |
-
dict(type='Collect', keys=['img', 'gt_bboxes', 'gt_labels']),
|
148 |
-
]
|
149 |
-
test_pipeline = [
|
150 |
-
dict(type='LoadImageFromFile'),
|
151 |
-
dict(
|
152 |
-
type='MultiScaleFlipAug',
|
153 |
-
img_scale=(1333, 800),
|
154 |
-
flip=False,
|
155 |
-
transforms=[
|
156 |
-
dict(type='Resize', keep_ratio=True),
|
157 |
-
dict(type='RandomFlip'),
|
158 |
-
dict(type='Normalize', **img_norm_cfg),
|
159 |
-
dict(type='Pad', size_divisor=32),
|
160 |
-
dict(type='DefaultFormatBundle'),
|
161 |
-
dict(type='Collect', keys=['img']),
|
162 |
-
])
|
163 |
-
]
|
164 |
-
data = dict(
|
165 |
-
samples_per_gpu=2,
|
166 |
-
workers_per_gpu=2,
|
167 |
-
train=dict(
|
168 |
-
type=dataset_type,
|
169 |
-
ann_file=f'{data_root}/annotations/instances_train2017.json',
|
170 |
-
img_prefix=f'{data_root}/train2017/',
|
171 |
-
pipeline=train_pipeline),
|
172 |
-
val=dict(
|
173 |
-
type=dataset_type,
|
174 |
-
ann_file=f'{data_root}/annotations/instances_val2017.json',
|
175 |
-
img_prefix=f'{data_root}/val2017/',
|
176 |
-
pipeline=test_pipeline),
|
177 |
-
test=dict(
|
178 |
-
type=dataset_type,
|
179 |
-
ann_file=f'{data_root}/annotations/instances_val2017.json',
|
180 |
-
img_prefix=f'{data_root}/val2017/',
|
181 |
-
pipeline=test_pipeline))
|
182 |
-
evaluation = dict(interval=1, metric='bbox')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/AgentVerse/agentVerse/agentverse/environments/simulation_env/rules/updater/basic.py
DELETED
@@ -1,75 +0,0 @@
|
|
1 |
-
from __future__ import annotations
|
2 |
-
|
3 |
-
from typing import TYPE_CHECKING, List, Tuple
|
4 |
-
|
5 |
-
from . import updater_registry as UpdaterRegistry
|
6 |
-
from .base import BaseUpdater
|
7 |
-
from agentverse.message import Message
|
8 |
-
from agentverse.logging import get_logger
|
9 |
-
|
10 |
-
if TYPE_CHECKING:
|
11 |
-
from agentverse.environments import BaseEnvironment
|
12 |
-
from agentverse.agents import BaseAgent
|
13 |
-
|
14 |
-
logger = get_logger()
|
15 |
-
|
16 |
-
|
17 |
-
@UpdaterRegistry.register("basic")
|
18 |
-
class BasicUpdater(BaseUpdater):
|
19 |
-
"""
|
20 |
-
The basic version of updater.
|
21 |
-
The messages will be seen by all the receiver specified in the message.
|
22 |
-
"""
|
23 |
-
|
24 |
-
def update_memory(self, environment: BaseEnvironment):
|
25 |
-
added = False
|
26 |
-
for message in environment.last_messages:
|
27 |
-
if len(message.tool_response) > 0:
|
28 |
-
self.add_tool_response(
|
29 |
-
message.sender, environment.agents, message.tool_response
|
30 |
-
)
|
31 |
-
if message.content == "":
|
32 |
-
continue
|
33 |
-
added |= self.add_message_to_all_agents(environment.agents, message)
|
34 |
-
# If no one speaks in this turn. Add an empty message to all agents
|
35 |
-
if not added:
|
36 |
-
for agent in environment.agents:
|
37 |
-
agent.add_message_to_memory([Message(content="[Silence]")])
|
38 |
-
|
39 |
-
def add_tool_response(
|
40 |
-
self,
|
41 |
-
name: str,
|
42 |
-
agents: List[BaseAgent],
|
43 |
-
tool_response: List[str],
|
44 |
-
):
|
45 |
-
for agent in agents:
|
46 |
-
if agent.name != name:
|
47 |
-
continue
|
48 |
-
if agent.tool_memory is not None:
|
49 |
-
agent.tool_memory.add_message(tool_response)
|
50 |
-
break
|
51 |
-
|
52 |
-
def add_message_to_all_agents(
|
53 |
-
self, agents: List[BaseAgent], message: Message
|
54 |
-
) -> bool:
|
55 |
-
if "all" in message.receiver:
|
56 |
-
# If receiver is all, then add the message to all agents
|
57 |
-
for agent in agents:
|
58 |
-
agent.add_message_to_memory([message])
|
59 |
-
return True
|
60 |
-
else:
|
61 |
-
# If receiver is not all, then add the message to the specified agents
|
62 |
-
receiver_set = message.receiver
|
63 |
-
for agent in agents:
|
64 |
-
if agent.name in receiver_set:
|
65 |
-
agent.add_message_to_memory([message])
|
66 |
-
receiver_set.remove(agent.name)
|
67 |
-
if len(receiver_set) > 0:
|
68 |
-
missing_receiver = ", ".join(list(receiver_set))
|
69 |
-
# raise ValueError(
|
70 |
-
# "Receiver {} not found. Message discarded".format(missing_receiver)
|
71 |
-
# )
|
72 |
-
logger.warn(
|
73 |
-
"Receiver {} not found. Message discarded".format(missing_receiver)
|
74 |
-
)
|
75 |
-
return True
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/AgentVerse/agentVerse/ui/src/phaser3-rex-plugins/templates/spinner/cube/Factory.d.ts
DELETED
@@ -1,6 +0,0 @@
|
|
1 |
-
import Cube from './Cube';
|
2 |
-
import Base from '../base/Base';
|
3 |
-
|
4 |
-
export default function Factory(
|
5 |
-
config?: Base.IConfig
|
6 |
-
): Cube;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/AgentVerse/agentVerse/ui/src/phaser3-rex-plugins/templates/ui/container/Container.js
DELETED
@@ -1,2 +0,0 @@
|
|
1 |
-
import Container from '../../../plugins/containerlite.js';
|
2 |
-
export default Container;
|
|
|
|
|
|
spaces/AgentVerse/agentVerse/ui/src/phaser3-rex-plugins/templates/ui/fade/Fade.ts
DELETED
@@ -1,5 +0,0 @@
|
|
1 |
-
import Fade from '../../../plugins/fade.js';
|
2 |
-
import FadeIn from '../../../plugins/fade-in';
|
3 |
-
import FadeOutDestroy from '../../../plugins/fade-out-destroy';
|
4 |
-
|
5 |
-
export { Fade, FadeIn, FadeOutDestroy };
|
|
|
|
|
|
|
|
|
|
|
|
spaces/AgentVerse/agentVerse/ui/src/phaser3-rex-plugins/templates/ui/lineprogress/LineProgress.js
DELETED
@@ -1,2 +0,0 @@
|
|
1 |
-
import LineProgress from '../../../plugins/lineprogress.js';
|
2 |
-
export default LineProgress;
|
|
|
|
|
|
spaces/AlexWang/lama/saicinpainting/evaluation/data.py
DELETED
@@ -1,167 +0,0 @@
|
|
1 |
-
import glob
|
2 |
-
import os
|
3 |
-
|
4 |
-
import cv2
|
5 |
-
import PIL.Image as Image
|
6 |
-
import numpy as np
|
7 |
-
|
8 |
-
from torch.utils.data import Dataset
|
9 |
-
import torch.nn.functional as F
|
10 |
-
|
11 |
-
|
12 |
-
def load_image(fname, mode='RGB', return_orig=False):
|
13 |
-
img = np.array(Image.open(fname).convert(mode))
|
14 |
-
if img.ndim == 3:
|
15 |
-
img = np.transpose(img, (2, 0, 1))
|
16 |
-
out_img = img.astype('float32') / 255
|
17 |
-
if return_orig:
|
18 |
-
return out_img, img
|
19 |
-
else:
|
20 |
-
return out_img
|
21 |
-
|
22 |
-
|
23 |
-
def ceil_modulo(x, mod):
|
24 |
-
if x % mod == 0:
|
25 |
-
return x
|
26 |
-
return (x // mod + 1) * mod
|
27 |
-
|
28 |
-
|
29 |
-
def pad_img_to_modulo(img, mod):
|
30 |
-
channels, height, width = img.shape
|
31 |
-
out_height = ceil_modulo(height, mod)
|
32 |
-
out_width = ceil_modulo(width, mod)
|
33 |
-
return np.pad(img, ((0, 0), (0, out_height - height), (0, out_width - width)), mode='symmetric')
|
34 |
-
|
35 |
-
|
36 |
-
def pad_tensor_to_modulo(img, mod):
|
37 |
-
batch_size, channels, height, width = img.shape
|
38 |
-
out_height = ceil_modulo(height, mod)
|
39 |
-
out_width = ceil_modulo(width, mod)
|
40 |
-
return F.pad(img, pad=(0, out_width - width, 0, out_height - height), mode='reflect')
|
41 |
-
|
42 |
-
|
43 |
-
def scale_image(img, factor, interpolation=cv2.INTER_AREA):
|
44 |
-
if img.shape[0] == 1:
|
45 |
-
img = img[0]
|
46 |
-
else:
|
47 |
-
img = np.transpose(img, (1, 2, 0))
|
48 |
-
|
49 |
-
img = cv2.resize(img, dsize=None, fx=factor, fy=factor, interpolation=interpolation)
|
50 |
-
|
51 |
-
if img.ndim == 2:
|
52 |
-
img = img[None, ...]
|
53 |
-
else:
|
54 |
-
img = np.transpose(img, (2, 0, 1))
|
55 |
-
return img
|
56 |
-
|
57 |
-
|
58 |
-
class InpaintingDataset(Dataset):
|
59 |
-
def __init__(self, datadir, img_suffix='.jpg', pad_out_to_modulo=None, scale_factor=None):
|
60 |
-
self.datadir = datadir
|
61 |
-
self.mask_filenames = sorted(list(glob.glob(os.path.join(self.datadir, '**', '*mask*.png'), recursive=True)))
|
62 |
-
self.img_filenames = [fname.rsplit('_mask', 1)[0] + img_suffix for fname in self.mask_filenames]
|
63 |
-
self.pad_out_to_modulo = pad_out_to_modulo
|
64 |
-
self.scale_factor = scale_factor
|
65 |
-
|
66 |
-
def __len__(self):
|
67 |
-
return len(self.mask_filenames)
|
68 |
-
|
69 |
-
def __getitem__(self, i):
|
70 |
-
image = load_image(self.img_filenames[i], mode='RGB')
|
71 |
-
mask = load_image(self.mask_filenames[i], mode='L')
|
72 |
-
result = dict(image=image, mask=mask[None, ...])
|
73 |
-
|
74 |
-
if self.scale_factor is not None:
|
75 |
-
result['image'] = scale_image(result['image'], self.scale_factor)
|
76 |
-
result['mask'] = scale_image(result['mask'], self.scale_factor, interpolation=cv2.INTER_NEAREST)
|
77 |
-
|
78 |
-
if self.pad_out_to_modulo is not None and self.pad_out_to_modulo > 1:
|
79 |
-
result['image'] = pad_img_to_modulo(result['image'], self.pad_out_to_modulo)
|
80 |
-
result['mask'] = pad_img_to_modulo(result['mask'], self.pad_out_to_modulo)
|
81 |
-
|
82 |
-
return result
|
83 |
-
|
84 |
-
class OurInpaintingDataset(Dataset):
|
85 |
-
def __init__(self, datadir, img_suffix='.jpg', pad_out_to_modulo=None, scale_factor=None):
|
86 |
-
self.datadir = datadir
|
87 |
-
self.mask_filenames = sorted(list(glob.glob(os.path.join(self.datadir, 'mask', '**', '*mask*.png'), recursive=True)))
|
88 |
-
self.img_filenames = [os.path.join(self.datadir, 'img', os.path.basename(fname.rsplit('-', 1)[0].rsplit('_', 1)[0]) + '.png') for fname in self.mask_filenames]
|
89 |
-
self.pad_out_to_modulo = pad_out_to_modulo
|
90 |
-
self.scale_factor = scale_factor
|
91 |
-
|
92 |
-
def __len__(self):
|
93 |
-
return len(self.mask_filenames)
|
94 |
-
|
95 |
-
def __getitem__(self, i):
|
96 |
-
result = dict(image=load_image(self.img_filenames[i], mode='RGB'),
|
97 |
-
mask=load_image(self.mask_filenames[i], mode='L')[None, ...])
|
98 |
-
|
99 |
-
if self.scale_factor is not None:
|
100 |
-
result['image'] = scale_image(result['image'], self.scale_factor)
|
101 |
-
result['mask'] = scale_image(result['mask'], self.scale_factor)
|
102 |
-
|
103 |
-
if self.pad_out_to_modulo is not None and self.pad_out_to_modulo > 1:
|
104 |
-
result['image'] = pad_img_to_modulo(result['image'], self.pad_out_to_modulo)
|
105 |
-
result['mask'] = pad_img_to_modulo(result['mask'], self.pad_out_to_modulo)
|
106 |
-
|
107 |
-
return result
|
108 |
-
|
109 |
-
class PrecomputedInpaintingResultsDataset(InpaintingDataset):
|
110 |
-
def __init__(self, datadir, predictdir, inpainted_suffix='_inpainted.jpg', **kwargs):
|
111 |
-
super().__init__(datadir, **kwargs)
|
112 |
-
if not datadir.endswith('/'):
|
113 |
-
datadir += '/'
|
114 |
-
self.predictdir = predictdir
|
115 |
-
self.pred_filenames = [os.path.join(predictdir, os.path.splitext(fname[len(datadir):])[0] + inpainted_suffix)
|
116 |
-
for fname in self.mask_filenames]
|
117 |
-
|
118 |
-
def __getitem__(self, i):
|
119 |
-
result = super().__getitem__(i)
|
120 |
-
result['inpainted'] = load_image(self.pred_filenames[i])
|
121 |
-
if self.pad_out_to_modulo is not None and self.pad_out_to_modulo > 1:
|
122 |
-
result['inpainted'] = pad_img_to_modulo(result['inpainted'], self.pad_out_to_modulo)
|
123 |
-
return result
|
124 |
-
|
125 |
-
class OurPrecomputedInpaintingResultsDataset(OurInpaintingDataset):
|
126 |
-
def __init__(self, datadir, predictdir, inpainted_suffix="png", **kwargs):
|
127 |
-
super().__init__(datadir, **kwargs)
|
128 |
-
if not datadir.endswith('/'):
|
129 |
-
datadir += '/'
|
130 |
-
self.predictdir = predictdir
|
131 |
-
self.pred_filenames = [os.path.join(predictdir, os.path.basename(os.path.splitext(fname)[0]) + f'_inpainted.{inpainted_suffix}')
|
132 |
-
for fname in self.mask_filenames]
|
133 |
-
# self.pred_filenames = [os.path.join(predictdir, os.path.splitext(fname[len(datadir):])[0] + inpainted_suffix)
|
134 |
-
# for fname in self.mask_filenames]
|
135 |
-
|
136 |
-
def __getitem__(self, i):
|
137 |
-
result = super().__getitem__(i)
|
138 |
-
result['inpainted'] = self.file_loader(self.pred_filenames[i])
|
139 |
-
|
140 |
-
if self.pad_out_to_modulo is not None and self.pad_out_to_modulo > 1:
|
141 |
-
result['inpainted'] = pad_img_to_modulo(result['inpainted'], self.pad_out_to_modulo)
|
142 |
-
return result
|
143 |
-
|
144 |
-
class InpaintingEvalOnlineDataset(Dataset):
|
145 |
-
def __init__(self, indir, mask_generator, img_suffix='.jpg', pad_out_to_modulo=None, scale_factor=None, **kwargs):
|
146 |
-
self.indir = indir
|
147 |
-
self.mask_generator = mask_generator
|
148 |
-
self.img_filenames = sorted(list(glob.glob(os.path.join(self.indir, '**', f'*{img_suffix}' ), recursive=True)))
|
149 |
-
self.pad_out_to_modulo = pad_out_to_modulo
|
150 |
-
self.scale_factor = scale_factor
|
151 |
-
|
152 |
-
def __len__(self):
|
153 |
-
return len(self.img_filenames)
|
154 |
-
|
155 |
-
def __getitem__(self, i):
|
156 |
-
img, raw_image = load_image(self.img_filenames[i], mode='RGB', return_orig=True)
|
157 |
-
mask = self.mask_generator(img, raw_image=raw_image)
|
158 |
-
result = dict(image=img, mask=mask)
|
159 |
-
|
160 |
-
if self.scale_factor is not None:
|
161 |
-
result['image'] = scale_image(result['image'], self.scale_factor)
|
162 |
-
result['mask'] = scale_image(result['mask'], self.scale_factor, interpolation=cv2.INTER_NEAREST)
|
163 |
-
|
164 |
-
if self.pad_out_to_modulo is not None and self.pad_out_to_modulo > 1:
|
165 |
-
result['image'] = pad_img_to_modulo(result['image'], self.pad_out_to_modulo)
|
166 |
-
result['mask'] = pad_img_to_modulo(result['mask'], self.pad_out_to_modulo)
|
167 |
-
return result
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/AlexWang/lama/saicinpainting/evaluation/evaluator.py
DELETED
@@ -1,220 +0,0 @@
|
|
1 |
-
import logging
|
2 |
-
import math
|
3 |
-
from typing import Dict
|
4 |
-
|
5 |
-
import numpy as np
|
6 |
-
import torch
|
7 |
-
import torch.nn as nn
|
8 |
-
import tqdm
|
9 |
-
from torch.utils.data import DataLoader
|
10 |
-
|
11 |
-
from saicinpainting.evaluation.utils import move_to_device
|
12 |
-
|
13 |
-
LOGGER = logging.getLogger(__name__)
|
14 |
-
|
15 |
-
|
16 |
-
class InpaintingEvaluator():
|
17 |
-
def __init__(self, dataset, scores, area_grouping=True, bins=10, batch_size=32, device='cuda',
|
18 |
-
integral_func=None, integral_title=None, clamp_image_range=None):
|
19 |
-
"""
|
20 |
-
:param dataset: torch.utils.data.Dataset which contains images and masks
|
21 |
-
:param scores: dict {score_name: EvaluatorScore object}
|
22 |
-
:param area_grouping: in addition to the overall scores, allows to compute score for the groups of samples
|
23 |
-
which are defined by share of area occluded by mask
|
24 |
-
:param bins: number of groups, partition is generated by np.linspace(0., 1., bins + 1)
|
25 |
-
:param batch_size: batch_size for the dataloader
|
26 |
-
:param device: device to use
|
27 |
-
"""
|
28 |
-
self.scores = scores
|
29 |
-
self.dataset = dataset
|
30 |
-
|
31 |
-
self.area_grouping = area_grouping
|
32 |
-
self.bins = bins
|
33 |
-
|
34 |
-
self.device = torch.device(device)
|
35 |
-
|
36 |
-
self.dataloader = DataLoader(self.dataset, shuffle=False, batch_size=batch_size)
|
37 |
-
|
38 |
-
self.integral_func = integral_func
|
39 |
-
self.integral_title = integral_title
|
40 |
-
self.clamp_image_range = clamp_image_range
|
41 |
-
|
42 |
-
def _get_bin_edges(self):
|
43 |
-
bin_edges = np.linspace(0, 1, self.bins + 1)
|
44 |
-
|
45 |
-
num_digits = max(0, math.ceil(math.log10(self.bins)) - 1)
|
46 |
-
interval_names = []
|
47 |
-
for idx_bin in range(self.bins):
|
48 |
-
start_percent, end_percent = round(100 * bin_edges[idx_bin], num_digits), \
|
49 |
-
round(100 * bin_edges[idx_bin + 1], num_digits)
|
50 |
-
start_percent = '{:.{n}f}'.format(start_percent, n=num_digits)
|
51 |
-
end_percent = '{:.{n}f}'.format(end_percent, n=num_digits)
|
52 |
-
interval_names.append("{0}-{1}%".format(start_percent, end_percent))
|
53 |
-
|
54 |
-
groups = []
|
55 |
-
for batch in self.dataloader:
|
56 |
-
mask = batch['mask']
|
57 |
-
batch_size = mask.shape[0]
|
58 |
-
area = mask.to(self.device).reshape(batch_size, -1).mean(dim=-1)
|
59 |
-
bin_indices = np.searchsorted(bin_edges, area.detach().cpu().numpy(), side='right') - 1
|
60 |
-
# corner case: when area is equal to 1, bin_indices should return bins - 1, not bins for that element
|
61 |
-
bin_indices[bin_indices == self.bins] = self.bins - 1
|
62 |
-
groups.append(bin_indices)
|
63 |
-
groups = np.hstack(groups)
|
64 |
-
|
65 |
-
return groups, interval_names
|
66 |
-
|
67 |
-
def evaluate(self, model=None):
|
68 |
-
"""
|
69 |
-
:param model: callable with signature (image_batch, mask_batch); should return inpainted_batch
|
70 |
-
:return: dict with (score_name, group_type) as keys, where group_type can be either 'overall' or
|
71 |
-
name of the particular group arranged by area of mask (e.g. '10-20%')
|
72 |
-
and score statistics for the group as values.
|
73 |
-
"""
|
74 |
-
results = dict()
|
75 |
-
if self.area_grouping:
|
76 |
-
groups, interval_names = self._get_bin_edges()
|
77 |
-
else:
|
78 |
-
groups = None
|
79 |
-
|
80 |
-
for score_name, score in tqdm.auto.tqdm(self.scores.items(), desc='scores'):
|
81 |
-
score.to(self.device)
|
82 |
-
with torch.no_grad():
|
83 |
-
score.reset()
|
84 |
-
for batch in tqdm.auto.tqdm(self.dataloader, desc=score_name, leave=False):
|
85 |
-
batch = move_to_device(batch, self.device)
|
86 |
-
image_batch, mask_batch = batch['image'], batch['mask']
|
87 |
-
if self.clamp_image_range is not None:
|
88 |
-
image_batch = torch.clamp(image_batch,
|
89 |
-
min=self.clamp_image_range[0],
|
90 |
-
max=self.clamp_image_range[1])
|
91 |
-
if model is None:
|
92 |
-
assert 'inpainted' in batch, \
|
93 |
-
'Model is None, so we expected precomputed inpainting results at key "inpainted"'
|
94 |
-
inpainted_batch = batch['inpainted']
|
95 |
-
else:
|
96 |
-
inpainted_batch = model(image_batch, mask_batch)
|
97 |
-
score(inpainted_batch, image_batch, mask_batch)
|
98 |
-
total_results, group_results = score.get_value(groups=groups)
|
99 |
-
|
100 |
-
results[(score_name, 'total')] = total_results
|
101 |
-
if groups is not None:
|
102 |
-
for group_index, group_values in group_results.items():
|
103 |
-
group_name = interval_names[group_index]
|
104 |
-
results[(score_name, group_name)] = group_values
|
105 |
-
|
106 |
-
if self.integral_func is not None:
|
107 |
-
results[(self.integral_title, 'total')] = dict(mean=self.integral_func(results))
|
108 |
-
|
109 |
-
return results
|
110 |
-
|
111 |
-
|
112 |
-
def ssim_fid100_f1(metrics, fid_scale=100):
|
113 |
-
ssim = metrics[('ssim', 'total')]['mean']
|
114 |
-
fid = metrics[('fid', 'total')]['mean']
|
115 |
-
fid_rel = max(0, fid_scale - fid) / fid_scale
|
116 |
-
f1 = 2 * ssim * fid_rel / (ssim + fid_rel + 1e-3)
|
117 |
-
return f1
|
118 |
-
|
119 |
-
|
120 |
-
def lpips_fid100_f1(metrics, fid_scale=100):
|
121 |
-
neg_lpips = 1 - metrics[('lpips', 'total')]['mean'] # invert, so bigger is better
|
122 |
-
fid = metrics[('fid', 'total')]['mean']
|
123 |
-
fid_rel = max(0, fid_scale - fid) / fid_scale
|
124 |
-
f1 = 2 * neg_lpips * fid_rel / (neg_lpips + fid_rel + 1e-3)
|
125 |
-
return f1
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
class InpaintingEvaluatorOnline(nn.Module):
|
130 |
-
def __init__(self, scores, bins=10, image_key='image', inpainted_key='inpainted',
|
131 |
-
integral_func=None, integral_title=None, clamp_image_range=None):
|
132 |
-
"""
|
133 |
-
:param scores: dict {score_name: EvaluatorScore object}
|
134 |
-
:param bins: number of groups, partition is generated by np.linspace(0., 1., bins + 1)
|
135 |
-
:param device: device to use
|
136 |
-
"""
|
137 |
-
super().__init__()
|
138 |
-
LOGGER.info(f'{type(self)} init called')
|
139 |
-
self.scores = nn.ModuleDict(scores)
|
140 |
-
self.image_key = image_key
|
141 |
-
self.inpainted_key = inpainted_key
|
142 |
-
self.bins_num = bins
|
143 |
-
self.bin_edges = np.linspace(0, 1, self.bins_num + 1)
|
144 |
-
|
145 |
-
num_digits = max(0, math.ceil(math.log10(self.bins_num)) - 1)
|
146 |
-
self.interval_names = []
|
147 |
-
for idx_bin in range(self.bins_num):
|
148 |
-
start_percent, end_percent = round(100 * self.bin_edges[idx_bin], num_digits), \
|
149 |
-
round(100 * self.bin_edges[idx_bin + 1], num_digits)
|
150 |
-
start_percent = '{:.{n}f}'.format(start_percent, n=num_digits)
|
151 |
-
end_percent = '{:.{n}f}'.format(end_percent, n=num_digits)
|
152 |
-
self.interval_names.append("{0}-{1}%".format(start_percent, end_percent))
|
153 |
-
|
154 |
-
self.groups = []
|
155 |
-
|
156 |
-
self.integral_func = integral_func
|
157 |
-
self.integral_title = integral_title
|
158 |
-
self.clamp_image_range = clamp_image_range
|
159 |
-
|
160 |
-
LOGGER.info(f'{type(self)} init done')
|
161 |
-
|
162 |
-
def _get_bins(self, mask_batch):
|
163 |
-
batch_size = mask_batch.shape[0]
|
164 |
-
area = mask_batch.view(batch_size, -1).mean(dim=-1).detach().cpu().numpy()
|
165 |
-
bin_indices = np.clip(np.searchsorted(self.bin_edges, area) - 1, 0, self.bins_num - 1)
|
166 |
-
return bin_indices
|
167 |
-
|
168 |
-
def forward(self, batch: Dict[str, torch.Tensor]):
|
169 |
-
"""
|
170 |
-
Calculate and accumulate metrics for batch. To finalize evaluation and obtain final metrics, call evaluation_end
|
171 |
-
:param batch: batch dict with mandatory fields mask, image, inpainted (can be overriden by self.inpainted_key)
|
172 |
-
"""
|
173 |
-
result = {}
|
174 |
-
with torch.no_grad():
|
175 |
-
image_batch, mask_batch, inpainted_batch = batch[self.image_key], batch['mask'], batch[self.inpainted_key]
|
176 |
-
if self.clamp_image_range is not None:
|
177 |
-
image_batch = torch.clamp(image_batch,
|
178 |
-
min=self.clamp_image_range[0],
|
179 |
-
max=self.clamp_image_range[1])
|
180 |
-
self.groups.extend(self._get_bins(mask_batch))
|
181 |
-
|
182 |
-
for score_name, score in self.scores.items():
|
183 |
-
result[score_name] = score(inpainted_batch, image_batch, mask_batch)
|
184 |
-
return result
|
185 |
-
|
186 |
-
def process_batch(self, batch: Dict[str, torch.Tensor]):
|
187 |
-
return self(batch)
|
188 |
-
|
189 |
-
def evaluation_end(self, states=None):
|
190 |
-
""":return: dict with (score_name, group_type) as keys, where group_type can be either 'overall' or
|
191 |
-
name of the particular group arranged by area of mask (e.g. '10-20%')
|
192 |
-
and score statistics for the group as values.
|
193 |
-
"""
|
194 |
-
LOGGER.info(f'{type(self)}: evaluation_end called')
|
195 |
-
|
196 |
-
self.groups = np.array(self.groups)
|
197 |
-
|
198 |
-
results = {}
|
199 |
-
for score_name, score in self.scores.items():
|
200 |
-
LOGGER.info(f'Getting value of {score_name}')
|
201 |
-
cur_states = [s[score_name] for s in states] if states is not None else None
|
202 |
-
total_results, group_results = score.get_value(groups=self.groups, states=cur_states)
|
203 |
-
LOGGER.info(f'Getting value of {score_name} done')
|
204 |
-
results[(score_name, 'total')] = total_results
|
205 |
-
|
206 |
-
for group_index, group_values in group_results.items():
|
207 |
-
group_name = self.interval_names[group_index]
|
208 |
-
results[(score_name, group_name)] = group_values
|
209 |
-
|
210 |
-
if self.integral_func is not None:
|
211 |
-
results[(self.integral_title, 'total')] = dict(mean=self.integral_func(results))
|
212 |
-
|
213 |
-
LOGGER.info(f'{type(self)}: reset scores')
|
214 |
-
self.groups = []
|
215 |
-
for sc in self.scores.values():
|
216 |
-
sc.reset()
|
217 |
-
LOGGER.info(f'{type(self)}: reset scores done')
|
218 |
-
|
219 |
-
LOGGER.info(f'{type(self)}: evaluation_end done')
|
220 |
-
return results
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Alycer/VITS-Umamusume-voice-synthesizer/README.md
DELETED
@@ -1,12 +0,0 @@
|
|
1 |
-
---
|
2 |
-
title: Multilingual Anime TTS
|
3 |
-
emoji: 🎙🐴
|
4 |
-
colorFrom: green
|
5 |
-
colorTo: gray
|
6 |
-
sdk: gradio
|
7 |
-
sdk_version: 3.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/Andy1621/uniformer_image_detection/configs/ms_rcnn/ms_rcnn_x101_64x4d_fpn_2x_coco.py
DELETED
@@ -1,4 +0,0 @@
|
|
1 |
-
_base_ = './ms_rcnn_x101_64x4d_fpn_1x_coco.py'
|
2 |
-
# learning policy
|
3 |
-
lr_config = dict(step=[16, 22])
|
4 |
-
runner = dict(type='EpochBasedRunner', max_epochs=24)
|
|
|
|
|
|
|
|
|
|
spaces/Andy1621/uniformer_image_detection/mmcv_custom/runner/__init__.py
DELETED
@@ -1,8 +0,0 @@
|
|
1 |
-
# Copyright (c) Open-MMLab. All rights reserved.
|
2 |
-
from .checkpoint import save_checkpoint
|
3 |
-
from .epoch_based_runner import EpochBasedRunnerAmp
|
4 |
-
|
5 |
-
|
6 |
-
__all__ = [
|
7 |
-
'EpochBasedRunnerAmp', 'save_checkpoint'
|
8 |
-
]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Andy1621/uniformer_image_segmentation/configs/encnet/encnet_r101-d8_512x512_20k_voc12aug.py
DELETED
@@ -1,2 +0,0 @@
|
|
1 |
-
_base_ = './encnet_r50-d8_512x512_20k_voc12aug.py'
|
2 |
-
model = dict(pretrained='open-mmlab://resnet101_v1c', backbone=dict(depth=101))
|
|
|
|
|
|
spaces/AnishKumbhar/ChatBot/text-generation-webui-main/docs/LoRA.md
DELETED
@@ -1,71 +0,0 @@
|
|
1 |
-
# LoRA
|
2 |
-
|
3 |
-
LoRA (Low-Rank Adaptation) is an extremely powerful method for customizing a base model by training only a small number of parameters. They can be attached to models at runtime.
|
4 |
-
|
5 |
-
For instance, a 50mb LoRA can teach LLaMA an entire new language, a given writing style, or give it instruction-following or chat abilities.
|
6 |
-
|
7 |
-
This is the current state of LoRA integration in the web UI:
|
8 |
-
|
9 |
-
|Loader | Status |
|
10 |
-
|--------|------|
|
11 |
-
| Transformers | Full support in 16-bit, `--load-in-8bit`, `--load-in-4bit`, and CPU modes. |
|
12 |
-
| ExLlama | Single LoRA support. Fast to remove the LoRA afterwards. |
|
13 |
-
| AutoGPTQ | Single LoRA support. Removing the LoRA requires reloading the entire model.|
|
14 |
-
| GPTQ-for-LLaMa | Full support with the [monkey patch](https://github.com/oobabooga/text-generation-webui/blob/main/docs/GPTQ-models-(4-bit-mode).md#using-loras-with-gptq-for-llama). |
|
15 |
-
|
16 |
-
## Downloading a LoRA
|
17 |
-
|
18 |
-
The download script can be used. For instance:
|
19 |
-
|
20 |
-
```
|
21 |
-
python download-model.py tloen/alpaca-lora-7b
|
22 |
-
```
|
23 |
-
|
24 |
-
The files will be saved to `loras/tloen_alpaca-lora-7b`.
|
25 |
-
|
26 |
-
## Using the LoRA
|
27 |
-
|
28 |
-
The `--lora` command-line flag can be used. Examples:
|
29 |
-
|
30 |
-
```
|
31 |
-
python server.py --model llama-7b-hf --lora tloen_alpaca-lora-7b
|
32 |
-
python server.py --model llama-7b-hf --lora tloen_alpaca-lora-7b --load-in-8bit
|
33 |
-
python server.py --model llama-7b-hf --lora tloen_alpaca-lora-7b --load-in-4bit
|
34 |
-
python server.py --model llama-7b-hf --lora tloen_alpaca-lora-7b --cpu
|
35 |
-
```
|
36 |
-
|
37 |
-
Instead of using the `--lora` command-line flag, you can also select the LoRA in the "Parameters" tab of the interface.
|
38 |
-
|
39 |
-
## Prompt
|
40 |
-
For the Alpaca LoRA in particular, the prompt must be formatted like this:
|
41 |
-
|
42 |
-
```
|
43 |
-
Below is an instruction that describes a task. Write a response that appropriately completes the request.
|
44 |
-
### Instruction:
|
45 |
-
Write a Python script that generates text using the transformers library.
|
46 |
-
### Response:
|
47 |
-
```
|
48 |
-
|
49 |
-
Sample output:
|
50 |
-
|
51 |
-
```
|
52 |
-
Below is an instruction that describes a task. Write a response that appropriately completes the request.
|
53 |
-
### Instruction:
|
54 |
-
Write a Python script that generates text using the transformers library.
|
55 |
-
### Response:
|
56 |
-
|
57 |
-
import transformers
|
58 |
-
from transformers import AutoTokenizer, AutoModelForCausalLM
|
59 |
-
tokenizer = AutoTokenizer.from_pretrained("bert-base-uncased")
|
60 |
-
model = AutoModelForCausalLM.from_pretrained("bert-base-uncased")
|
61 |
-
texts = ["Hello world", "How are you"]
|
62 |
-
for sentence in texts:
|
63 |
-
sentence = tokenizer(sentence)
|
64 |
-
print(f"Generated {len(sentence)} tokens from '{sentence}'")
|
65 |
-
output = model(sentences=sentence).predict()
|
66 |
-
print(f"Predicted {len(output)} tokens for '{sentence}':\n{output}")
|
67 |
-
```
|
68 |
-
|
69 |
-
## Training a LoRA
|
70 |
-
|
71 |
-
You can train your own LoRAs from the `Training` tab. See [Training LoRAs](Training-LoRAs.md) for details.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Arnx/MusicGenXvAKN/audiocraft/modules/activations.py
DELETED
@@ -1,96 +0,0 @@
|
|
1 |
-
# Copyright (c) Meta Platforms, Inc. and affiliates.
|
2 |
-
# All rights reserved.
|
3 |
-
#
|
4 |
-
# This source code is licensed under the license found in the
|
5 |
-
# LICENSE file in the root directory of this source tree.
|
6 |
-
|
7 |
-
import torch
|
8 |
-
import torch.nn as nn
|
9 |
-
from torch import Tensor
|
10 |
-
from typing import Union, Callable
|
11 |
-
|
12 |
-
|
13 |
-
class CustomGLU(nn.Module):
|
14 |
-
"""Custom Gated Linear Unit activation.
|
15 |
-
Applies a modified gated linear unit :math:`a * f(b)` where :math:`a` is the first half
|
16 |
-
of the input matrices, :math:`b` is the second half, and :math:`f` is a provided activation
|
17 |
-
function (i.e. sigmoid, swish, etc.).
|
18 |
-
|
19 |
-
Args:
|
20 |
-
activation (nn.Module): The custom activation to apply in the Gated Linear Unit
|
21 |
-
dim (int): the dimension on which to split the input. Default: -1
|
22 |
-
|
23 |
-
Shape:
|
24 |
-
- Input: :math:`(\ast_1, N, \ast_2)` where `*` means, any number of additional
|
25 |
-
dimensions
|
26 |
-
- Output: :math:`(\ast_1, M, \ast_2)` where :math:`M=N/2`
|
27 |
-
|
28 |
-
Examples::
|
29 |
-
>>> m = CustomGLU(nn.Sigmoid())
|
30 |
-
>>> input = torch.randn(4, 2)
|
31 |
-
>>> output = m(input)
|
32 |
-
"""
|
33 |
-
def __init__(self, activation: nn.Module, dim: int = -1):
|
34 |
-
super(CustomGLU, self).__init__()
|
35 |
-
self.dim = dim
|
36 |
-
self.activation = activation
|
37 |
-
|
38 |
-
def forward(self, x: Tensor):
|
39 |
-
assert x.shape[self.dim] % 2 == 0 # M = N / 2
|
40 |
-
a, b = torch.chunk(x, 2, dim=self.dim)
|
41 |
-
return a * self.activation(b)
|
42 |
-
|
43 |
-
|
44 |
-
class SwiGLU(CustomGLU):
|
45 |
-
"""SiLU Gated Linear Unit activation.
|
46 |
-
Applies SiLU Gated Linear Unit :math:`a * SiLU(b)` where :math:`a` is
|
47 |
-
the first half of the input matrices, :math:`b` is the second half.
|
48 |
-
|
49 |
-
Args:
|
50 |
-
dim (int): the dimension on which to split the input. Default: -1
|
51 |
-
"""
|
52 |
-
def __init__(self, dim: int = -1):
|
53 |
-
super(SwiGLU, self).__init__(nn.SiLU(), dim)
|
54 |
-
|
55 |
-
|
56 |
-
class GeGLU(CustomGLU):
|
57 |
-
"""GeLU Gated Linear Unit activation.
|
58 |
-
Applies GeLU Gated Linear Unit :math:`a * GELU(b)` where :math:`a` is
|
59 |
-
the first half of the input matrices, :math:`b` is the second half.
|
60 |
-
|
61 |
-
Args:
|
62 |
-
dim (int): the dimension on which to split the input. Default: -1
|
63 |
-
"""
|
64 |
-
def __init__(self, dim: int = -1):
|
65 |
-
super(GeGLU, self).__init__(nn.GELU(), dim)
|
66 |
-
|
67 |
-
|
68 |
-
class ReGLU(CustomGLU):
|
69 |
-
"""ReLU Gated Linear Unit activation.
|
70 |
-
Applies ReLU Gated Linear Unit :math:`a * ReLU(b)` where :math:`a` is
|
71 |
-
the first half of the input matrices, :math:`b` is the second half.
|
72 |
-
|
73 |
-
Args:
|
74 |
-
dim (int): the dimension on which to split the input. Default: -1
|
75 |
-
"""
|
76 |
-
def __init__(self, dim: int = -1):
|
77 |
-
super(ReGLU, self).__init__(nn.ReLU(), dim)
|
78 |
-
|
79 |
-
|
80 |
-
def get_activation_fn(
|
81 |
-
activation: Union[str, Callable[[Tensor], Tensor]]
|
82 |
-
) -> Union[str, Callable[[Tensor], Tensor]]:
|
83 |
-
"""Helper function to map an activation string to the activation class.
|
84 |
-
If the supplied activation is not a string that is recognized, the activation is passed back.
|
85 |
-
|
86 |
-
Args:
|
87 |
-
activation (Union[str, Callable[[Tensor], Tensor]]): Activation to check
|
88 |
-
"""
|
89 |
-
if isinstance(activation, str):
|
90 |
-
if activation == "reglu":
|
91 |
-
return ReGLU()
|
92 |
-
elif activation == "geglu":
|
93 |
-
return GeGLU()
|
94 |
-
elif activation == "swiglu":
|
95 |
-
return SwiGLU()
|
96 |
-
return activation
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/ArtGAN/Video-Diffusion-WebUI/video_diffusion/tuneavideo/models/attention.py
DELETED
@@ -1,322 +0,0 @@
|
|
1 |
-
# Adapted from https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/attention.py
|
2 |
-
|
3 |
-
from dataclasses import dataclass
|
4 |
-
from typing import Optional
|
5 |
-
|
6 |
-
import torch
|
7 |
-
import torch.nn.functional as F
|
8 |
-
from diffusers.configuration_utils import ConfigMixin, register_to_config
|
9 |
-
from diffusers.models.attention import AdaLayerNorm, FeedForward
|
10 |
-
from diffusers.models.cross_attention import CrossAttention
|
11 |
-
from diffusers.models.modeling_utils import ModelMixin
|
12 |
-
from diffusers.utils import BaseOutput
|
13 |
-
from diffusers.utils.import_utils import is_xformers_available
|
14 |
-
from einops import rearrange, repeat
|
15 |
-
from torch import nn
|
16 |
-
|
17 |
-
|
18 |
-
@dataclass
|
19 |
-
class Transformer3DModelOutput(BaseOutput):
|
20 |
-
sample: torch.FloatTensor
|
21 |
-
|
22 |
-
|
23 |
-
if is_xformers_available():
|
24 |
-
import xformers
|
25 |
-
import xformers.ops
|
26 |
-
else:
|
27 |
-
xformers = None
|
28 |
-
|
29 |
-
|
30 |
-
class Transformer3DModel(ModelMixin, ConfigMixin):
|
31 |
-
@register_to_config
|
32 |
-
def __init__(
|
33 |
-
self,
|
34 |
-
num_attention_heads: int = 16,
|
35 |
-
attention_head_dim: int = 88,
|
36 |
-
in_channels: Optional[int] = None,
|
37 |
-
num_layers: int = 1,
|
38 |
-
dropout: float = 0.0,
|
39 |
-
norm_num_groups: int = 32,
|
40 |
-
cross_attention_dim: Optional[int] = None,
|
41 |
-
attention_bias: bool = False,
|
42 |
-
activation_fn: str = "geglu",
|
43 |
-
num_embeds_ada_norm: Optional[int] = None,
|
44 |
-
use_linear_projection: bool = False,
|
45 |
-
only_cross_attention: bool = False,
|
46 |
-
upcast_attention: bool = False,
|
47 |
-
):
|
48 |
-
super().__init__()
|
49 |
-
self.use_linear_projection = use_linear_projection
|
50 |
-
self.num_attention_heads = num_attention_heads
|
51 |
-
self.attention_head_dim = attention_head_dim
|
52 |
-
inner_dim = num_attention_heads * attention_head_dim
|
53 |
-
|
54 |
-
# Define input layers
|
55 |
-
self.in_channels = in_channels
|
56 |
-
|
57 |
-
self.norm = torch.nn.GroupNorm(num_groups=norm_num_groups, num_channels=in_channels, eps=1e-6, affine=True)
|
58 |
-
if use_linear_projection:
|
59 |
-
self.proj_in = nn.Linear(in_channels, inner_dim)
|
60 |
-
else:
|
61 |
-
self.proj_in = nn.Conv2d(in_channels, inner_dim, kernel_size=1, stride=1, padding=0)
|
62 |
-
|
63 |
-
# Define transformers blocks
|
64 |
-
self.transformer_blocks = nn.ModuleList(
|
65 |
-
[
|
66 |
-
BasicTransformerBlock(
|
67 |
-
inner_dim,
|
68 |
-
num_attention_heads,
|
69 |
-
attention_head_dim,
|
70 |
-
dropout=dropout,
|
71 |
-
cross_attention_dim=cross_attention_dim,
|
72 |
-
activation_fn=activation_fn,
|
73 |
-
num_embeds_ada_norm=num_embeds_ada_norm,
|
74 |
-
attention_bias=attention_bias,
|
75 |
-
only_cross_attention=only_cross_attention,
|
76 |
-
upcast_attention=upcast_attention,
|
77 |
-
)
|
78 |
-
for d in range(num_layers)
|
79 |
-
]
|
80 |
-
)
|
81 |
-
|
82 |
-
# 4. Define output layers
|
83 |
-
if use_linear_projection:
|
84 |
-
self.proj_out = nn.Linear(in_channels, inner_dim)
|
85 |
-
else:
|
86 |
-
self.proj_out = nn.Conv2d(inner_dim, in_channels, kernel_size=1, stride=1, padding=0)
|
87 |
-
|
88 |
-
def forward(self, hidden_states, encoder_hidden_states=None, timestep=None, return_dict: bool = True):
|
89 |
-
# Input
|
90 |
-
assert hidden_states.dim() == 5, f"Expected hidden_states to have ndim=5, but got ndim={hidden_states.dim()}."
|
91 |
-
video_length = hidden_states.shape[2]
|
92 |
-
hidden_states = rearrange(hidden_states, "b c f h w -> (b f) c h w")
|
93 |
-
encoder_hidden_states = repeat(encoder_hidden_states, "b n c -> (b f) n c", f=video_length)
|
94 |
-
|
95 |
-
batch, channel, height, weight = hidden_states.shape
|
96 |
-
residual = hidden_states
|
97 |
-
|
98 |
-
hidden_states = self.norm(hidden_states)
|
99 |
-
if not self.use_linear_projection:
|
100 |
-
hidden_states = self.proj_in(hidden_states)
|
101 |
-
inner_dim = hidden_states.shape[1]
|
102 |
-
hidden_states = hidden_states.permute(0, 2, 3, 1).reshape(batch, height * weight, inner_dim)
|
103 |
-
else:
|
104 |
-
inner_dim = hidden_states.shape[1]
|
105 |
-
hidden_states = hidden_states.permute(0, 2, 3, 1).reshape(batch, height * weight, inner_dim)
|
106 |
-
hidden_states = self.proj_in(hidden_states)
|
107 |
-
|
108 |
-
# Blocks
|
109 |
-
for block in self.transformer_blocks:
|
110 |
-
hidden_states = block(
|
111 |
-
hidden_states, encoder_hidden_states=encoder_hidden_states, timestep=timestep, video_length=video_length
|
112 |
-
)
|
113 |
-
|
114 |
-
# Output
|
115 |
-
if not self.use_linear_projection:
|
116 |
-
hidden_states = hidden_states.reshape(batch, height, weight, inner_dim).permute(0, 3, 1, 2).contiguous()
|
117 |
-
hidden_states = self.proj_out(hidden_states)
|
118 |
-
else:
|
119 |
-
hidden_states = self.proj_out(hidden_states)
|
120 |
-
hidden_states = hidden_states.reshape(batch, height, weight, inner_dim).permute(0, 3, 1, 2).contiguous()
|
121 |
-
|
122 |
-
output = hidden_states + residual
|
123 |
-
|
124 |
-
output = rearrange(output, "(b f) c h w -> b c f h w", f=video_length)
|
125 |
-
if not return_dict:
|
126 |
-
return (output,)
|
127 |
-
|
128 |
-
return Transformer3DModelOutput(sample=output)
|
129 |
-
|
130 |
-
|
131 |
-
class BasicTransformerBlock(nn.Module):
|
132 |
-
def __init__(
|
133 |
-
self,
|
134 |
-
dim: int,
|
135 |
-
num_attention_heads: int,
|
136 |
-
attention_head_dim: int,
|
137 |
-
dropout=0.0,
|
138 |
-
cross_attention_dim: Optional[int] = None,
|
139 |
-
activation_fn: str = "geglu",
|
140 |
-
num_embeds_ada_norm: Optional[int] = None,
|
141 |
-
attention_bias: bool = False,
|
142 |
-
only_cross_attention: bool = False,
|
143 |
-
upcast_attention: bool = False,
|
144 |
-
):
|
145 |
-
super().__init__()
|
146 |
-
self.only_cross_attention = only_cross_attention
|
147 |
-
self.use_ada_layer_norm = num_embeds_ada_norm is not None
|
148 |
-
|
149 |
-
# SC-Attn
|
150 |
-
self.attn1 = SparseCausalAttention(
|
151 |
-
query_dim=dim,
|
152 |
-
heads=num_attention_heads,
|
153 |
-
dim_head=attention_head_dim,
|
154 |
-
dropout=dropout,
|
155 |
-
bias=attention_bias,
|
156 |
-
cross_attention_dim=cross_attention_dim if only_cross_attention else None,
|
157 |
-
upcast_attention=upcast_attention,
|
158 |
-
)
|
159 |
-
self.norm1 = AdaLayerNorm(dim, num_embeds_ada_norm) if self.use_ada_layer_norm else nn.LayerNorm(dim)
|
160 |
-
|
161 |
-
# Cross-Attn
|
162 |
-
if cross_attention_dim is not None:
|
163 |
-
self.attn2 = CrossAttention(
|
164 |
-
query_dim=dim,
|
165 |
-
cross_attention_dim=cross_attention_dim,
|
166 |
-
heads=num_attention_heads,
|
167 |
-
dim_head=attention_head_dim,
|
168 |
-
dropout=dropout,
|
169 |
-
bias=attention_bias,
|
170 |
-
upcast_attention=upcast_attention,
|
171 |
-
)
|
172 |
-
else:
|
173 |
-
self.attn2 = None
|
174 |
-
|
175 |
-
if cross_attention_dim is not None:
|
176 |
-
self.norm2 = AdaLayerNorm(dim, num_embeds_ada_norm) if self.use_ada_layer_norm else nn.LayerNorm(dim)
|
177 |
-
else:
|
178 |
-
self.norm2 = None
|
179 |
-
|
180 |
-
# Feed-forward
|
181 |
-
self.ff = FeedForward(dim, dropout=dropout, activation_fn=activation_fn)
|
182 |
-
self.norm3 = nn.LayerNorm(dim)
|
183 |
-
|
184 |
-
# Temp-Attn
|
185 |
-
self.attn_temp = CrossAttention(
|
186 |
-
query_dim=dim,
|
187 |
-
heads=num_attention_heads,
|
188 |
-
dim_head=attention_head_dim,
|
189 |
-
dropout=dropout,
|
190 |
-
bias=attention_bias,
|
191 |
-
upcast_attention=upcast_attention,
|
192 |
-
)
|
193 |
-
nn.init.zeros_(self.attn_temp.to_out[0].weight.data)
|
194 |
-
self.norm_temp = AdaLayerNorm(dim, num_embeds_ada_norm) if self.use_ada_layer_norm else nn.LayerNorm(dim)
|
195 |
-
|
196 |
-
def set_use_memory_efficient_attention_xformers(self, use_memory_efficient_attention_xformers: bool):
|
197 |
-
if not is_xformers_available():
|
198 |
-
print("Here is how to install it")
|
199 |
-
raise ModuleNotFoundError(
|
200 |
-
"Refer to https://github.com/facebookresearch/xformers for more information on how to install"
|
201 |
-
" xformers",
|
202 |
-
name="xformers",
|
203 |
-
)
|
204 |
-
elif not torch.cuda.is_available():
|
205 |
-
raise ValueError(
|
206 |
-
"torch.cuda.is_available() should be True but is False. xformers' memory efficient attention is only"
|
207 |
-
" available for GPU "
|
208 |
-
)
|
209 |
-
else:
|
210 |
-
try:
|
211 |
-
# Make sure we can run the memory efficient attention
|
212 |
-
_ = xformers.ops.memory_efficient_attention(
|
213 |
-
torch.randn((1, 2, 40), device="cuda"),
|
214 |
-
torch.randn((1, 2, 40), device="cuda"),
|
215 |
-
torch.randn((1, 2, 40), device="cuda"),
|
216 |
-
)
|
217 |
-
except Exception as e:
|
218 |
-
raise e
|
219 |
-
self.attn1._use_memory_efficient_attention_xformers = use_memory_efficient_attention_xformers
|
220 |
-
if self.attn2 is not None:
|
221 |
-
self.attn2._use_memory_efficient_attention_xformers = use_memory_efficient_attention_xformers
|
222 |
-
# self.attn_temp._use_memory_efficient_attention_xformers = use_memory_efficient_attention_xformers
|
223 |
-
|
224 |
-
def forward(self, hidden_states, encoder_hidden_states=None, timestep=None, attention_mask=None, video_length=None):
|
225 |
-
# SparseCausal-Attention
|
226 |
-
norm_hidden_states = (
|
227 |
-
self.norm1(hidden_states, timestep) if self.use_ada_layer_norm else self.norm1(hidden_states)
|
228 |
-
)
|
229 |
-
|
230 |
-
if self.only_cross_attention:
|
231 |
-
hidden_states = (
|
232 |
-
self.attn1(norm_hidden_states, encoder_hidden_states, attention_mask=attention_mask) + hidden_states
|
233 |
-
)
|
234 |
-
else:
|
235 |
-
hidden_states = (
|
236 |
-
self.attn1(norm_hidden_states, attention_mask=attention_mask, video_length=video_length) + hidden_states
|
237 |
-
)
|
238 |
-
|
239 |
-
if self.attn2 is not None:
|
240 |
-
# Cross-Attention
|
241 |
-
norm_hidden_states = (
|
242 |
-
self.norm2(hidden_states, timestep) if self.use_ada_layer_norm else self.norm2(hidden_states)
|
243 |
-
)
|
244 |
-
hidden_states = (
|
245 |
-
self.attn2(
|
246 |
-
norm_hidden_states, encoder_hidden_states=encoder_hidden_states, attention_mask=attention_mask
|
247 |
-
)
|
248 |
-
+ hidden_states
|
249 |
-
)
|
250 |
-
|
251 |
-
# Feed-forward
|
252 |
-
hidden_states = self.ff(self.norm3(hidden_states)) + hidden_states
|
253 |
-
|
254 |
-
# Temporal-Attention
|
255 |
-
d = hidden_states.shape[1]
|
256 |
-
hidden_states = rearrange(hidden_states, "(b f) d c -> (b d) f c", f=video_length)
|
257 |
-
norm_hidden_states = (
|
258 |
-
self.norm_temp(hidden_states, timestep) if self.use_ada_layer_norm else self.norm_temp(hidden_states)
|
259 |
-
)
|
260 |
-
hidden_states = self.attn_temp(norm_hidden_states) + hidden_states
|
261 |
-
hidden_states = rearrange(hidden_states, "(b d) f c -> (b f) d c", d=d)
|
262 |
-
|
263 |
-
return hidden_states
|
264 |
-
|
265 |
-
|
266 |
-
class SparseCausalAttention(CrossAttention):
|
267 |
-
def forward(self, hidden_states, encoder_hidden_states=None, attention_mask=None, video_length=None):
|
268 |
-
batch_size, sequence_length, _ = hidden_states.shape
|
269 |
-
|
270 |
-
encoder_hidden_states = encoder_hidden_states
|
271 |
-
|
272 |
-
if self.group_norm is not None:
|
273 |
-
hidden_states = self.group_norm(hidden_states.transpose(1, 2)).transpose(1, 2)
|
274 |
-
|
275 |
-
query = self.to_q(hidden_states)
|
276 |
-
dim = query.shape[-1]
|
277 |
-
query = self.reshape_heads_to_batch_dim(query)
|
278 |
-
|
279 |
-
if self.added_kv_proj_dim is not None:
|
280 |
-
raise NotImplementedError
|
281 |
-
|
282 |
-
encoder_hidden_states = encoder_hidden_states if encoder_hidden_states is not None else hidden_states
|
283 |
-
key = self.to_k(encoder_hidden_states)
|
284 |
-
value = self.to_v(encoder_hidden_states)
|
285 |
-
|
286 |
-
former_frame_index = torch.arange(video_length) - 1
|
287 |
-
former_frame_index[0] = 0
|
288 |
-
|
289 |
-
key = rearrange(key, "(b f) d c -> b f d c", f=video_length)
|
290 |
-
key = torch.cat([key[:, [0] * video_length], key[:, former_frame_index]], dim=2)
|
291 |
-
key = rearrange(key, "b f d c -> (b f) d c")
|
292 |
-
|
293 |
-
value = rearrange(value, "(b f) d c -> b f d c", f=video_length)
|
294 |
-
value = torch.cat([value[:, [0] * video_length], value[:, former_frame_index]], dim=2)
|
295 |
-
value = rearrange(value, "b f d c -> (b f) d c")
|
296 |
-
|
297 |
-
key = self.reshape_heads_to_batch_dim(key)
|
298 |
-
value = self.reshape_heads_to_batch_dim(value)
|
299 |
-
|
300 |
-
if attention_mask is not None:
|
301 |
-
if attention_mask.shape[-1] != query.shape[1]:
|
302 |
-
target_length = query.shape[1]
|
303 |
-
attention_mask = F.pad(attention_mask, (0, target_length), value=0.0)
|
304 |
-
attention_mask = attention_mask.repeat_interleave(self.heads, dim=0)
|
305 |
-
|
306 |
-
# attention, what we cannot get enough of
|
307 |
-
if self._use_memory_efficient_attention_xformers:
|
308 |
-
hidden_states = self._memory_efficient_attention_xformers(query, key, value, attention_mask)
|
309 |
-
# Some versions of xformers return output in fp32, cast it back to the dtype of the input
|
310 |
-
hidden_states = hidden_states.to(query.dtype)
|
311 |
-
else:
|
312 |
-
if self._slice_size is None or query.shape[0] // self._slice_size == 1:
|
313 |
-
hidden_states = self._attention(query, key, value, attention_mask)
|
314 |
-
else:
|
315 |
-
hidden_states = self._sliced_attention(query, key, value, sequence_length, dim, attention_mask)
|
316 |
-
|
317 |
-
# linear proj
|
318 |
-
hidden_states = self.to_out[0](hidden_states)
|
319 |
-
|
320 |
-
# dropout
|
321 |
-
hidden_states = self.to_out[1](hidden_states)
|
322 |
-
return hidden_states
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Ataturk-Chatbot/HuggingFaceChat/venv/lib/python3.11/site-packages/pip/_vendor/requests/cookies.py
DELETED
@@ -1,561 +0,0 @@
|
|
1 |
-
"""
|
2 |
-
requests.cookies
|
3 |
-
~~~~~~~~~~~~~~~~
|
4 |
-
|
5 |
-
Compatibility code to be able to use `cookielib.CookieJar` with requests.
|
6 |
-
|
7 |
-
requests.utils imports from here, so be careful with imports.
|
8 |
-
"""
|
9 |
-
|
10 |
-
import calendar
|
11 |
-
import copy
|
12 |
-
import time
|
13 |
-
|
14 |
-
from ._internal_utils import to_native_string
|
15 |
-
from .compat import Morsel, MutableMapping, cookielib, urlparse, urlunparse
|
16 |
-
|
17 |
-
try:
|
18 |
-
import threading
|
19 |
-
except ImportError:
|
20 |
-
import dummy_threading as threading
|
21 |
-
|
22 |
-
|
23 |
-
class MockRequest:
|
24 |
-
"""Wraps a `requests.Request` to mimic a `urllib2.Request`.
|
25 |
-
|
26 |
-
The code in `cookielib.CookieJar` expects this interface in order to correctly
|
27 |
-
manage cookie policies, i.e., determine whether a cookie can be set, given the
|
28 |
-
domains of the request and the cookie.
|
29 |
-
|
30 |
-
The original request object is read-only. The client is responsible for collecting
|
31 |
-
the new headers via `get_new_headers()` and interpreting them appropriately. You
|
32 |
-
probably want `get_cookie_header`, defined below.
|
33 |
-
"""
|
34 |
-
|
35 |
-
def __init__(self, request):
|
36 |
-
self._r = request
|
37 |
-
self._new_headers = {}
|
38 |
-
self.type = urlparse(self._r.url).scheme
|
39 |
-
|
40 |
-
def get_type(self):
|
41 |
-
return self.type
|
42 |
-
|
43 |
-
def get_host(self):
|
44 |
-
return urlparse(self._r.url).netloc
|
45 |
-
|
46 |
-
def get_origin_req_host(self):
|
47 |
-
return self.get_host()
|
48 |
-
|
49 |
-
def get_full_url(self):
|
50 |
-
# Only return the response's URL if the user hadn't set the Host
|
51 |
-
# header
|
52 |
-
if not self._r.headers.get("Host"):
|
53 |
-
return self._r.url
|
54 |
-
# If they did set it, retrieve it and reconstruct the expected domain
|
55 |
-
host = to_native_string(self._r.headers["Host"], encoding="utf-8")
|
56 |
-
parsed = urlparse(self._r.url)
|
57 |
-
# Reconstruct the URL as we expect it
|
58 |
-
return urlunparse(
|
59 |
-
[
|
60 |
-
parsed.scheme,
|
61 |
-
host,
|
62 |
-
parsed.path,
|
63 |
-
parsed.params,
|
64 |
-
parsed.query,
|
65 |
-
parsed.fragment,
|
66 |
-
]
|
67 |
-
)
|
68 |
-
|
69 |
-
def is_unverifiable(self):
|
70 |
-
return True
|
71 |
-
|
72 |
-
def has_header(self, name):
|
73 |
-
return name in self._r.headers or name in self._new_headers
|
74 |
-
|
75 |
-
def get_header(self, name, default=None):
|
76 |
-
return self._r.headers.get(name, self._new_headers.get(name, default))
|
77 |
-
|
78 |
-
def add_header(self, key, val):
|
79 |
-
"""cookielib has no legitimate use for this method; add it back if you find one."""
|
80 |
-
raise NotImplementedError(
|
81 |
-
"Cookie headers should be added with add_unredirected_header()"
|
82 |
-
)
|
83 |
-
|
84 |
-
def add_unredirected_header(self, name, value):
|
85 |
-
self._new_headers[name] = value
|
86 |
-
|
87 |
-
def get_new_headers(self):
|
88 |
-
return self._new_headers
|
89 |
-
|
90 |
-
@property
|
91 |
-
def unverifiable(self):
|
92 |
-
return self.is_unverifiable()
|
93 |
-
|
94 |
-
@property
|
95 |
-
def origin_req_host(self):
|
96 |
-
return self.get_origin_req_host()
|
97 |
-
|
98 |
-
@property
|
99 |
-
def host(self):
|
100 |
-
return self.get_host()
|
101 |
-
|
102 |
-
|
103 |
-
class MockResponse:
|
104 |
-
"""Wraps a `httplib.HTTPMessage` to mimic a `urllib.addinfourl`.
|
105 |
-
|
106 |
-
...what? Basically, expose the parsed HTTP headers from the server response
|
107 |
-
the way `cookielib` expects to see them.
|
108 |
-
"""
|
109 |
-
|
110 |
-
def __init__(self, headers):
|
111 |
-
"""Make a MockResponse for `cookielib` to read.
|
112 |
-
|
113 |
-
:param headers: a httplib.HTTPMessage or analogous carrying the headers
|
114 |
-
"""
|
115 |
-
self._headers = headers
|
116 |
-
|
117 |
-
def info(self):
|
118 |
-
return self._headers
|
119 |
-
|
120 |
-
def getheaders(self, name):
|
121 |
-
self._headers.getheaders(name)
|
122 |
-
|
123 |
-
|
124 |
-
def extract_cookies_to_jar(jar, request, response):
|
125 |
-
"""Extract the cookies from the response into a CookieJar.
|
126 |
-
|
127 |
-
:param jar: cookielib.CookieJar (not necessarily a RequestsCookieJar)
|
128 |
-
:param request: our own requests.Request object
|
129 |
-
:param response: urllib3.HTTPResponse object
|
130 |
-
"""
|
131 |
-
if not (hasattr(response, "_original_response") and response._original_response):
|
132 |
-
return
|
133 |
-
# the _original_response field is the wrapped httplib.HTTPResponse object,
|
134 |
-
req = MockRequest(request)
|
135 |
-
# pull out the HTTPMessage with the headers and put it in the mock:
|
136 |
-
res = MockResponse(response._original_response.msg)
|
137 |
-
jar.extract_cookies(res, req)
|
138 |
-
|
139 |
-
|
140 |
-
def get_cookie_header(jar, request):
|
141 |
-
"""
|
142 |
-
Produce an appropriate Cookie header string to be sent with `request`, or None.
|
143 |
-
|
144 |
-
:rtype: str
|
145 |
-
"""
|
146 |
-
r = MockRequest(request)
|
147 |
-
jar.add_cookie_header(r)
|
148 |
-
return r.get_new_headers().get("Cookie")
|
149 |
-
|
150 |
-
|
151 |
-
def remove_cookie_by_name(cookiejar, name, domain=None, path=None):
|
152 |
-
"""Unsets a cookie by name, by default over all domains and paths.
|
153 |
-
|
154 |
-
Wraps CookieJar.clear(), is O(n).
|
155 |
-
"""
|
156 |
-
clearables = []
|
157 |
-
for cookie in cookiejar:
|
158 |
-
if cookie.name != name:
|
159 |
-
continue
|
160 |
-
if domain is not None and domain != cookie.domain:
|
161 |
-
continue
|
162 |
-
if path is not None and path != cookie.path:
|
163 |
-
continue
|
164 |
-
clearables.append((cookie.domain, cookie.path, cookie.name))
|
165 |
-
|
166 |
-
for domain, path, name in clearables:
|
167 |
-
cookiejar.clear(domain, path, name)
|
168 |
-
|
169 |
-
|
170 |
-
class CookieConflictError(RuntimeError):
|
171 |
-
"""There are two cookies that meet the criteria specified in the cookie jar.
|
172 |
-
Use .get and .set and include domain and path args in order to be more specific.
|
173 |
-
"""
|
174 |
-
|
175 |
-
|
176 |
-
class RequestsCookieJar(cookielib.CookieJar, MutableMapping):
|
177 |
-
"""Compatibility class; is a cookielib.CookieJar, but exposes a dict
|
178 |
-
interface.
|
179 |
-
|
180 |
-
This is the CookieJar we create by default for requests and sessions that
|
181 |
-
don't specify one, since some clients may expect response.cookies and
|
182 |
-
session.cookies to support dict operations.
|
183 |
-
|
184 |
-
Requests does not use the dict interface internally; it's just for
|
185 |
-
compatibility with external client code. All requests code should work
|
186 |
-
out of the box with externally provided instances of ``CookieJar``, e.g.
|
187 |
-
``LWPCookieJar`` and ``FileCookieJar``.
|
188 |
-
|
189 |
-
Unlike a regular CookieJar, this class is pickleable.
|
190 |
-
|
191 |
-
.. warning:: dictionary operations that are normally O(1) may be O(n).
|
192 |
-
"""
|
193 |
-
|
194 |
-
def get(self, name, default=None, domain=None, path=None):
|
195 |
-
"""Dict-like get() that also supports optional domain and path args in
|
196 |
-
order to resolve naming collisions from using one cookie jar over
|
197 |
-
multiple domains.
|
198 |
-
|
199 |
-
.. warning:: operation is O(n), not O(1).
|
200 |
-
"""
|
201 |
-
try:
|
202 |
-
return self._find_no_duplicates(name, domain, path)
|
203 |
-
except KeyError:
|
204 |
-
return default
|
205 |
-
|
206 |
-
def set(self, name, value, **kwargs):
|
207 |
-
"""Dict-like set() that also supports optional domain and path args in
|
208 |
-
order to resolve naming collisions from using one cookie jar over
|
209 |
-
multiple domains.
|
210 |
-
"""
|
211 |
-
# support client code that unsets cookies by assignment of a None value:
|
212 |
-
if value is None:
|
213 |
-
remove_cookie_by_name(
|
214 |
-
self, name, domain=kwargs.get("domain"), path=kwargs.get("path")
|
215 |
-
)
|
216 |
-
return
|
217 |
-
|
218 |
-
if isinstance(value, Morsel):
|
219 |
-
c = morsel_to_cookie(value)
|
220 |
-
else:
|
221 |
-
c = create_cookie(name, value, **kwargs)
|
222 |
-
self.set_cookie(c)
|
223 |
-
return c
|
224 |
-
|
225 |
-
def iterkeys(self):
|
226 |
-
"""Dict-like iterkeys() that returns an iterator of names of cookies
|
227 |
-
from the jar.
|
228 |
-
|
229 |
-
.. seealso:: itervalues() and iteritems().
|
230 |
-
"""
|
231 |
-
for cookie in iter(self):
|
232 |
-
yield cookie.name
|
233 |
-
|
234 |
-
def keys(self):
|
235 |
-
"""Dict-like keys() that returns a list of names of cookies from the
|
236 |
-
jar.
|
237 |
-
|
238 |
-
.. seealso:: values() and items().
|
239 |
-
"""
|
240 |
-
return list(self.iterkeys())
|
241 |
-
|
242 |
-
def itervalues(self):
|
243 |
-
"""Dict-like itervalues() that returns an iterator of values of cookies
|
244 |
-
from the jar.
|
245 |
-
|
246 |
-
.. seealso:: iterkeys() and iteritems().
|
247 |
-
"""
|
248 |
-
for cookie in iter(self):
|
249 |
-
yield cookie.value
|
250 |
-
|
251 |
-
def values(self):
|
252 |
-
"""Dict-like values() that returns a list of values of cookies from the
|
253 |
-
jar.
|
254 |
-
|
255 |
-
.. seealso:: keys() and items().
|
256 |
-
"""
|
257 |
-
return list(self.itervalues())
|
258 |
-
|
259 |
-
def iteritems(self):
|
260 |
-
"""Dict-like iteritems() that returns an iterator of name-value tuples
|
261 |
-
from the jar.
|
262 |
-
|
263 |
-
.. seealso:: iterkeys() and itervalues().
|
264 |
-
"""
|
265 |
-
for cookie in iter(self):
|
266 |
-
yield cookie.name, cookie.value
|
267 |
-
|
268 |
-
def items(self):
|
269 |
-
"""Dict-like items() that returns a list of name-value tuples from the
|
270 |
-
jar. Allows client-code to call ``dict(RequestsCookieJar)`` and get a
|
271 |
-
vanilla python dict of key value pairs.
|
272 |
-
|
273 |
-
.. seealso:: keys() and values().
|
274 |
-
"""
|
275 |
-
return list(self.iteritems())
|
276 |
-
|
277 |
-
def list_domains(self):
|
278 |
-
"""Utility method to list all the domains in the jar."""
|
279 |
-
domains = []
|
280 |
-
for cookie in iter(self):
|
281 |
-
if cookie.domain not in domains:
|
282 |
-
domains.append(cookie.domain)
|
283 |
-
return domains
|
284 |
-
|
285 |
-
def list_paths(self):
|
286 |
-
"""Utility method to list all the paths in the jar."""
|
287 |
-
paths = []
|
288 |
-
for cookie in iter(self):
|
289 |
-
if cookie.path not in paths:
|
290 |
-
paths.append(cookie.path)
|
291 |
-
return paths
|
292 |
-
|
293 |
-
def multiple_domains(self):
|
294 |
-
"""Returns True if there are multiple domains in the jar.
|
295 |
-
Returns False otherwise.
|
296 |
-
|
297 |
-
:rtype: bool
|
298 |
-
"""
|
299 |
-
domains = []
|
300 |
-
for cookie in iter(self):
|
301 |
-
if cookie.domain is not None and cookie.domain in domains:
|
302 |
-
return True
|
303 |
-
domains.append(cookie.domain)
|
304 |
-
return False # there is only one domain in jar
|
305 |
-
|
306 |
-
def get_dict(self, domain=None, path=None):
|
307 |
-
"""Takes as an argument an optional domain and path and returns a plain
|
308 |
-
old Python dict of name-value pairs of cookies that meet the
|
309 |
-
requirements.
|
310 |
-
|
311 |
-
:rtype: dict
|
312 |
-
"""
|
313 |
-
dictionary = {}
|
314 |
-
for cookie in iter(self):
|
315 |
-
if (domain is None or cookie.domain == domain) and (
|
316 |
-
path is None or cookie.path == path
|
317 |
-
):
|
318 |
-
dictionary[cookie.name] = cookie.value
|
319 |
-
return dictionary
|
320 |
-
|
321 |
-
def __contains__(self, name):
|
322 |
-
try:
|
323 |
-
return super().__contains__(name)
|
324 |
-
except CookieConflictError:
|
325 |
-
return True
|
326 |
-
|
327 |
-
def __getitem__(self, name):
|
328 |
-
"""Dict-like __getitem__() for compatibility with client code. Throws
|
329 |
-
exception if there are more than one cookie with name. In that case,
|
330 |
-
use the more explicit get() method instead.
|
331 |
-
|
332 |
-
.. warning:: operation is O(n), not O(1).
|
333 |
-
"""
|
334 |
-
return self._find_no_duplicates(name)
|
335 |
-
|
336 |
-
def __setitem__(self, name, value):
|
337 |
-
"""Dict-like __setitem__ for compatibility with client code. Throws
|
338 |
-
exception if there is already a cookie of that name in the jar. In that
|
339 |
-
case, use the more explicit set() method instead.
|
340 |
-
"""
|
341 |
-
self.set(name, value)
|
342 |
-
|
343 |
-
def __delitem__(self, name):
|
344 |
-
"""Deletes a cookie given a name. Wraps ``cookielib.CookieJar``'s
|
345 |
-
``remove_cookie_by_name()``.
|
346 |
-
"""
|
347 |
-
remove_cookie_by_name(self, name)
|
348 |
-
|
349 |
-
def set_cookie(self, cookie, *args, **kwargs):
|
350 |
-
if (
|
351 |
-
hasattr(cookie.value, "startswith")
|
352 |
-
and cookie.value.startswith('"')
|
353 |
-
and cookie.value.endswith('"')
|
354 |
-
):
|
355 |
-
cookie.value = cookie.value.replace('\\"', "")
|
356 |
-
return super().set_cookie(cookie, *args, **kwargs)
|
357 |
-
|
358 |
-
def update(self, other):
|
359 |
-
"""Updates this jar with cookies from another CookieJar or dict-like"""
|
360 |
-
if isinstance(other, cookielib.CookieJar):
|
361 |
-
for cookie in other:
|
362 |
-
self.set_cookie(copy.copy(cookie))
|
363 |
-
else:
|
364 |
-
super().update(other)
|
365 |
-
|
366 |
-
def _find(self, name, domain=None, path=None):
|
367 |
-
"""Requests uses this method internally to get cookie values.
|
368 |
-
|
369 |
-
If there are conflicting cookies, _find arbitrarily chooses one.
|
370 |
-
See _find_no_duplicates if you want an exception thrown if there are
|
371 |
-
conflicting cookies.
|
372 |
-
|
373 |
-
:param name: a string containing name of cookie
|
374 |
-
:param domain: (optional) string containing domain of cookie
|
375 |
-
:param path: (optional) string containing path of cookie
|
376 |
-
:return: cookie.value
|
377 |
-
"""
|
378 |
-
for cookie in iter(self):
|
379 |
-
if cookie.name == name:
|
380 |
-
if domain is None or cookie.domain == domain:
|
381 |
-
if path is None or cookie.path == path:
|
382 |
-
return cookie.value
|
383 |
-
|
384 |
-
raise KeyError(f"name={name!r}, domain={domain!r}, path={path!r}")
|
385 |
-
|
386 |
-
def _find_no_duplicates(self, name, domain=None, path=None):
|
387 |
-
"""Both ``__get_item__`` and ``get`` call this function: it's never
|
388 |
-
used elsewhere in Requests.
|
389 |
-
|
390 |
-
:param name: a string containing name of cookie
|
391 |
-
:param domain: (optional) string containing domain of cookie
|
392 |
-
:param path: (optional) string containing path of cookie
|
393 |
-
:raises KeyError: if cookie is not found
|
394 |
-
:raises CookieConflictError: if there are multiple cookies
|
395 |
-
that match name and optionally domain and path
|
396 |
-
:return: cookie.value
|
397 |
-
"""
|
398 |
-
toReturn = None
|
399 |
-
for cookie in iter(self):
|
400 |
-
if cookie.name == name:
|
401 |
-
if domain is None or cookie.domain == domain:
|
402 |
-
if path is None or cookie.path == path:
|
403 |
-
if toReturn is not None:
|
404 |
-
# if there are multiple cookies that meet passed in criteria
|
405 |
-
raise CookieConflictError(
|
406 |
-
f"There are multiple cookies with name, {name!r}"
|
407 |
-
)
|
408 |
-
# we will eventually return this as long as no cookie conflict
|
409 |
-
toReturn = cookie.value
|
410 |
-
|
411 |
-
if toReturn:
|
412 |
-
return toReturn
|
413 |
-
raise KeyError(f"name={name!r}, domain={domain!r}, path={path!r}")
|
414 |
-
|
415 |
-
def __getstate__(self):
|
416 |
-
"""Unlike a normal CookieJar, this class is pickleable."""
|
417 |
-
state = self.__dict__.copy()
|
418 |
-
# remove the unpickleable RLock object
|
419 |
-
state.pop("_cookies_lock")
|
420 |
-
return state
|
421 |
-
|
422 |
-
def __setstate__(self, state):
|
423 |
-
"""Unlike a normal CookieJar, this class is pickleable."""
|
424 |
-
self.__dict__.update(state)
|
425 |
-
if "_cookies_lock" not in self.__dict__:
|
426 |
-
self._cookies_lock = threading.RLock()
|
427 |
-
|
428 |
-
def copy(self):
|
429 |
-
"""Return a copy of this RequestsCookieJar."""
|
430 |
-
new_cj = RequestsCookieJar()
|
431 |
-
new_cj.set_policy(self.get_policy())
|
432 |
-
new_cj.update(self)
|
433 |
-
return new_cj
|
434 |
-
|
435 |
-
def get_policy(self):
|
436 |
-
"""Return the CookiePolicy instance used."""
|
437 |
-
return self._policy
|
438 |
-
|
439 |
-
|
440 |
-
def _copy_cookie_jar(jar):
|
441 |
-
if jar is None:
|
442 |
-
return None
|
443 |
-
|
444 |
-
if hasattr(jar, "copy"):
|
445 |
-
# We're dealing with an instance of RequestsCookieJar
|
446 |
-
return jar.copy()
|
447 |
-
# We're dealing with a generic CookieJar instance
|
448 |
-
new_jar = copy.copy(jar)
|
449 |
-
new_jar.clear()
|
450 |
-
for cookie in jar:
|
451 |
-
new_jar.set_cookie(copy.copy(cookie))
|
452 |
-
return new_jar
|
453 |
-
|
454 |
-
|
455 |
-
def create_cookie(name, value, **kwargs):
|
456 |
-
"""Make a cookie from underspecified parameters.
|
457 |
-
|
458 |
-
By default, the pair of `name` and `value` will be set for the domain ''
|
459 |
-
and sent on every request (this is sometimes called a "supercookie").
|
460 |
-
"""
|
461 |
-
result = {
|
462 |
-
"version": 0,
|
463 |
-
"name": name,
|
464 |
-
"value": value,
|
465 |
-
"port": None,
|
466 |
-
"domain": "",
|
467 |
-
"path": "/",
|
468 |
-
"secure": False,
|
469 |
-
"expires": None,
|
470 |
-
"discard": True,
|
471 |
-
"comment": None,
|
472 |
-
"comment_url": None,
|
473 |
-
"rest": {"HttpOnly": None},
|
474 |
-
"rfc2109": False,
|
475 |
-
}
|
476 |
-
|
477 |
-
badargs = set(kwargs) - set(result)
|
478 |
-
if badargs:
|
479 |
-
raise TypeError(
|
480 |
-
f"create_cookie() got unexpected keyword arguments: {list(badargs)}"
|
481 |
-
)
|
482 |
-
|
483 |
-
result.update(kwargs)
|
484 |
-
result["port_specified"] = bool(result["port"])
|
485 |
-
result["domain_specified"] = bool(result["domain"])
|
486 |
-
result["domain_initial_dot"] = result["domain"].startswith(".")
|
487 |
-
result["path_specified"] = bool(result["path"])
|
488 |
-
|
489 |
-
return cookielib.Cookie(**result)
|
490 |
-
|
491 |
-
|
492 |
-
def morsel_to_cookie(morsel):
|
493 |
-
"""Convert a Morsel object into a Cookie containing the one k/v pair."""
|
494 |
-
|
495 |
-
expires = None
|
496 |
-
if morsel["max-age"]:
|
497 |
-
try:
|
498 |
-
expires = int(time.time() + int(morsel["max-age"]))
|
499 |
-
except ValueError:
|
500 |
-
raise TypeError(f"max-age: {morsel['max-age']} must be integer")
|
501 |
-
elif morsel["expires"]:
|
502 |
-
time_template = "%a, %d-%b-%Y %H:%M:%S GMT"
|
503 |
-
expires = calendar.timegm(time.strptime(morsel["expires"], time_template))
|
504 |
-
return create_cookie(
|
505 |
-
comment=morsel["comment"],
|
506 |
-
comment_url=bool(morsel["comment"]),
|
507 |
-
discard=False,
|
508 |
-
domain=morsel["domain"],
|
509 |
-
expires=expires,
|
510 |
-
name=morsel.key,
|
511 |
-
path=morsel["path"],
|
512 |
-
port=None,
|
513 |
-
rest={"HttpOnly": morsel["httponly"]},
|
514 |
-
rfc2109=False,
|
515 |
-
secure=bool(morsel["secure"]),
|
516 |
-
value=morsel.value,
|
517 |
-
version=morsel["version"] or 0,
|
518 |
-
)
|
519 |
-
|
520 |
-
|
521 |
-
def cookiejar_from_dict(cookie_dict, cookiejar=None, overwrite=True):
|
522 |
-
"""Returns a CookieJar from a key/value dictionary.
|
523 |
-
|
524 |
-
:param cookie_dict: Dict of key/values to insert into CookieJar.
|
525 |
-
:param cookiejar: (optional) A cookiejar to add the cookies to.
|
526 |
-
:param overwrite: (optional) If False, will not replace cookies
|
527 |
-
already in the jar with new ones.
|
528 |
-
:rtype: CookieJar
|
529 |
-
"""
|
530 |
-
if cookiejar is None:
|
531 |
-
cookiejar = RequestsCookieJar()
|
532 |
-
|
533 |
-
if cookie_dict is not None:
|
534 |
-
names_from_jar = [cookie.name for cookie in cookiejar]
|
535 |
-
for name in cookie_dict:
|
536 |
-
if overwrite or (name not in names_from_jar):
|
537 |
-
cookiejar.set_cookie(create_cookie(name, cookie_dict[name]))
|
538 |
-
|
539 |
-
return cookiejar
|
540 |
-
|
541 |
-
|
542 |
-
def merge_cookies(cookiejar, cookies):
|
543 |
-
"""Add cookies to cookiejar and returns a merged CookieJar.
|
544 |
-
|
545 |
-
:param cookiejar: CookieJar object to add the cookies to.
|
546 |
-
:param cookies: Dictionary or CookieJar object to be added.
|
547 |
-
:rtype: CookieJar
|
548 |
-
"""
|
549 |
-
if not isinstance(cookiejar, cookielib.CookieJar):
|
550 |
-
raise ValueError("You can only merge into CookieJar")
|
551 |
-
|
552 |
-
if isinstance(cookies, dict):
|
553 |
-
cookiejar = cookiejar_from_dict(cookies, cookiejar=cookiejar, overwrite=False)
|
554 |
-
elif isinstance(cookies, cookielib.CookieJar):
|
555 |
-
try:
|
556 |
-
cookiejar.update(cookies)
|
557 |
-
except AttributeError:
|
558 |
-
for cookie_in_jar in cookies:
|
559 |
-
cookiejar.set_cookie(cookie_in_jar)
|
560 |
-
|
561 |
-
return cookiejar
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Ataturk-Chatbot/HuggingFaceChat/venv/lib/python3.11/site-packages/setuptools/wheel.py
DELETED
@@ -1,222 +0,0 @@
|
|
1 |
-
"""Wheels support."""
|
2 |
-
|
3 |
-
import email
|
4 |
-
import itertools
|
5 |
-
import os
|
6 |
-
import posixpath
|
7 |
-
import re
|
8 |
-
import zipfile
|
9 |
-
import contextlib
|
10 |
-
|
11 |
-
from distutils.util import get_platform
|
12 |
-
|
13 |
-
import pkg_resources
|
14 |
-
import setuptools
|
15 |
-
from pkg_resources import parse_version
|
16 |
-
from setuptools.extern.packaging.tags import sys_tags
|
17 |
-
from setuptools.extern.packaging.utils import canonicalize_name
|
18 |
-
from setuptools.command.egg_info import write_requirements
|
19 |
-
from setuptools.archive_util import _unpack_zipfile_obj
|
20 |
-
|
21 |
-
|
22 |
-
WHEEL_NAME = re.compile(
|
23 |
-
r"""^(?P<project_name>.+?)-(?P<version>\d.*?)
|
24 |
-
((-(?P<build>\d.*?))?-(?P<py_version>.+?)-(?P<abi>.+?)-(?P<platform>.+?)
|
25 |
-
)\.whl$""",
|
26 |
-
re.VERBOSE).match
|
27 |
-
|
28 |
-
NAMESPACE_PACKAGE_INIT = \
|
29 |
-
"__import__('pkg_resources').declare_namespace(__name__)\n"
|
30 |
-
|
31 |
-
|
32 |
-
def unpack(src_dir, dst_dir):
|
33 |
-
'''Move everything under `src_dir` to `dst_dir`, and delete the former.'''
|
34 |
-
for dirpath, dirnames, filenames in os.walk(src_dir):
|
35 |
-
subdir = os.path.relpath(dirpath, src_dir)
|
36 |
-
for f in filenames:
|
37 |
-
src = os.path.join(dirpath, f)
|
38 |
-
dst = os.path.join(dst_dir, subdir, f)
|
39 |
-
os.renames(src, dst)
|
40 |
-
for n, d in reversed(list(enumerate(dirnames))):
|
41 |
-
src = os.path.join(dirpath, d)
|
42 |
-
dst = os.path.join(dst_dir, subdir, d)
|
43 |
-
if not os.path.exists(dst):
|
44 |
-
# Directory does not exist in destination,
|
45 |
-
# rename it and prune it from os.walk list.
|
46 |
-
os.renames(src, dst)
|
47 |
-
del dirnames[n]
|
48 |
-
# Cleanup.
|
49 |
-
for dirpath, dirnames, filenames in os.walk(src_dir, topdown=True):
|
50 |
-
assert not filenames
|
51 |
-
os.rmdir(dirpath)
|
52 |
-
|
53 |
-
|
54 |
-
@contextlib.contextmanager
|
55 |
-
def disable_info_traces():
|
56 |
-
"""
|
57 |
-
Temporarily disable info traces.
|
58 |
-
"""
|
59 |
-
from distutils import log
|
60 |
-
saved = log.set_threshold(log.WARN)
|
61 |
-
try:
|
62 |
-
yield
|
63 |
-
finally:
|
64 |
-
log.set_threshold(saved)
|
65 |
-
|
66 |
-
|
67 |
-
class Wheel:
|
68 |
-
|
69 |
-
def __init__(self, filename):
|
70 |
-
match = WHEEL_NAME(os.path.basename(filename))
|
71 |
-
if match is None:
|
72 |
-
raise ValueError('invalid wheel name: %r' % filename)
|
73 |
-
self.filename = filename
|
74 |
-
for k, v in match.groupdict().items():
|
75 |
-
setattr(self, k, v)
|
76 |
-
|
77 |
-
def tags(self):
|
78 |
-
'''List tags (py_version, abi, platform) supported by this wheel.'''
|
79 |
-
return itertools.product(
|
80 |
-
self.py_version.split('.'),
|
81 |
-
self.abi.split('.'),
|
82 |
-
self.platform.split('.'),
|
83 |
-
)
|
84 |
-
|
85 |
-
def is_compatible(self):
|
86 |
-
'''Is the wheel is compatible with the current platform?'''
|
87 |
-
supported_tags = set(
|
88 |
-
(t.interpreter, t.abi, t.platform) for t in sys_tags())
|
89 |
-
return next((True for t in self.tags() if t in supported_tags), False)
|
90 |
-
|
91 |
-
def egg_name(self):
|
92 |
-
return pkg_resources.Distribution(
|
93 |
-
project_name=self.project_name, version=self.version,
|
94 |
-
platform=(None if self.platform == 'any' else get_platform()),
|
95 |
-
).egg_name() + '.egg'
|
96 |
-
|
97 |
-
def get_dist_info(self, zf):
|
98 |
-
# find the correct name of the .dist-info dir in the wheel file
|
99 |
-
for member in zf.namelist():
|
100 |
-
dirname = posixpath.dirname(member)
|
101 |
-
if (dirname.endswith('.dist-info') and
|
102 |
-
canonicalize_name(dirname).startswith(
|
103 |
-
canonicalize_name(self.project_name))):
|
104 |
-
return dirname
|
105 |
-
raise ValueError("unsupported wheel format. .dist-info not found")
|
106 |
-
|
107 |
-
def install_as_egg(self, destination_eggdir):
|
108 |
-
'''Install wheel as an egg directory.'''
|
109 |
-
with zipfile.ZipFile(self.filename) as zf:
|
110 |
-
self._install_as_egg(destination_eggdir, zf)
|
111 |
-
|
112 |
-
def _install_as_egg(self, destination_eggdir, zf):
|
113 |
-
dist_basename = '%s-%s' % (self.project_name, self.version)
|
114 |
-
dist_info = self.get_dist_info(zf)
|
115 |
-
dist_data = '%s.data' % dist_basename
|
116 |
-
egg_info = os.path.join(destination_eggdir, 'EGG-INFO')
|
117 |
-
|
118 |
-
self._convert_metadata(zf, destination_eggdir, dist_info, egg_info)
|
119 |
-
self._move_data_entries(destination_eggdir, dist_data)
|
120 |
-
self._fix_namespace_packages(egg_info, destination_eggdir)
|
121 |
-
|
122 |
-
@staticmethod
|
123 |
-
def _convert_metadata(zf, destination_eggdir, dist_info, egg_info):
|
124 |
-
def get_metadata(name):
|
125 |
-
with zf.open(posixpath.join(dist_info, name)) as fp:
|
126 |
-
value = fp.read().decode('utf-8')
|
127 |
-
return email.parser.Parser().parsestr(value)
|
128 |
-
|
129 |
-
wheel_metadata = get_metadata('WHEEL')
|
130 |
-
# Check wheel format version is supported.
|
131 |
-
wheel_version = parse_version(wheel_metadata.get('Wheel-Version'))
|
132 |
-
wheel_v1 = (
|
133 |
-
parse_version('1.0') <= wheel_version < parse_version('2.0dev0')
|
134 |
-
)
|
135 |
-
if not wheel_v1:
|
136 |
-
raise ValueError(
|
137 |
-
'unsupported wheel format version: %s' % wheel_version)
|
138 |
-
# Extract to target directory.
|
139 |
-
_unpack_zipfile_obj(zf, destination_eggdir)
|
140 |
-
# Convert metadata.
|
141 |
-
dist_info = os.path.join(destination_eggdir, dist_info)
|
142 |
-
dist = pkg_resources.Distribution.from_location(
|
143 |
-
destination_eggdir, dist_info,
|
144 |
-
metadata=pkg_resources.PathMetadata(destination_eggdir, dist_info),
|
145 |
-
)
|
146 |
-
|
147 |
-
# Note: Evaluate and strip markers now,
|
148 |
-
# as it's difficult to convert back from the syntax:
|
149 |
-
# foobar; "linux" in sys_platform and extra == 'test'
|
150 |
-
def raw_req(req):
|
151 |
-
req.marker = None
|
152 |
-
return str(req)
|
153 |
-
install_requires = list(map(raw_req, dist.requires()))
|
154 |
-
extras_require = {
|
155 |
-
extra: [
|
156 |
-
req
|
157 |
-
for req in map(raw_req, dist.requires((extra,)))
|
158 |
-
if req not in install_requires
|
159 |
-
]
|
160 |
-
for extra in dist.extras
|
161 |
-
}
|
162 |
-
os.rename(dist_info, egg_info)
|
163 |
-
os.rename(
|
164 |
-
os.path.join(egg_info, 'METADATA'),
|
165 |
-
os.path.join(egg_info, 'PKG-INFO'),
|
166 |
-
)
|
167 |
-
setup_dist = setuptools.Distribution(
|
168 |
-
attrs=dict(
|
169 |
-
install_requires=install_requires,
|
170 |
-
extras_require=extras_require,
|
171 |
-
),
|
172 |
-
)
|
173 |
-
with disable_info_traces():
|
174 |
-
write_requirements(
|
175 |
-
setup_dist.get_command_obj('egg_info'),
|
176 |
-
None,
|
177 |
-
os.path.join(egg_info, 'requires.txt'),
|
178 |
-
)
|
179 |
-
|
180 |
-
@staticmethod
|
181 |
-
def _move_data_entries(destination_eggdir, dist_data):
|
182 |
-
"""Move data entries to their correct location."""
|
183 |
-
dist_data = os.path.join(destination_eggdir, dist_data)
|
184 |
-
dist_data_scripts = os.path.join(dist_data, 'scripts')
|
185 |
-
if os.path.exists(dist_data_scripts):
|
186 |
-
egg_info_scripts = os.path.join(
|
187 |
-
destination_eggdir, 'EGG-INFO', 'scripts')
|
188 |
-
os.mkdir(egg_info_scripts)
|
189 |
-
for entry in os.listdir(dist_data_scripts):
|
190 |
-
# Remove bytecode, as it's not properly handled
|
191 |
-
# during easy_install scripts install phase.
|
192 |
-
if entry.endswith('.pyc'):
|
193 |
-
os.unlink(os.path.join(dist_data_scripts, entry))
|
194 |
-
else:
|
195 |
-
os.rename(
|
196 |
-
os.path.join(dist_data_scripts, entry),
|
197 |
-
os.path.join(egg_info_scripts, entry),
|
198 |
-
)
|
199 |
-
os.rmdir(dist_data_scripts)
|
200 |
-
for subdir in filter(os.path.exists, (
|
201 |
-
os.path.join(dist_data, d)
|
202 |
-
for d in ('data', 'headers', 'purelib', 'platlib')
|
203 |
-
)):
|
204 |
-
unpack(subdir, destination_eggdir)
|
205 |
-
if os.path.exists(dist_data):
|
206 |
-
os.rmdir(dist_data)
|
207 |
-
|
208 |
-
@staticmethod
|
209 |
-
def _fix_namespace_packages(egg_info, destination_eggdir):
|
210 |
-
namespace_packages = os.path.join(
|
211 |
-
egg_info, 'namespace_packages.txt')
|
212 |
-
if os.path.exists(namespace_packages):
|
213 |
-
with open(namespace_packages) as fp:
|
214 |
-
namespace_packages = fp.read().split()
|
215 |
-
for mod in namespace_packages:
|
216 |
-
mod_dir = os.path.join(destination_eggdir, *mod.split('.'))
|
217 |
-
mod_init = os.path.join(mod_dir, '__init__.py')
|
218 |
-
if not os.path.exists(mod_dir):
|
219 |
-
os.mkdir(mod_dir)
|
220 |
-
if not os.path.exists(mod_init):
|
221 |
-
with open(mod_init, 'w') as fp:
|
222 |
-
fp.write(NAMESPACE_PACKAGE_INIT)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Ayya/anime-remove-background/app.py
DELETED
@@ -1,52 +0,0 @@
|
|
1 |
-
import gradio as gr
|
2 |
-
import huggingface_hub
|
3 |
-
import onnxruntime as rt
|
4 |
-
import numpy as np
|
5 |
-
import cv2
|
6 |
-
|
7 |
-
|
8 |
-
def get_mask(img, s=1024):
|
9 |
-
img = (img / 255).astype(np.float32)
|
10 |
-
h, w = h0, w0 = img.shape[:-1]
|
11 |
-
h, w = (s, int(s * w / h)) if h > w else (int(s * h / w), s)
|
12 |
-
ph, pw = s - h, s - w
|
13 |
-
img_input = np.zeros([s, s, 3], dtype=np.float32)
|
14 |
-
img_input[ph // 2:ph // 2 + h, pw // 2:pw // 2 + w] = cv2.resize(img, (w, h))
|
15 |
-
img_input = np.transpose(img_input, (2, 0, 1))
|
16 |
-
img_input = img_input[np.newaxis, :]
|
17 |
-
mask = rmbg_model.run(None, {'img': img_input})[0][0]
|
18 |
-
mask = np.transpose(mask, (1, 2, 0))
|
19 |
-
mask = mask[ph // 2:ph // 2 + h, pw // 2:pw // 2 + w]
|
20 |
-
mask = cv2.resize(mask, (w0, h0))[:, :, np.newaxis]
|
21 |
-
return mask
|
22 |
-
|
23 |
-
|
24 |
-
def rmbg_fn(img):
|
25 |
-
mask = get_mask(img)
|
26 |
-
img = (mask * img + 255 * (1 - mask)).astype(np.uint8)
|
27 |
-
mask = (mask * 255).astype(np.uint8)
|
28 |
-
img = np.concatenate([img, mask], axis=2, dtype=np.uint8)
|
29 |
-
mask = mask.repeat(3, axis=2)
|
30 |
-
return mask, img
|
31 |
-
|
32 |
-
|
33 |
-
if __name__ == "__main__":
|
34 |
-
providers = ['CUDAExecutionProvider', 'CPUExecutionProvider']
|
35 |
-
model_path = huggingface_hub.hf_hub_download("skytnt/anime-seg", "isnetis.onnx")
|
36 |
-
rmbg_model = rt.InferenceSession(model_path, providers=providers)
|
37 |
-
app = gr.Blocks()
|
38 |
-
with app:
|
39 |
-
gr.Markdown("# Anime Remove Background\n\n"
|
40 |
-
"\n\n"
|
41 |
-
"demo for [https://github.com/SkyTNT/anime-segmentation/](https://github.com/SkyTNT/anime-segmentation/)")
|
42 |
-
with gr.Row():
|
43 |
-
with gr.Column():
|
44 |
-
input_img = gr.Image(label="input image")
|
45 |
-
examples_data = [[f"examples/{x:02d}.jpg"] for x in range(1, 4)]
|
46 |
-
examples = gr.Dataset(components=[input_img], samples=examples_data)
|
47 |
-
run_btn = gr.Button(variant="primary")
|
48 |
-
output_mask = gr.Image(label="mask")
|
49 |
-
output_img = gr.Image(label="result", image_mode="RGBA")
|
50 |
-
examples.click(lambda x: x[0], [examples], [input_img])
|
51 |
-
run_btn.click(rmbg_fn, [input_img], [output_mask, output_img])
|
52 |
-
app.launch()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/BIASLab/sars-cov-2-classification-fcgr/src/fcgr.py
DELETED
@@ -1,72 +0,0 @@
|
|
1 |
-
from .cgr import CGR
|
2 |
-
from itertools import product
|
3 |
-
from collections import defaultdict
|
4 |
-
import numpy as np
|
5 |
-
|
6 |
-
class FCGR(CGR):
|
7 |
-
"""Frequency matrix CGR
|
8 |
-
an (2**k x 2**k) 2D representation will be created for a
|
9 |
-
n-long sequence.
|
10 |
-
- k represents the k-mer.
|
11 |
-
- 2**k x 2**k = 4**k the total number of k-mers (sequences of length k)
|
12 |
-
- pixel value correspond to the value of the frequency for each k-mer
|
13 |
-
"""
|
14 |
-
|
15 |
-
def __init__(self, k: int,):
|
16 |
-
super().__init__()
|
17 |
-
self.k = k # k-mer representation
|
18 |
-
self.kmers = list("".join(kmer) for kmer in product("ACGT", repeat=self.k))
|
19 |
-
self.kmer2pixel = self.kmer2pixel_position()
|
20 |
-
|
21 |
-
def __call__(self, sequence: str):
|
22 |
-
"Given a DNA sequence, returns an array with his frequencies in the same order as FCGR"
|
23 |
-
self.count_kmers(sequence)
|
24 |
-
|
25 |
-
# Create an empty array to save the FCGR values
|
26 |
-
array_size = int(2**self.k)
|
27 |
-
freq_matrix = np.zeros((array_size,array_size))
|
28 |
-
|
29 |
-
# Assign frequency to each box in the matrix
|
30 |
-
for kmer, freq in self.freq_kmer.items():
|
31 |
-
pos_x, pos_y = self.kmer2pixel[kmer]
|
32 |
-
freq_matrix[int(pos_x)-1,int(pos_y)-1] = freq
|
33 |
-
return freq_matrix
|
34 |
-
|
35 |
-
def count_kmer(self, kmer):
|
36 |
-
if "N" not in kmer:
|
37 |
-
self.freq_kmer[kmer] += 1
|
38 |
-
|
39 |
-
def count_kmers(self, sequence: str):
|
40 |
-
self.freq_kmer = defaultdict(int)
|
41 |
-
# representativity of kmers
|
42 |
-
last_j = len(sequence) - self.k + 1
|
43 |
-
kmers = (sequence[i:(i+self.k)] for i in range(last_j))
|
44 |
-
# count kmers in a dictionary
|
45 |
-
list(self.count_kmer(kmer) for kmer in kmers)
|
46 |
-
|
47 |
-
def kmer_probabilities(self, sequence: str):
|
48 |
-
self.probabilities = defaultdict(float)
|
49 |
-
N=len(sequence)
|
50 |
-
for key, value in self.freq_kmer.items():
|
51 |
-
self.probabilities[key] = float(value) / (N - self.k + 1)
|
52 |
-
|
53 |
-
def pixel_position(self, kmer: str):
|
54 |
-
"Get pixel position in the FCGR matrix for a k-mer"
|
55 |
-
|
56 |
-
coords = self.encode(kmer)
|
57 |
-
N,x,y = coords.N, coords.x, coords.y
|
58 |
-
|
59 |
-
# Coordinates from [-1,1]² to [1,2**k]²
|
60 |
-
np_coords = np.array([(x + 1)/2, (y + 1)/2]) # move coordinates from [-1,1]² to [0,1]²
|
61 |
-
np_coords *= 2**self.k # rescale coordinates from [0,1]² to [0,2**k]²
|
62 |
-
x,y = np.ceil(np_coords) # round to upper integer
|
63 |
-
|
64 |
-
# Turn coordinates (cx,cy) into pixel (px,py) position
|
65 |
-
# px = 2**k-cy+1, py = cx
|
66 |
-
return 2**self.k-int(y)+1, int(x)
|
67 |
-
|
68 |
-
def kmer2pixel_position(self,):
|
69 |
-
kmer2pixel = dict()
|
70 |
-
for kmer in self.kmers:
|
71 |
-
kmer2pixel[kmer] = self.pixel_position(kmer)
|
72 |
-
return kmer2pixel
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Benson/text-generation/Examples/Blackeye Download.md
DELETED
@@ -1,84 +0,0 @@
|
|
1 |
-
|
2 |
-
<h1>Cómo descargar y usar Blackeye: Una herramienta de phishing en Kali Linux</h1>
|
3 |
-
<p>El phishing es uno de los ciberataques más comunes y eficaces que pueden robar su información personal, como nombres de usuario, contraseñas, números de tarjetas de crédito, datos de cuentas bancarias o incluso su identidad. Los atacantes de phishing usan correos electrónicos o sitios web falsos que parecen provenir de fuentes legítimas, como su banco, redes sociales o gobierno, para engañarlo para que haga clic en un enlace, abra un archivo adjunto o ingrese sus credenciales. </p>
|
4 |
-
<h2>blackeye download</h2><br /><p><b><b>DOWNLOAD</b> ✦✦✦ <a href="https://bltlly.com/2v6JG0">https://bltlly.com/2v6JG0</a></b></p><br /><br />
|
5 |
-
<p>Blackeye es una poderosa herramienta de código abierto que puede ayudarlo a crear páginas de phishing para varios sitios web y plataformas, como Facebook, Instagram, Google, Netflix, PayPal y más. Blackeye es fácil de usar y viene con 38 plantillas que puedes personalizar según tus necesidades. Puedes usar blackeye para probar tu propia conciencia de seguridad, realizar experimentos de hacking ético o aprender más sobre cómo funciona el phishing. </p>
|
6 |
-
<p>En este artículo, le mostraremos cómo descargar e instalar blackeye en Kali Linux, cómo usarlo para crear páginas de phishing y cómo protegerse de los ataques de phishing. También proporcionaremos algunos consejos y precauciones para usar los ojos negros de manera responsable y legal. </p>
|
7 |
-
<h2>Cómo descargar e instalar Blackeye en Kali Linux</h2>
|
8 |
-
<p>Blackeye está disponible en GitHub y puedes descargarlo usando el comando git. Para instalar blackeye en Kali Linux, sigue estos pasos:</p>
|
9 |
-
<ol>
|
10 |
-
<li>Abra su terminal y escriba el siguiente comando para clonar el repositorio de GitHub:<br>
|
11 |
-
<code>git clone https://github.com/An0nUD4Y/blackeye</code></li>
|
12 |
-
<li>Entrar en el directorio de blackeye escribiendo:<br>
|
13 |
-
<código>cd blackeye</code></li>
|
14 |
-
<li>Ejecutar el script escribiendo:<br>
|
15 |
-
<code>bash blackeye.sh</code></li>
|
16 |
-
</ol>
|
17 |
-
<p>El script buscará dependencias e las instalará si es necesario. También generará una URL usando Ngrok, que es un servicio que le permite exponer su servidor local a Internet. Necesitarás esta URL para enviarla a tu objetivo más tarde. </p>
|
18 |
-
<p></p>
|
19 |
-
|
20 |
-
<p>Una vez que haya instalado blackeye, puede usarlo para crear páginas de phishing para diferentes sitios web y plataformas. Para usar blackeye, siga estos pasos:</p>
|
21 |
-
<ol start="4">
|
22 |
-
<li>Elija una plantilla del menú escribiendo el número correspondiente. Por ejemplo, si quieres crear una página de phishing para Instagram, escribe <code>1</code>. <br>
|
23 |
-
<img src="( i )" alt="Menú de ojos negros"></li>
|
24 |
-
<li>Copie el enlace generado que comienza con <code>https://</code> y envíelo a su destino. Puedes usar cualquier método que prefieras, como correo electrónico, mensaje de texto, redes sociales, etc.<br>
|
25 |
-
<img src="( i )" alt="Blackeye link"></li>
|
26 |
-
<li>Monitorea el terminal para cualquier credencial u otra información que tu objetivo ingrese en la página de phishing. Los verás en tu pantalla. <br>
|
27 |
-
<img src="( i )" alt="Credenciales de Blackeye"></li>
|
28 |
-
</ol>
|
29 |
-
<h2>Consejos y precauciones para el uso de Blackeye</h2>
|
30 |
-
|
31 |
-
<p>Blackeye es una herramienta útil que puede ayudarle a crear páginas de phishing para varios sitios web y plataformas. Puede usarlo para probar su propia conciencia de seguridad, realizar experimentos de hacking ético o aprender más sobre cómo funciona el phishing. Sin embargo, también debes ser cuidadoso y responsable al usar blackeye, ya que el phishing es ilegal y poco ético en muchos casos. Siempre debe usar blackeye con el permiso de su objetivo, y no para fines dañinos o maliciosos. </p>
|
32 |
-
<p>Si quieres aprender más sobre phishing y cómo protegerte de él, aquí hay algunos recursos que puedes consultar:</p>
|
33 |
-
<ul>
|
34 |
-
<li><a href="( i )">Phishing.org</a>: Un sitio web que proporciona información y consejos sobre la prevención y el conocimiento de phishing. </li>
|
35 |
-
<li><a href="( i )">PhishTank</a>: Un sitio web basado en la comunidad que permite a los usuarios informar y verificar sitios web de phishing. </li>
|
36 |
-
<li><a href="( i )">Anti-Phishing Working Group (APWG)</a>: Una organización internacional que lucha contra el phishing y el cibercrimen. </li>
|
37 |
-
</ul>
|
38 |
-
<h2>Preguntas frecuentes</h2>
|
39 |
-
<h3>¿Cuáles son algunos tipos comunes de ataques de phishing? </h3>
|
40 |
-
<p>Algunos tipos comunes de ataques de phishing son:</p>
|
41 |
-
<ul>
|
42 |
-
<li><strong>Spear phishing</strong>: Un ataque de phishing dirigido que utiliza información personalizada sobre el objetivo, como su nombre, dirección de correo electrónico o título de trabajo. </li>
|
43 |
-
<li><strong>Caza de ballenas</strong>: Una forma de phishing de lanza que se dirige a individuos de alto perfil, como ejecutivos, celebridades o políticos. </li>
|
44 |
-
<li><strong>Vishing</strong>: Un ataque de phishing que utiliza llamadas de voz en lugar de correos electrónicos o sitios web. </li>
|
45 |
-
<li><strong>Pharming</strong>: Un ataque de phishing que redirige el objetivo a un sitio web falso mediante la manipulación de su configuración de DNS. </li>
|
46 |
-
<li><strong>Clonar phishing</strong>: Un ataque de phishing que replica un correo electrónico o sitio web legítimo con ligeras modificaciones para engañar al objetivo. </li>
|
47 |
-
</ul>
|
48 |
-
<h3>¿Cómo puedo detectar un correo electrónico o sitio web de phishing? </h3>
|
49 |
-
|
50 |
-
<ul>
|
51 |
-
<li>La dirección de correo electrónico del remitente o el nombre de dominio del sitio web está mal escrito, es desconocido o diferente del esperado. </li>
|
52 |
-
<li>El correo electrónico o el sitio web pide información personal o confidencial, como contraseñas, números de tarjetas de crédito o datos de cuentas bancarias. </li>
|
53 |
-
<li>El correo electrónico o sitio web contiene errores gramaticales, errores de ortografía o mal formato. </li>
|
54 |
-
<li>El correo electrónico o sitio web utiliza un lenguaje urgente o amenazante, como "Su cuenta será suspendida" o "Usted ha ganado un premio". </li>
|
55 |
-
<li>El correo electrónico o sitio web contiene enlaces o archivos adjuntos que parecen sospechosos o no coinciden con el contenido. </li>
|
56 |
-
</ul>
|
57 |
-
<h3>¿Qué debo hacer si recibo un correo electrónico de phishing o visito un sitio web de phishing? </h3>
|
58 |
-
<p>Si recibe un correo electrónico de phishing o visita un sitio web de phishing, debería:</p>
|
59 |
-
<ul>
|
60 |
-
<li>No haga clic en ningún enlace ni abra ningún archivo adjunto en el correo electrónico o el sitio web. </li>
|
61 |
-
<li>No introduzca ninguna información personal o confidencial en el correo electrónico o sitio web. </li>
|
62 |
-
<li>Eliminar el correo electrónico o cerrar la pestaña del navegador inmediatamente. </li>
|
63 |
-
<li>Informe el correo electrónico o el sitio web a la fuente legítima de la que afirma ser, como su banco, las redes sociales o el gobierno. </li>
|
64 |
-
<li>Escanea tu dispositivo en busca de malware o virus que podrían haber sido instalados por el correo electrónico o el sitio web. </li>
|
65 |
-
<li>Cambie sus contraseñas para cualquier cuenta que pueda haber sido comprometida por el correo electrónico o el sitio web. </li>
|
66 |
-
</ul>
|
67 |
-
<h3>¿Cuáles son algunas herramientas de seguridad que pueden ayudarme a prevenir ataques de phishing? </h3>
|
68 |
-
<p>Algunas herramientas de seguridad que pueden ayudarte a prevenir ataques de phishing son:</p>
|
69 |
-
<ul <li><strong>Software antivirus</strong>: Un programa que puede detectar y eliminar malware o virus de su dispositivo. </li>
|
70 |
-
<li><strong>Firewall</strong>: Un sistema que puede bloquear el acceso no autorizado a su dispositivo o red. </li>
|
71 |
-
<li><strong>Extensiones de navegador</strong>: Una herramienta que puede mejorar la funcionalidad y la seguridad de su navegador, como el bloqueo de ventanas emergentes, anuncios o scripts maliciosos. </li>
|
72 |
-
|
73 |
-
<li><strong>Autenticación de dos factores</strong>: Un método que puede agregar una capa adicional de seguridad a sus cuentas en línea, requiriendo que ingrese un código o un token que se envía a su teléfono o correo electrónico, además de su contraseña. </li>
|
74 |
-
</ul>
|
75 |
-
<h3>¿Cómo puedo reportar una estafa de phishing o sitio web? </h3>
|
76 |
-
<p>Si se encuentra con una estafa de phishing o sitio web, puede denunciarlo a las siguientes autoridades u organizaciones:</p>
|
77 |
-
<ul>
|
78 |
-
<li><strong>Su agencia local de aplicación de la ley</strong>: Puede ponerse en contacto con su policía local o unidad de cibercrimen y proporcionarles los detalles de la estafa de phishing o sitio web, como la dirección de correo electrónico del remitente, la URL del sitio web o las capturas de pantalla del correo electrónico o sitio web. </li>
|
79 |
-
<li><strong>La Comisión Federal de Comercio (FTC)</strong>: Usted puede presentar una queja con la FTC en línea en <a href="( i )">https:/reportd.frauftc.gov/</a> o llamando al 1-877-FTC-HELP (1-877-382-4357). La FTC puede ayudarlo a recuperarse del robo de identidad y proporcionarle consejos y recursos sobre cómo evitar las estafas de phishing. </li>
|
80 |
-
<li><strong>El Grupo de Trabajo Anti-Phishing (APWG)</strong>: Puede reportar correos electrónicos o sitios web de phishing al APWG en línea en <a href="( i )">https://www.antiphishing.org/n.-phishing/</a>. La APWG es una organización internacional que recopila y analiza datos de phishing y trabaja con la policía, la industria y la academia para luchar contra el phishing y el cibercrimen. </li>
|
81 |
-
</ul>
|
82 |
-
<p>Espero que haya encontrado este artículo útil e informativo. Si tiene alguna pregunta o comentario, no dude en dejar un comentario a continuación. ¡Gracias por leer! </p> 64aa2da5cf<br />
|
83 |
-
<br />
|
84 |
-
<br />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Benson/text-generation/Examples/Como Descargar Llamada De Deber Warzone Mvil Apk.md
DELETED
@@ -1,149 +0,0 @@
|
|
1 |
-
<br />
|
2 |
-
<tabla>
|
3 |
-
<tr>
|
4 |
-
<td>
|
5 |
-
<h1>CarX Street Mod APK última versión 0.8 5: Todo lo que necesita saber</h1>
|
6 |
-
<p>¿Eres un fan de los juegos de carreras? ¿Te encanta conducir coches rápidos y desafiar a otros jugadores en línea? Si es así, entonces deberías echar un vistazo a CarX Street, un nuevo juego de carreras de CarX Technologies. CarX Street es un juego realista de carreras callejeras que te permite personalizar tu coche, participar en carreras online y competir con otros jugadores de todo el mundo. Pero, ¿qué pasa si quieres disfrutar del juego sin limitaciones ni restricciones? ¿Qué pasa si quieres tener dinero ilimitado, desbloquear todos los coches, y eliminar los anuncios del juego? Bueno, hay una manera de hacer eso. Puede descargar CarX Street mod apk última versión 0.8 5 y obtener todos estos beneficios de forma gratuita. En este artículo, le diremos todo lo que necesita saber sobre CarX Street mod apk última versión 0.8 5, incluyendo lo que es, por qué debe descargarlo, cómo descargarlo e instalarlo, cómo jugarlo, y algunos consejos y trucos para ello. También responderemos algunas preguntas frecuentes sobre CarX Street al final del artículo. ¡Así que, empecemos! </p>
|
7 |
-
<h2>¿Qué es CarX Street? </h2>
|
8 |
-
<p>CarX Street es un juego de carreras que fue lanzado en marzo de 2021 por CarX Technologies, una empresa que se especializa en la creación de coches realistas de física y gráficos para los juegos. CarX Street es uno de sus últimos proyectos que tiene como objetivo proporcionar una experiencia de carreras callejeras realista e inmersiva para los jugadores. En CarX Street, puedes:</p>
|
9 |
-
<h2>como descargar llamada de deber warzone móvil apk</h2><br /><p><b><b>Download File</b> ===== <a href="https://bltlly.com/2v6Lzm">https://bltlly.com/2v6Lzm</a></b></p><br /><br />
|
10 |
-
<ul>
|
11 |
-
<li>Elige entre más de 50 coches de diferentes marcas y modelos</li>
|
12 |
-
<li>Personaliza tu coche con varias partes, colores, pegatinas y calcomanías</li>
|
13 |
-
<li>Únete a carreras online con hasta 16 jugadores en diferentes modos y ubicaciones</li>
|
14 |
-
<li>Gana dinero y reputación ganando carreras y completando desafíos</li>
|
15 |
-
<li>Actualizar el rendimiento y la apariencia de su coche con varias partes y opciones de ajuste</li>
|
16 |
-
<li> Disfrutar de la física realista del coche, gráficos, sonidos y efectos</li>
|
17 |
-
</ul>
|
18 |
-
|
19 |
-
<h2>¿Por qué descargar CarX Street Mod APK? </h2>
|
20 |
-
<p>CarX Street mod apk última versión 0.8 5 es una versión modificada del juego original que le da algunas características adicionales y beneficios que no están disponibles en la versión oficial. Al descargar CarX Street mod apk última versión 0.8 5, se puede disfrutar de las siguientes ventajas:</p>
|
21 |
-
<h3>Dinero ilimitado</h3>
|
22 |
-
<p>El dinero es la moneda principal en CarX Street que puedes usar para comprar autos, piezas, mejoras y más. Puedes ganar dinero ganando carreras, completando desafíos y viendo anuncios. Sin embargo, ganar dinero puede ser lento y tedioso, especialmente si desea comprar los mejores coches y piezas en el juego. Es por eso que CarX Street mod apk última versión 0.8 5 le da dinero ilimitado para gastar como desee. Puede comprar cualquier coche que desee, personalizarlo a su gusto, y actualizarlo al máximo sin preocuparse por el costo. También puede omitir ver anuncios y ahorrar tiempo y datos. </p>
|
23 |
-
<h3>Todos los coches desbloqueados</h3>
|
24 |
-
<p>CarX Street tiene más de 50 coches de diferentes marcas y modelos entre los que puedes elegir. Sin embargo, no todos los coches están disponibles desde el principio. Tienes que desbloquearlos ganando puntos de reputación, que son otra moneda en el juego que puedes obtener al ganar carreras y completar desafíos. Desbloquear coches puede ser desafiante y frustrante, especialmente si desea probar diferentes coches y encontrar su favorito. Es por eso que CarX Street mod apk última versión 0.8 5 desbloquea todos los coches para usted desde el principio. Puede acceder a cualquier coche que desee sin tener que desbloquearlo primero. También puedes cambiar de coche tantas veces como quieras y disfrutar de sus diferentes características y estilos. </p>
|
25 |
-
<h3>No hay anuncios</h3>
|
26 |
-
|
27 |
-
<h2>Cómo descargar e instalar CarX Street Mod APK? </h2>
|
28 |
-
<p>Ahora que sabes por qué usted debe descargar CarX Street mod apk última versión 0.8 5, usted puede preguntarse cómo hacerlo. Bueno, no te preocupes, porque tenemos una guía simple y fácil para usted sobre cómo descargar e instalar CarX Street mod apk última versión 0.8 5 en su dispositivo Android. Solo tienes que seguir estos pasos:</p>
|
29 |
-
<ol>
|
30 |
-
<li>Primero, debe habilitar fuentes desconocidas en la configuración del dispositivo. Esto le permitirá instalar aplicaciones desde fuentes distintas de Google Play Store.</li>
|
31 |
-
<li>Siguiente, es necesario descargar CarX Street mod apk última versión 0.8 5 archivo de una fuente confiable en línea. Puede utilizar este enlace para descargar el archivo de forma segura y rápida. </li>
|
32 |
-
<li> Después de descargar el archivo, es necesario ubicarlo en el almacenamiento del dispositivo y toque en él para iniciar el proceso de instalación. </li>
|
33 |
-
<li>Siga las instrucciones en la pantalla y espere a que termine la instalación. </li>
|
34 |
-
<li>Una vez que se realiza la instalación, puede iniciar el juego desde el cajón de la aplicación o la pantalla de inicio y disfrutar de CarX Street mod apk última versión 0.8 5.</li>
|
35 |
-
</ol>
|
36 |
-
<p>Nota: Si usted tiene la versión original de CarX Street instalado en su dispositivo, es necesario desinstalarlo primero antes de instalar CarX Street mod apk última versión 0.8 5.</p>
|
37 |
-
<h2>¿Cómo se juega CarX Street? </h2>
|
38 |
-
<p>CarX Street es un juego de carreras divertido y emocionante que es fácil de jugar pero difícil de dominar. Si eres nuevo en el juego o quieres algunos consejos sobre cómo jugarlo mejor, aquí hay algunos pasos básicos sobre cómo jugar CarX Street:</p>
|
39 |
-
<h3>Elige tu coche</h3>
|
40 |
-
<p>Lo primero que tienes que hacer es elegir tu coche desde el garaje. Puede acceder al garaje tocando el icono del coche en la esquina inferior izquierda de la pantalla. En el garaje, se puede ver todos los coches que están disponibles para su uso. También puede ver sus estadísticas, como velocidad, aceleración, manejo y deriva. Puede deslizar hacia la izquierda o hacia la derecha para navegar por diferentes coches y toque en uno para seleccionarlo. </p>
|
41 |
-
<p></p>
|
42 |
-
|
43 |
-
<h3>Carrera contra otros jugadores</h3>
|
44 |
-
<p>Lo siguiente que tienes que hacer es unirte a una carrera online y competir con otros jugadores. Puedes acceder al menú de carreras online pulsando en el icono de carrera en el centro inferior de la pantalla. En el menú de carreras online, puedes ver diferentes modos y ubicaciones entre los que puedes elegir. También puedes ver el número de jugadores y las recompensas para cada modo y ubicación. Puede deslizar hacia la izquierda o hacia la derecha para navegar por diferentes modos y ubicaciones y tocar en uno para unirse a él. </p>
|
45 |
-
<p>Algunos de los modos y ubicaciones que puedes elegir son:</p>
|
46 |
-
<ul>
|
47 |
-
<li>Sprint: Una carrera corta y rápida donde tienes que llegar primero a la línea de meta. </li>
|
48 |
-
<li>Circuito: Una carrera más larga y desafiante donde tienes que completar un número de vueltas. </li>
|
49 |
-
<li>Deriva: Una carrera en la que tienes que derivar tanto como sea posible y ganar puntos. </li>
|
50 |
-
<li>Ciudad: Una carrera en un entorno urbano con tráfico y obstáculos. </li>
|
51 |
-
<li>Carretera: Una carrera en una carretera con alta velocidad y adelantamiento. </li>
|
52 |
-
<li>Desierto: Una carrera en un desierto con arena y polvo. </li>
|
53 |
-
</ul>
|
54 |
-
<p>Una vez que se une a un modo y ubicación, se le corresponde con hasta 15 otros jugadores que se han unido al mismo modo y ubicación. A continuación, entrará en un vestíbulo donde se puede ver los coches y las estadísticas de sus oponentes. También puede chatear con ellos utilizando el icono de chat en la esquina superior derecha de la pantalla. También puede utilizar el icono de listo en la esquina inferior derecha de la pantalla para indicar que está listo para iniciar la carrera. Una vez que todos los jugadores estén listos, la carrera comenzará. </p>
|
55 |
-
|
56 |
-
<p>Tu objetivo es llegar primero a la línea de meta o ganar más puntos que tus oponentes, dependiendo del modo. Verás tu posición, número de vuelta, tiempo, velocidad y puntos en el centro superior de la pantalla. También verás un mini-mapa en la esquina inferior derecha de la pantalla que muestra tu ubicación y la ubicación de tus oponentes. También verás un temporizador de cuenta atrás en el centro inferior de la pantalla que muestra cuánto tiempo queda para la carrera. </p>
|
57 |
-
<p>Al final de la carrera, verá la pantalla de resultados que muestra su rango, tiempo, velocidad, puntos, dinero y reputación. También verás el rango, tiempo, velocidad, puntos, dinero y reputación de tus oponentes. También verás un icono de compartir en la esquina superior derecha de la pantalla que te permite compartir tus resultados en las redes sociales. También verás un icono de repetición en la esquina superior izquierda de la pantalla que te permite ver una repetición de la carrera. También verás un siguiente icono en la esquina inferior derecha de la pantalla que te permite proceder a la siguiente carrera o volver al menú de carreras online. </p>
|
58 |
-
<h3>Mejora tu coche</h3>
|
59 |
-
<p>Otra cosa que puede hacer en CarX Street es actualizar su coche con varias partes y opciones de ajuste. Puede acceder al menú de actualización pulsando en el icono de actualización en el centro inferior de la pantalla. En el menú de actualización, puede ver diferentes categorías de piezas y opciones de ajuste, como motor, transmisión, suspensión, frenos, neumáticos, carrocería, aerodinámica y electrónica. Puede tocar en cada categoría para ver las partes disponibles y opciones de ajuste y sus efectos en las estadísticas de su coche. También puede ver el costo de cada parte y la opción de ajuste en puntos de dinero y reputación. Puede deslizar hacia la izquierda o hacia la derecha para navegar a través de diferentes partes y opciones de ajuste y toque en uno para comprarlo y aplicarlo a su coche. </p>
|
60 |
-
<p>Algunas de las partes y opciones de ajuste que puede comprar y aplicar a su coche son:</p>
|
61 |
-
<tabla>
|
62 |
-
<tr>
|
63 |
-
<th>Categoría</th>
|
64 |
-
<th>Parte/Opción de ajuste</th>
|
65 |
-
<th>Efecto</th>
|
66 |
-
</tr>
|
67 |
-
<tr>
|
68 |
-
|
69 |
-
<td>Filtro de aire</td>
|
70 |
-
<td>Aumenta la aceleración</td>
|
71 |
-
</tr>
|
72 |
-
<tr>
|
73 |
-
<td>Motor</td>
|
74 |
-
<td>Turbocompresor</td>
|
75 |
-
<td>Aumenta la velocidad y la aceleración</td>
|
76 |
-
</tr>
|
77 |
-
<tr>
|
78 |
-
<td>Transmisión</td>
|
79 |
-
<td>Caja de cambios</td>
|
80 |
-
<td>Aumenta la velocidad y la aceleración</td>
|
81 |
-
</tr>
|
82 |
-
<tr>
|
83 |
-
<td>Transmisión</td>
|
84 |
-
<td>Diferencial</td>
|
85 |
-
<td>Aumenta el manejo y la deriva</td>
|
86 |
-
</tr>
|
87 |
-
<tr>
|
88 |
-
<td>Suspensión</td>
|
89 |
-
<td>Muelles</td>
|
90 |
-
<td>Aumenta el manejo y la deriva</td>
|
91 |
-
</tr>
|
92 |
-
<tr>
|
93 |
-
<td>Suspensión</td>
|
94 |
-
<td>Amortiguadores</td>
|
95 |
-
<td>Aumenta el manejo y la deriva</td>
|
96 |
-
</tr>
|
97 |
-
<tr>
|
98 |
-
<td>Frenos</td>
|
99 |
-
<td>Pastillas de freno</td>
|
100 |
-
<td>Aumenta la potencia de frenado y la estabilidad</td>
|
101 |
-
</tr>
|
102 |
-
<tr>
|
103 |
-
<td>Frenos</td ><td>Discos de freno</td ><td>Aumenta la potencia y estabilidad de frenado</td ></tr ><tr ><td>Neumáticos ></td><td>Tipo de neumático ></td><td>Afecta la velocidad, aceleración, manejo, y deriva dependiendo de la superficie de la carretera ></td></tr ><tr ><td>Neumáticos ></td><td><td>Presión de los neumáticos ></td><td>Afecta la velocidad, aceleración, manejo, y deriva según la preferencia ></td></tr ><tr ><td>Cuerpo ></td><td><td>Parachoques ></td><td>Afecta la apariencia y la aerodinámica ></td></tr ><tr ><td>Cuerpo >/td><td>Capó >/td><td>Afecta la apariencia y la aerodinámica >>><td><>>>>>Aerodinámica velocidad, aceleración, manipulación, y deriva mediante el cambio de la fuerza descendente ></td></tr ><tr ><td>Aerodinámica ></td><td>Faldones laterales ></td><td>Afecta la apariencia y la aerodinámica ></td></tr ><tr ><td>Electrónica ></td><td>Sistema de Nitro></td>>><td>>>Aumenta la velocidad y la aceleración inyectando temporalmente el óxido nitro motor</td></tr>
|
104 |
-
<tr>
|
105 |
-
<td>Electrónica</td>
|
106 |
-
<td>Sistema ABS</td>
|
107 |
-
<td>Aumenta la potencia de frenado y la estabilidad al evitar que las ruedas se bloqueen</td>
|
108 |
-
</tr>
|
109 |
-
<tr>
|
110 |
-
<td>Electrónica</td>
|
111 |
-
<td>Sistema ESP</td>
|
112 |
-
<td>Aumenta el manejo y la estabilidad mediante la corrección de la dirección del coche y la prevención de derrapes</td>
|
113 |
-
</tr>
|
114 |
-
</tabla>
|
115 |
-
|
116 |
-
<h2>Consejos y trucos para CarX Street</h2>
|
117 |
-
<p>CarX Street es un juego que requiere habilidad, estrategia y práctica para dominar. Si quieres mejorar tu rendimiento y divertirte más en el juego, aquí tienes algunos consejos y trucos que puedes usar:</p>
|
118 |
-
<ul>
|
119 |
-
<li>Elija el coche adecuado para el modo y la ubicación adecuados. Diferentes coches tienen diferentes fortalezas y debilidades, y algunos coches pueden funcionar mejor en ciertos modos y lugares que otros. Por ejemplo, un coche con alta velocidad y aceleración puede ser bueno para carreras de sprint y carretera, mientras que un coche con alta manipulación y deriva puede ser bueno para carreras de circuito y ciudad. Puede comprobar las estadísticas de cada coche en el garaje y elegir el que se adapte a su preferencia y estrategia. </li>
|
120 |
-
<li>Personalizar su coche para adaptarse a su estilo y necesidades. Puede personalizar su coche con varias partes, colores, pegatinas y calcomanías para que se vea único y fresco. También puede personalizar su coche con varias partes y opciones de ajuste para mejorar su rendimiento y adaptarse a su estilo de conducción. Por ejemplo, puede aumentar la velocidad y la aceleración de su automóvil con piezas de motor y transmisión, o aumentar el manejo y la deriva de su automóvil con piezas de suspensión y aerodinámica. También puede ajustar la presión de los neumáticos de su automóvil para afectar su agarre y tracción. </li>
|
121 |
-
<li>Usa nitro sabiamente. Nitro es una característica de gran alcance que puede aumentar la velocidad y la aceleración de su coche temporalmente mediante la inyección de óxido nitroso en el motor. Puede utilizar nitro pulsando en el icono de nitro en el lado derecho de la pantalla. Sin embargo, el nitro no es ilimitado, y tienes que rellenarlo a la deriva o adelantando a otros coches. Puedes ver tu nivel de nitro en el centro inferior de la pantalla. Debes usar nitro estratégicamente, como cuando necesites alcanzar a otros jugadores, adelantarlos o terminar la carrera más rápido. </li>
|
122 |
-
|
123 |
-
<li>Cuidado con el tráfico y los obstáculos. CarX Street es un juego de carreras de calle realista que cuenta con el tráfico y los obstáculos que pueden afectar a su carrera. El tráfico incluye otros coches, autobuses, camiones, motocicletas y peatones que se mueven al azar en la carretera. Los obstáculos incluyen postes, señales, barreras, conos, contenedores de basura y más que se colocan en la carretera o en los lados. El tráfico y los obstáculos pueden ralentizarte, dañar tu auto o hacerte chocar. Usted debe tener cuidado con el tráfico y los obstáculos, tales como mediante el uso del mini-mapa para ver su ubicación, evitarlos cuando sea posible, o usarlos para su ventaja. </li>
|
124 |
-
</ul>
|
125 |
-
<h2>Conclusión</h2>
|
126 |
-
<p>CarX Street es un divertido y emocionante juego de carreras que te permite personalizar tu coche, unirte a carreras online y competir con otros jugadores de todo el mundo. Sin embargo, si quieres disfrutar del juego sin limitaciones ni restricciones, usted debe descargar CarX Street mod apk última versión 0.8 5. CarX Street mod apk última versión 0.8 5 le da dinero ilimitado, desbloquea todos los coches, y elimina los anuncios del juego de forma gratuita. Puede descargar CarX Street mod apk última versión 0.8 5 desde este enlace y siga nuestra guía sobre cómo instalarlo en su dispositivo Android. </p>
|
127 |
-
<p>Esperamos que este artículo le ha ayudado a aprender todo lo que necesita saber acerca de CarX Street mod apk última versión 0.8 5. Si usted tiene alguna pregunta o comentario acerca de CarX Street o CarX Street mod apk última versión 0.8 5 , por favor no dude en dejar un comentario a continuación o póngase en contacto con nosotros a través de nuestro sitio web. Nos encantaría saber de usted y ayudarle con cualquier problema o consulta que pueda tener. ¡Gracias por leer y correr feliz! </p>
|
128 |
-
<h2>Preguntas frecuentes</h2>
|
129 |
-
<p>Aquí hay algunas preguntas frecuentes sobre CarX Street y CarX Street mod apk última versión 0.8 5 que usted puede encontrar útil:</p>
|
130 |
-
<ol>
|
131 |
-
<li>Q: Es CarX Street mod apk última versión 0.8 5 seguro de descargar y usar? </li>
|
132 |
-
|
133 |
-
<li>Q: Es CarX Street mod apk última versión 0.8 5 compatible con mi dispositivo? </li>
|
134 |
-
<li>A: CarX Street mod apk última versión 0.8 5 es compatible con la mayoría de los dispositivos Android que se ejecutan en Android 6.0 o superior. Sin embargo, algunos dispositivos pueden no ser compatibles con el juego o el mod apk debido a diferentes especificaciones, configuraciones o características. Puede comprobar la compatibilidad de su dispositivo visitando la página de Google Play Store de CarX Street o intentando instalar el archivo mod apk en su dispositivo. Si encuentras algún problema de compatibilidad, puedes intentar actualizar el software del dispositivo, borrar la caché del dispositivo o ponerte en contacto con el desarrollador del juego para obtener ayuda. </li>
|
135 |
-
<li>Q: ¿Cómo puedo actualizar CarX Street mod apk última versión 0.8 5?</li>
|
136 |
-
<li>A: CarX Street mod apk última versión 0.8 5 se basa en la versión original de CarX Street que fue lanzado en marzo de 2021. Desde entonces, el desarrollador del juego puede haber lanzado nuevas actualizaciones para el juego que incluyen nuevas características, mejoras, correcciones de errores y más. Sin embargo, CarX Street mod apk última versión 0.8 5 no puede ser actualizado de forma automática o regular para que coincida con la versión oficial del juego. Por lo tanto, si desea actualizar CarX Street mod apk última versión 0.8 5, usted tiene que descargar e instalar el último archivo apk mod de la misma fuente en línea que se utiliza antes. También puede comprobar este artículo regularmente para cualquier actualización en CarX Street mod apk última versión 0.8 5.</li>
|
137 |
-
<li>Q: ¿Cómo puedo desinstalar CarX Street mod apk última versión 0.8 5?</li>
|
138 |
-
<li>A: Si desea desinstalar CarX Street mod apk última versión 0.8 5 de su dispositivo, puede hacerlo siguiendo estos pasos:</li>
|
139 |
-
<ul>
|
140 |
-
<li>Ir a la configuración del dispositivo y toque en aplicaciones o aplicaciones. </li>
|
141 |
-
<li>Buscar y toque en CarX Street mod apk última versión 0.8 5 de la lista de aplicaciones. </li>
|
142 |
-
<li>Toque en desinstalar y confirme su acción. </li>
|
143 |
-
<li>Espere a que termine el proceso de desinstalación y luego reinicie su dispositivo. </li>
|
144 |
-
</ul>
|
145 |
-
|
146 |
-
<li>A: Sí, se puede jugar CarX Street sin descargar CarX Street mod apk última versión 0.8 5 mediante la descarga de la versión oficial del juego desde Google Play Store o desde el sitio web oficial. Sin embargo, usted no será capaz de disfrutar de los beneficios de CarX Street mod apk última versión 0.8 5, tales como dinero ilimitado, todos los coches desbloqueados, y sin anuncios. </li>
|
147 |
-
</ol></p> 64aa2da5cf<br />
|
148 |
-
<br />
|
149 |
-
<br />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Benson/text-generation/Examples/Cuerda Hroe 3 Mod Apkpure.md
DELETED
@@ -1,91 +0,0 @@
|
|
1 |
-
<br />
|
2 |
-
<h1>Rope Hero 3 Mod Apkpure: Una guía para descargar y jugar el juego de superhéroes</h1>
|
3 |
-
<p>¿Eres un fan de los juegos de superhéroes? ¿Quieres jugar un juego en el que puedes girar por la ciudad con una cuerda, luchar contra los criminales, conducir varios vehículos y usar increíbles habilidades? Si es así, entonces deberías probar Rope Hero 3, un emocionante juego de acción en 3D que te mantendrá entretenido durante horas. Y si quieres hacer el juego aún más divertido y emocionante, usted debe descargar Rope Hero 3 Mod Apkpure, una versión modificada del juego que ofrece dinero ilimitado y gemas. En este artículo, le diremos todo lo que necesita saber sobre Rope Hero 3 Mod Apkpure, incluyendo lo que es, cómo descargarlo, cómo jugarlo, consejos y trucos para ello, y una revisión de la misma. </p>
|
4 |
-
<h2>cuerda héroe 3 mod apkpure</h2><br /><p><b><b>Download File</b> 🆓 <a href="https://bltlly.com/2v6MY1">https://bltlly.com/2v6MY1</a></b></p><br /><br />
|
5 |
-
<h2>¿Qué es Rope Hero 3?</h2>
|
6 |
-
<p>Rope Hero 3 es una secuela de la saga de cuerdas de superhéroes, una serie de juegos donde juegas como un hombre con un gancho que tiene que demostrar a toda la ciudad que él es el verdadero héroe. El juego está desarrollado por Naxeex Action & RPG Games, un estudio especializado en crear juegos llenos de acción con gráficos realistas. </p>
|
7 |
-
<h3>Una secuela de la saga de cuerdas de superhéroes</h3>
|
8 |
-
<p>En Rope Hero 3, continúas la historia de los juegos anteriores, donde tienes que enfrentarte a clones malvados que invadieron la ciudad. Tienes que usar tus nuevas habilidades para expulsar a tus clones de la ciudad, sobrevivir a las peleas épicas y completar todas las tareas. También encontrarás nuevos enemigos, como pandillas, policías, robots, zombies y alienígenas. Tienes que usar tus nuevas habilidades para expulsar a tus clones de la ciudad, sobrevivir a las peleas épicas y completar todas las tareas. También descubrirás nuevas armas, vehículos y súper habilidades que te harán imparable. </p>
|
9 |
-
<h3>Un juego de acción en 3D con un gran mundo abierto</h3>
|
10 |
-
|
11 |
-
<h3>Un juego con un montón de misiones, misiones, enemigos, armas, vehículos y súper habilidades</h3>
|
12 |
-
<p>Rope Hero 3 es un juego con mucho contenido y características que te mantendrán entretenido durante horas. Puedes encontrar misiones y misiones en el mapa o en el mini mapa, y completarlas para ganar dinero, gemas, armas y otras recompensas. También puedes encontrar enemigos en las calles o en los techos de los edificios, y luchar contra ellos con tus armas o súper habilidades. Puedes usar armas, cuchillos, granadas, cohetes, láseres y más para derrotar a tus enemigos. También puedes usar tu súper cuerda para acercar a los enemigos, tirarlos o colgarlos. También puedes usar tus súper habilidades para volar, correr rápido, volverte invisible o desatar explosiones poderosas. El juego tiene mucha variedad y desafío para cada fan de superhéroes. </p>
|
13 |
-
<h2>¿Qué es Rope Hero 3 Mod Apkpure? </h2>
|
14 |
-
<p>Rope Hero 3 Mod Apkpure es una versión modificada del juego que ofrece dinero y gemas ilimitadas. Esto significa que puede comprar cualquier arma, vehículo o mejora de habilidad sin preocuparse por el costo. También puedes desbloquear todas las características y objetos del juego sin completar ninguna misión o tarea. De esta manera, podrás disfrutar del juego con más libertad y diversión. </p>
|
15 |
-
<h3>Una versión modificada del juego que ofrece dinero y gemas ilimitadas</h3>
|
16 |
-
<p>Rope Hero 3 Mod Apkpure es una versión modificada del juego que ofrece dinero y gemas ilimitadas. El dinero y las gemas son las principales monedas del juego que puedes usar para comprar armas, vehículos, habilidades y otros artículos. Normalmente, tienes que ganar dinero y gemas completando misiones, tareas o recompensas diarias. Sin embargo, con Rope Hero 3 Mod Apkpure, tendrás dinero y gemas ilimitadas desde el principio. Esto significa que puedes comprar lo que quieras sin limitaciones o restricciones. </p>
|
17 |
-
<p></p>
|
18 |
-
<h3>Una fuente para descargar el juego gratis y sin ningún tipo de virus o malware</h3>
|
19 |
-
|
20 |
-
<h3>Una forma de disfrutar del juego con más características y diversión</h3>
|
21 |
-
<p>Rope Hero 3 Mod Apkpure es también una manera de disfrutar del juego con más características y diversión. Con Rope Hero 3 Mod Apkpure, tendrás acceso a todas las características y objetos del juego sin tener que desbloquearlos ni pagarlos. También tendrás dinero ilimitado y gemas para comprar lo que quieras o necesites. Usted será capaz de personalizar su héroe con diferentes trajes, máscaras, sombreros, gafas y más. Podrás usar cualquier arma, vehículo o habilidad en el juego sin limitaciones o restricciones. Usted será capaz de explorar la ciudad con más libertad y diversión. </p> <h2>Cómo descargar e instalar Rope Hero 3 Mod Apkpure? </h2>
|
22 |
-
<p>Si desea descargar e instalar Rope Hero 3 Mod Apkpure, puede seguir estos sencillos pasos:</p>
|
23 |
-
<h3>Paso 1: Ir a la página web de Apkpure y buscar Héroe de la cuerda 3</h3>
|
24 |
-
<p>El primer paso es ir al sitio web de Apkpure, que es <a href="">https://apkpure.com/</a>. En la página principal, verás una barra de búsqueda donde puedes escribir el nombre del juego que deseas descargar. En este caso, puede escribir "Rope Hero 3" y pulsar enter. Verá una lista de resultados que coinciden con su consulta de búsqueda. </p>
|
25 |
-
<h3>Paso 2: Elija la versión mod del juego y haga clic en descargar</h3>
|
26 |
-
<p>El segundo paso es elegir la versión mod del juego y hacer clic en descargar. En la lista de resultados, verás diferentes versiones de Rope Hero 3, como la versión original, la versión mod y las versiones antiguas. También puede ver las calificaciones, reseñas y capturas de pantalla de cada versión. Para descargar la versión mod, puedes buscar la que tiene "mod" en su nombre, como "Rope Hero 3 v2.0 mod". También puede comprobar la descripción y características de la versión mod para ver lo que ofrece. Una vez que encuentre la versión mod que desea, puede hacer clic en el botón de descarga junto a él. </p>
|
27 |
-
<h3>Paso 3: Habilitar fuentes desconocidas en el dispositivo e instalar el archivo apk</h3>
|
28 |
-
|
29 |
-
<h3>Paso 4: Iniciar el juego y disfrutar de</h3>
|
30 |
-
<p>El cuarto y último paso es lanzar el juego y disfrutar. Después de instalar el archivo apk, verá un icono de Rope Hero 3 Mod Apkpure en la pantalla del dispositivo. Puede tocar en él y lanzar el juego. Verá una pantalla de carga y luego un menú principal donde puede comenzar a jugar. También notarás que tienes dinero y gemas ilimitadas en el juego. Puedes usarlas para comprar cualquier arma, vehículo o mejora de habilidad que desees. También puedes desbloquear todas las características y objetos del juego sin completar ninguna misión o tarea. Puedes disfrutar jugando Rope Hero 3 Mod Apkpure con más libertad y diversión. </p> <h2>Cómo Jugar Rope Hero 3 Mod Apkpure? </h2>
|
31 |
-
<p>Si has descargado e instalado Rope Hero 3 Mod Apkpure, puedes empezar a jugar y divertirte. Aquí hay algunos consejos básicos sobre cómo jugar el juego:</p>
|
32 |
-
<h3>Explora la ciudad y encuentra tareas y enemigos</h3>
|
33 |
-
<p>El juego se desarrolla en una gran ciudad de mundo abierto que puedes explorar libremente. Puedes moverte por la ciudad con tu súper cuerda, balancearte de edificio en edificio, escalar paredes y saltar obstáculos. También puedes conducir varios vehículos, como coches, bicicletas, camiones e incluso tanques. Puedes usarlos para viajar más rápido, atropellar enemigos o causar caos. La ciudad está llena de tareas y enemigos que puedes encontrar en el mapa o en el mini mapa. Puedes completar tareas para ganar dinero, gemas, armas y otras recompensas. También puedes luchar contra enemigos para ganar puntos de experiencia y aumentar tu nivel. Encontrarás diferentes tipos de enemigos, como pandillas, policías, robots, zombies y alienígenas. Tienes que usar tus armas y súper habilidades para derrotarlos. </p>
|
34 |
-
<h3>Usa tus armas y súper cuerda para luchar y sobrevivir</h3>
|
35 |
-
|
36 |
-
<h3>Robar vehículos y conducirlos</h3>
|
37 |
-
<p>El juego también es un juego de conducción con una gran cantidad de vehículos que se pueden robar y conducir alrededor. Usted puede encontrar vehículos estacionados en las calles o en movimiento en las carreteras. Puede acercarse a cualquier vehículo y presionar un botón para secuestrarlo. A continuación, puede conducir el vehículo con los controles en la pantalla. Puede acelerar, frenar, dirigir, tocar la bocina, disparar o saltar con el vehículo. También puede cambiar entre diferentes vistas de la cámara para ver el vehículo desde diferentes ángulos. Puede conducir varios vehículos, como coches, bicicletas, camiones e incluso tanques. Cada vehículo tiene su propia velocidad, manejo, durabilidad y potencia de fuego. Puedes usar vehículos para viajar más rápido, atropellar enemigos o causar caos. </p>
|
38 |
-
<h3>Mejora tus habilidades y armas con el dinero ilimitado y gemas</h3>
|
39 |
-
<p>El juego también es un juego de rol con muchas habilidades y armas que puedes mejorar con el dinero ilimitado y gemas. El dinero y las gemas son las principales monedas del juego que puedes usar para comprar armas, vehículos, habilidades y otros artículos. Normalmente, tienes que ganar dinero y gemas completando misiones, tareas o recompensas diarias. Sin embargo, con Rope Hero 3 Mod Apkpure, tendrás dinero y gemas ilimitadas desde el principio. Esto significa que puedes comprar lo que quieras sin limitaciones o restricciones. </p>
|
40 |
-
<p>Puedes mejorar tus habilidades yendo al menú de habilidades en el lado izquierdo de la pantalla. Verás cuatro categorías de habilidades: fuerza, resistencia, precisión e inteligencia. Cada categoría tiene varias sub-habilidades que afectan su rendimiento en el juego. Por ejemplo, las habilidades de fuerza aumentan tu daño, las habilidades de resistencia aumentan tu salud y armadura, las habilidades de precisión aumentan tu precisión de disparo y las habilidades de inteligencia aumentan tu poder de súper habilidad. Puedes mejorar cada habilidad gastando dinero o gemas. Cuanto más alto sea el nivel de la habilidad, más dinero o gemas necesitarás. </p>
|
41 |
-
|
42 |
-
<p>Si quieres jugar Rope Hero 3 Mod Apkpure como un profesional, puedes seguir estos consejos y trucos:</p>
|
43 |
-
<h3>Usa tu cuerda para moverte rápido y evitar balas</h3>
|
44 |
-
<p>Una de las características más útiles en el juego es su súper cuerda, que se puede utilizar para moverse por la ciudad con facilidad. Puedes usar tu cuerda para balancearte de edificio en edificio, escalar paredes y saltar obstáculos. También puedes usar tu cuerda para esquivar el fuego enemigo, alejándote de las balas o colgando detrás de objetos de cobertura. También puedes usar la cuerda para acercar a los enemigos, tirarlos o colgarlos. Puedes usar la cuerda para moverte rápido y evitar las balas. </p>
|
45 |
-
<h3>Usa diferentes armas para diferentes situaciones</h3>
|
46 |
-
<p>Otra característica útil en el juego es su arsenal de armas, que se puede utilizar para luchar y sobrevivir. Puedes usar armas, cuchillos, granadas, cohetes, láseres y más para disparar, apuñalar, explotar o quemar a tus enemigos. Sin embargo, también debe saber qué arma es la mejor para cada situación. Por ejemplo, puedes usar un rifle de francotirador para disparos de largo alcance, una escopeta para disparos de corto alcance, un lanzacohetes para grupos de enemigos, una pistola láser para robots, etc. También debes cambiar entre diferentes armas dependiendo de tu munición y tiempo de recarga. Puedes usar diferentes armas para diferentes situaciones. </p>
|
47 |
-
<h3>Recoge recompensas diarias y recursos gratuitos</h3>
|
48 |
-
<p>Una tercera característica útil en el juego es su capacidad para recoger recompensas diarias y recursos gratuitos. Todos los días, puede reclamar una recompensa diaria que le da dinero, gemas, armas u otros artículos. También puede encontrar recursos gratuitos en el mapa o en el mini mapa, como botiquines, kits de armadura, cajas de munición, bolsas de dinero, cajas de gemas y más. Usted puede recoger estos recursos para restaurar su salud y armadura, rellenar su munición, aumentar su dinero y gemas, y así sucesivamente. Deberías recoger recompensas diarias y recursos gratuitos tanto como sea posible. </p>
|
49 |
-
<h3>Encuentra secretos ocultos en el mapa</h3>
|
50 |
-
|
51 |
-
<h2>Revisión de la cuerda héroe 3 Mod Apkpure</h2>
|
52 |
-
<p>Para concluir este artículo, le daremos una revisión de Rope Hero 3 Mod Apkpure, basado en sus pros y contras, clasificación y comentarios de los jugadores. </p>
|
53 |
-
<h3>Pros y contras del juego</h3>
|
54 |
-
<p>El juego tiene muchos pros y contras que debes considerar antes de jugarlo. Estos son algunos de ellos:</p>
|
55 |
-
<h4>Pros:</h4>
|
56 |
-
<ul>
|
57 |
-
<li>Juego divertido y desafiante</li>
|
58 |
-
<li>Grandes gráficos y efectos de sonido</li>
|
59 |
-
<li>Características diversas y personalizables</li>
|
60 |
-
<li>Descarga gratuita y segura</li>
|
61 |
-
</ul>
|
62 |
-
<h4>Contras:</h4>
|
63 |
-
<ul>
|
64 |
-
<li>Algunos errores y problemas técnicos</li>
|
65 |
-
<li>Algunos anuncios y compras en la aplicación</li>
|
66 |
-
<li>Algunas misiones repetitivas y enemigos</li>
|
67 |
-
</ul>
|
68 |
-
<h4>Clasificación:</h4>
|
69 |
-
<p>El juego tiene una calificación de 4.1 de 5 estrellas en Google Play Store, lo que indica que la mayoría de los jugadores disfrutan jugando. La clasificación se basa en el número de descargas, reseñas y calificaciones que el juego ha recibido de los jugadores. El juego tiene más de 10 millones de descargas, más de 100 mil comentarios, y más de 200 mil calificaciones en Google Play Store.</p>
|
70 |
-
<h3>Comentarios positivos de los jugadores</h3>
|
71 |
-
<p>El juego también ha recibido comentarios positivos de los jugadores que lo han jugado. Aquí hay algunos ejemplos de lo que han dicho sobre el juego:</p>
|
72 |
-
<blockquote>"Este juego es impresionante! Me encantan los gráficos, el juego, las armas, los vehículos y todo lo demás. Es como GTA pero con superhéroes. Recomiendo este juego a todos los que les gustan los juegos de acción." </blockquote>
|
73 |
-
<blockquote>"Este es uno de los mejores juegos que he jugado. Tiene tantas características y opciones que lo hacen divertido y emocionante. La versión mod es aún mejor porque te da dinero y gemas ilimitadas. Puedes comprar lo que quieras o necesites en el juego." </blockquote>
|
74 |
-
<blockquote>"Realmente me gusta jugar a este juego. Es muy adictivo y entretenido. La versión mod es muy fácil de descargar e instalar. No tiene virus ni malware. Funciona perfectamente en mi dispositivo. Me encanta este juego y este mod." </blockquote>
|
75 |
-
|
76 |
-
<p>Rope Hero 3 Mod Apkpure es una versión modificada de Rope Hero 3, un emocionante juego de acción en 3D donde juegas como un superhéroe con una cuerda. La versión mod ofrece dinero y gemas ilimitadas, que puedes usar para comprar cualquier arma, vehículo o mejora de habilidad en el juego. También puedes desbloquear todas las características y objetos del juego sin completar ninguna misión o tarea. Puede descargar la versión mod de Apkpure, un sitio web confiable y seguro que proporciona archivos apk para juegos y aplicaciones Android. Puede instalar el archivo apk en su dispositivo después de habilitar fuentes desconocidas. A continuación, puede iniciar el juego y disfrutar de jugar con más libertad y diversión. </p>
|
77 |
-
<p>En este artículo, le hemos dicho todo lo que necesita saber sobre Rope Hero 3 Mod Apkpure, incluyendo lo que es, cómo descargarlo, cómo jugarlo, consejos y trucos para ello, y una revisión de ella. Esperamos que este artículo haya sido útil e informativo para usted. Si tiene alguna pregunta o comentario, no dude en dejarlos a continuación. Gracias por leer y tener un gran día! </p>
|
78 |
-
<h2>Preguntas frecuentes</h2>
|
79 |
-
<p>Aquí hay algunas preguntas frecuentes sobre Rope Hero 3 Mod Apkpure:</p>
|
80 |
-
<h3>Q: ¿Es seguro descargar e instalar Rope Hero 3 Mod Apkpure? </h3>
|
81 |
-
<p>A: Sí, Rope Hero 3 Mod Apkpure es seguro para descargar e instalar. Apkpure es un sitio web confiable y seguro que escanea todos los archivos apk en busca de virus y malware antes de cargarlos. Por lo tanto, puede descargar Rope Hero 3 Mod Apkpure desde Apkpure sin preocupaciones ni riesgos. </p>
|
82 |
-
<h3>P: ¿Necesito rootear mi dispositivo para usar Rope Hero 3 Mod Apkpure? </h3>
|
83 |
-
<p>A: No, no necesitas rootear tu dispositivo para usar Rope Hero 3 Mod Apkpure. Puedes usar la versión mod en cualquier dispositivo Android sin rootearlo. Sin embargo, necesitas habilitar fuentes desconocidas en tu dispositivo para instalar el archivo apk. </p>
|
84 |
-
<h3>Q: ¿Puedo jugar Rope Hero 3 Mod Apkpure en línea con otros jugadores? </h3>
|
85 |
-
|
86 |
-
<h3>Q: ¿Puedo actualizar Rope Hero 3 Mod Apkpure a la última versión? </h3>
|
87 |
-
<p>A: Sí, puede actualizar Rope Hero 3 Mod Apkpure a la última versión. Puede buscar actualizaciones en el sitio web de Apkpure o en la aplicación de Apkpure. También puede habilitar la actualización automática en la configuración del dispositivo para obtener las últimas actualizaciones automáticamente. </p>
|
88 |
-
<h3>Q: ¿Puedo desinstalar Rope Hero 3 Mod Apkpure si no me gusta? </h3>
|
89 |
-
<p>A: Sí, puede desinstalar Rope Hero 3 Mod Apkpure si no le gusta. Puede desinstalar el juego como cualquier otra aplicación en su dispositivo. Puede ir a la configuración del dispositivo, luego aplicaciones, luego Rope Hero 3 Mod Apkpure, luego desinstalar. También puede eliminar el archivo apk de su carpeta de descargas si lo desea. </p> 64aa2da5cf<br />
|
90 |
-
<br />
|
91 |
-
<br />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Benson/text-generation/Examples/Descargar Conseguir Sobre l Mod Men Apk.md
DELETED
@@ -1,67 +0,0 @@
|
|
1 |
-
|
2 |
-
<h1>Descargar Cómo superarlo Mod Menu Apk: Una guía para los usuarios de Android</h1>
|
3 |
-
<p>Si usted está buscando una manera de mejorar su experiencia de juego con Getting Over It with Bennett Foddy, es posible que desee intentar descargar e instalar un archivo apk menú mod. Un archivo apk menú mod es una versión modificada del juego original que le permite acceder a varias características y opciones que no están disponibles en la versión oficial. En este artículo, vamos a explicar lo que Cómo Obtener Más Con Bennett Foddy es, lo que es un archivo apk menú mod es, y cómo descargar e instalar sobre él menú mod apk en su dispositivo Android. </p>
|
4 |
-
<h2>descargar conseguir sobre él mod menú apk</h2><br /><p><b><b>Download</b> ►►► <a href="https://bltlly.com/2v6KuN">https://bltlly.com/2v6KuN</a></b></p><br /><br />
|
5 |
-
<h2>¿Qué es superar con Bennett Foddy? </h2>
|
6 |
-
<p>Getting Over It with Bennett Foddy es un juego de escalada que fue lanzado en 2017 por Bennett Foddy, un desarrollador de juegos independiente y profesor de la Universidad de Nueva York. El juego está inspirado en un juego B de 2002 llamado Sexy Hiking, creado por Jazzuo. El juego te reta a subir una montaña usando solo un martillo y una olla, mientras escuchas los comentarios filosóficos del propio Foddy. El juego es conocido por su alto nivel de dificultad, ya que cualquier error puede causar que pierdas todo tu progreso y caigas de nuevo al fondo. El juego tampoco tiene puntos de control, ningún sistema de guardado, y ningún objetivo final, a excepción de llegar a la cima de la montaña. </p>
|
7 |
-
<p>El juego ha recibido críticas mixtas de críticos y jugadores por igual, pero también ha ganado un seguimiento de culto y una gran base de fans. El juego ha sido elogiado por su jugabilidad única, su narración humorística y su gratificante sensación de logro. Sin embargo, también ha sido criticado por su diseño frustrante, su falta de accesibilidad y su potencial para inducir el abandono de la rabia. El juego ha aparecido en muchos videos en línea, transmisiones, memes y parodias, así como en varios eventos de speedrunning. El juego también ha ganado varios premios, como el Nuovo Award en el Festival de Juegos Independientes en 2018. </p>
|
8 |
-
<h2>¿Qué es un menú mod apk? </h2>
|
9 |
-
|
10 |
-
<p>Un archivo apk menú mod puede ofrecer varios beneficios para los jugadores. Por ejemplo, puede permitirle disfrutar de más contenido, mejorar su rendimiento, personalizar su experiencia o superar desafíos. Sin embargo, un archivo apk menú mod también puede plantear algunos riesgos para su dispositivo y su cuenta. Por ejemplo, puede contener malware o virus que pueden dañar tu dispositivo o robar tus datos. También puede violar los términos de servicio o los derechos de propiedad intelectual de la aplicación o desarrollador de juegos. Por lo tanto, es importante ser cuidadoso y responsable cuando se utiliza un archivo apk menú mod. Siempre debe descargarlo de una fuente confiable, escanearlo en busca de virus y hacer una copia de seguridad de sus datos antes de instalarlo. También debe respetar los derechos y deseos de la aplicación o desarrollador de juegos, y evitar su uso con fines ilegales o poco éticos. Algunos ejemplos de archivos apk menú mod para juegos populares son GTA 5 Mod Menu Apk, PUBG Mobile Mod Menu Apk, y entre nosotros Mod Menu Apk. <h2>Cómo descargar e instalar sobre él mod menú apk en Android? </h2>
|
11 |
-
<p>Si desea tratar de conseguir más de él menú mod apk en su dispositivo Android, tendrá que seguir estos pasos:</p>
|
12 |
-
<ol>
|
13 |
-
<li>Descargar el archivo apk de una fuente confiable. Usted puede buscar para conseguir más de él menú mod apk en Google o cualquier otro motor de búsqueda, o se puede utilizar un enlace proporcionado por un sitio web de confianza o un amigo. Asegúrese de que el archivo es compatible con su dispositivo y su versión de Android. El tamaño del archivo debe ser de alrededor de 100 MB.</li>
|
14 |
-
<li>Habilitar fuentes desconocidas en su dispositivo. Esto le permitirá instalar aplicaciones o juegos que no son de Google Play Store. Para hacer esto, vaya a Configuración > Seguridad > Fuentes desconocidas y conéctelo. También es posible que necesite conceder permiso a su navegador o administrador de archivos para instalar aplicaciones. </li>
|
15 |
-
|
16 |
-
<li>Iniciar y utilizar el menú mod en el juego. Abra el juego desde el cajón de la aplicación o la pantalla de inicio. Deberías ver un nuevo icono o botón que diga "Mod Menu" o algo similar. Toque en él y verá una lista de características u opciones que puede habilitar o deshabilitar. Por ejemplo, puedes activar la invencibilidad, teletransportación, hackeo de velocidad, control de gravedad o monedas ilimitadas. También puede ajustar la configuración del menú mod según su preferencia. </li>
|
17 |
-
</ol>
|
18 |
-
<p>Felicidades! Usted ha descargado e instalado con éxito sobre él mod menú apk en su dispositivo Android. Ahora puedes disfrutar del juego con más diversión y menos frustración. </p>
|
19 |
-
<h2>Conclusión</h2>
|
20 |
-
<p>Superarlo con Bennett Foddy es un juego desafiante y gratificante que pone a prueba tu paciencia y habilidad. Sin embargo, si desea darle vida a su juego o superar algunos obstáculos, puede intentar usar un archivo apk menú mod. Un archivo apk menú mod es una versión modificada del juego que le da acceso a varias características y opciones que no están disponibles en la versión oficial. Sin embargo, también debe ser consciente de los riesgos y responsabilidades que vienen con el uso de un archivo apk menú mod. Solo debe descargarlo de una fuente confiable, escanearlo en busca de virus, realizar copias de seguridad de sus datos y respetar los derechos del desarrollador. </p>
|
21 |
-
<p></p>
|
22 |
-
<p>Si usted está interesado en la descarga y la instalación de conseguir sobre ella mod menú apk en su dispositivo Android, puede seguir los pasos que hemos descrito en este artículo. Esperamos que esta guía haya sido útil e informativa para usted. Si tiene alguna pregunta o comentario, no dude en dejar un comentario a continuación. ¡Gracias por leer! </p>
|
23 |
-
<h2>Preguntas frecuentes</h2>
|
24 |
-
<h3>¿Cuáles son algunas de las características de conseguir sobre él mod menú apk? </h3>
|
25 |
-
<p>Algunas características de conseguir sobre ella mod menú apk son:</p>
|
26 |
-
<ul>
|
27 |
-
<li>Invencibilidad: Puedes evitar que te caigas o te lastimes por cualquier obstáculo. </li>
|
28 |
-
<li>Teletransportación: Puedes moverte a cualquier lugar del mapa al instante. </li>
|
29 |
-
|
30 |
-
<li>Control de gravedad: Puede cambiar el nivel de gravedad del juego. </li>
|
31 |
-
<li>Monedas ilimitadas: Puedes obtener monedas ilimitadas para comprar artículos o desbloquear logros. </li>
|
32 |
-
</ul>
|
33 |
-
<h3>¿Está consiguiendo sobre él menú mod apk seguro y legal de usar? </h3>
|
34 |
-
<p>La seguridad y la legalidad de superarlo mod menú apk dependen de varios factores, tales como:</p>
|
35 |
-
<ul>
|
36 |
-
<li>La fuente del archivo apk: Solo debe descargar el archivo apk de una fuente confiable que no contiene malware o virus. </li>
|
37 |
-
<li> El dispositivo y la versión de Android: Usted debe asegurarse de que el archivo apk es compatible con su dispositivo y su versión de Android. </li>
|
38 |
-
<li>La copia de seguridad y la seguridad: Usted debe copia de seguridad de sus datos antes de instalar el archivo apk y habilitar fuentes desconocidas a su propio riesgo. </li>
|
39 |
-
<li>Los términos de servicio y derechos de propiedad intelectual: Usted debe respetar los derechos y deseos de la aplicación o desarrollador de juegos y evitar el uso del archivo apk para fines ilegales o poco éticos. </li>
|
40 |
-
</ul>
|
41 |
-
<h3>Cómo actualizar sobre él mod menú apk? </h3>
|
42 |
-
<p>Para actualizar Para obtener sobre ella mod menú apk, tendrá que seguir estos pasos:</p>
|
43 |
-
<ol>
|
44 |
-
<li>Compruebe la última versión del archivo apk. Usted puede hacer esto visitando el sitio web o el enlace donde se descargó el archivo apk, o mediante la búsqueda de conseguir sobre ella mod menú apk en Google o cualquier otro motor de búsqueda. También puede comprobar el número de versión y la fecha del archivo apk en el almacenamiento de su dispositivo. </li>
|
45 |
-
<li>Descargar la última versión del archivo apk de una fuente de buena reputación. Asegúrese de que el archivo es compatible con su dispositivo y su versión de Android. El tamaño del archivo debe ser de alrededor de 100 MB.</li>
|
46 |
-
<li>Desinstalar la versión anterior del archivo apk en su dispositivo. Para hacer esto, vaya a Configuración > Aplicaciones > Superarlo > Desinstalar y confirmar su acción. También puede que necesite eliminar la caché y los datos de la aplicación. </li>
|
47 |
-
|
48 |
-
<li>Iniciar y utilizar el menú mod en el juego. Sigue los mismos pasos que antes para acceder y personalizar las características u opciones del menú mod del juego. </li>
|
49 |
-
</ol>
|
50 |
-
<p>Eso es todo! Se ha actualizado con éxito conseguir sobre él menú mod apk en su dispositivo Android. Disfruta jugando el juego con las últimas características y opciones. </p>
|
51 |
-
<h3>Cómo desinstalar conseguir sobre él mod menú apk? </h3>
|
52 |
-
<p>Si desea desinstalar conseguir sobre él menú mod apk desde su dispositivo Android, tendrá que seguir estos pasos:</p>
|
53 |
-
<ol>
|
54 |
-
<li>Ir a Configuración > Aplicaciones > Superarlo > Desinstalar y confirmar su acción. Esto eliminará la aplicación y el menú mod de su dispositivo. </li>
|
55 |
-
<li>Eliminar el archivo apk de almacenamiento de su dispositivo. Busque el archivo descargado en el almacenamiento de su dispositivo y toque en él. Puede ver un mensaje de advertencia que dice "Este tipo de archivo puede dañar su dispositivo". Ignórelo y toque en "Eliminar" o "Aceptar". </li>
|
56 |
-
<li>Restaurar los datos si usted ha hecho una copia de seguridad antes de instalar el archivo apk. Puede usar un servicio en la nube, un cable USB o una aplicación de terceros para transferir sus datos a su dispositivo. </li>
|
57 |
-
</ol>
|
58 |
-
<p>Eso es todo! Usted ha desinstalado con éxito conseguir sobre él menú mod apk desde su dispositivo Android. Ahora puedes jugar el juego sin modificaciones o mejoras. </p>
|
59 |
-
<h3>¿Dónde puedo encontrar más información y soporte para superarlo mod menú apk? </h3>
|
60 |
-
<p>Si necesita más información o soporte para superarlo mod menú apk, puede probar estas fuentes:</p>
|
61 |
-
<ul>
|
62 |
-
<li>El sitio web o el enlace donde descargó el archivo apk. Puede encontrar algunas preguntas frecuentes, tutoriales, comentarios o detalles de contacto allí. </li>
|
63 |
-
<li>El sitio web oficial o cuentas de redes sociales de Bennett Foddy, el desarrollador de Getting Over It with Bennett Foddy. Puede encontrar algunas noticias, actualizaciones, consejos o comentarios allí. </li>
|
64 |
-
<li>Los foros o comunidades en línea de Cómo superarlo con los fans o jugadores de Bennett Foddy. Usted puede encontrar algunas discusiones, sugerencias, experiencias, o ayuda allí. </li>
|
65 |
-
</ul></p> 64aa2da5cf<br />
|
66 |
-
<br />
|
67 |
-
<br />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Big-Web/MMSD/env/Lib/site-packages/botocore/configprovider.py
DELETED
@@ -1,838 +0,0 @@
|
|
1 |
-
# Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
2 |
-
#
|
3 |
-
# Licensed under the Apache License, Version 2.0 (the "License"). You
|
4 |
-
# may not use this file except in compliance with the License. A copy of
|
5 |
-
# the License is located at
|
6 |
-
#
|
7 |
-
# http://aws.amazon.com/apache2.0/
|
8 |
-
#
|
9 |
-
# or in the "license" file accompanying this file. This file is
|
10 |
-
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
|
11 |
-
# ANY KIND, either express or implied. See the License for the specific
|
12 |
-
# language governing permissions and limitations under the License.
|
13 |
-
"""This module contains the inteface for controlling how configuration
|
14 |
-
is loaded.
|
15 |
-
"""
|
16 |
-
import copy
|
17 |
-
import logging
|
18 |
-
import os
|
19 |
-
|
20 |
-
from botocore import utils
|
21 |
-
|
22 |
-
logger = logging.getLogger(__name__)
|
23 |
-
|
24 |
-
|
25 |
-
#: A default dictionary that maps the logical names for session variables
|
26 |
-
#: to the specific environment variables and configuration file names
|
27 |
-
#: that contain the values for these variables.
|
28 |
-
#: When creating a new Session object, you can pass in your own dictionary
|
29 |
-
#: to remap the logical names or to add new logical names. You can then
|
30 |
-
#: get the current value for these variables by using the
|
31 |
-
#: ``get_config_variable`` method of the :class:`botocore.session.Session`
|
32 |
-
#: class.
|
33 |
-
#: These form the keys of the dictionary. The values in the dictionary
|
34 |
-
#: are tuples of (<config_name>, <environment variable>, <default value>,
|
35 |
-
#: <conversion func>).
|
36 |
-
#: The conversion func is a function that takes the configuration value
|
37 |
-
#: as an argument and returns the converted value. If this value is
|
38 |
-
#: None, then the configuration value is returned unmodified. This
|
39 |
-
#: conversion function can be used to type convert config values to
|
40 |
-
#: values other than the default values of strings.
|
41 |
-
#: The ``profile`` and ``config_file`` variables should always have a
|
42 |
-
#: None value for the first entry in the tuple because it doesn't make
|
43 |
-
#: sense to look inside the config file for the location of the config
|
44 |
-
#: file or for the default profile to use.
|
45 |
-
#: The ``config_name`` is the name to look for in the configuration file,
|
46 |
-
#: the ``env var`` is the OS environment variable (``os.environ``) to
|
47 |
-
#: use, and ``default_value`` is the value to use if no value is otherwise
|
48 |
-
#: found.
|
49 |
-
BOTOCORE_DEFAUT_SESSION_VARIABLES = {
|
50 |
-
# logical: config_file, env_var, default_value, conversion_func
|
51 |
-
'profile': (None, ['AWS_DEFAULT_PROFILE', 'AWS_PROFILE'], None, None),
|
52 |
-
'region': ('region', 'AWS_DEFAULT_REGION', None, None),
|
53 |
-
'data_path': ('data_path', 'AWS_DATA_PATH', None, None),
|
54 |
-
'config_file': (None, 'AWS_CONFIG_FILE', '~/.aws/config', None),
|
55 |
-
'ca_bundle': ('ca_bundle', 'AWS_CA_BUNDLE', None, None),
|
56 |
-
'api_versions': ('api_versions', None, {}, None),
|
57 |
-
# This is the shared credentials file amongst sdks.
|
58 |
-
'credentials_file': (
|
59 |
-
None,
|
60 |
-
'AWS_SHARED_CREDENTIALS_FILE',
|
61 |
-
'~/.aws/credentials',
|
62 |
-
None,
|
63 |
-
),
|
64 |
-
# These variables only exist in the config file.
|
65 |
-
# This is the number of seconds until we time out a request to
|
66 |
-
# the instance metadata service.
|
67 |
-
'metadata_service_timeout': (
|
68 |
-
'metadata_service_timeout',
|
69 |
-
'AWS_METADATA_SERVICE_TIMEOUT',
|
70 |
-
1,
|
71 |
-
int,
|
72 |
-
),
|
73 |
-
# This is the number of request attempts we make until we give
|
74 |
-
# up trying to retrieve data from the instance metadata service.
|
75 |
-
'metadata_service_num_attempts': (
|
76 |
-
'metadata_service_num_attempts',
|
77 |
-
'AWS_METADATA_SERVICE_NUM_ATTEMPTS',
|
78 |
-
1,
|
79 |
-
int,
|
80 |
-
),
|
81 |
-
'ec2_metadata_service_endpoint': (
|
82 |
-
'ec2_metadata_service_endpoint',
|
83 |
-
'AWS_EC2_METADATA_SERVICE_ENDPOINT',
|
84 |
-
None,
|
85 |
-
None,
|
86 |
-
),
|
87 |
-
'ec2_metadata_service_endpoint_mode': (
|
88 |
-
'ec2_metadata_service_endpoint_mode',
|
89 |
-
'AWS_EC2_METADATA_SERVICE_ENDPOINT_MODE',
|
90 |
-
None,
|
91 |
-
None,
|
92 |
-
),
|
93 |
-
'imds_use_ipv6': (
|
94 |
-
'imds_use_ipv6',
|
95 |
-
'AWS_IMDS_USE_IPV6',
|
96 |
-
False,
|
97 |
-
utils.ensure_boolean,
|
98 |
-
),
|
99 |
-
'use_dualstack_endpoint': (
|
100 |
-
'use_dualstack_endpoint',
|
101 |
-
'AWS_USE_DUALSTACK_ENDPOINT',
|
102 |
-
None,
|
103 |
-
utils.ensure_boolean,
|
104 |
-
),
|
105 |
-
'use_fips_endpoint': (
|
106 |
-
'use_fips_endpoint',
|
107 |
-
'AWS_USE_FIPS_ENDPOINT',
|
108 |
-
None,
|
109 |
-
utils.ensure_boolean,
|
110 |
-
),
|
111 |
-
'parameter_validation': ('parameter_validation', None, True, None),
|
112 |
-
# Client side monitoring configurations.
|
113 |
-
# Note: These configurations are considered internal to botocore.
|
114 |
-
# Do not use them until publicly documented.
|
115 |
-
'csm_enabled': (
|
116 |
-
'csm_enabled',
|
117 |
-
'AWS_CSM_ENABLED',
|
118 |
-
False,
|
119 |
-
utils.ensure_boolean,
|
120 |
-
),
|
121 |
-
'csm_host': ('csm_host', 'AWS_CSM_HOST', '127.0.0.1', None),
|
122 |
-
'csm_port': ('csm_port', 'AWS_CSM_PORT', 31000, int),
|
123 |
-
'csm_client_id': ('csm_client_id', 'AWS_CSM_CLIENT_ID', '', None),
|
124 |
-
# Endpoint discovery configuration
|
125 |
-
'endpoint_discovery_enabled': (
|
126 |
-
'endpoint_discovery_enabled',
|
127 |
-
'AWS_ENDPOINT_DISCOVERY_ENABLED',
|
128 |
-
'auto',
|
129 |
-
None,
|
130 |
-
),
|
131 |
-
'sts_regional_endpoints': (
|
132 |
-
'sts_regional_endpoints',
|
133 |
-
'AWS_STS_REGIONAL_ENDPOINTS',
|
134 |
-
'legacy',
|
135 |
-
None,
|
136 |
-
),
|
137 |
-
'retry_mode': ('retry_mode', 'AWS_RETRY_MODE', 'legacy', None),
|
138 |
-
'defaults_mode': ('defaults_mode', 'AWS_DEFAULTS_MODE', 'legacy', None),
|
139 |
-
# We can't have a default here for v1 because we need to defer to
|
140 |
-
# whatever the defaults are in _retry.json.
|
141 |
-
'max_attempts': ('max_attempts', 'AWS_MAX_ATTEMPTS', None, int),
|
142 |
-
}
|
143 |
-
# A mapping for the s3 specific configuration vars. These are the configuration
|
144 |
-
# vars that typically go in the s3 section of the config file. This mapping
|
145 |
-
# follows the same schema as the previous session variable mapping.
|
146 |
-
DEFAULT_S3_CONFIG_VARS = {
|
147 |
-
'addressing_style': (('s3', 'addressing_style'), None, None, None),
|
148 |
-
'use_accelerate_endpoint': (
|
149 |
-
('s3', 'use_accelerate_endpoint'),
|
150 |
-
None,
|
151 |
-
None,
|
152 |
-
utils.ensure_boolean,
|
153 |
-
),
|
154 |
-
'use_dualstack_endpoint': (
|
155 |
-
('s3', 'use_dualstack_endpoint'),
|
156 |
-
None,
|
157 |
-
None,
|
158 |
-
utils.ensure_boolean,
|
159 |
-
),
|
160 |
-
'payload_signing_enabled': (
|
161 |
-
('s3', 'payload_signing_enabled'),
|
162 |
-
None,
|
163 |
-
None,
|
164 |
-
utils.ensure_boolean,
|
165 |
-
),
|
166 |
-
'use_arn_region': (
|
167 |
-
['s3_use_arn_region', ('s3', 'use_arn_region')],
|
168 |
-
'AWS_S3_USE_ARN_REGION',
|
169 |
-
None,
|
170 |
-
utils.ensure_boolean,
|
171 |
-
),
|
172 |
-
'us_east_1_regional_endpoint': (
|
173 |
-
[
|
174 |
-
's3_us_east_1_regional_endpoint',
|
175 |
-
('s3', 'us_east_1_regional_endpoint'),
|
176 |
-
],
|
177 |
-
'AWS_S3_US_EAST_1_REGIONAL_ENDPOINT',
|
178 |
-
None,
|
179 |
-
None,
|
180 |
-
),
|
181 |
-
's3_disable_multiregion_access_points': (
|
182 |
-
('s3', 's3_disable_multiregion_access_points'),
|
183 |
-
'AWS_S3_DISABLE_MULTIREGION_ACCESS_POINTS',
|
184 |
-
None,
|
185 |
-
utils.ensure_boolean,
|
186 |
-
),
|
187 |
-
}
|
188 |
-
# A mapping for the proxy specific configuration vars. These are
|
189 |
-
# used to configure how botocore interacts with proxy setups while
|
190 |
-
# sending requests.
|
191 |
-
DEFAULT_PROXIES_CONFIG_VARS = {
|
192 |
-
'proxy_ca_bundle': ('proxy_ca_bundle', None, None, None),
|
193 |
-
'proxy_client_cert': ('proxy_client_cert', None, None, None),
|
194 |
-
'proxy_use_forwarding_for_https': (
|
195 |
-
'proxy_use_forwarding_for_https',
|
196 |
-
None,
|
197 |
-
None,
|
198 |
-
utils.normalize_boolean,
|
199 |
-
),
|
200 |
-
}
|
201 |
-
|
202 |
-
|
203 |
-
def create_botocore_default_config_mapping(session):
|
204 |
-
chain_builder = ConfigChainFactory(session=session)
|
205 |
-
config_mapping = _create_config_chain_mapping(
|
206 |
-
chain_builder, BOTOCORE_DEFAUT_SESSION_VARIABLES
|
207 |
-
)
|
208 |
-
config_mapping['s3'] = SectionConfigProvider(
|
209 |
-
's3',
|
210 |
-
session,
|
211 |
-
_create_config_chain_mapping(chain_builder, DEFAULT_S3_CONFIG_VARS),
|
212 |
-
)
|
213 |
-
config_mapping['proxies_config'] = SectionConfigProvider(
|
214 |
-
'proxies_config',
|
215 |
-
session,
|
216 |
-
_create_config_chain_mapping(
|
217 |
-
chain_builder, DEFAULT_PROXIES_CONFIG_VARS
|
218 |
-
),
|
219 |
-
)
|
220 |
-
return config_mapping
|
221 |
-
|
222 |
-
|
223 |
-
def _create_config_chain_mapping(chain_builder, config_variables):
|
224 |
-
mapping = {}
|
225 |
-
for logical_name, config in config_variables.items():
|
226 |
-
mapping[logical_name] = chain_builder.create_config_chain(
|
227 |
-
instance_name=logical_name,
|
228 |
-
env_var_names=config[1],
|
229 |
-
config_property_names=config[0],
|
230 |
-
default=config[2],
|
231 |
-
conversion_func=config[3],
|
232 |
-
)
|
233 |
-
return mapping
|
234 |
-
|
235 |
-
|
236 |
-
class DefaultConfigResolver:
|
237 |
-
def __init__(self, default_config_data):
|
238 |
-
self._base_default_config = default_config_data['base']
|
239 |
-
self._modes = default_config_data['modes']
|
240 |
-
self._resolved_default_configurations = {}
|
241 |
-
|
242 |
-
def _resolve_default_values_by_mode(self, mode):
|
243 |
-
default_config = self._base_default_config.copy()
|
244 |
-
modifications = self._modes.get(mode)
|
245 |
-
|
246 |
-
for config_var in modifications:
|
247 |
-
default_value = default_config[config_var]
|
248 |
-
modification_dict = modifications[config_var]
|
249 |
-
modification = list(modification_dict.keys())[0]
|
250 |
-
modification_value = modification_dict[modification]
|
251 |
-
if modification == 'multiply':
|
252 |
-
default_value *= modification_value
|
253 |
-
elif modification == 'add':
|
254 |
-
default_value += modification_value
|
255 |
-
elif modification == 'override':
|
256 |
-
default_value = modification_value
|
257 |
-
default_config[config_var] = default_value
|
258 |
-
return default_config
|
259 |
-
|
260 |
-
def get_default_modes(self):
|
261 |
-
default_modes = ['legacy', 'auto']
|
262 |
-
default_modes.extend(self._modes.keys())
|
263 |
-
return default_modes
|
264 |
-
|
265 |
-
def get_default_config_values(self, mode):
|
266 |
-
if mode not in self._resolved_default_configurations:
|
267 |
-
defaults = self._resolve_default_values_by_mode(mode)
|
268 |
-
self._resolved_default_configurations[mode] = defaults
|
269 |
-
return self._resolved_default_configurations[mode]
|
270 |
-
|
271 |
-
|
272 |
-
class ConfigChainFactory:
|
273 |
-
"""Factory class to create our most common configuration chain case.
|
274 |
-
|
275 |
-
This is a convenience class to construct configuration chains that follow
|
276 |
-
our most common pattern. This is to prevent ordering them incorrectly,
|
277 |
-
and to make the config chain construction more readable.
|
278 |
-
"""
|
279 |
-
|
280 |
-
def __init__(self, session, environ=None):
|
281 |
-
"""Initialize a ConfigChainFactory.
|
282 |
-
|
283 |
-
:type session: :class:`botocore.session.Session`
|
284 |
-
:param session: This is the session that should be used to look up
|
285 |
-
values from the config file.
|
286 |
-
|
287 |
-
:type environ: dict
|
288 |
-
:param environ: A mapping to use for environment variables. If this
|
289 |
-
is not provided it will default to use os.environ.
|
290 |
-
"""
|
291 |
-
self._session = session
|
292 |
-
if environ is None:
|
293 |
-
environ = os.environ
|
294 |
-
self._environ = environ
|
295 |
-
|
296 |
-
def create_config_chain(
|
297 |
-
self,
|
298 |
-
instance_name=None,
|
299 |
-
env_var_names=None,
|
300 |
-
config_property_names=None,
|
301 |
-
default=None,
|
302 |
-
conversion_func=None,
|
303 |
-
):
|
304 |
-
"""Build a config chain following the standard botocore pattern.
|
305 |
-
|
306 |
-
In botocore most of our config chains follow the the precendence:
|
307 |
-
session_instance_variables, environment, config_file, default_value.
|
308 |
-
|
309 |
-
This is a convenience function for creating a chain that follow
|
310 |
-
that precendence.
|
311 |
-
|
312 |
-
:type instance_name: str
|
313 |
-
:param instance_name: This indicates what session instance variable
|
314 |
-
corresponds to this config value. If it is None it will not be
|
315 |
-
added to the chain.
|
316 |
-
|
317 |
-
:type env_var_names: str or list of str or None
|
318 |
-
:param env_var_names: One or more environment variable names to
|
319 |
-
search for this value. They are searched in order. If it is None
|
320 |
-
it will not be added to the chain.
|
321 |
-
|
322 |
-
:type config_property_names: str/tuple or list of str/tuple or None
|
323 |
-
:param config_property_names: One of more strings or tuples
|
324 |
-
representing the name of the key in the config file for this
|
325 |
-
config option. They are searched in order. If it is None it will
|
326 |
-
not be added to the chain.
|
327 |
-
|
328 |
-
:type default: Any
|
329 |
-
:param default: Any constant value to be returned.
|
330 |
-
|
331 |
-
:type conversion_func: None or callable
|
332 |
-
:param conversion_func: If this value is None then it has no effect on
|
333 |
-
the return type. Otherwise, it is treated as a function that will
|
334 |
-
conversion_func our provided type.
|
335 |
-
|
336 |
-
:rvalue: ConfigChain
|
337 |
-
:returns: A ConfigChain that resolves in the order env_var_names ->
|
338 |
-
config_property_name -> default. Any values that were none are
|
339 |
-
omitted form the chain.
|
340 |
-
"""
|
341 |
-
providers = []
|
342 |
-
if instance_name is not None:
|
343 |
-
providers.append(
|
344 |
-
InstanceVarProvider(
|
345 |
-
instance_var=instance_name, session=self._session
|
346 |
-
)
|
347 |
-
)
|
348 |
-
if env_var_names is not None:
|
349 |
-
providers.extend(self._get_env_providers(env_var_names))
|
350 |
-
if config_property_names is not None:
|
351 |
-
providers.extend(
|
352 |
-
self._get_scoped_config_providers(config_property_names)
|
353 |
-
)
|
354 |
-
if default is not None:
|
355 |
-
providers.append(ConstantProvider(value=default))
|
356 |
-
|
357 |
-
return ChainProvider(
|
358 |
-
providers=providers,
|
359 |
-
conversion_func=conversion_func,
|
360 |
-
)
|
361 |
-
|
362 |
-
def _get_env_providers(self, env_var_names):
|
363 |
-
env_var_providers = []
|
364 |
-
if not isinstance(env_var_names, list):
|
365 |
-
env_var_names = [env_var_names]
|
366 |
-
for env_var_name in env_var_names:
|
367 |
-
env_var_providers.append(
|
368 |
-
EnvironmentProvider(name=env_var_name, env=self._environ)
|
369 |
-
)
|
370 |
-
return env_var_providers
|
371 |
-
|
372 |
-
def _get_scoped_config_providers(self, config_property_names):
|
373 |
-
scoped_config_providers = []
|
374 |
-
if not isinstance(config_property_names, list):
|
375 |
-
config_property_names = [config_property_names]
|
376 |
-
for config_property_name in config_property_names:
|
377 |
-
scoped_config_providers.append(
|
378 |
-
ScopedConfigProvider(
|
379 |
-
config_var_name=config_property_name,
|
380 |
-
session=self._session,
|
381 |
-
)
|
382 |
-
)
|
383 |
-
return scoped_config_providers
|
384 |
-
|
385 |
-
|
386 |
-
class ConfigValueStore:
|
387 |
-
"""The ConfigValueStore object stores configuration values."""
|
388 |
-
|
389 |
-
def __init__(self, mapping=None):
|
390 |
-
"""Initialize a ConfigValueStore.
|
391 |
-
|
392 |
-
:type mapping: dict
|
393 |
-
:param mapping: The mapping parameter is a map of string to a subclass
|
394 |
-
of BaseProvider. When a config variable is asked for via the
|
395 |
-
get_config_variable method, the corresponding provider will be
|
396 |
-
invoked to load the value.
|
397 |
-
"""
|
398 |
-
self._overrides = {}
|
399 |
-
self._mapping = {}
|
400 |
-
if mapping is not None:
|
401 |
-
for logical_name, provider in mapping.items():
|
402 |
-
self.set_config_provider(logical_name, provider)
|
403 |
-
|
404 |
-
def __deepcopy__(self, memo):
|
405 |
-
return ConfigValueStore(copy.deepcopy(self._mapping, memo))
|
406 |
-
|
407 |
-
def get_config_variable(self, logical_name):
|
408 |
-
"""
|
409 |
-
Retrieve the value associeated with the specified logical_name
|
410 |
-
from the corresponding provider. If no value is found None will
|
411 |
-
be returned.
|
412 |
-
|
413 |
-
:type logical_name: str
|
414 |
-
:param logical_name: The logical name of the session variable
|
415 |
-
you want to retrieve. This name will be mapped to the
|
416 |
-
appropriate environment variable name for this session as
|
417 |
-
well as the appropriate config file entry.
|
418 |
-
|
419 |
-
:returns: value of variable or None if not defined.
|
420 |
-
"""
|
421 |
-
if logical_name in self._overrides:
|
422 |
-
return self._overrides[logical_name]
|
423 |
-
if logical_name not in self._mapping:
|
424 |
-
return None
|
425 |
-
provider = self._mapping[logical_name]
|
426 |
-
return provider.provide()
|
427 |
-
|
428 |
-
def get_config_provider(self, logical_name):
|
429 |
-
"""
|
430 |
-
Retrieve the provider associated with the specified logical_name.
|
431 |
-
If no provider is found None will be returned.
|
432 |
-
|
433 |
-
:type logical_name: str
|
434 |
-
:param logical_name: The logical name of the session variable
|
435 |
-
you want to retrieve. This name will be mapped to the
|
436 |
-
appropriate environment variable name for this session as
|
437 |
-
well as the appropriate config file entry.
|
438 |
-
|
439 |
-
:returns: configuration provider or None if not defined.
|
440 |
-
"""
|
441 |
-
if (
|
442 |
-
logical_name in self._overrides
|
443 |
-
or logical_name not in self._mapping
|
444 |
-
):
|
445 |
-
return None
|
446 |
-
provider = self._mapping[logical_name]
|
447 |
-
return provider
|
448 |
-
|
449 |
-
def set_config_variable(self, logical_name, value):
|
450 |
-
"""Set a configuration variable to a specific value.
|
451 |
-
|
452 |
-
By using this method, you can override the normal lookup
|
453 |
-
process used in ``get_config_variable`` by explicitly setting
|
454 |
-
a value. Subsequent calls to ``get_config_variable`` will
|
455 |
-
use the ``value``. This gives you per-session specific
|
456 |
-
configuration values.
|
457 |
-
|
458 |
-
::
|
459 |
-
>>> # Assume logical name 'foo' maps to env var 'FOO'
|
460 |
-
>>> os.environ['FOO'] = 'myvalue'
|
461 |
-
>>> s.get_config_variable('foo')
|
462 |
-
'myvalue'
|
463 |
-
>>> s.set_config_variable('foo', 'othervalue')
|
464 |
-
>>> s.get_config_variable('foo')
|
465 |
-
'othervalue'
|
466 |
-
|
467 |
-
:type logical_name: str
|
468 |
-
:param logical_name: The logical name of the session variable
|
469 |
-
you want to set. These are the keys in ``SESSION_VARIABLES``.
|
470 |
-
|
471 |
-
:param value: The value to associate with the config variable.
|
472 |
-
"""
|
473 |
-
self._overrides[logical_name] = value
|
474 |
-
|
475 |
-
def clear_config_variable(self, logical_name):
|
476 |
-
"""Remove an override config variable from the session.
|
477 |
-
|
478 |
-
:type logical_name: str
|
479 |
-
:param logical_name: The name of the parameter to clear the override
|
480 |
-
value from.
|
481 |
-
"""
|
482 |
-
self._overrides.pop(logical_name, None)
|
483 |
-
|
484 |
-
def set_config_provider(self, logical_name, provider):
|
485 |
-
"""Set the provider for a config value.
|
486 |
-
|
487 |
-
This provides control over how a particular configuration value is
|
488 |
-
loaded. This replaces the provider for ``logical_name`` with the new
|
489 |
-
``provider``.
|
490 |
-
|
491 |
-
:type logical_name: str
|
492 |
-
:param logical_name: The name of the config value to change the config
|
493 |
-
provider for.
|
494 |
-
|
495 |
-
:type provider: :class:`botocore.configprovider.BaseProvider`
|
496 |
-
:param provider: The new provider that should be responsible for
|
497 |
-
providing a value for the config named ``logical_name``.
|
498 |
-
"""
|
499 |
-
self._mapping[logical_name] = provider
|
500 |
-
|
501 |
-
|
502 |
-
class SmartDefaultsConfigStoreFactory:
|
503 |
-
def __init__(self, default_config_resolver, imds_region_provider):
|
504 |
-
self._default_config_resolver = default_config_resolver
|
505 |
-
self._imds_region_provider = imds_region_provider
|
506 |
-
# Initializing _instance_metadata_region as None so we
|
507 |
-
# can fetch region in a lazy fashion only when needed.
|
508 |
-
self._instance_metadata_region = None
|
509 |
-
|
510 |
-
def merge_smart_defaults(self, config_store, mode, region_name):
|
511 |
-
if mode == 'auto':
|
512 |
-
mode = self.resolve_auto_mode(region_name)
|
513 |
-
default_configs = (
|
514 |
-
self._default_config_resolver.get_default_config_values(mode)
|
515 |
-
)
|
516 |
-
for config_var in default_configs:
|
517 |
-
config_value = default_configs[config_var]
|
518 |
-
method = getattr(self, f'_set_{config_var}', None)
|
519 |
-
if method:
|
520 |
-
method(config_store, config_value)
|
521 |
-
|
522 |
-
def resolve_auto_mode(self, region_name):
|
523 |
-
current_region = None
|
524 |
-
if os.environ.get('AWS_EXECUTION_ENV'):
|
525 |
-
default_region = os.environ.get('AWS_DEFAULT_REGION')
|
526 |
-
current_region = os.environ.get('AWS_REGION', default_region)
|
527 |
-
if not current_region:
|
528 |
-
if self._instance_metadata_region:
|
529 |
-
current_region = self._instance_metadata_region
|
530 |
-
else:
|
531 |
-
try:
|
532 |
-
current_region = self._imds_region_provider.provide()
|
533 |
-
self._instance_metadata_region = current_region
|
534 |
-
except Exception:
|
535 |
-
pass
|
536 |
-
|
537 |
-
if current_region:
|
538 |
-
if region_name == current_region:
|
539 |
-
return 'in-region'
|
540 |
-
else:
|
541 |
-
return 'cross-region'
|
542 |
-
return 'standard'
|
543 |
-
|
544 |
-
def _update_provider(self, config_store, variable, value):
|
545 |
-
provider = config_store.get_config_provider(variable)
|
546 |
-
default_provider = ConstantProvider(value)
|
547 |
-
if isinstance(provider, ChainProvider):
|
548 |
-
provider.set_default_provider(default_provider)
|
549 |
-
return
|
550 |
-
elif isinstance(provider, BaseProvider):
|
551 |
-
default_provider = ChainProvider(
|
552 |
-
providers=[provider, default_provider]
|
553 |
-
)
|
554 |
-
config_store.set_config_provider(variable, default_provider)
|
555 |
-
|
556 |
-
def _update_section_provider(
|
557 |
-
self, config_store, section_name, variable, value
|
558 |
-
):
|
559 |
-
section_provider = config_store.get_config_provider(section_name)
|
560 |
-
section_provider.set_default_provider(
|
561 |
-
variable, ConstantProvider(value)
|
562 |
-
)
|
563 |
-
|
564 |
-
def _set_retryMode(self, config_store, value):
|
565 |
-
self._update_provider(config_store, 'retry_mode', value)
|
566 |
-
|
567 |
-
def _set_stsRegionalEndpoints(self, config_store, value):
|
568 |
-
self._update_provider(config_store, 'sts_regional_endpoints', value)
|
569 |
-
|
570 |
-
def _set_s3UsEast1RegionalEndpoints(self, config_store, value):
|
571 |
-
self._update_section_provider(
|
572 |
-
config_store, 's3', 'us_east_1_regional_endpoint', value
|
573 |
-
)
|
574 |
-
|
575 |
-
def _set_connectTimeoutInMillis(self, config_store, value):
|
576 |
-
self._update_provider(config_store, 'connect_timeout', value / 1000)
|
577 |
-
|
578 |
-
|
579 |
-
class BaseProvider:
|
580 |
-
"""Base class for configuration value providers.
|
581 |
-
|
582 |
-
A configuration provider has some method of providing a configuration
|
583 |
-
value.
|
584 |
-
"""
|
585 |
-
|
586 |
-
def provide(self):
|
587 |
-
"""Provide a config value."""
|
588 |
-
raise NotImplementedError('provide')
|
589 |
-
|
590 |
-
|
591 |
-
class ChainProvider(BaseProvider):
|
592 |
-
"""This provider wraps one or more other providers.
|
593 |
-
|
594 |
-
Each provider in the chain is called, the first one returning a non-None
|
595 |
-
value is then returned.
|
596 |
-
"""
|
597 |
-
|
598 |
-
def __init__(self, providers=None, conversion_func=None):
|
599 |
-
"""Initalize a ChainProvider.
|
600 |
-
|
601 |
-
:type providers: list
|
602 |
-
:param providers: The initial list of providers to check for values
|
603 |
-
when invoked.
|
604 |
-
|
605 |
-
:type conversion_func: None or callable
|
606 |
-
:param conversion_func: If this value is None then it has no affect on
|
607 |
-
the return type. Otherwise, it is treated as a function that will
|
608 |
-
transform provided value.
|
609 |
-
"""
|
610 |
-
if providers is None:
|
611 |
-
providers = []
|
612 |
-
self._providers = providers
|
613 |
-
self._conversion_func = conversion_func
|
614 |
-
|
615 |
-
def __deepcopy__(self, memo):
|
616 |
-
return ChainProvider(
|
617 |
-
copy.deepcopy(self._providers, memo), self._conversion_func
|
618 |
-
)
|
619 |
-
|
620 |
-
def provide(self):
|
621 |
-
"""Provide the value from the first provider to return non-None.
|
622 |
-
|
623 |
-
Each provider in the chain has its provide method called. The first
|
624 |
-
one in the chain to return a non-None value is the returned from the
|
625 |
-
ChainProvider. When no non-None value is found, None is returned.
|
626 |
-
"""
|
627 |
-
for provider in self._providers:
|
628 |
-
value = provider.provide()
|
629 |
-
if value is not None:
|
630 |
-
return self._convert_type(value)
|
631 |
-
return None
|
632 |
-
|
633 |
-
def set_default_provider(self, default_provider):
|
634 |
-
if self._providers and isinstance(
|
635 |
-
self._providers[-1], ConstantProvider
|
636 |
-
):
|
637 |
-
self._providers[-1] = default_provider
|
638 |
-
else:
|
639 |
-
self._providers.append(default_provider)
|
640 |
-
|
641 |
-
num_of_constants = sum(
|
642 |
-
isinstance(provider, ConstantProvider)
|
643 |
-
for provider in self._providers
|
644 |
-
)
|
645 |
-
if num_of_constants > 1:
|
646 |
-
logger.info(
|
647 |
-
'ChainProvider object contains multiple '
|
648 |
-
'instances of ConstantProvider objects'
|
649 |
-
)
|
650 |
-
|
651 |
-
def _convert_type(self, value):
|
652 |
-
if self._conversion_func is not None:
|
653 |
-
return self._conversion_func(value)
|
654 |
-
return value
|
655 |
-
|
656 |
-
def __repr__(self):
|
657 |
-
return '[%s]' % ', '.join([str(p) for p in self._providers])
|
658 |
-
|
659 |
-
|
660 |
-
class InstanceVarProvider(BaseProvider):
|
661 |
-
"""This class loads config values from the session instance vars."""
|
662 |
-
|
663 |
-
def __init__(self, instance_var, session):
|
664 |
-
"""Initialize InstanceVarProvider.
|
665 |
-
|
666 |
-
:type instance_var: str
|
667 |
-
:param instance_var: The instance variable to load from the session.
|
668 |
-
|
669 |
-
:type session: :class:`botocore.session.Session`
|
670 |
-
:param session: The botocore session to get the loaded configuration
|
671 |
-
file variables from.
|
672 |
-
"""
|
673 |
-
self._instance_var = instance_var
|
674 |
-
self._session = session
|
675 |
-
|
676 |
-
def __deepcopy__(self, memo):
|
677 |
-
return InstanceVarProvider(
|
678 |
-
copy.deepcopy(self._instance_var, memo), self._session
|
679 |
-
)
|
680 |
-
|
681 |
-
def provide(self):
|
682 |
-
"""Provide a config value from the session instance vars."""
|
683 |
-
instance_vars = self._session.instance_variables()
|
684 |
-
value = instance_vars.get(self._instance_var)
|
685 |
-
return value
|
686 |
-
|
687 |
-
def __repr__(self):
|
688 |
-
return 'InstanceVarProvider(instance_var={}, session={})'.format(
|
689 |
-
self._instance_var,
|
690 |
-
self._session,
|
691 |
-
)
|
692 |
-
|
693 |
-
|
694 |
-
class ScopedConfigProvider(BaseProvider):
|
695 |
-
def __init__(self, config_var_name, session):
|
696 |
-
"""Initialize ScopedConfigProvider.
|
697 |
-
|
698 |
-
:type config_var_name: str or tuple
|
699 |
-
:param config_var_name: The name of the config variable to load from
|
700 |
-
the configuration file. If the value is a tuple, it must only
|
701 |
-
consist of two items, where the first item represents the section
|
702 |
-
and the second item represents the config var name in the section.
|
703 |
-
|
704 |
-
:type session: :class:`botocore.session.Session`
|
705 |
-
:param session: The botocore session to get the loaded configuration
|
706 |
-
file variables from.
|
707 |
-
"""
|
708 |
-
self._config_var_name = config_var_name
|
709 |
-
self._session = session
|
710 |
-
|
711 |
-
def __deepcopy__(self, memo):
|
712 |
-
return ScopedConfigProvider(
|
713 |
-
copy.deepcopy(self._config_var_name, memo), self._session
|
714 |
-
)
|
715 |
-
|
716 |
-
def provide(self):
|
717 |
-
"""Provide a value from a config file property."""
|
718 |
-
scoped_config = self._session.get_scoped_config()
|
719 |
-
if isinstance(self._config_var_name, tuple):
|
720 |
-
section_config = scoped_config.get(self._config_var_name[0])
|
721 |
-
if not isinstance(section_config, dict):
|
722 |
-
return None
|
723 |
-
return section_config.get(self._config_var_name[1])
|
724 |
-
return scoped_config.get(self._config_var_name)
|
725 |
-
|
726 |
-
def __repr__(self):
|
727 |
-
return 'ScopedConfigProvider(config_var_name={}, session={})'.format(
|
728 |
-
self._config_var_name,
|
729 |
-
self._session,
|
730 |
-
)
|
731 |
-
|
732 |
-
|
733 |
-
class EnvironmentProvider(BaseProvider):
|
734 |
-
"""This class loads config values from environment variables."""
|
735 |
-
|
736 |
-
def __init__(self, name, env):
|
737 |
-
"""Initialize with the keys in the dictionary to check.
|
738 |
-
|
739 |
-
:type name: str
|
740 |
-
:param name: The key with that name will be loaded and returned.
|
741 |
-
|
742 |
-
:type env: dict
|
743 |
-
:param env: Environment variables dictionary to get variables from.
|
744 |
-
"""
|
745 |
-
self._name = name
|
746 |
-
self._env = env
|
747 |
-
|
748 |
-
def __deepcopy__(self, memo):
|
749 |
-
return EnvironmentProvider(
|
750 |
-
copy.deepcopy(self._name, memo), copy.deepcopy(self._env, memo)
|
751 |
-
)
|
752 |
-
|
753 |
-
def provide(self):
|
754 |
-
"""Provide a config value from a source dictionary."""
|
755 |
-
if self._name in self._env:
|
756 |
-
return self._env[self._name]
|
757 |
-
return None
|
758 |
-
|
759 |
-
def __repr__(self):
|
760 |
-
return f'EnvironmentProvider(name={self._name}, env={self._env})'
|
761 |
-
|
762 |
-
|
763 |
-
class SectionConfigProvider(BaseProvider):
|
764 |
-
"""Provides a dictionary from a section in the scoped config
|
765 |
-
|
766 |
-
This is useful for retrieving scoped config variables (i.e. s3) that have
|
767 |
-
their own set of config variables and resolving logic.
|
768 |
-
"""
|
769 |
-
|
770 |
-
def __init__(self, section_name, session, override_providers=None):
|
771 |
-
self._section_name = section_name
|
772 |
-
self._session = session
|
773 |
-
self._scoped_config_provider = ScopedConfigProvider(
|
774 |
-
self._section_name, self._session
|
775 |
-
)
|
776 |
-
self._override_providers = override_providers
|
777 |
-
if self._override_providers is None:
|
778 |
-
self._override_providers = {}
|
779 |
-
|
780 |
-
def __deepcopy__(self, memo):
|
781 |
-
return SectionConfigProvider(
|
782 |
-
copy.deepcopy(self._section_name, memo),
|
783 |
-
self._session,
|
784 |
-
copy.deepcopy(self._override_providers, memo),
|
785 |
-
)
|
786 |
-
|
787 |
-
def provide(self):
|
788 |
-
section_config = self._scoped_config_provider.provide()
|
789 |
-
if section_config and not isinstance(section_config, dict):
|
790 |
-
logger.debug(
|
791 |
-
"The %s config key is not a dictionary type, "
|
792 |
-
"ignoring its value of: %s",
|
793 |
-
self._section_name,
|
794 |
-
section_config,
|
795 |
-
)
|
796 |
-
return None
|
797 |
-
for section_config_var, provider in self._override_providers.items():
|
798 |
-
provider_val = provider.provide()
|
799 |
-
if provider_val is not None:
|
800 |
-
if section_config is None:
|
801 |
-
section_config = {}
|
802 |
-
section_config[section_config_var] = provider_val
|
803 |
-
return section_config
|
804 |
-
|
805 |
-
def set_default_provider(self, key, default_provider):
|
806 |
-
provider = self._override_providers.get(key)
|
807 |
-
if isinstance(provider, ChainProvider):
|
808 |
-
provider.set_default_provider(default_provider)
|
809 |
-
return
|
810 |
-
elif isinstance(provider, BaseProvider):
|
811 |
-
default_provider = ChainProvider(
|
812 |
-
providers=[provider, default_provider]
|
813 |
-
)
|
814 |
-
self._override_providers[key] = default_provider
|
815 |
-
|
816 |
-
def __repr__(self):
|
817 |
-
return (
|
818 |
-
f'SectionConfigProvider(section_name={self._section_name}, '
|
819 |
-
f'session={self._session}, '
|
820 |
-
f'override_providers={self._override_providers})'
|
821 |
-
)
|
822 |
-
|
823 |
-
|
824 |
-
class ConstantProvider(BaseProvider):
|
825 |
-
"""This provider provides a constant value."""
|
826 |
-
|
827 |
-
def __init__(self, value):
|
828 |
-
self._value = value
|
829 |
-
|
830 |
-
def __deepcopy__(self, memo):
|
831 |
-
return ConstantProvider(copy.deepcopy(self._value, memo))
|
832 |
-
|
833 |
-
def provide(self):
|
834 |
-
"""Provide the constant value given during initialization."""
|
835 |
-
return self._value
|
836 |
-
|
837 |
-
def __repr__(self):
|
838 |
-
return 'ConstantProvider(value=%s)' % self._value
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Big-Web/MMSD/env/Lib/site-packages/pip/_vendor/chardet/charsetprober.py
DELETED
@@ -1,147 +0,0 @@
|
|
1 |
-
######################## BEGIN LICENSE BLOCK ########################
|
2 |
-
# The Original Code is Mozilla Universal charset detector code.
|
3 |
-
#
|
4 |
-
# The Initial Developer of the Original Code is
|
5 |
-
# Netscape Communications Corporation.
|
6 |
-
# Portions created by the Initial Developer are Copyright (C) 2001
|
7 |
-
# the Initial Developer. All Rights Reserved.
|
8 |
-
#
|
9 |
-
# Contributor(s):
|
10 |
-
# Mark Pilgrim - port to Python
|
11 |
-
# Shy Shalom - original C code
|
12 |
-
#
|
13 |
-
# This library is free software; you can redistribute it and/or
|
14 |
-
# modify it under the terms of the GNU Lesser General Public
|
15 |
-
# License as published by the Free Software Foundation; either
|
16 |
-
# version 2.1 of the License, or (at your option) any later version.
|
17 |
-
#
|
18 |
-
# This library is distributed in the hope that it will be useful,
|
19 |
-
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
20 |
-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
21 |
-
# Lesser General Public License for more details.
|
22 |
-
#
|
23 |
-
# You should have received a copy of the GNU Lesser General Public
|
24 |
-
# License along with this library; if not, write to the Free Software
|
25 |
-
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
|
26 |
-
# 02110-1301 USA
|
27 |
-
######################### END LICENSE BLOCK #########################
|
28 |
-
|
29 |
-
import logging
|
30 |
-
import re
|
31 |
-
from typing import Optional, Union
|
32 |
-
|
33 |
-
from .enums import LanguageFilter, ProbingState
|
34 |
-
|
35 |
-
INTERNATIONAL_WORDS_PATTERN = re.compile(
|
36 |
-
b"[a-zA-Z]*[\x80-\xFF]+[a-zA-Z]*[^a-zA-Z\x80-\xFF]?"
|
37 |
-
)
|
38 |
-
|
39 |
-
|
40 |
-
class CharSetProber:
|
41 |
-
|
42 |
-
SHORTCUT_THRESHOLD = 0.95
|
43 |
-
|
44 |
-
def __init__(self, lang_filter: LanguageFilter = LanguageFilter.NONE) -> None:
|
45 |
-
self._state = ProbingState.DETECTING
|
46 |
-
self.active = True
|
47 |
-
self.lang_filter = lang_filter
|
48 |
-
self.logger = logging.getLogger(__name__)
|
49 |
-
|
50 |
-
def reset(self) -> None:
|
51 |
-
self._state = ProbingState.DETECTING
|
52 |
-
|
53 |
-
@property
|
54 |
-
def charset_name(self) -> Optional[str]:
|
55 |
-
return None
|
56 |
-
|
57 |
-
@property
|
58 |
-
def language(self) -> Optional[str]:
|
59 |
-
raise NotImplementedError
|
60 |
-
|
61 |
-
def feed(self, byte_str: Union[bytes, bytearray]) -> ProbingState:
|
62 |
-
raise NotImplementedError
|
63 |
-
|
64 |
-
@property
|
65 |
-
def state(self) -> ProbingState:
|
66 |
-
return self._state
|
67 |
-
|
68 |
-
def get_confidence(self) -> float:
|
69 |
-
return 0.0
|
70 |
-
|
71 |
-
@staticmethod
|
72 |
-
def filter_high_byte_only(buf: Union[bytes, bytearray]) -> bytes:
|
73 |
-
buf = re.sub(b"([\x00-\x7F])+", b" ", buf)
|
74 |
-
return buf
|
75 |
-
|
76 |
-
@staticmethod
|
77 |
-
def filter_international_words(buf: Union[bytes, bytearray]) -> bytearray:
|
78 |
-
"""
|
79 |
-
We define three types of bytes:
|
80 |
-
alphabet: english alphabets [a-zA-Z]
|
81 |
-
international: international characters [\x80-\xFF]
|
82 |
-
marker: everything else [^a-zA-Z\x80-\xFF]
|
83 |
-
The input buffer can be thought to contain a series of words delimited
|
84 |
-
by markers. This function works to filter all words that contain at
|
85 |
-
least one international character. All contiguous sequences of markers
|
86 |
-
are replaced by a single space ascii character.
|
87 |
-
This filter applies to all scripts which do not use English characters.
|
88 |
-
"""
|
89 |
-
filtered = bytearray()
|
90 |
-
|
91 |
-
# This regex expression filters out only words that have at-least one
|
92 |
-
# international character. The word may include one marker character at
|
93 |
-
# the end.
|
94 |
-
words = INTERNATIONAL_WORDS_PATTERN.findall(buf)
|
95 |
-
|
96 |
-
for word in words:
|
97 |
-
filtered.extend(word[:-1])
|
98 |
-
|
99 |
-
# If the last character in the word is a marker, replace it with a
|
100 |
-
# space as markers shouldn't affect our analysis (they are used
|
101 |
-
# similarly across all languages and may thus have similar
|
102 |
-
# frequencies).
|
103 |
-
last_char = word[-1:]
|
104 |
-
if not last_char.isalpha() and last_char < b"\x80":
|
105 |
-
last_char = b" "
|
106 |
-
filtered.extend(last_char)
|
107 |
-
|
108 |
-
return filtered
|
109 |
-
|
110 |
-
@staticmethod
|
111 |
-
def remove_xml_tags(buf: Union[bytes, bytearray]) -> bytes:
|
112 |
-
"""
|
113 |
-
Returns a copy of ``buf`` that retains only the sequences of English
|
114 |
-
alphabet and high byte characters that are not between <> characters.
|
115 |
-
This filter can be applied to all scripts which contain both English
|
116 |
-
characters and extended ASCII characters, but is currently only used by
|
117 |
-
``Latin1Prober``.
|
118 |
-
"""
|
119 |
-
filtered = bytearray()
|
120 |
-
in_tag = False
|
121 |
-
prev = 0
|
122 |
-
buf = memoryview(buf).cast("c")
|
123 |
-
|
124 |
-
for curr, buf_char in enumerate(buf):
|
125 |
-
# Check if we're coming out of or entering an XML tag
|
126 |
-
|
127 |
-
# https://github.com/python/typeshed/issues/8182
|
128 |
-
if buf_char == b">": # type: ignore[comparison-overlap]
|
129 |
-
prev = curr + 1
|
130 |
-
in_tag = False
|
131 |
-
# https://github.com/python/typeshed/issues/8182
|
132 |
-
elif buf_char == b"<": # type: ignore[comparison-overlap]
|
133 |
-
if curr > prev and not in_tag:
|
134 |
-
# Keep everything after last non-extended-ASCII,
|
135 |
-
# non-alphabetic character
|
136 |
-
filtered.extend(buf[prev:curr])
|
137 |
-
# Output a space to delimit stretch we kept
|
138 |
-
filtered.extend(b" ")
|
139 |
-
in_tag = True
|
140 |
-
|
141 |
-
# If we're not in a tag...
|
142 |
-
if not in_tag:
|
143 |
-
# Keep everything after last non-extended-ASCII, non-alphabetic
|
144 |
-
# character
|
145 |
-
filtered.extend(buf[prev:])
|
146 |
-
|
147 |
-
return filtered
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Big-Web/MMSD/env/Lib/site-packages/setuptools/_vendor/ordered_set.py
DELETED
@@ -1,488 +0,0 @@
|
|
1 |
-
"""
|
2 |
-
An OrderedSet is a custom MutableSet that remembers its order, so that every
|
3 |
-
entry has an index that can be looked up.
|
4 |
-
|
5 |
-
Based on a recipe originally posted to ActiveState Recipes by Raymond Hettiger,
|
6 |
-
and released under the MIT license.
|
7 |
-
"""
|
8 |
-
import itertools as it
|
9 |
-
from collections import deque
|
10 |
-
|
11 |
-
try:
|
12 |
-
# Python 3
|
13 |
-
from collections.abc import MutableSet, Sequence
|
14 |
-
except ImportError:
|
15 |
-
# Python 2.7
|
16 |
-
from collections import MutableSet, Sequence
|
17 |
-
|
18 |
-
SLICE_ALL = slice(None)
|
19 |
-
__version__ = "3.1"
|
20 |
-
|
21 |
-
|
22 |
-
def is_iterable(obj):
|
23 |
-
"""
|
24 |
-
Are we being asked to look up a list of things, instead of a single thing?
|
25 |
-
We check for the `__iter__` attribute so that this can cover types that
|
26 |
-
don't have to be known by this module, such as NumPy arrays.
|
27 |
-
|
28 |
-
Strings, however, should be considered as atomic values to look up, not
|
29 |
-
iterables. The same goes for tuples, since they are immutable and therefore
|
30 |
-
valid entries.
|
31 |
-
|
32 |
-
We don't need to check for the Python 2 `unicode` type, because it doesn't
|
33 |
-
have an `__iter__` attribute anyway.
|
34 |
-
"""
|
35 |
-
return (
|
36 |
-
hasattr(obj, "__iter__")
|
37 |
-
and not isinstance(obj, str)
|
38 |
-
and not isinstance(obj, tuple)
|
39 |
-
)
|
40 |
-
|
41 |
-
|
42 |
-
class OrderedSet(MutableSet, Sequence):
|
43 |
-
"""
|
44 |
-
An OrderedSet is a custom MutableSet that remembers its order, so that
|
45 |
-
every entry has an index that can be looked up.
|
46 |
-
|
47 |
-
Example:
|
48 |
-
>>> OrderedSet([1, 1, 2, 3, 2])
|
49 |
-
OrderedSet([1, 2, 3])
|
50 |
-
"""
|
51 |
-
|
52 |
-
def __init__(self, iterable=None):
|
53 |
-
self.items = []
|
54 |
-
self.map = {}
|
55 |
-
if iterable is not None:
|
56 |
-
self |= iterable
|
57 |
-
|
58 |
-
def __len__(self):
|
59 |
-
"""
|
60 |
-
Returns the number of unique elements in the ordered set
|
61 |
-
|
62 |
-
Example:
|
63 |
-
>>> len(OrderedSet([]))
|
64 |
-
0
|
65 |
-
>>> len(OrderedSet([1, 2]))
|
66 |
-
2
|
67 |
-
"""
|
68 |
-
return len(self.items)
|
69 |
-
|
70 |
-
def __getitem__(self, index):
|
71 |
-
"""
|
72 |
-
Get the item at a given index.
|
73 |
-
|
74 |
-
If `index` is a slice, you will get back that slice of items, as a
|
75 |
-
new OrderedSet.
|
76 |
-
|
77 |
-
If `index` is a list or a similar iterable, you'll get a list of
|
78 |
-
items corresponding to those indices. This is similar to NumPy's
|
79 |
-
"fancy indexing". The result is not an OrderedSet because you may ask
|
80 |
-
for duplicate indices, and the number of elements returned should be
|
81 |
-
the number of elements asked for.
|
82 |
-
|
83 |
-
Example:
|
84 |
-
>>> oset = OrderedSet([1, 2, 3])
|
85 |
-
>>> oset[1]
|
86 |
-
2
|
87 |
-
"""
|
88 |
-
if isinstance(index, slice) and index == SLICE_ALL:
|
89 |
-
return self.copy()
|
90 |
-
elif is_iterable(index):
|
91 |
-
return [self.items[i] for i in index]
|
92 |
-
elif hasattr(index, "__index__") or isinstance(index, slice):
|
93 |
-
result = self.items[index]
|
94 |
-
if isinstance(result, list):
|
95 |
-
return self.__class__(result)
|
96 |
-
else:
|
97 |
-
return result
|
98 |
-
else:
|
99 |
-
raise TypeError("Don't know how to index an OrderedSet by %r" % index)
|
100 |
-
|
101 |
-
def copy(self):
|
102 |
-
"""
|
103 |
-
Return a shallow copy of this object.
|
104 |
-
|
105 |
-
Example:
|
106 |
-
>>> this = OrderedSet([1, 2, 3])
|
107 |
-
>>> other = this.copy()
|
108 |
-
>>> this == other
|
109 |
-
True
|
110 |
-
>>> this is other
|
111 |
-
False
|
112 |
-
"""
|
113 |
-
return self.__class__(self)
|
114 |
-
|
115 |
-
def __getstate__(self):
|
116 |
-
if len(self) == 0:
|
117 |
-
# The state can't be an empty list.
|
118 |
-
# We need to return a truthy value, or else __setstate__ won't be run.
|
119 |
-
#
|
120 |
-
# This could have been done more gracefully by always putting the state
|
121 |
-
# in a tuple, but this way is backwards- and forwards- compatible with
|
122 |
-
# previous versions of OrderedSet.
|
123 |
-
return (None,)
|
124 |
-
else:
|
125 |
-
return list(self)
|
126 |
-
|
127 |
-
def __setstate__(self, state):
|
128 |
-
if state == (None,):
|
129 |
-
self.__init__([])
|
130 |
-
else:
|
131 |
-
self.__init__(state)
|
132 |
-
|
133 |
-
def __contains__(self, key):
|
134 |
-
"""
|
135 |
-
Test if the item is in this ordered set
|
136 |
-
|
137 |
-
Example:
|
138 |
-
>>> 1 in OrderedSet([1, 3, 2])
|
139 |
-
True
|
140 |
-
>>> 5 in OrderedSet([1, 3, 2])
|
141 |
-
False
|
142 |
-
"""
|
143 |
-
return key in self.map
|
144 |
-
|
145 |
-
def add(self, key):
|
146 |
-
"""
|
147 |
-
Add `key` as an item to this OrderedSet, then return its index.
|
148 |
-
|
149 |
-
If `key` is already in the OrderedSet, return the index it already
|
150 |
-
had.
|
151 |
-
|
152 |
-
Example:
|
153 |
-
>>> oset = OrderedSet()
|
154 |
-
>>> oset.append(3)
|
155 |
-
0
|
156 |
-
>>> print(oset)
|
157 |
-
OrderedSet([3])
|
158 |
-
"""
|
159 |
-
if key not in self.map:
|
160 |
-
self.map[key] = len(self.items)
|
161 |
-
self.items.append(key)
|
162 |
-
return self.map[key]
|
163 |
-
|
164 |
-
append = add
|
165 |
-
|
166 |
-
def update(self, sequence):
|
167 |
-
"""
|
168 |
-
Update the set with the given iterable sequence, then return the index
|
169 |
-
of the last element inserted.
|
170 |
-
|
171 |
-
Example:
|
172 |
-
>>> oset = OrderedSet([1, 2, 3])
|
173 |
-
>>> oset.update([3, 1, 5, 1, 4])
|
174 |
-
4
|
175 |
-
>>> print(oset)
|
176 |
-
OrderedSet([1, 2, 3, 5, 4])
|
177 |
-
"""
|
178 |
-
item_index = None
|
179 |
-
try:
|
180 |
-
for item in sequence:
|
181 |
-
item_index = self.add(item)
|
182 |
-
except TypeError:
|
183 |
-
raise ValueError(
|
184 |
-
"Argument needs to be an iterable, got %s" % type(sequence)
|
185 |
-
)
|
186 |
-
return item_index
|
187 |
-
|
188 |
-
def index(self, key):
|
189 |
-
"""
|
190 |
-
Get the index of a given entry, raising an IndexError if it's not
|
191 |
-
present.
|
192 |
-
|
193 |
-
`key` can be an iterable of entries that is not a string, in which case
|
194 |
-
this returns a list of indices.
|
195 |
-
|
196 |
-
Example:
|
197 |
-
>>> oset = OrderedSet([1, 2, 3])
|
198 |
-
>>> oset.index(2)
|
199 |
-
1
|
200 |
-
"""
|
201 |
-
if is_iterable(key):
|
202 |
-
return [self.index(subkey) for subkey in key]
|
203 |
-
return self.map[key]
|
204 |
-
|
205 |
-
# Provide some compatibility with pd.Index
|
206 |
-
get_loc = index
|
207 |
-
get_indexer = index
|
208 |
-
|
209 |
-
def pop(self):
|
210 |
-
"""
|
211 |
-
Remove and return the last element from the set.
|
212 |
-
|
213 |
-
Raises KeyError if the set is empty.
|
214 |
-
|
215 |
-
Example:
|
216 |
-
>>> oset = OrderedSet([1, 2, 3])
|
217 |
-
>>> oset.pop()
|
218 |
-
3
|
219 |
-
"""
|
220 |
-
if not self.items:
|
221 |
-
raise KeyError("Set is empty")
|
222 |
-
|
223 |
-
elem = self.items[-1]
|
224 |
-
del self.items[-1]
|
225 |
-
del self.map[elem]
|
226 |
-
return elem
|
227 |
-
|
228 |
-
def discard(self, key):
|
229 |
-
"""
|
230 |
-
Remove an element. Do not raise an exception if absent.
|
231 |
-
|
232 |
-
The MutableSet mixin uses this to implement the .remove() method, which
|
233 |
-
*does* raise an error when asked to remove a non-existent item.
|
234 |
-
|
235 |
-
Example:
|
236 |
-
>>> oset = OrderedSet([1, 2, 3])
|
237 |
-
>>> oset.discard(2)
|
238 |
-
>>> print(oset)
|
239 |
-
OrderedSet([1, 3])
|
240 |
-
>>> oset.discard(2)
|
241 |
-
>>> print(oset)
|
242 |
-
OrderedSet([1, 3])
|
243 |
-
"""
|
244 |
-
if key in self:
|
245 |
-
i = self.map[key]
|
246 |
-
del self.items[i]
|
247 |
-
del self.map[key]
|
248 |
-
for k, v in self.map.items():
|
249 |
-
if v >= i:
|
250 |
-
self.map[k] = v - 1
|
251 |
-
|
252 |
-
def clear(self):
|
253 |
-
"""
|
254 |
-
Remove all items from this OrderedSet.
|
255 |
-
"""
|
256 |
-
del self.items[:]
|
257 |
-
self.map.clear()
|
258 |
-
|
259 |
-
def __iter__(self):
|
260 |
-
"""
|
261 |
-
Example:
|
262 |
-
>>> list(iter(OrderedSet([1, 2, 3])))
|
263 |
-
[1, 2, 3]
|
264 |
-
"""
|
265 |
-
return iter(self.items)
|
266 |
-
|
267 |
-
def __reversed__(self):
|
268 |
-
"""
|
269 |
-
Example:
|
270 |
-
>>> list(reversed(OrderedSet([1, 2, 3])))
|
271 |
-
[3, 2, 1]
|
272 |
-
"""
|
273 |
-
return reversed(self.items)
|
274 |
-
|
275 |
-
def __repr__(self):
|
276 |
-
if not self:
|
277 |
-
return "%s()" % (self.__class__.__name__,)
|
278 |
-
return "%s(%r)" % (self.__class__.__name__, list(self))
|
279 |
-
|
280 |
-
def __eq__(self, other):
|
281 |
-
"""
|
282 |
-
Returns true if the containers have the same items. If `other` is a
|
283 |
-
Sequence, then order is checked, otherwise it is ignored.
|
284 |
-
|
285 |
-
Example:
|
286 |
-
>>> oset = OrderedSet([1, 3, 2])
|
287 |
-
>>> oset == [1, 3, 2]
|
288 |
-
True
|
289 |
-
>>> oset == [1, 2, 3]
|
290 |
-
False
|
291 |
-
>>> oset == [2, 3]
|
292 |
-
False
|
293 |
-
>>> oset == OrderedSet([3, 2, 1])
|
294 |
-
False
|
295 |
-
"""
|
296 |
-
# In Python 2 deque is not a Sequence, so treat it as one for
|
297 |
-
# consistent behavior with Python 3.
|
298 |
-
if isinstance(other, (Sequence, deque)):
|
299 |
-
# Check that this OrderedSet contains the same elements, in the
|
300 |
-
# same order, as the other object.
|
301 |
-
return list(self) == list(other)
|
302 |
-
try:
|
303 |
-
other_as_set = set(other)
|
304 |
-
except TypeError:
|
305 |
-
# If `other` can't be converted into a set, it's not equal.
|
306 |
-
return False
|
307 |
-
else:
|
308 |
-
return set(self) == other_as_set
|
309 |
-
|
310 |
-
def union(self, *sets):
|
311 |
-
"""
|
312 |
-
Combines all unique items.
|
313 |
-
Each items order is defined by its first appearance.
|
314 |
-
|
315 |
-
Example:
|
316 |
-
>>> oset = OrderedSet.union(OrderedSet([3, 1, 4, 1, 5]), [1, 3], [2, 0])
|
317 |
-
>>> print(oset)
|
318 |
-
OrderedSet([3, 1, 4, 5, 2, 0])
|
319 |
-
>>> oset.union([8, 9])
|
320 |
-
OrderedSet([3, 1, 4, 5, 2, 0, 8, 9])
|
321 |
-
>>> oset | {10}
|
322 |
-
OrderedSet([3, 1, 4, 5, 2, 0, 10])
|
323 |
-
"""
|
324 |
-
cls = self.__class__ if isinstance(self, OrderedSet) else OrderedSet
|
325 |
-
containers = map(list, it.chain([self], sets))
|
326 |
-
items = it.chain.from_iterable(containers)
|
327 |
-
return cls(items)
|
328 |
-
|
329 |
-
def __and__(self, other):
|
330 |
-
# the parent implementation of this is backwards
|
331 |
-
return self.intersection(other)
|
332 |
-
|
333 |
-
def intersection(self, *sets):
|
334 |
-
"""
|
335 |
-
Returns elements in common between all sets. Order is defined only
|
336 |
-
by the first set.
|
337 |
-
|
338 |
-
Example:
|
339 |
-
>>> oset = OrderedSet.intersection(OrderedSet([0, 1, 2, 3]), [1, 2, 3])
|
340 |
-
>>> print(oset)
|
341 |
-
OrderedSet([1, 2, 3])
|
342 |
-
>>> oset.intersection([2, 4, 5], [1, 2, 3, 4])
|
343 |
-
OrderedSet([2])
|
344 |
-
>>> oset.intersection()
|
345 |
-
OrderedSet([1, 2, 3])
|
346 |
-
"""
|
347 |
-
cls = self.__class__ if isinstance(self, OrderedSet) else OrderedSet
|
348 |
-
if sets:
|
349 |
-
common = set.intersection(*map(set, sets))
|
350 |
-
items = (item for item in self if item in common)
|
351 |
-
else:
|
352 |
-
items = self
|
353 |
-
return cls(items)
|
354 |
-
|
355 |
-
def difference(self, *sets):
|
356 |
-
"""
|
357 |
-
Returns all elements that are in this set but not the others.
|
358 |
-
|
359 |
-
Example:
|
360 |
-
>>> OrderedSet([1, 2, 3]).difference(OrderedSet([2]))
|
361 |
-
OrderedSet([1, 3])
|
362 |
-
>>> OrderedSet([1, 2, 3]).difference(OrderedSet([2]), OrderedSet([3]))
|
363 |
-
OrderedSet([1])
|
364 |
-
>>> OrderedSet([1, 2, 3]) - OrderedSet([2])
|
365 |
-
OrderedSet([1, 3])
|
366 |
-
>>> OrderedSet([1, 2, 3]).difference()
|
367 |
-
OrderedSet([1, 2, 3])
|
368 |
-
"""
|
369 |
-
cls = self.__class__
|
370 |
-
if sets:
|
371 |
-
other = set.union(*map(set, sets))
|
372 |
-
items = (item for item in self if item not in other)
|
373 |
-
else:
|
374 |
-
items = self
|
375 |
-
return cls(items)
|
376 |
-
|
377 |
-
def issubset(self, other):
|
378 |
-
"""
|
379 |
-
Report whether another set contains this set.
|
380 |
-
|
381 |
-
Example:
|
382 |
-
>>> OrderedSet([1, 2, 3]).issubset({1, 2})
|
383 |
-
False
|
384 |
-
>>> OrderedSet([1, 2, 3]).issubset({1, 2, 3, 4})
|
385 |
-
True
|
386 |
-
>>> OrderedSet([1, 2, 3]).issubset({1, 4, 3, 5})
|
387 |
-
False
|
388 |
-
"""
|
389 |
-
if len(self) > len(other): # Fast check for obvious cases
|
390 |
-
return False
|
391 |
-
return all(item in other for item in self)
|
392 |
-
|
393 |
-
def issuperset(self, other):
|
394 |
-
"""
|
395 |
-
Report whether this set contains another set.
|
396 |
-
|
397 |
-
Example:
|
398 |
-
>>> OrderedSet([1, 2]).issuperset([1, 2, 3])
|
399 |
-
False
|
400 |
-
>>> OrderedSet([1, 2, 3, 4]).issuperset({1, 2, 3})
|
401 |
-
True
|
402 |
-
>>> OrderedSet([1, 4, 3, 5]).issuperset({1, 2, 3})
|
403 |
-
False
|
404 |
-
"""
|
405 |
-
if len(self) < len(other): # Fast check for obvious cases
|
406 |
-
return False
|
407 |
-
return all(item in self for item in other)
|
408 |
-
|
409 |
-
def symmetric_difference(self, other):
|
410 |
-
"""
|
411 |
-
Return the symmetric difference of two OrderedSets as a new set.
|
412 |
-
That is, the new set will contain all elements that are in exactly
|
413 |
-
one of the sets.
|
414 |
-
|
415 |
-
Their order will be preserved, with elements from `self` preceding
|
416 |
-
elements from `other`.
|
417 |
-
|
418 |
-
Example:
|
419 |
-
>>> this = OrderedSet([1, 4, 3, 5, 7])
|
420 |
-
>>> other = OrderedSet([9, 7, 1, 3, 2])
|
421 |
-
>>> this.symmetric_difference(other)
|
422 |
-
OrderedSet([4, 5, 9, 2])
|
423 |
-
"""
|
424 |
-
cls = self.__class__ if isinstance(self, OrderedSet) else OrderedSet
|
425 |
-
diff1 = cls(self).difference(other)
|
426 |
-
diff2 = cls(other).difference(self)
|
427 |
-
return diff1.union(diff2)
|
428 |
-
|
429 |
-
def _update_items(self, items):
|
430 |
-
"""
|
431 |
-
Replace the 'items' list of this OrderedSet with a new one, updating
|
432 |
-
self.map accordingly.
|
433 |
-
"""
|
434 |
-
self.items = items
|
435 |
-
self.map = {item: idx for (idx, item) in enumerate(items)}
|
436 |
-
|
437 |
-
def difference_update(self, *sets):
|
438 |
-
"""
|
439 |
-
Update this OrderedSet to remove items from one or more other sets.
|
440 |
-
|
441 |
-
Example:
|
442 |
-
>>> this = OrderedSet([1, 2, 3])
|
443 |
-
>>> this.difference_update(OrderedSet([2, 4]))
|
444 |
-
>>> print(this)
|
445 |
-
OrderedSet([1, 3])
|
446 |
-
|
447 |
-
>>> this = OrderedSet([1, 2, 3, 4, 5])
|
448 |
-
>>> this.difference_update(OrderedSet([2, 4]), OrderedSet([1, 4, 6]))
|
449 |
-
>>> print(this)
|
450 |
-
OrderedSet([3, 5])
|
451 |
-
"""
|
452 |
-
items_to_remove = set()
|
453 |
-
for other in sets:
|
454 |
-
items_to_remove |= set(other)
|
455 |
-
self._update_items([item for item in self.items if item not in items_to_remove])
|
456 |
-
|
457 |
-
def intersection_update(self, other):
|
458 |
-
"""
|
459 |
-
Update this OrderedSet to keep only items in another set, preserving
|
460 |
-
their order in this set.
|
461 |
-
|
462 |
-
Example:
|
463 |
-
>>> this = OrderedSet([1, 4, 3, 5, 7])
|
464 |
-
>>> other = OrderedSet([9, 7, 1, 3, 2])
|
465 |
-
>>> this.intersection_update(other)
|
466 |
-
>>> print(this)
|
467 |
-
OrderedSet([1, 3, 7])
|
468 |
-
"""
|
469 |
-
other = set(other)
|
470 |
-
self._update_items([item for item in self.items if item in other])
|
471 |
-
|
472 |
-
def symmetric_difference_update(self, other):
|
473 |
-
"""
|
474 |
-
Update this OrderedSet to remove items from another set, then
|
475 |
-
add items from the other set that were not present in this set.
|
476 |
-
|
477 |
-
Example:
|
478 |
-
>>> this = OrderedSet([1, 4, 3, 5, 7])
|
479 |
-
>>> other = OrderedSet([9, 7, 1, 3, 2])
|
480 |
-
>>> this.symmetric_difference_update(other)
|
481 |
-
>>> print(this)
|
482 |
-
OrderedSet([4, 5, 9, 2])
|
483 |
-
"""
|
484 |
-
items_to_add = [item for item in other if item not in self]
|
485 |
-
items_to_remove = set(other)
|
486 |
-
self._update_items(
|
487 |
-
[item for item in self.items if item not in items_to_remove] + items_to_add
|
488 |
-
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/CVPR/Dual-Key_Backdoor_Attacks/openvqa/openvqa/models/ban/model_cfgs.py
DELETED
@@ -1,20 +0,0 @@
|
|
1 |
-
# --------------------------------------------------------
|
2 |
-
# OpenVQA
|
3 |
-
# Written by Zhenwei Shao https://github.com/ParadoxZW
|
4 |
-
# --------------------------------------------------------
|
5 |
-
|
6 |
-
from openvqa.core.base_cfgs import BaseCfgs
|
7 |
-
|
8 |
-
|
9 |
-
class Cfgs(BaseCfgs):
|
10 |
-
def __init__(self):
|
11 |
-
super(Cfgs, self).__init__()
|
12 |
-
|
13 |
-
self.IMG_FEAT_SIZE = 2048
|
14 |
-
self.GLIMPSE = 8
|
15 |
-
self.HIDDEN_SIZE = 1024
|
16 |
-
self.K_TIMES = 3
|
17 |
-
self.BA_HIDDEN_SIZE = self.K_TIMES * self.HIDDEN_SIZE
|
18 |
-
self.DROPOUT_R = 0.2
|
19 |
-
self.CLASSIFER_DROPOUT_R = 0.5
|
20 |
-
self.FLAT_OUT_SIZE = 2048
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/CVPR/LIVE/thrust/thrust/detail/allocator/temporary_allocator.h
DELETED
@@ -1,85 +0,0 @@
|
|
1 |
-
/*
|
2 |
-
* Copyright 2008-2013 NVIDIA Corporation
|
3 |
-
*
|
4 |
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
5 |
-
* you may not use this file except in compliance with the License.
|
6 |
-
* You may obtain a copy of the License at
|
7 |
-
*
|
8 |
-
* http://www.apache.org/licenses/LICENSE-2.0
|
9 |
-
*
|
10 |
-
* Unless required by applicable law or agreed to in writing, software
|
11 |
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
12 |
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13 |
-
* See the License for the specific language governing permissions and
|
14 |
-
* limitations under the License.
|
15 |
-
*/
|
16 |
-
|
17 |
-
#pragma once
|
18 |
-
|
19 |
-
#include <thrust/detail/config.h>
|
20 |
-
#include <thrust/detail/allocator/tagged_allocator.h>
|
21 |
-
#include <thrust/detail/allocator/allocator_traits.h>
|
22 |
-
#include <thrust/pair.h>
|
23 |
-
#include <thrust/memory.h>
|
24 |
-
#include <thrust/detail/execution_policy.h>
|
25 |
-
|
26 |
-
namespace thrust
|
27 |
-
{
|
28 |
-
namespace detail
|
29 |
-
{
|
30 |
-
|
31 |
-
|
32 |
-
// XXX the pointer parameter given to tagged_allocator should be related to
|
33 |
-
// the type of the expression get_temporary_buffer(system, n).first
|
34 |
-
// without decltype, compromise on pointer<T,System>
|
35 |
-
template<typename T, typename System>
|
36 |
-
class temporary_allocator
|
37 |
-
: public thrust::detail::tagged_allocator<
|
38 |
-
T, System, thrust::pointer<T,System>
|
39 |
-
>
|
40 |
-
{
|
41 |
-
private:
|
42 |
-
typedef thrust::detail::tagged_allocator<
|
43 |
-
T, System, thrust::pointer<T,System>
|
44 |
-
> super_t;
|
45 |
-
|
46 |
-
System &m_system;
|
47 |
-
|
48 |
-
public:
|
49 |
-
typedef typename super_t::pointer pointer;
|
50 |
-
typedef typename super_t::size_type size_type;
|
51 |
-
|
52 |
-
inline __host__ __device__
|
53 |
-
temporary_allocator(const temporary_allocator &other) :
|
54 |
-
super_t(),
|
55 |
-
m_system(other.m_system)
|
56 |
-
{}
|
57 |
-
|
58 |
-
inline __host__ __device__
|
59 |
-
explicit temporary_allocator(thrust::execution_policy<System> &system) :
|
60 |
-
super_t(),
|
61 |
-
m_system(thrust::detail::derived_cast(system))
|
62 |
-
{}
|
63 |
-
|
64 |
-
__host__ __device__
|
65 |
-
pointer allocate(size_type cnt);
|
66 |
-
|
67 |
-
__host__ __device__
|
68 |
-
void deallocate(pointer p, size_type n);
|
69 |
-
|
70 |
-
__host__ __device__
|
71 |
-
inline System &system()
|
72 |
-
{
|
73 |
-
return m_system;
|
74 |
-
} // end system()
|
75 |
-
|
76 |
-
private:
|
77 |
-
typedef thrust::pair<pointer, size_type> pointer_and_size;
|
78 |
-
}; // end temporary_allocator
|
79 |
-
|
80 |
-
|
81 |
-
} // end detail
|
82 |
-
} // end thrust
|
83 |
-
|
84 |
-
#include <thrust/detail/allocator/temporary_allocator.inl>
|
85 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/CVPR/LIVE/thrust/thrust/iterator/permutation_iterator.h
DELETED
@@ -1,217 +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 |
-
/*! \file thrust/iterator/permutation_iterator.h
|
18 |
-
* \brief An iterator which performs a gather or scatter operation when dereferenced
|
19 |
-
*/
|
20 |
-
|
21 |
-
/*
|
22 |
-
* (C) Copyright Toon Knapen 2001.
|
23 |
-
* (C) Copyright David Abrahams 2003.
|
24 |
-
* (C) Copyright Roland Richter 2003.
|
25 |
-
*
|
26 |
-
* Distributed under the Boost Software License, Version 1.0.
|
27 |
-
* (See accompanying NOTICE file for the complete license)
|
28 |
-
*
|
29 |
-
* For more information, see http://www.boost.org
|
30 |
-
*/
|
31 |
-
|
32 |
-
#pragma once
|
33 |
-
|
34 |
-
#include <thrust/detail/config.h>
|
35 |
-
#include <thrust/detail/type_traits.h>
|
36 |
-
#include <thrust/iterator/detail/permutation_iterator_base.h>
|
37 |
-
#include <thrust/iterator/iterator_facade.h>
|
38 |
-
#include <thrust/iterator/iterator_traits.h>
|
39 |
-
|
40 |
-
namespace thrust
|
41 |
-
{
|
42 |
-
|
43 |
-
|
44 |
-
/*! \addtogroup iterators
|
45 |
-
* \{
|
46 |
-
*/
|
47 |
-
|
48 |
-
/*! \addtogroup fancyiterator Fancy Iterators
|
49 |
-
* \ingroup iterators
|
50 |
-
* \{
|
51 |
-
*/
|
52 |
-
|
53 |
-
/*! \p permutation_iterator is an iterator which represents a pointer into a
|
54 |
-
* reordered view of a given range. \p permutation_iterator is an imprecise name;
|
55 |
-
* the reordered view need not be a strict permutation. This iterator is useful
|
56 |
-
* for fusing a scatter or gather operation with other algorithms.
|
57 |
-
*
|
58 |
-
* This iterator takes two arguments:
|
59 |
-
*
|
60 |
-
* - an iterator to the range \c V on which the "permutation" will be applied
|
61 |
-
* - the reindexing scheme that defines how the elements of \c V will be permuted.
|
62 |
-
*
|
63 |
-
* Note that \p permutation_iterator is not limited to strict permutations of the
|
64 |
-
* given range \c V. The distance between begin and end of the reindexing iterators
|
65 |
-
* is allowed to be smaller compared to the size of the range \c V, in which case
|
66 |
-
* the \p permutation_iterator only provides a "permutation" of a subrange of \c V.
|
67 |
-
* The indices neither need to be unique. In this same context, it must be noted
|
68 |
-
* that the past-the-end \p permutation_iterator is completely defined by means of
|
69 |
-
* the past-the-end iterator to the indices.
|
70 |
-
*
|
71 |
-
* The following code snippet demonstrates how to create a \p permutation_iterator
|
72 |
-
* which represents a reordering of the contents of a \p device_vector.
|
73 |
-
*
|
74 |
-
* \code
|
75 |
-
* #include <thrust/iterator/permutation_iterator.h>
|
76 |
-
* #include <thrust/device_vector.h>
|
77 |
-
* ...
|
78 |
-
* thrust::device_vector<float> values(4);
|
79 |
-
* values[0] = 10.0f;
|
80 |
-
* values[1] = 20.0f;
|
81 |
-
* values[2] = 30.0f;
|
82 |
-
* values[3] = 40.0f;
|
83 |
-
* values[4] = 50.0f;
|
84 |
-
* values[5] = 60.0f;
|
85 |
-
* values[6] = 70.0f;
|
86 |
-
* values[7] = 80.0f;
|
87 |
-
*
|
88 |
-
* thrust::device_vector<int> indices(4);
|
89 |
-
* indices[0] = 2;
|
90 |
-
* indices[1] = 6;
|
91 |
-
* indices[2] = 1;
|
92 |
-
* indices[3] = 3;
|
93 |
-
*
|
94 |
-
* typedef thrust::device_vector<float>::iterator ElementIterator;
|
95 |
-
* typedef thrust::device_vector<int>::iterator IndexIterator;
|
96 |
-
*
|
97 |
-
* thrust::permutation_iterator<ElementIterator,IndexIterator> iter(values.begin(), indices.begin());
|
98 |
-
*
|
99 |
-
* *iter; // returns 30.0f;
|
100 |
-
* iter[0]; // returns 30.0f;
|
101 |
-
* iter[1]; // returns 70.0f;
|
102 |
-
* iter[2]; // returns 20.0f;
|
103 |
-
* iter[3]; // returns 40.0f;
|
104 |
-
*
|
105 |
-
* // iter[4] is an out-of-bounds error
|
106 |
-
*
|
107 |
-
* *iter = -1.0f; // sets values[2] to -1.0f;
|
108 |
-
* iter[0] = -1.0f; // sets values[2] to -1.0f;
|
109 |
-
* iter[1] = -1.0f; // sets values[6] to -1.0f;
|
110 |
-
* iter[2] = -1.0f; // sets values[1] to -1.0f;
|
111 |
-
* iter[3] = -1.0f; // sets values[3] to -1.0f;
|
112 |
-
*
|
113 |
-
* // values is now {10, -1, -1, -1, 50, 60, -1, 80}
|
114 |
-
* \endcode
|
115 |
-
*
|
116 |
-
* \see make_permutation_iterator
|
117 |
-
*/
|
118 |
-
template <typename ElementIterator,
|
119 |
-
typename IndexIterator>
|
120 |
-
class permutation_iterator
|
121 |
-
: public thrust::detail::permutation_iterator_base<
|
122 |
-
ElementIterator,
|
123 |
-
IndexIterator
|
124 |
-
>::type
|
125 |
-
{
|
126 |
-
/*! \cond
|
127 |
-
*/
|
128 |
-
private:
|
129 |
-
typedef typename detail::permutation_iterator_base<ElementIterator,IndexIterator>::type super_t;
|
130 |
-
|
131 |
-
friend class thrust::iterator_core_access;
|
132 |
-
/*! \endcond
|
133 |
-
*/
|
134 |
-
|
135 |
-
public:
|
136 |
-
/*! Null constructor calls the null constructor of this \p permutation_iterator's
|
137 |
-
* element iterator.
|
138 |
-
*/
|
139 |
-
__host__ __device__
|
140 |
-
permutation_iterator()
|
141 |
-
: m_element_iterator() {}
|
142 |
-
|
143 |
-
/*! Constructor accepts an \c ElementIterator into a range of values and an
|
144 |
-
* \c IndexIterator into a range of indices defining the indexing scheme on the
|
145 |
-
* values.
|
146 |
-
*
|
147 |
-
* \param x An \c ElementIterator pointing this \p permutation_iterator's range of values.
|
148 |
-
* \param y An \c IndexIterator pointing to an indexing scheme to use on \p x.
|
149 |
-
*/
|
150 |
-
__host__ __device__
|
151 |
-
explicit permutation_iterator(ElementIterator x, IndexIterator y)
|
152 |
-
: super_t(y), m_element_iterator(x) {}
|
153 |
-
|
154 |
-
/*! Copy constructor accepts a related \p permutation_iterator.
|
155 |
-
* \param r A compatible \p permutation_iterator to copy from.
|
156 |
-
*/
|
157 |
-
template<typename OtherElementIterator, typename OtherIndexIterator>
|
158 |
-
__host__ __device__
|
159 |
-
permutation_iterator(permutation_iterator<OtherElementIterator,OtherIndexIterator> const &r
|
160 |
-
// XXX remove these guards when we have static_assert
|
161 |
-
, typename detail::enable_if_convertible<OtherElementIterator, ElementIterator>::type* = 0
|
162 |
-
, typename detail::enable_if_convertible<OtherIndexIterator, IndexIterator>::type* = 0
|
163 |
-
)
|
164 |
-
: super_t(r.base()), m_element_iterator(r.m_element_iterator)
|
165 |
-
{}
|
166 |
-
|
167 |
-
/*! \cond
|
168 |
-
*/
|
169 |
-
private:
|
170 |
-
// MSVC 2013 and 2015 incorrectly warning about returning a reference to
|
171 |
-
// a local/temporary here.
|
172 |
-
// See goo.gl/LELTNp
|
173 |
-
THRUST_DISABLE_MSVC_WARNING_BEGIN(4172)
|
174 |
-
|
175 |
-
__thrust_exec_check_disable__
|
176 |
-
__host__ __device__
|
177 |
-
typename super_t::reference dereference() const
|
178 |
-
{
|
179 |
-
return *(m_element_iterator + *this->base());
|
180 |
-
}
|
181 |
-
|
182 |
-
THRUST_DISABLE_MSVC_WARNING_END(4172)
|
183 |
-
|
184 |
-
// make friends for the copy constructor
|
185 |
-
template<typename,typename> friend class permutation_iterator;
|
186 |
-
|
187 |
-
ElementIterator m_element_iterator;
|
188 |
-
/*! \endcond
|
189 |
-
*/
|
190 |
-
}; // end permutation_iterator
|
191 |
-
|
192 |
-
|
193 |
-
/*! \p make_permutation_iterator creates a \p permutation_iterator
|
194 |
-
* from an \c ElementIterator pointing to a range of elements to "permute"
|
195 |
-
* and an \c IndexIterator pointing to a range of indices defining an indexing
|
196 |
-
* scheme on the values.
|
197 |
-
*
|
198 |
-
* \param e An \c ElementIterator pointing to a range of values.
|
199 |
-
* \param i An \c IndexIterator pointing to an indexing scheme to use on \p e.
|
200 |
-
* \return A new \p permutation_iterator which permutes the range \p e by \p i.
|
201 |
-
* \see permutation_iterator
|
202 |
-
*/
|
203 |
-
template<typename ElementIterator, typename IndexIterator>
|
204 |
-
__host__ __device__
|
205 |
-
permutation_iterator<ElementIterator,IndexIterator> make_permutation_iterator(ElementIterator e, IndexIterator i)
|
206 |
-
{
|
207 |
-
return permutation_iterator<ElementIterator,IndexIterator>(e,i);
|
208 |
-
}
|
209 |
-
|
210 |
-
/*! \} // end fancyiterators
|
211 |
-
*/
|
212 |
-
|
213 |
-
/*! \} // end iterators
|
214 |
-
*/
|
215 |
-
|
216 |
-
} // end thrust
|
217 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/CVPR/LIVE/thrust/thrust/system/detail/adl/equal.h
DELETED
@@ -1,44 +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 equal 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 |
-
// the purpose of this header is to #include the equal.h header
|
22 |
-
// of the sequential, host, and device systems. It should be #included in any
|
23 |
-
// code which uses adl to dispatch equal
|
24 |
-
|
25 |
-
#include <thrust/system/detail/sequential/equal.h>
|
26 |
-
|
27 |
-
// SCons can't see through the #defines below to figure out what this header
|
28 |
-
// includes, so we fake it out by specifying all possible files we might end up
|
29 |
-
// including inside an #if 0.
|
30 |
-
#if 0
|
31 |
-
#include <thrust/system/cpp/detail/equal.h>
|
32 |
-
#include <thrust/system/cuda/detail/equal.h>
|
33 |
-
#include <thrust/system/omp/detail/equal.h>
|
34 |
-
#include <thrust/system/tbb/detail/equal.h>
|
35 |
-
#endif
|
36 |
-
|
37 |
-
#define __THRUST_HOST_SYSTEM_EQUAL_HEADER <__THRUST_HOST_SYSTEM_ROOT/detail/equal.h>
|
38 |
-
#include __THRUST_HOST_SYSTEM_EQUAL_HEADER
|
39 |
-
#undef __THRUST_HOST_SYSTEM_EQUAL_HEADER
|
40 |
-
|
41 |
-
#define __THRUST_DEVICE_SYSTEM_EQUAL_HEADER <__THRUST_DEVICE_SYSTEM_ROOT/detail/equal.h>
|
42 |
-
#include __THRUST_DEVICE_SYSTEM_EQUAL_HEADER
|
43 |
-
#undef __THRUST_DEVICE_SYSTEM_EQUAL_HEADER
|
44 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/CVPR/WALT/mmdet/models/detectors/rpn.py
DELETED
@@ -1,154 +0,0 @@
|
|
1 |
-
import mmcv
|
2 |
-
from mmcv.image import tensor2imgs
|
3 |
-
|
4 |
-
from mmdet.core import bbox_mapping
|
5 |
-
from ..builder import DETECTORS, build_backbone, build_head, build_neck
|
6 |
-
from .base import BaseDetector
|
7 |
-
|
8 |
-
|
9 |
-
@DETECTORS.register_module()
|
10 |
-
class RPN(BaseDetector):
|
11 |
-
"""Implementation of Region Proposal Network."""
|
12 |
-
|
13 |
-
def __init__(self,
|
14 |
-
backbone,
|
15 |
-
neck,
|
16 |
-
rpn_head,
|
17 |
-
train_cfg,
|
18 |
-
test_cfg,
|
19 |
-
pretrained=None):
|
20 |
-
super(RPN, self).__init__()
|
21 |
-
self.backbone = build_backbone(backbone)
|
22 |
-
self.neck = build_neck(neck) if neck is not None else None
|
23 |
-
rpn_train_cfg = train_cfg.rpn if train_cfg is not None else None
|
24 |
-
rpn_head.update(train_cfg=rpn_train_cfg)
|
25 |
-
rpn_head.update(test_cfg=test_cfg.rpn)
|
26 |
-
self.rpn_head = build_head(rpn_head)
|
27 |
-
self.train_cfg = train_cfg
|
28 |
-
self.test_cfg = test_cfg
|
29 |
-
self.init_weights(pretrained=pretrained)
|
30 |
-
|
31 |
-
def init_weights(self, pretrained=None):
|
32 |
-
"""Initialize the weights in detector.
|
33 |
-
|
34 |
-
Args:
|
35 |
-
pretrained (str, optional): Path to pre-trained weights.
|
36 |
-
Defaults to None.
|
37 |
-
"""
|
38 |
-
super(RPN, self).init_weights(pretrained)
|
39 |
-
self.backbone.init_weights(pretrained=pretrained)
|
40 |
-
if self.with_neck:
|
41 |
-
self.neck.init_weights()
|
42 |
-
self.rpn_head.init_weights()
|
43 |
-
|
44 |
-
def extract_feat(self, img):
|
45 |
-
"""Extract features.
|
46 |
-
|
47 |
-
Args:
|
48 |
-
img (torch.Tensor): Image tensor with shape (n, c, h ,w).
|
49 |
-
|
50 |
-
Returns:
|
51 |
-
list[torch.Tensor]: Multi-level features that may have
|
52 |
-
different resolutions.
|
53 |
-
"""
|
54 |
-
x = self.backbone(img)
|
55 |
-
if self.with_neck:
|
56 |
-
x = self.neck(x)
|
57 |
-
return x
|
58 |
-
|
59 |
-
def forward_dummy(self, img):
|
60 |
-
"""Dummy forward function."""
|
61 |
-
x = self.extract_feat(img)
|
62 |
-
rpn_outs = self.rpn_head(x)
|
63 |
-
return rpn_outs
|
64 |
-
|
65 |
-
def forward_train(self,
|
66 |
-
img,
|
67 |
-
img_metas,
|
68 |
-
gt_bboxes=None,
|
69 |
-
gt_bboxes_ignore=None):
|
70 |
-
"""
|
71 |
-
Args:
|
72 |
-
img (Tensor): Input images of shape (N, C, H, W).
|
73 |
-
Typically these should be mean centered and std scaled.
|
74 |
-
img_metas (list[dict]): A List of image info dict where each dict
|
75 |
-
has: 'img_shape', 'scale_factor', 'flip', and may also contain
|
76 |
-
'filename', 'ori_shape', 'pad_shape', and 'img_norm_cfg'.
|
77 |
-
For details on the values of these keys see
|
78 |
-
:class:`mmdet.datasets.pipelines.Collect`.
|
79 |
-
gt_bboxes (list[Tensor]): Each item are the truth boxes for each
|
80 |
-
image in [tl_x, tl_y, br_x, br_y] format.
|
81 |
-
gt_bboxes_ignore (None | list[Tensor]): Specify which bounding
|
82 |
-
boxes can be ignored when computing the loss.
|
83 |
-
|
84 |
-
Returns:
|
85 |
-
dict[str, Tensor]: A dictionary of loss components.
|
86 |
-
"""
|
87 |
-
if (isinstance(self.train_cfg.rpn, dict)
|
88 |
-
and self.train_cfg.rpn.get('debug', False)):
|
89 |
-
self.rpn_head.debug_imgs = tensor2imgs(img)
|
90 |
-
|
91 |
-
x = self.extract_feat(img)
|
92 |
-
losses = self.rpn_head.forward_train(x, img_metas, gt_bboxes, None,
|
93 |
-
gt_bboxes_ignore)
|
94 |
-
return losses
|
95 |
-
|
96 |
-
def simple_test(self, img, img_metas, rescale=False):
|
97 |
-
"""Test function without test time augmentation.
|
98 |
-
|
99 |
-
Args:
|
100 |
-
imgs (list[torch.Tensor]): List of multiple images
|
101 |
-
img_metas (list[dict]): List of image information.
|
102 |
-
rescale (bool, optional): Whether to rescale the results.
|
103 |
-
Defaults to False.
|
104 |
-
|
105 |
-
Returns:
|
106 |
-
list[np.ndarray]: proposals
|
107 |
-
"""
|
108 |
-
x = self.extract_feat(img)
|
109 |
-
proposal_list = self.rpn_head.simple_test_rpn(x, img_metas)
|
110 |
-
if rescale:
|
111 |
-
for proposals, meta in zip(proposal_list, img_metas):
|
112 |
-
proposals[:, :4] /= proposals.new_tensor(meta['scale_factor'])
|
113 |
-
|
114 |
-
return [proposal.cpu().numpy() for proposal in proposal_list]
|
115 |
-
|
116 |
-
def aug_test(self, imgs, img_metas, rescale=False):
|
117 |
-
"""Test function with test time augmentation.
|
118 |
-
|
119 |
-
Args:
|
120 |
-
imgs (list[torch.Tensor]): List of multiple images
|
121 |
-
img_metas (list[dict]): List of image information.
|
122 |
-
rescale (bool, optional): Whether to rescale the results.
|
123 |
-
Defaults to False.
|
124 |
-
|
125 |
-
Returns:
|
126 |
-
list[np.ndarray]: proposals
|
127 |
-
"""
|
128 |
-
proposal_list = self.rpn_head.aug_test_rpn(
|
129 |
-
self.extract_feats(imgs), img_metas)
|
130 |
-
if not rescale:
|
131 |
-
for proposals, img_meta in zip(proposal_list, img_metas[0]):
|
132 |
-
img_shape = img_meta['img_shape']
|
133 |
-
scale_factor = img_meta['scale_factor']
|
134 |
-
flip = img_meta['flip']
|
135 |
-
flip_direction = img_meta['flip_direction']
|
136 |
-
proposals[:, :4] = bbox_mapping(proposals[:, :4], img_shape,
|
137 |
-
scale_factor, flip,
|
138 |
-
flip_direction)
|
139 |
-
return [proposal.cpu().numpy() for proposal in proposal_list]
|
140 |
-
|
141 |
-
def show_result(self, data, result, top_k=20, **kwargs):
|
142 |
-
"""Show RPN proposals on the image.
|
143 |
-
|
144 |
-
Args:
|
145 |
-
data (str or np.ndarray): Image filename or loaded image.
|
146 |
-
result (Tensor or tuple): The results to draw over `img`
|
147 |
-
bbox_result or (bbox_result, segm_result).
|
148 |
-
top_k (int): Plot the first k bboxes only
|
149 |
-
if set positive. Default: 20
|
150 |
-
|
151 |
-
Returns:
|
152 |
-
np.ndarray: The image with bboxes drawn on it.
|
153 |
-
"""
|
154 |
-
mmcv.imshow_bboxes(data, result, top_k=top_k)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/CVPR/regionclip-demo/detectron2/structures/image_list.py
DELETED
@@ -1,124 +0,0 @@
|
|
1 |
-
# Copyright (c) Facebook, Inc. and its affiliates.
|
2 |
-
from __future__ import division
|
3 |
-
from typing import Any, List, Tuple
|
4 |
-
import torch
|
5 |
-
from torch import device
|
6 |
-
from torch.nn import functional as F
|
7 |
-
|
8 |
-
from detectron2.utils.env import TORCH_VERSION
|
9 |
-
|
10 |
-
|
11 |
-
def _as_tensor(x: Tuple[int, int]) -> torch.Tensor:
|
12 |
-
"""
|
13 |
-
An equivalent of `torch.as_tensor`, but works under tracing if input
|
14 |
-
is a list of tensor. `torch.as_tensor` will record a constant in tracing,
|
15 |
-
but this function will use `torch.stack` instead.
|
16 |
-
"""
|
17 |
-
if torch.jit.is_scripting():
|
18 |
-
return torch.as_tensor(x)
|
19 |
-
if isinstance(x, (list, tuple)) and all([isinstance(t, torch.Tensor) for t in x]):
|
20 |
-
return torch.stack(x)
|
21 |
-
return torch.as_tensor(x)
|
22 |
-
|
23 |
-
|
24 |
-
class ImageList(object):
|
25 |
-
"""
|
26 |
-
Structure that holds a list of images (of possibly
|
27 |
-
varying sizes) as a single tensor.
|
28 |
-
This works by padding the images to the same size,
|
29 |
-
and storing in a field the original sizes of each image
|
30 |
-
|
31 |
-
Attributes:
|
32 |
-
image_sizes (list[tuple[int, int]]): each tuple is (h, w).
|
33 |
-
During tracing, it becomes list[Tensor] instead.
|
34 |
-
"""
|
35 |
-
|
36 |
-
def __init__(self, tensor: torch.Tensor, image_sizes: List[Tuple[int, int]]):
|
37 |
-
"""
|
38 |
-
Arguments:
|
39 |
-
tensor (Tensor): of shape (N, H, W) or (N, C_1, ..., C_K, H, W) where K >= 1
|
40 |
-
image_sizes (list[tuple[int, int]]): Each tuple is (h, w). It can
|
41 |
-
be smaller than (H, W) due to padding.
|
42 |
-
"""
|
43 |
-
self.tensor = tensor
|
44 |
-
self.image_sizes = image_sizes
|
45 |
-
|
46 |
-
def __len__(self) -> int:
|
47 |
-
return len(self.image_sizes)
|
48 |
-
|
49 |
-
def __getitem__(self, idx) -> torch.Tensor:
|
50 |
-
"""
|
51 |
-
Access the individual image in its original size.
|
52 |
-
|
53 |
-
Args:
|
54 |
-
idx: int or slice
|
55 |
-
|
56 |
-
Returns:
|
57 |
-
Tensor: an image of shape (H, W) or (C_1, ..., C_K, H, W) where K >= 1
|
58 |
-
"""
|
59 |
-
size = self.image_sizes[idx]
|
60 |
-
return self.tensor[idx, ..., : size[0], : size[1]]
|
61 |
-
|
62 |
-
@torch.jit.unused
|
63 |
-
def to(self, *args: Any, **kwargs: Any) -> "ImageList":
|
64 |
-
cast_tensor = self.tensor.to(*args, **kwargs)
|
65 |
-
return ImageList(cast_tensor, self.image_sizes)
|
66 |
-
|
67 |
-
@property
|
68 |
-
def device(self) -> device:
|
69 |
-
return self.tensor.device
|
70 |
-
|
71 |
-
@staticmethod
|
72 |
-
def from_tensors(
|
73 |
-
tensors: List[torch.Tensor], size_divisibility: int = 0, pad_value: float = 0.0
|
74 |
-
) -> "ImageList":
|
75 |
-
"""
|
76 |
-
Args:
|
77 |
-
tensors: a tuple or list of `torch.Tensor`, each of shape (Hi, Wi) or
|
78 |
-
(C_1, ..., C_K, Hi, Wi) where K >= 1. The Tensors will be padded
|
79 |
-
to the same shape with `pad_value`.
|
80 |
-
size_divisibility (int): If `size_divisibility > 0`, add padding to ensure
|
81 |
-
the common height and width is divisible by `size_divisibility`.
|
82 |
-
This depends on the model and many models need a divisibility of 32.
|
83 |
-
pad_value (float): value to pad
|
84 |
-
|
85 |
-
Returns:
|
86 |
-
an `ImageList`.
|
87 |
-
"""
|
88 |
-
assert len(tensors) > 0
|
89 |
-
assert isinstance(tensors, (tuple, list))
|
90 |
-
for t in tensors:
|
91 |
-
assert isinstance(t, torch.Tensor), type(t)
|
92 |
-
assert t.shape[:-2] == tensors[0].shape[:-2], t.shape
|
93 |
-
|
94 |
-
image_sizes = [(im.shape[-2], im.shape[-1]) for im in tensors]
|
95 |
-
image_sizes_tensor = [_as_tensor(x) for x in image_sizes]
|
96 |
-
max_size = torch.stack(image_sizes_tensor).max(0).values
|
97 |
-
|
98 |
-
if size_divisibility > 1:
|
99 |
-
stride = size_divisibility
|
100 |
-
# the last two dims are H,W, both subject to divisibility requirement
|
101 |
-
max_size = (max_size + (stride - 1)) // stride * stride
|
102 |
-
|
103 |
-
# handle weirdness of scripting and tracing ...
|
104 |
-
if torch.jit.is_scripting():
|
105 |
-
max_size: List[int] = max_size.to(dtype=torch.long).tolist()
|
106 |
-
else:
|
107 |
-
# https://github.com/pytorch/pytorch/issues/42448
|
108 |
-
if TORCH_VERSION >= (1, 7) and torch.jit.is_tracing():
|
109 |
-
image_sizes = image_sizes_tensor
|
110 |
-
|
111 |
-
if len(tensors) == 1:
|
112 |
-
# This seems slightly (2%) faster.
|
113 |
-
# TODO: check whether it's faster for multiple images as well
|
114 |
-
image_size = image_sizes[0]
|
115 |
-
padding_size = [0, max_size[-1] - image_size[1], 0, max_size[-2] - image_size[0]]
|
116 |
-
batched_imgs = F.pad(tensors[0], padding_size, value=pad_value).unsqueeze_(0)
|
117 |
-
else:
|
118 |
-
# max_size can be a tensor in tracing mode, therefore convert to list
|
119 |
-
batch_shape = [len(tensors)] + list(tensors[0].shape[:-2]) + list(max_size)
|
120 |
-
batched_imgs = tensors[0].new_full(batch_shape, pad_value)
|
121 |
-
for img, pad_img in zip(tensors, batched_imgs):
|
122 |
-
pad_img[..., : img.shape[-2], : img.shape[-1]].copy_(img)
|
123 |
-
|
124 |
-
return ImageList(batched_imgs.contiguous(), image_sizes)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Carlosito16/HXM-summarization/helper_function.py
DELETED
@@ -1,140 +0,0 @@
|
|
1 |
-
def get_all_models():
|
2 |
-
with open("requirements.txt") as f:
|
3 |
-
content = f.readlines()
|
4 |
-
models = []
|
5 |
-
for line in content:
|
6 |
-
if "huggingface.co" in line:
|
7 |
-
models.append(line.split("/")[4])
|
8 |
-
return models
|
9 |
-
|
10 |
-
|
11 |
-
def clear_input():
|
12 |
-
return ("", "")
|
13 |
-
|
14 |
-
|
15 |
-
def camembert_generate_summary(article_text):
|
16 |
-
inputs = cmb_tokenizer([article_text], padding="max_length", truncation=True,
|
17 |
-
max_length=512,
|
18 |
-
return_tensors="pt")
|
19 |
-
input_ids = inputs.input_ids.to(device)
|
20 |
-
attention_mask = inputs.attention_mask.to(device)
|
21 |
-
output = cmb_model.generate(input_ids, attention_mask=attention_mask)
|
22 |
-
return cmb_tokenizer.decode(output[0], skip_special_tokens=True)
|
23 |
-
|
24 |
-
|
25 |
-
def t5_generate_summary(article_text):
|
26 |
-
input_ids = t5_tokenizer(
|
27 |
-
[WHITESPACE_HANDLER(article_text)],
|
28 |
-
return_tensors="pt",
|
29 |
-
padding="max_length",
|
30 |
-
truncation=True,
|
31 |
-
max_length=512)["input_ids"]
|
32 |
-
|
33 |
-
output_ids = t5_model.generate(
|
34 |
-
input_ids=input_ids,
|
35 |
-
max_length=84,
|
36 |
-
no_repeat_ngram_size=2,
|
37 |
-
num_beams=4
|
38 |
-
)[0]
|
39 |
-
|
40 |
-
output = t5_tokenizer.decode(
|
41 |
-
output_ids,
|
42 |
-
skip_special_tokens=True,
|
43 |
-
clean_up_tokenization_spaces=False
|
44 |
-
)
|
45 |
-
|
46 |
-
return output
|
47 |
-
|
48 |
-
def summarizer(dropdown_model, article_text):
|
49 |
-
"""
|
50 |
-
Ruturs a summarized version from the full article based on the selected pretrained-model
|
51 |
-
"""
|
52 |
-
|
53 |
-
if dropdown_model == 'camembert':
|
54 |
-
summary = camembert_generate_summary(article_text)
|
55 |
-
|
56 |
-
elif dropdown_model == 'T5':
|
57 |
-
summary = t5_generate_summary(article_text)
|
58 |
-
|
59 |
-
return summary
|
60 |
-
|
61 |
-
|
62 |
-
class keyWordExtractor():
|
63 |
-
|
64 |
-
def __init__(self,
|
65 |
-
article_text,
|
66 |
-
similarity_model,
|
67 |
-
n_gram = 1,
|
68 |
-
top_n = 3,
|
69 |
-
french_stopwords = None,
|
70 |
-
ner= None,
|
71 |
-
):
|
72 |
-
self.article_text = article_text
|
73 |
-
self.french_stopwords = french_stopwords
|
74 |
-
self.candidates = self.count_vectorizer(n_gram)
|
75 |
-
self.noun_candidates, self.proper_noun_candidates = self.slice_only_noun_token(ner, self.candidates)
|
76 |
-
self.top_n_keywords = self.top_n_extractor(similarity_model, top_n)
|
77 |
-
|
78 |
-
def count_vectorizer(self, n_gram):
|
79 |
-
n_gram_range = (n_gram, n_gram)
|
80 |
-
# Extract candidate words/phrases
|
81 |
-
count = CountVectorizer(ngram_range=n_gram_range,
|
82 |
-
stop_words = self.french_stopwords).fit([self.article_text]) #Main change
|
83 |
-
candidates = count.get_feature_names_out()
|
84 |
-
|
85 |
-
return candidates
|
86 |
-
|
87 |
-
def slice_only_noun_token(self, ner, token_list):
|
88 |
-
"""
|
89 |
-
Given the tokenized list, this function returns only the "NOUN" token
|
90 |
-
Args:
|
91 |
-
ner (spacy): The NER class to detect the `token.pos_`
|
92 |
-
token_list (list): List of token from the full article
|
93 |
-
|
94 |
-
Returns:
|
95 |
-
slice_list (list): List of token containing only "NOUN" part of speech
|
96 |
-
"""
|
97 |
-
|
98 |
-
noun_slice_list = []
|
99 |
-
proper_noun_slice_list = []
|
100 |
-
for word_idx in range(len(token_list)):
|
101 |
-
doc = ner(token_list[word_idx])
|
102 |
-
|
103 |
-
for token in doc:
|
104 |
-
if token.pos_ == 'NOUN':
|
105 |
-
noun_slice_list.append(token.text)
|
106 |
-
elif token.pos_ == 'PROPN':
|
107 |
-
proper_noun_slice_list.append(token.text)
|
108 |
-
|
109 |
-
return noun_slice_list, proper_noun_slice_list
|
110 |
-
|
111 |
-
def top_n_extractor(self, model, top_n):
|
112 |
-
doc_embedding = model.encode([self.article_text])
|
113 |
-
candidate_embeddings = model.encode(self.noun_candidates)
|
114 |
-
distances = cosine_similarity(doc_embedding, candidate_embeddings)
|
115 |
-
keywords = [self.noun_candidates[index] for index in distances.argsort()[0][-top_n:]]
|
116 |
-
|
117 |
-
return keywords
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
def extract_top_3(article):
|
122 |
-
nlp = spacy.load("fr_core_news_md")
|
123 |
-
# model = SentenceTransformer("dangvantuan/sentence-camembert-large") #
|
124 |
-
|
125 |
-
a= keyWordExtractor(article,
|
126 |
-
n_gram = 1,
|
127 |
-
top_n = 3,
|
128 |
-
ner = nlp,
|
129 |
-
similarity_model = model)
|
130 |
-
keyword = ", ".join(a.top_n_keywords) #to return ['a' , 'b'] >> "a, b"
|
131 |
-
proper_nonuns = ", ".join(a.proper_noun_candidates)
|
132 |
-
|
133 |
-
return keyword, proper_nonuns
|
134 |
-
|
135 |
-
|
136 |
-
def runall(dropdown_model, article_text):
|
137 |
-
summary = summarizer(dropdown_model, article_text)
|
138 |
-
keywords, proper_n = extract_top_3(article_text)
|
139 |
-
|
140 |
-
return summary, keywords, proper_n
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/CelesteChen/GPT-token/app.py
DELETED
@@ -1,34 +0,0 @@
|
|
1 |
-
import os
|
2 |
-
|
3 |
-
import gradio as gr
|
4 |
-
import tiktoken
|
5 |
-
|
6 |
-
|
7 |
-
os.environ["TIKTOKEN_CACHE_DIR"] = ""
|
8 |
-
|
9 |
-
encoding = tiktoken.get_encoding("cl100k_base")
|
10 |
-
|
11 |
-
enc_mapping = {
|
12 |
-
"gpt-4": "cl100k_base", "gpt-3.5-turbo(chatgpt)": "cl100k_base", "text-embedding-ada-002": "cl100k_base", "Codex": "p50k_base", "text-davinci-002": "p50k_base", "text-davinci-003": "p50k_base", "gpt3": "r50k_base", "gpt2": "r50k_base"
|
13 |
-
}
|
14 |
-
|
15 |
-
|
16 |
-
def tokenize(text, model):
|
17 |
-
encoding = tiktoken.get_encoding(enc_mapping[model])
|
18 |
-
enc = encoding.encode(text)
|
19 |
-
return len(enc), enc
|
20 |
-
|
21 |
-
|
22 |
-
title = "GPT Token"
|
23 |
-
description = "This demo uses <a href='https://github.com/openai/tiktoken' target='_blank'>tiktoken</a> to calculate the token number needed for GPT models."
|
24 |
-
|
25 |
-
iface = gr.Interface(fn=tokenize,
|
26 |
-
inputs=[
|
27 |
-
gr.Textbox(label="input sequence"),
|
28 |
-
gr.Radio(choices=["gpt-4", "gpt-3.5-turbo(chatgpt)", "text-embedding-ada-002", "Codex", "text-davinci-002", "text-davinci-003", "gpt3", "gpt2"], value="gpt-3.5-turbo(chatgpt)", label="model")],
|
29 |
-
outputs=[gr.Textbox(label="token number"), gr.Textbox(
|
30 |
-
label="token sequence")],
|
31 |
-
title=title,
|
32 |
-
description=description,
|
33 |
-
allow_flagging='never')
|
34 |
-
iface.launch(share=False, debug=True)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Clebersla/RVC_V2_Huggingface_Version/run.sh
DELETED
@@ -1,16 +0,0 @@
|
|
1 |
-
# Install Debian packages
|
2 |
-
sudo apt-get update
|
3 |
-
sudo apt-get install -qq -y build-essential ffmpeg aria2
|
4 |
-
|
5 |
-
# Upgrade pip and setuptools
|
6 |
-
pip install --upgrade pip
|
7 |
-
pip install --upgrade setuptools
|
8 |
-
|
9 |
-
# Install wheel package (built-package format for Python)
|
10 |
-
pip install wheel
|
11 |
-
|
12 |
-
# Install Python packages using pip
|
13 |
-
pip install -r requirements.txt
|
14 |
-
|
15 |
-
# Run application locally at http://127.0.0.1:7860
|
16 |
-
python app.py
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Cyril666/ContourNet-ABI/maskrcnn_benchmark/modeling/utils.py
DELETED
@@ -1,16 +0,0 @@
|
|
1 |
-
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
|
2 |
-
"""
|
3 |
-
Miscellaneous utility functions
|
4 |
-
"""
|
5 |
-
|
6 |
-
import torch
|
7 |
-
|
8 |
-
|
9 |
-
def cat(tensors, dim=0):
|
10 |
-
"""
|
11 |
-
Efficient version of torch.cat that avoids a copy if there is only a single element in a list
|
12 |
-
"""
|
13 |
-
assert isinstance(tensors, (list, tuple))
|
14 |
-
if len(tensors) == 1:
|
15 |
-
return tensors[0]
|
16 |
-
return torch.cat(tensors, dim)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/DQChoi/gpt-demo/venv/lib/python3.11/site-packages/fontTools/feaLib/__init__.py
DELETED
@@ -1,4 +0,0 @@
|
|
1 |
-
"""fontTools.feaLib -- a package for dealing with OpenType feature files."""
|
2 |
-
|
3 |
-
# The structure of OpenType feature files is defined here:
|
4 |
-
# http://www.adobe.com/devnet/opentype/afdko/topic_feature_file_syntax.html
|
|
|
|
|
|
|
|
|
|
spaces/DQChoi/gpt-demo/venv/lib/python3.11/site-packages/fontTools/ttLib/tables/T_S_I_B_.py
DELETED
@@ -1,5 +0,0 @@
|
|
1 |
-
from .T_S_I_V_ import table_T_S_I_V_
|
2 |
-
|
3 |
-
|
4 |
-
class table_T_S_I_B_(table_T_S_I_V_):
|
5 |
-
pass
|
|
|
|
|
|
|
|
|
|
|
|