parquet-converter commited on
Commit
351ac5c
·
1 Parent(s): ae74b9b

Update parquet files (step 8 of 476)

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. spaces/1acneusushi/gradio-2dmoleculeeditor/data/Download Navicat 15.md +0 -20
  2. spaces/1acneusushi/gradio-2dmoleculeeditor/data/Font DB X Set 15 DS X PSL X PSL Prorar.md +0 -106
  3. spaces/1gistliPinn/ChatGPT4/Examples/Ableton Live 10 Crack Incl Serial Key Free [REPACK] [Windows MAC] 2020.md +0 -6
  4. spaces/1gistliPinn/ChatGPT4/Examples/Folder Maker Serial Key.md +0 -9
  5. spaces/1pelhydcardo/ChatGPT-prompt-generator/assets/Download Clash Mini for Android - The Ultimate Auto Battler Game.md +0 -103
  6. spaces/1phancelerku/anime-remove-background/Android Oyun Clubs Dark Riddle APK Hile The Most Challenging and Scary Game Ever.md +0 -82
  7. spaces/1phancelerku/anime-remove-background/Download the Best Poker App for Android Texas Holdem Poker Deluxe Versi Lama.md +0 -162
  8. spaces/2023Liu2023/bingo/src/components/chat-header.tsx +0 -12
  9. spaces/4Taps/SadTalker/src/facerender/modules/make_animation.py +0 -160
  10. spaces/52Hz/SUNet_AWGN_denoising/app.py +0 -38
  11. spaces/74run/Predict_Car/app.py +0 -141
  12. spaces/AIFILMS/generate_human_motion/pyrender/examples/example.py +0 -157
  13. spaces/AIGC-Audio/Make_An_Audio/ldm/modules/losses_audio/vggishish/logger.py +0 -87
  14. spaces/AIGText/GlyphControl/ldm/models/diffusion/plms.py +0 -244
  15. spaces/AgentVerse/agentVerse/ui/src/phaser3-rex-plugins/templates/ui/canvasinput/Factory.js +0 -13
  16. spaces/Akbartus/U2net-with-rgba/README.md +0 -38
  17. spaces/AlanMars/QYL-AI-Space/modules/pdf_func.py +0 -180
  18. spaces/Alican/pixera/options/test_options.py +0 -23
  19. spaces/Alpaca233/SadTalker/src/face3d/models/arcface_torch/configs/glint360k_r50.py +0 -26
  20. spaces/Alpaca233/SadTalker/src/facerender/modules/discriminator.py +0 -90
  21. spaces/Amrrs/DragGan-Inversion/stylegan_human/style_mixing.py +0 -114
  22. spaces/Andy1621/uniformer_image_segmentation/configs/_base_/datasets/pascal_context.py +0 -60
  23. spaces/Ani1712full/Estimacion_tasa_morosidad/app.py +0 -43
  24. spaces/Anonymous-sub/Rerender/ControlNet/annotator/uniformer/configs/_base_/datasets/pascal_context.py +0 -60
  25. spaces/Anthony7906/MengHuiMXD_GPT/ChuanhuChatbot.py +0 -470
  26. spaces/Arnx/MusicGenXvAKN/audiocraft/utils/__init__.py +0 -5
  27. spaces/Awiny/Image2Paragraph/models/grit_src/third_party/CenterNet2/detectron2/layers/csrc/box_iou_rotated/box_iou_rotated_cpu.cpp +0 -39
  28. spaces/Awiny/Image2Paragraph/models/grit_src/third_party/CenterNet2/detectron2/layers/roi_align_rotated.py +0 -91
  29. spaces/Bart92/RVC_HF/infer/lib/uvr5_pack/lib_v5/layers_123821KB.py +0 -118
  30. spaces/Benson/text-generation/Examples/Descargar Bgmi Battleground Mobile India Logo Png.md +0 -75
  31. spaces/BetterAPI/BetterChat/src/lib/types/SharedConversation.ts +0 -11
  32. spaces/Big-Web/MMSD/env/Lib/site-packages/botocore/docs/method.py +0 -328
  33. spaces/Big-Web/MMSD/env/Lib/site-packages/dateutil/parser/__init__.py +0 -61
  34. spaces/Big-Web/MMSD/env/Lib/site-packages/pip/_internal/models/selection_prefs.py +0 -51
  35. spaces/Big-Web/MMSD/env/Lib/site-packages/pip/_vendor/packaging/tags.py +0 -487
  36. spaces/Bingyunhu/hoping/Dockerfile +0 -34
  37. spaces/Boadiwaa/Recipes/openai/wandb_logger.py +0 -299
  38. spaces/CVPR/Dual-Key_Backdoor_Attacks/datagen/detectron2/detectron2/export/patcher.py +0 -153
  39. spaces/CVPR/Dual-Key_Backdoor_Attacks/datagen/detectron2/detectron2/solver/lr_scheduler.py +0 -116
  40. spaces/CVPR/LIVE/thrust/testing/unittest/exceptions.h +0 -56
  41. spaces/CVPR/LIVE/thrust/thrust/system/detail/sequential/sequence.h +0 -22
  42. spaces/CVPR/WALT/mmdet/core/bbox/samplers/combined_sampler.py +0 -20
  43. spaces/CVPR/WALT/mmdet/datasets/pipelines/auto_augment.py +0 -890
  44. spaces/CVPR/lama-example/models/ade20k/segm_lib/nn/parallel/__init__.py +0 -1
  45. spaces/CVPR/monoscene_lite/monoscene/config.py +0 -26
  46. spaces/CikeyQI/Yunzai/Yunzai/plugins/ws-plugin/components/index.js +0 -20
  47. spaces/CikeyQI/meme-api/meme_generator/memes/bocchi_draft/__init__.py +0 -42
  48. spaces/ClassCat/mnist-classification-ja/README.md +0 -12
  49. spaces/ClassCat/wide-resnet-cifar10-classification/app.py +0 -190
  50. spaces/CofAI/chat/client/css/buttons.css +0 -4
spaces/1acneusushi/gradio-2dmoleculeeditor/data/Download Navicat 15.md DELETED
@@ -1,20 +0,0 @@
1
-
2
- <h1>How to Download and Install Navicat 15 on Your Computer</h1>
3
- <p>Navicat 15 is a powerful and user-friendly database management tool that supports multiple database servers, such as MySQL, PostgreSQL, Oracle, SQLite, MongoDB and more. With Navicat 15, you can easily connect to your databases, create and edit tables, queries, views, triggers, functions and procedures, import and export data, backup and restore databases, synchronize data and structure, and perform many other tasks.</p>
4
- <p>In this article, we will show you how to download and install Navicat 15 on your computer. You will need a valid license key to activate the full version of Navicat 15. You can also use the trial version for 14 days for free.</p>
5
- <h2>download navicat 15</h2><br /><p><b><b>Download File</b> &#10038;&#10038;&#10038; <a href="https://byltly.com/2uKwJy">https://byltly.com/2uKwJy</a></b></p><br /><br />
6
- <h2>Step 1: Download Navicat 15</h2>
7
- <p>To download Navicat 15, go to the official website of Navicat at <a href="https://www.navicat.com/en/download">https://www.navicat.com/en/download</a>. You can choose the edition that suits your needs, such as Navicat Premium, Navicat for MySQL, Navicat for PostgreSQL and more. You can also choose the operating system that you are using, such as Windows, Mac or Linux.</p>
8
- <p>Click on the download button and save the installer file to your computer. The file size may vary depending on the edition and the operating system that you choose.</p>
9
- <h2>Step 2: Install Navicat 15</h2>
10
- <p>To install Navicat 15, locate the installer file that you downloaded and double-click on it to run it. Follow the instructions on the screen to complete the installation process. You may need to agree to the terms and conditions, choose the destination folder, select the components to install and create shortcuts.</p>
11
- <p>Once the installation is finished, you can launch Navicat 15 from your desktop or start menu. You will see a welcome screen that asks you to enter your license key or start a trial. If you have a license key, enter it and click on activate. If you want to use the trial version, click on start trial and enter your email address.</p>
12
- <h2>Step 3: Connect to Your Databases</h2>
13
- <p>To connect to your databases with Navicat 15, click on the new connection button on the toolbar or go to file > new connection. You will see a list of supported database servers. Choose the one that you want to connect to and enter the connection details, such as the host name or IP address, port number, user name, password and database name.</p>
14
- <p>Click on test connection to check if the connection is successful. If it is, click on OK to save the connection. You will see your connection listed in the connection tree on the left panel. You can expand it to see the objects in your database, such as tables, queries, views and more.</p>
15
- <p>You can now use Navicat 15 to manage your databases with ease. You can right-click on any object in your database and choose from various options to create, edit or delete it. You can also use the toolbar buttons or the menu items to perform common tasks.</p>
16
- <p></p>
17
- <h2>Conclusion</h2>
18
- <p>Navicat 15 is a great tool for database management that supports multiple database servers and offers many features and functions. In this article, we showed you how to download and install Navicat 15 on your computer and how to connect to your databases with it. We hope you found this article helpful and enjoy using Navicat 15.</p> ddb901b051<br />
19
- <br />
20
- <br />
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/1acneusushi/gradio-2dmoleculeeditor/data/Font DB X Set 15 DS X PSL X PSL Prorar.md DELETED
@@ -1,106 +0,0 @@
1
- <br />
2
- <h1>Font DB X Set 15 DS X PSL X PSL Prorar: A Unique and Versatile Font Collection</h1>
3
- <p>If you are looking for a font collection that can make your projects stand out from the crowd, you might want to check out <strong>Font DB X Set 15 DS X PSL X PSL Prorar</strong>. This font collection is a combination of two different fonts that have their own unique characteristics and styles. Font DB X Set 15 DS is a modern and elegant font that can be used for various purposes, such as logos, headlines, posters, and more. PSL X PSL Prorar is a playful and quirky font that can add some fun and personality to your projects, such as invitations, cards, stickers, and more. Together, these two fonts can create a stunning and versatile font collection that can suit any project and theme.</p>
4
- <h2>Font DB X Set 15 DS X PSL X PSL Prorar</h2><br /><p><b><b>Download</b> &#10042; <a href="https://byltly.com/2uKzH8">https://byltly.com/2uKzH8</a></b></p><br /><br />
5
- <p>In this article, we will explore the features and benefits of using Font DB X Set 15 DS X PSL X PSL Prorar for your projects. We will also show you how to get this font collection and use it for your projects. We will provide you with some examples of how Font DB X Set 15 DS X PSL X PSL Prorar can be used in different ways and contexts. By the end of this article, you will have a clear idea of why Font DB X Set 15 DS X PSL X PSL Prorar is a unique and versatile font collection that you should try out for your projects.</p>
6
- <h2>The Components of Font DB X Set 15 DS X PSL X PSL Prorar</h2>
7
- <p>Font DB X Set 15 DS X PSL X PSL Prorar is a font collection that consists of two different fonts: Font DB X Set 15 DS and PSL X PSL Prorar. Each font has its own characteristics and style that make it stand out from other fonts. Let's take a closer look at each font and see what they have to offer.</p>
8
- <h3>Font DB X Set 15 DS</h3>
9
- <p>Font DB X Set 15 DS is a modern and elegant font that can be used for various purposes, such as logos, headlines, posters, and more. It has a sleek and minimalist design that can create a sophisticated and professional look for your projects. It has four different weights: light, regular, medium, and bold. It also has uppercase and lowercase letters, numbers, punctuation marks, symbols, and multilingual support. It is compatible with most software and devices, such as Windows, Mac, Linux, Photoshop, Illustrator, InDesign, Word, PowerPoint, etc.</p>
10
- <p></p>
11
- <p>Font DB X Set 15 DS is a great font for creating clean and elegant designs that can catch the attention of your audience. It can be used for various industries and niches, such as fashion, beauty, technology, business, education, etc. It can also be paired with other fonts to create contrast and hierarchy in your design. For example, you can use Font DB X Set 15 DS for your logo or headline, and use another font for your body text or subheading.</p>
12
- <p>Here are some examples of Font DB X Set 15 DS in action:</p>
13
- <img src="https://i.imgur.com/0wQj6lJ.png" alt="Example of Font DB X Set 15 DS for a logo" width="300" height="300">
14
- <p>This is an example of Font DB X Set 15 DS for a logo. The font creates a simple and elegant logo that can represent a fashion or beauty brand. The font is used in bold weight to create impact and contrast with the background color. The font also has a slight curve on some letters to add some flair and style to the logo.</p>
15
- <img src="https://i.imgur.com/4y7ZxYH.png" alt="Example of Font DB X Set 15 DS for a headline" width="600" height="300">
16
- <p>This is an example of Font DB X Set 15 DS for a headline. The font creates a sleek and modern headline that can attract the attention of the readers. The font is used in medium weight to create balance and harmony with the image and the body text. The font also has a subtle shadow effect to add some depth and dimension to the headline.</p>
17
- <img src="https://i.imgur.com/8s1qWt9.png" alt="Example of Font DB X Set 15 DS for a poster" width="400" height="600">
18
- <p>This is an example of Font DB X Set 15 DS for a poster. The font creates a sophisticated and professional poster that can promote an event or a product. The font is used in light weight to create a minimalist and elegant design that can highlight the main message and the image. The font also has a slight tilt on some letters to add some dynamism and movement to the poster.</p>
19
- <h3>PSL X PSL Prorar</h3>
20
- <p>PSL X PSL Prorar is a playful and quirky font that can add some fun and personality to your projects, such as invitations, cards, stickers, and more. It has a hand-drawn and whimsical design that can create a friendly and cheerful look for your projects. It has two different styles: regular and outline. It also has uppercase and lowercase letters, numbers, punctuation marks, symbols, and multilingual support. It is compatible with most software and devices, such as Windows, Mac, Linux, Photoshop, Illustrator, InDesign, Word, PowerPoint, etc.</p>
21
- <p>PSL X PSL Prorar is a great font for creating fun and colorful designs that can appeal to your audience. It can be used for various themes and occasions, such as children, animals, holidays, parties, etc. It can also be paired with other fonts to create contrast and variety in your design. For example, you can use PSL X PSL Prorar for your invitation or card, and use another font for your name or message.</p>
22
- <p>Here are some examples of PSL X PSL Prorar in action:</p>
23
- <img src="https://i.imgur.com/9wZyY6a.png" alt="Example of PSL X PSL Prorar for an invitation" width="400" height="600">
24
- <p>This is an example of PSL X PSL Prorar for an invitation. The font creates a cute and festive invitation that can invite the guests to a birthday party. The font is used in outline style to create a light and airy design that can match the background color and the image. The font also has a slight curve on some letters to add some charm and style to the invitation.</p>
25
- <img src="https://i.imgur.com/3n1g0mE.png" alt="Example of PSL X PSL Prorar for a card" width="600" height="300">
26
- <p>This is an example of PSL X PSL Prorar for a card. The font creates a lovely and sweet card that can express gratitude or appreciation to someone. The font is used in regular style to create a bold and solid design that can contrast with the background color and the image. The font also has a slight tilt on some letters to add some dynamism and movement to the card.</p>
27
- <img src="https://i.imgur.com/7tXQYwN.png" alt="Example of PSL X PSL Prorar for a sticker" width="300" height="300">
28
- <p>This is an example of PSL X PSL Prorar for a sticker. The font creates a fun and colorful sticker that can decorate or personalize anything. The font is used in both regular and outline styles to create a layered and textured design that can enhance the image. The font also has a slight twist on some letters to add some flair and style to the sticker.</p>
29
- <h3>The Combination of Font DB X Set 15 DS and PSL X PSL Prorar</h3>
30
- <p>Font DB X Set 15 DS and PSL X PSL Prorar are two different fonts that have their own unique characteristics and styles. However, when they are combined together, they can create a stunning and versatile font collection that can suit any project and theme. Font DB X Set 15 DS and PSL X PSL Prorar complement each other in many ways:</p>
31
- <ul>
32
- <li>They have different weights and styles that can create contrast and hierarchy in your design.</li>
33
- <li>They have different shapes and curves that can create harmony and balance in your design.</li>
34
- <li>They have different moods and tones that can create variety and interest in your design.</li>
35
- </ul>
36
- <p>The combination of Font DB X Set 15 DS and PSL X PSL Prorar can offer many advantages for your projects:</p>
37
- <ul>
38
- <li>They can make your projects look more unique and memorable.</li>
39
- <li>They can make your projects look more professional and creative.</li>
40
- <li>They can make your projects look more appealing and engaging.</li>
41
- </ul>
42
- <p>Here are some examples of the combination of Font DB X Set 15 DS and PSL X PSL Prorar in action:</p>
43
- <img src="https://i.imgur.com/8XJw0sZ.png" alt="Example of the combination of Font DB X Set 15 DS and PSL X PSL Prorar for a logo" width="300" height="300">
44
- <p>This is an example of the combination of Font DB X Set 15 DS and PSL X PSL Prorar for a logo. The logo is for a pet shop that sells various products and services for animals. The font combination creates a unique and memorable logo that can represent the brand identity. The font DB X Set 15 DS is used in bold weight for the word "Pet" to create a solid and professional look. The font PSL X PSL Prorar is used in regular style for the word "Shop" to create a playful and friendly look. The font combination also creates contrast and harmony with the colors and the image.</p>
45
- <img src="https://i.imgur.com/1f2s5lL.png" alt="Example of the combination of Font DB X Set 15 DS and PSL X PSL Prorar for a headline" width="600" height="300">
46
- <p>This is an example of the combination of Font DB X Set 15 DS and PSL X PSL Prorar for a headline. The headline is for an article that talks about how to make your own DIY crafts with recycled materials. The font combination creates a catchy and creative headline that can attract the attention of the readers. The font DB X Set 15 DS is used in medium weight for the words "DIY Crafts" to create a sleek and modern look. The font PSL X PSL Prorar is used in outline style for the words "With Recycled Materials" to create a light and whimsical look. The font combination also creates contrast and balance with the colors and the image.</p>
47
- <img src="https://i.imgur.com/4Qxwq6o.png" alt="Example of the combination of Font DB X Set 15 DS and PSL X PSL Prorar for a poster" width="400" height="600">
48
- <p>This is an example of the combination of Font DB X Set 15 DS and PSL X PSL Prorar for a poster. The poster is for a music festival that features various artists and genres. The font combination creates a stunning and versatile poster that can promote the event and the artists. The font DB X Set 15 DS is used in light weight for the name of the festival to create a minimalist and elegant look. The font PSL X PSL Prorar is used in regular style for the names of the artists to create a fun and colorful look. The font combination also creates contrast and variety with the colors and the image.</p>
49
- <h2>How to Use Font DB X Set 15 DS X PSL X PSL Prorar for Your Projects</h2>
50
- <p>Now that you have seen the features and benefits of using Font DB X Set 15 DS X PSL X PSL Prorar for your projects, you might be wondering how to get this font collection and use it for your projects. In this section, we will show you how to download and install Font DB X Set 15 DS X PSL X PSL Prorar on your device, how to choose the right font size, color, and style for your projects, and how to combine Font DB X Set 15 DS X PSL X PSL Prorar with other fonts and elements in your project.</p>
51
- <h3>How to Download and Install Font DB X Set 15 DS X PSL X PSL Prorar</h3>
52
- <p>The first step to use Font DB X Set 15 DS X PSL X PSL Prorar for your projects is to download and install it on your device. Here are the steps to do so:</p>
53
- <ol>
54
- <li>Go to the official website of Font DB X Set 15 DS X PSL X PSL Prorar at <a href="">https://fontdbxset15dsxpslxpslprorar.com</a>. This is the only authorized and safe source to get this font collection.</li>
55
- <li>Click on the "Download" button and choose the format that suits your device and software. You can choose between OTF, TTF, or WOFF formats.</li>
56
- <li>Save the file to your device and unzip it if necessary.</li>
57
- <li>Open the file and double-click on each font file to install it on your device. You may need to agree to the license terms and conditions before installing.</li>
58
- <li>Restart your device and software if needed to activate the font collection.</li>
59
- </ol>
60
- <p>Congratulations! You have successfully downloaded and installed Font DB X Set 15 DS X PSL X PSL Prorar on your device. You can now use it for your projects.</p>
61
- <h3>How to Choose the Right Font Size, Color, and Style for Your Projects</h3>
62
- <p>The next step to use Font DB X Set 15 DS X PSL X PSL Prorar for your projects is to choose the right font size, color, and style for your projects. Here are some best practices to follow:</p>
63
- <ul>
64
- <li>Choose a font size that is appropriate for your project and audience. For example, if you are creating a logo or a headline, you may want to use a larger font size to create impact and visibility. If you are creating a body text or a subheading, you may want to use a smaller font size to create readability and clarity.</li>
65
- <li>Choose a font color that is suitable for your project and theme. For example, if you are creating a project that has a dark background, you may want to use a lighter font color to create contrast and legibility. If you are creating a project that has a light background, you may want to use a darker font color to create contrast and legibility.</li>
66
- <li>Choose a font style that is consistent with your project and message. For example, if you are creating a project that is formal and professional, you may want to use a font style that is sleek and elegant, such as Font DB X Set 15 DS. If you are creating a project that is informal and playful, you may want to use a font style that is whimsical and friendly, such as PSL X PSL Prorar.</li>
67
- </ul>
68
- <p>You can also use Font DB X Set 15 DS X PSL X PSL Prorar to create contrast, hierarchy, and harmony in your design. For example, you can use Font DB X Set 15 DS for your main text and PSL X PSL Prorar for your accent text, or vice versa. You can also use different weights and styles of the same font to create variation and emphasis in your design.</p>
69
- <p>You can test and preview your font choices before finalizing your project. You can use online tools such as <a href="https://fonts.google.com/">Google Fonts</a> or <a href="https://www.fontsquirrel.com/">Font Squirrel</a> to see how your font choices look on different devices and browsers. You can also ask for feedback from your friends, colleagues, or clients to see if your font choices are effective and appealing.</p>
70
- <h3>How to Combine Font DB X Set 15 DS X PSL X PSL Prorar with Other Fonts and Elements</h3>
71
- <p>The final step to use Font DB X Set 15 DS X PSL X PSL Prorar for your projects is to combine it with other fonts and elements in your project. Here are some best practices to follow:</p>
72
- <ul>
73
- <li>Choose fonts that are compatible and complementary with Font DB X Set 15 DS X PSL X PSL Prorar. For example, you can use fonts that have similar or contrasting characteristics, such as shape, curve, mood, tone, etc. You can also use fonts that belong to the same or different categories, such as serif, sans serif, script, etc.</li>
74
- <li>Choose elements that are suitable and supportive of Font DB X Set 15 DS X PSL X PSL Prorar. For example, you can use elements that have similar or contrasting colors, shapes, sizes, textures, etc. You can also use elements that enhance or highlight Font DB X Set 15 DS X PSL X PSL Prorar, such as images, icons, graphics, etc.</li>
75
- <li>Use the principles of design to create a cohesive and attractive project. For example, you can use alignment, proximity, repetition, contrast, balance, etc. to create a project that is easy to read and understand. You can also use white space, grid system, typography hierarchy, etc. to create a project that is organized and structured.</li>
76
- </ul>
77
- <p>You can use Font DB X Set 15 DS X PSL X PSL Prorar to create a unique and memorable brand identity for your business or organization. You can use it to create a logo, a slogan, a tagline, a business card, a letterhead, etc. You can also use it to create a consistent and recognizable visual identity across different platforms and channels, such as website, social media, email, etc.</p>
78
- <p>You can also use Font DB X Set 15 DS X PSL X PSL Prorar to enhance your content and message for your audience or customers. You can use it to create headlines, subheadings, captions, bullet points, etc. that can capture the attention and interest of your audience or customers. You can also use it to create content that is clear, concise, and persuasive, such as blog posts, articles, newsletters, sales pages, etc.</p>
79
- <h2>Conclusion</h2>
80
- <p>Font DB X Set 15 DS X PSL X PSL Prorar is a unique and versatile font collection that can make your projects stand out from the crowd. It is a combination of two different fonts that have their own unique characteristics and styles: Font DB X Set 15 DS and PSL X PSL Prorar. Together, these two fonts can create a stunning and versatile font collection that can suit any project and theme.</p>
81
- <p>Font DB X Set 15 DS is a modern and elegant font that can be used for various purposes, such as logos, headlines, posters, and more. It has a sleek and minimalist design that can create a sophisticated and professional look for your projects. PSL X PSL Prorar is a playful and quirky font that can add some fun and personality to your projects, such as invitations, cards, stickers, and more. It has a hand-drawn and whimsical design that can create a friendly and cheerful look for your projects.</p>
82
- <p>You can use Font DB X Set 15 DS X PSL X PSL Prorar for your projects by following these steps: download and install it on your device, choose the right font size, color, and style for your projects, and combine it with other fonts and elements in your project. You can also use Font DB X Set 15 DS X PSL X PSL Prorar to create a unique and memorable brand identity for your business or organization, and to enhance your content and message for your audience or customers.</p>
83
- <p>If you are looking for a font collection that can make your projects stand out from the crowd, you should try out Font DB X Set 15 DS X PSL X PSL Prorar. It is a unique and versatile font collection that can suit any project and theme. You can download it from the official website at <a href="">https://fontdbxset15dsxpslxpslprorar.com</a>. You will not regret it!</p>
84
- <h2>FAQs</h2>
85
- <p>Here are some answers to some common questions about Font DB X Set 15 DS X PSL X PSL Prorar:</p>
86
- <ol>
87
- <li><strong>What is the price of Font DB X Set 15 DS X PSL X PSL Prorar?</strong></li>
88
- <p>Font DB X Set 15 DS X PSL X PSL Prorar is available for free for personal use only. If you want to use it for commercial purposes, you need to purchase a license from the official website at <a href="">https://fontdbxset15dsxpslxpslprorar.com</a>. The price of the license depends on the number of users and devices you want to use it on.</p>
89
- <li><strong>What are the file formats of Font DB X Set 15 DS X PSL X PSL Prorar?</strong></li>
90
- <p>Font DB X Set 15 DS X PSL X PSL Prorar is available in three file formats: OTF, TTF, and WOFF. OTF stands for OpenType Format, which is a standard font format that supports advanced typographic features. TTF stands for TrueType Format, which is a common font format that supports basic typographic features. WOFF stands for Web Open Font Format, which is a web font format that supports fast loading and rendering on web browsers.</p>
91
- <li><strong>What are the languages supported by Font DB X Set 15 DS X PSL X PSL Prorar?</strong></li>
92
- <p>Font DB X Set 15 DS X PSL X PSL Prorar supports multiple languages, such as English, French, Spanish, German, Italian, Portuguese, Dutch, Swedish, Norwegian, Danish, Finnish, Icelandic, Polish, Czech, Slovak, Hungarian, Romanian, Turkish, and more. You can check the full list of supported languages on the official website at <a href="">https://fontdbxset15dsxpslxpslprorar.com</a>.</p>
93
- <li><strong>What are the best projects to use Font DB X Set 15 DS X PSL X PSL Prorar for?</strong></li>
94
- <p>Font DB X Set 15 DS X PSL X PSL Prorar is a versatile font collection that can suit any project and theme. However, some of the best projects to use Font DB X Set 15 DS X PSL X PSL Prorar for are:</p>
95
- <ul>
96
- <li>Logos and branding: You can use Font DB X Set 15 DS X PSL X PSL Prorar to create a unique and memorable logo and brand identity for your business or organization. You can also use it to create a consistent and recognizable visual identity across different platforms and channels.</li>
97
- <li>Headlines and titles: You can use Font DB X Set 15 DS X PSL X PSL Prorar to create catchy and creative headlines and titles for your articles, blogs, newsletters, sales pages, etc. You can also use it to create contrast and hierarchy with your subheadings and body text.</li>
98
- <li>Posters and flyers: You can use Font DB X Set 15 DS X PSL X PSL Prorar to create stunning and attractive posters and flyers for your events, products, services, etc. You can also use it to create contrast and harmony with your images and graphics.</li>
99
- <li>Invitations and cards: You can use Font DB X Set 15 DS X PSL X PSL Prorar to create cute and festive invitations and cards for your parties, holidays, celebrations, etc. You can also use it to create contrast and variety with your name and message.</li>
100
- <li>Stickers and labels: You can use Font DB X Set 15 DS X PSL X PSL Prorar to create fun and colorful stickers and labels for your products, gifts, packages, etc. You can also use it to create contrast and texture with your image and background.</li>
101
- </ul>
102
- <li><strong>How can I contact the creator of Font DB X Set 15 DS X PSL X PSL Prorar?</strong></li>
103
- <p>If you have any questions, feedback, or suggestions about Font DB X Set 15 DS X PSL X PSL Prorar, you can contact the creator of this font collection at <a href="mailto:[email protected]">[email protected]</a>. The creator is always happy to hear from you and will reply to you as soon as possible.</p>
104
- </ol></p> b2dd77e56b<br />
105
- <br />
106
- <br />
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/1gistliPinn/ChatGPT4/Examples/Ableton Live 10 Crack Incl Serial Key Free [REPACK] [Windows MAC] 2020.md DELETED
@@ -1,6 +0,0 @@
1
- <h2>Ableton Live 10 Crack Incl Serial key Free [Windows MAC] 2020</h2><br /><p><b><b>DOWNLOAD</b> &#9658;&#9658;&#9658; <a href="https://imgfil.com/2uxY4u">https://imgfil.com/2uxY4u</a></b></p><br /><br />
2
- <br />
3
- Jan 12, 2020 Ableton Crack Live 10 Suite Full Version 2020 Keygen 100% Working free download for Mac & Windows. It is advanced and most trusted. 1fdad05405<br />
4
- <br />
5
- <br />
6
- <p></p>
 
 
 
 
 
 
 
spaces/1gistliPinn/ChatGPT4/Examples/Folder Maker Serial Key.md DELETED
@@ -1,9 +0,0 @@
1
- <h2>Folder Maker Serial Key</h2><br /><p><b><b>Download File</b> &#9675; <a href="https://imgfil.com/2uy0ch">https://imgfil.com/2uy0ch</a></b></p><br /><br />
2
-
3
- August 23, 2021 - Folder Marker Pro Crack is a tiny yet powerful tool specially designed for users who want to customize their folders with a color or an image. Do you need more?
4
- Folder Marker Pro Crack has over 150 customizable color schemes and built-in images that can be easily modified.
5
- You can create your own folders with your own color or pattern, or just take a template from the creation wizard and just customize it.
6
- Folder Marker Pro Crack is the perfect tool for those who want to use their projects and other types of folder creation software with beautiful folders. 8a78ff9644<br />
7
- <br />
8
- <br />
9
- <p></p>
 
 
 
 
 
 
 
 
 
 
spaces/1pelhydcardo/ChatGPT-prompt-generator/assets/Download Clash Mini for Android - The Ultimate Auto Battler Game.md DELETED
@@ -1,103 +0,0 @@
1
-
2
- <h1>Clash Mini: A Fun and Fast-Paced Strategy Game from the Clash Universe</h1>
3
- <p>If you are a fan of the Clash of Clans or Clash Royale games, you might want to check out Clash Mini, a new strategy game from Supercell. Clash Mini is an auto-chess game that features miniature versions of the familiar characters from the Clash universe. You can collect, summon, and upgrade your army of minis and battle against other players in real-time. The game is easy to learn but challenging to master, as you have to anticipate your opponent's moves and arrange your army in limitless positions. You can also customize your minis with unique skins and abilities, and unlock new heroes such as Barbarian King, Archer Queen, Shield Maiden, and more. In this article, we will show you how to download and install Clash Mini on your Android device, what are the game features, game modes, game tips, and game review.</p>
4
- <h2>clash mini download android apk</h2><br /><p><b><b>DOWNLOAD</b> &#10037;&#10037;&#10037; <a href="https://urlin.us/2uSYCo">https://urlin.us/2uSYCo</a></b></p><br /><br />
5
- <h2>How to Download and Install Clash Mini on Android Devices</h2>
6
- <p>Clash Mini is currently in beta testing and is only available in select countries. However, you can still download and install it on your Android device by following these steps:</p>
7
- <ol>
8
- <li>Go to the official website of Clash Mini ([1](https://apkcombo.com/clash-mini/com.supercell.clashmini/)) or Google Play Store ([2](https://play.google.com/store/apps/details?id=com.supercell.clashmini)).</li>
9
- <li>Tap on the download button or install button.</li>
10
- <li>Wait for the download or installation to complete.</li>
11
- <li>Launch the game and enjoy.</li>
12
- </ol>
13
- <h2>Clash Mini Game Features</h2>
14
- <h3>Miniature Characters: Collect, summon, and upgrade your army of minis</h3>
15
- <p>Clash Mini features over 40 different minis that you can collect and use in your battles. Each mini has its own elixir cost, stats, abilities, and keywords. You can summon up to six minis per round, including one hero. You can also upgrade your minis during battle to activate stronger abilities. Some of the minis include wizards, archers, pekkas, goblins, giants, dragons, healers, witches, skeletons, princes, princesses, miners, hog riders, balloons, golems, lava hounds, ice spirits, fire spirits, bats, minions, electro dragons, sparky, inferno dragon, mega knight, and many more. You can see the full list of minis and their abilities on the official website of Clash Mini ([3](https://clash.com/clashmini/)).</p>
16
- <h3>Strategic Gameplay: Anticipate your opponent's moves and arrange your army in limitless positions</h3>
17
- <p>Clash Mini is a game of strategy and tactics, where you have to think ahead and plan your moves carefully. You can arrange your minis on a 3x3 grid, and each position has its own advantages and disadvantages. For example, the front row is good for tanky minis that can absorb damage, the middle row is good for ranged minis that can deal damage from afar, and the back row is good for support minis that can heal or buff your army. You can also rotate your grid to change the orientation of your minis. You have to consider the elixir cost, keywords, abilities, and synergies of your minis, as well as the enemy's minis, when placing them on the grid. You can also use spells to boost your minis or hinder your opponent's minis.</p>
18
- <p>clash mini game free download for android<br />
19
- how to download clash mini on android device<br />
20
- clash mini apk latest version download<br />
21
- clash mini android gameplay and review<br />
22
- download clash mini mod apk unlimited gems<br />
23
- clash mini strategy board game for android<br />
24
- clash mini beta apk download link<br />
25
- clash mini release date and download size<br />
26
- clash mini tips and tricks for android players<br />
27
- clash mini best minis and formations for android<br />
28
- clash mini apk mirror download site<br />
29
- clash mini offline mode download for android<br />
30
- clash mini update and patch notes for android<br />
31
- clash mini cheats and hacks for android apk<br />
32
- clash mini online multiplayer mode for android<br />
33
- clash mini system requirements and compatibility for android<br />
34
- clash mini google play store download page<br />
35
- clash mini apk pure download source<br />
36
- clash mini fun and addictive android game<br />
37
- clash mini tutorial and guide for android beginners<br />
38
- clash mini new features and improvements for android<br />
39
- clash mini support and feedback for android users<br />
40
- clash mini rewards and achievements for android apk<br />
41
- clash mini customizations and skins for android minis<br />
42
- clash mini challenges and events for android players<br />
43
- clash mini rankings and leaderboards for android apk<br />
44
- clash mini community and forums for android gamers<br />
45
- clash mini fan art and wallpapers for android devices<br />
46
- clash mini developer blog and news for android fans<br />
47
- clash mini faq and troubleshooting for android issues<br />
48
- clash mini videos and screenshots for android apk<br />
49
- clash mini wiki and database for android information<br />
50
- clash mini reddit and discord for android discussions<br />
51
- clash mini facebook and twitter for android updates<br />
52
- clash mini instagram and tiktok for android content<br />
53
- clash mini merchandise and products for android lovers<br />
54
- clash mini podcasts and streams for android enthusiasts<br />
55
- clash mini reviews and ratings for android apk<br />
56
- clash mini testimonials and feedbacks for android game<br />
57
- clash mini comparisons and alternatives for android users</p>
58
- <h3>Fast, Exciting 3D Battles: Watch your minis come to life and clash to be the last one standing</h3>
59
- <p>Clash Mini is not only a game of strategy, but also a game of spectacle. The game features stunning 3D graphics and animations that bring your minis to life. You can watch them fight, cast spells, dodge attacks, and perform special moves in real-time. The battles are fast-paced and exciting, as each round lasts only 30 seconds. You have to be quick and decisive to win the battle. The game also has a dynamic camera that zooms in and out to capture the best moments of the battle. You can also replay your battles and share them with your friends.</p>
60
- <h3>Collect, Upgrade, and Customize: Unlock new abilities, skins, and heroes for your minis</h3>
61
- <p>Clash Mini is not only a game of strategy, but also a game of collection. You can unlock new minis, abilities, skins, and heroes as you play the game. You can earn chests by winning battles or completing quests. The chests contain gold, gems, cards, and tokens that you can use to upgrade or customize your minis. You can also join a clan and chat with other players, donate or request cards, and participate in clan wars. You can also access the shop and buy chests, cards, gems, or special offers with real money.</p>
62
- <h2>Clash Mini Game Modes</h2>
63
- <h3>Duel Mode: Challenge other players in a best of three match</h3>
64
- <p>Duel Mode is the main game mode of Clash Mini. In this mode, you can challenge other players from around the world in a best of three match. Each match consists of three rounds, and each round lasts 30 seconds. You have to win two rounds to win the match. You can choose from four different leagues: Bronze, Silver, Gold, and Diamond. Each league has its own rewards and challenges. You can earn trophies by winning matches and climb up the leaderboard. You can also lose trophies by losing matches and drop down the leaderboard.</p>
65
- <h3>Rumble Mode: Compete against seven other players in a five-round tournament</h3>
66
- <p>Rumble Mode is another game mode of Clash Mini. In this mode, you can compete against seven other players in a five-round tournament. Each round consists of one match against a random opponent. You have to win as many matches as possible to earn points. The player with the most points at the end of the tournament wins the grand prize. The prizes include gold, gems, cards, tokens, and chests.</p>
67
- <h3>Puzzle Mode: Solve tricky puzzles with limited resources</h3>
68
- <p>Puzzle Mode is another game mode of Clash Mini. In this mode, you can solve tricky puzzles with limited resources. Each puzzle consists of a pre-set grid with some minis on it. You have to place your own minis on the grid to achieve a certain objective. For example, you might have to defeat all enemy minis or survive for a certain number of turns. The puzzles vary in difficulty and complexity. You can earn stars by solving puzzles and unlock new puzzles.</p>
69
- <h3>Raid Mode: Team up with other players and raid enemy bases</h3>
70
- <p>Raid Mode is another game mode of Clash Mini. In this mode, you can team up with other players and raid enemy bases. Each base consists of several rooms with different layouts and defenses. You have to break through the defenses and reach the core room to win the raid. You can use your own minis or borrow minis from your clan members or friends. You can earn loot by raiding bases and use it to upgrade your own base.</p>
71
- <h3>Events Mode : Participate in special events and earn rewards</h3>
72
- <p>Events Mode is another game mode of Clash Mini. In this mode, you can participate in special events that have different rules and objectives. For example, you might have to use only certain minis or face a powerful boss. The events change every week and offer different rewards. You can earn gold, gems, cards, tokens, chests, and exclusive items by completing events.</p>
73
- <h2>Clash Mini Game Tips</h2>
74
- <h3>Choosing the Right Characters: Know the strengths and weaknesses of each mini</h3>
75
- <p>One of the most important aspects of Clash Mini is choosing the right characters for your army. You have to consider the elixir cost, stats, abilities, and keywords of each mini. You also have to know the strengths and weaknesses of each mini and how they interact with each other. For example, some minis are good against certain types of minis, such as fire minis against ice minis or air minis against ground minis. Some minis also have synergies with other minis, such as healers with tanks or witches with skeletons. You can see the details of each mini on the official website of Clash Mini ([4](https://clash.com/clashmini/)).</p>
76
- <h3>Positioning on the Battlefield: Place your minis strategically to maximize their potential</h3>
77
- <p>Another important aspect of Clash Mini is positioning your minis on the battlefield. You have to place your minis on a 3x3 grid, and each position has its own advantages and disadvantages. You have to think about the range, direction, and area of effect of your minis' abilities and how they affect your opponent's minis. You also have to consider the keywords of your minis, such as taunt, stealth, charge, splash, or stun. You can also rotate your grid to change the orientation of your minis. You can see some examples of positioning on the official website of Clash Mini ([5](https://clash.com/clashmini/)).</p>
78
- <h3>Utilizing Special Abilities: Use your minis' abilities at the right time to turn the tide of battle</h3>
79
- <p>Another important aspect of Clash Mini is utilizing your minis' abilities at the right time. Each mini has its own ability that can be activated once per round. Some abilities are passive and trigger automatically, while some abilities are active and require you to tap on them. You have to use your minis' abilities wisely and strategically to gain an edge over your opponent. For example, you might want to use a healing ability when your minis are low on health or a damaging ability when your opponent's minis are clustered together. You can also use spells to enhance your minis' abilities or counter your opponent's abilities.</p>
80
- <h2>Clash Mini Game Review</h2>
81
- <p>Clash Mini is a fun and fast-paced strategy game that offers a lot of variety and replay value. The game has amazing graphics and animations that make the battles lively and exciting. The game also has a simple and intuitive interface that makes it easy to play and enjoy. The game has a lot of features and modes that keep you entertained and challenged. The game is suitable for players of all ages and skill levels, as it has a balanced difficulty curve and a fair matchmaking system. The game is also free to play and does not require an internet connection to play.</p>
82
- <p>However, Clash Mini is not without its flaws. The game is still in beta testing and may have some bugs and glitches that affect the gameplay. The game also may have some balance issues that make some minis or strategies more dominant than others. The game also may have some pay-to-win elements that give an advantage to players who spend real money on the game.</p>
83
- <p>Overall, Clash Mini is a great game that deserves a try if you are looking for a new strategy game that is fun and easy to play. The game has a lot of potential and can become even better with more updates and improvements.</p>
84
- <h2>Conclusion</h2>
85
- <p>Clash Mini is a new strategy game from Supercell that features miniature characters from the Clash universe. You can collect, summon, and upgrade your army of minis and battle against other players in real-time. The game is easy to learn but challenging to master, as you have to anticipate your opponent's moves and arrange your army in limitless positions. You can also customize your minis with unique skins and abilities, and unlock new heroes such as Barbarian King, Archer Queen, Shield Maiden, and more.</p>
86
- <p>In this article, we showed you how to download and install Clash Mini on your Android device, what are the game features, game modes, game tips, and game review. We hope you found this article helpful and informative.</p>
87
- <p>If you want to learn more about Clash Mini or join the Clash Mini community, you can visit the official website of Clash Mini ([6](https://clash.com/clashmini/)), follow the official social media accounts of Clash Mini ([7](https://www.facebook.com/ClashMiniOfficial)), ([8](https://twitter.com/ClashMini)), ([9](https://www.instagram.com/clashmini/)), or join the official Discord server of Clash Mini ([10](https://discord.gg/clashmini)). You can also watch gameplay videos and tutorials of Clash Mini on YouTube ([11](https://www.youtube.com/channel/UC4Y0y9l0wQZk3wQXrZ1L1jg)).</p>
88
- <h2>FAQs</h2>
89
- <p>Here are some frequently asked questions about Clash Mini:</p>
90
- <ol>
91
- <li>What is the release date of Clash Mini?</li>
92
- <p>Clash Mini is currently in beta testing and is only available in select countries. The official release date of Clash Mini has not been announced yet, but it is expected to be sometime in 2023.</p>
93
- <li>What are the system requirements of Clash Mini?</li>
94
- <p>Clash Mini is compatible with Android devices that have Android 5.0 or higher and at least 2 GB of RAM. The game size is about 200 MB.</p>
95
- <li>How can I get free gems in Clash Mini?</li>
96
- <p>You can get free gems in Clash Mini by completing quests, opening chests, participating in events, watching ads, or leveling up. You can also get free gems by inviting your friends to play the game or joining a clan.</p>
97
- <li>How can I contact the support team of Clash Mini?</li>
98
- <p>You can contact the support team of Clash Mini by tapping on the settings icon on the top right corner of the screen, then tapping on the help and support button. You can also send an email to [email protected] or visit the official website of Clash Mini ([12](https://clash.com/clashmini/support)).</p>
99
- <li>Is Clash Mini a multiplayer game?</li>
100
- <p>Yes, Clash Mini is a multiplayer game that requires an internet connection to play. You can play against other players from around the world in real-time or team up with other players and raid enemy bases. You can also chat with other players and join a clan.</p>
101
- </ol></p> 197e85843d<br />
102
- <br />
103
- <br />
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/1phancelerku/anime-remove-background/Android Oyun Clubs Dark Riddle APK Hile The Most Challenging and Scary Game Ever.md DELETED
@@ -1,82 +0,0 @@
1
- <br />
2
- <h1>Dark Riddle APK Hile Android Oyun Club: A Review</h1>
3
- <p>If you are looking for a game that combines escape, adventure and puzzle elements with stealth, humor and mystery, you might want to check out Dark Riddle. This is a popular game on the Android platform that lets you explore your neighbor's house and discover his secrets. But what if you want to enjoy the game without any limitations or interruptions? That's where Dark Riddle APK Hile comes in. This is a modded version of the game that gives you unlimited money and removes ads and in-app purchases. In this article, we will review Dark Riddle APK Hile and tell you how to download and install it from Android Oyun Club. We will also discuss the features, benefits, drawbacks and risks of using this modded version.</p>
4
- <h2>What is Dark Riddle?</h2>
5
- <h3>A game of escape, adventure and puzzle</h3>
6
- <p>Dark Riddle is a game developed by Nika Entertainment that was released in 2019. It is inspired by other games like Hello Neighbor and Granny, where you have to sneak into your neighbor's house and find out what he is hiding. You can use various items and tools to distract, trick or fight your neighbor, who will chase you if he sees you. You can also interact with other characters and objects in the game world, such as animals, cars, plants and more. The game has different levels and modes, each with its own challenges and surprises.</p>
7
- <h2>dark riddle apk hile android oyun club</h2><br /><p><b><b>Download File</b> &#9989; <a href="https://jinyurl.com/2uNO53">https://jinyurl.com/2uNO53</a></b></p><br /><br />
8
- <h3>A game of stealth, humor and mystery</h3>
9
- <p>Dark Riddle is not just a game of escape, adventure and puzzle. It is also a game of stealth, humor and mystery. You have to use your skills and creativity to avoid being detected by your neighbor, who has a lot of traps and cameras in his house. You can also use your sense of humor to prank your neighbor or make him laugh. The game has a lot of funny moments and dialogues that will make you smile. Moreover, the game has a lot of mystery and suspense that will keep you hooked. You will want to know more about your neighbor's secrets and motives, as well as the story behind the game.</p>
10
- <h2>What is Dark Riddle APK Hile?</h2>
11
- <h3>A modded version of the game with unlimited money</h3>
12
- <p>Dark Riddle APK Hile is a modded version of the game that gives you unlimited money. This means that you can buy anything you want in the game without worrying about the cost. You can get all the items, skins and weapons that are available in the game store. You can also upgrade your skills and abilities to make yourself stronger and faster. With unlimited money, you can enjoy the game without any restrictions or limitations.</p>
13
- <h3>A way to enjoy the game without ads or in-app purchases</h3>
14
- <p>Dark Riddle APK Hile is also a way to enjoy the game without ads or in-app purchases. This means that you can play the game without any interruptions or annoyances. You don't have to watch any ads or spend any real money to get extra features or resources in the game. You can play the game smoothly and comfortably without any hassle or pressure.</p>
15
- <h2>How to <h2>How to download and install Dark Riddle APK Hile?</h2>
16
- <h3>The steps to download the file from Android Oyun Club</h3>
17
- <p>Dark Riddle APK Hile is available for download from Android Oyun Club, a website that offers modded versions of various Android games. To download the file from Android Oyun Club, you need to follow these steps:</p>
18
- <ol>
19
- <li>Go to the official website of Android Oyun Club at <a href="">https://androidoyun.club/</a></li>
20
- <li>Search for Dark Riddle in the search bar or browse the categories to find the game.</li>
21
- <li>Click on the game title and scroll down to the download section.</li>
22
- <li>Choose the version of Dark Riddle APK Hile that you want to download and click on the download button.</li>
23
- <li>Wait for the download to complete and save the file on your device.</li>
24
- </ol>
25
- <h3>The steps to install the file on your device</h3>
26
- <p>After downloading the file from Android Oyun Club, you need to install it on your device. To install the file on your device, you need to follow these steps:</p>
27
- <ol>
28
- <li>Go to the settings of your device and enable the option to install apps from unknown sources.</li>
29
- <li>Locate the downloaded file on your device and tap on it.</li>
30
- <li>Follow the instructions on the screen and allow the necessary permissions.</li>
31
- <li>Wait for the installation to finish and launch the game.</li>
32
- </ol>
33
- <h2>What are the features and benefits of Dark Riddle APK Hile?</h2>
34
- <h3>The features of the modded version, such as unlocked items, skins and weapons</h3>
35
- <p>Dark Riddle APK Hile has many features that make it different from the original version of the game. Some of these features are:</p>
36
- <ul>
37
- <li>Unlimited money: You can buy anything you want in the game without worrying about the cost.</li>
38
- <li>Unlocked items: You can access all the items that are available in the game store, such as flashlights, cameras, binoculars, etc.</li>
39
- <li>Unlocked skins: You can customize your character with different skins, such as clown, pirate, ninja, etc.</li>
40
- <li>Unlocked weapons: You can use different weapons to fight your neighbor, such as guns, knives, bats, etc.</li>
41
- </ul>
42
- <h3>The benefits of the modded version, such as more fun, freedom and challenge</h3>
43
- <p>Dark Riddle APK Hile has many benefits that make it more fun, freedom and challenge than the original version of the game. Some of these benefits are:</p>
44
- <ul>
45
- <li>More fun: You can enjoy the game without any limitations or interruptions. You can prank your neighbor or make him laugh with your humor and creativity.</li>
46
- <li>More freedom: You can explore your neighbor's house and discover his secrets without any restrictions or limitations. You can use any item or tool you want to solve puzzles and escape.</li>
47
- <li>More challenge: You can increase the difficulty and excitement of the game by using different weapons and skins. You can also face new challenges and surprises in each level and mode.</li>
48
- </ul> <h2>What are the drawbacks and risks of Dark Riddle APK Hile?</h2>
49
- <h3>The drawbacks of the modded version, such as possible bugs, glitches and crashes</h3>
50
- <p>Dark Riddle APK Hile is not a perfect version of the game. It has some drawbacks that may affect your gaming experience. Some of these drawbacks are:</p>
51
- <p>This is a first-person adventure thriller with an interactive environment and interesting quests. Solve puzzles and uncover the secrets of a suspicious neighbor who lives across from you.<br />
52
- Your adventure begins in an unusual city where you can find many useful and unique items. You will meet a police officer and a seller of alien devices, and during the game you will get acquainted with unusual creatures. Each item and character has a huge story behind it.<br />
53
- The game has a lot of humor, various levels of difficulty and multiple endings - the outcome of the story depends entirely on your actions and decisions. You can use headphones to explore the city in detail and better understand the plot.</p>
54
- <ul>
55
- <li>Possible bugs: The modded version may have some bugs or errors that may cause the game to malfunction or behave unexpectedly.</li>
56
- <li>Possible glitches: The modded version may have some glitches or flaws that may affect the graphics, sound or gameplay of the game.</li>
57
- <li>Possible crashes: The modded version may have some crashes or freezes that may cause the game to stop working or close abruptly.</li>
58
- </ul>
59
- <h3>The risks of the modded version, such as malware, viruses and bans</h3>
60
- <p>Dark Riddle APK Hile is not a safe version of the game. It has some risks that may harm your device or account. Some of these risks are:</p>
61
- <ul>
62
- <li>Possible malware: The modded version may have some malware or malicious code that may infect your device or steal your data.</li>
63
- <li>Possible viruses: The modded version may have some viruses or harmful programs that may damage your device or corrupt your files.</li>
64
- <li>Possible bans: The modded version may have some bans or penalties that may prevent you from playing the game or accessing your account.</li>
65
- </ul>
66
- <h2>Conclusion</h2>
67
- <p>Dark Riddle APK Hile is a modded version of the game that gives you unlimited money and removes ads and in-app purchases. It also unlocks all the items, skins and weapons in the game. It is a way to enjoy the game without any limitations or interruptions. However, it also has some drawbacks and risks that may affect your gaming experience or harm your device or account. Therefore, you should be careful and responsible when using this modded version. You should also respect the original developers and creators of the game and support them if you like their work.</p>
68
- <h2>FAQs</h2>
69
- <ol>
70
- <li>Q: Is Dark Riddle APK Hile legal?</li>
71
- <li>A: Dark Riddle APK Hile is not legal. It is a modded version of the game that violates the terms and conditions of the original game. It also infringes the intellectual property rights of the original developers and creators of the game.</li>
72
- <li>Q: Is Dark Riddle APK Hile safe?</li>
73
- <li>A: Dark Riddle APK Hile is not safe. It is a modded version of the game that may contain malware, viruses or bans that may harm your device or account. It also may have bugs, glitches or crashes that may affect your gaming experience.</li>
74
- <li>Q: How to update Dark Riddle APK Hile?</li>
75
- <li>A: Dark Riddle APK Hile is not easy to update. It is a modded version of the game that may not be compatible with the latest version of the original game. You may need to download and install a new version of Dark Riddle APK Hile from Android Oyun Club whenever there is an update available.</li>
76
- <li>Q: How to uninstall Dark Riddle APK Hile?</li>
77
- <li>A: Dark Riddle APK Hile is easy to uninstall. You can simply delete the file from your device or go to the settings of your device and uninstall the app like any other app.</li>
78
- <li>Q: Where to get more information about Dark Riddle APK Hile?</li>
79
- <li>A: You can get more information about Dark Riddle APK Hile from Android Oyun Club, the website that offers this modded version of the game. You can also visit the official website or social media pages of Dark Riddle, the original game, to get more information about it.</li>
80
- </ol></p> 401be4b1e0<br />
81
- <br />
82
- <br />
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/1phancelerku/anime-remove-background/Download the Best Poker App for Android Texas Holdem Poker Deluxe Versi Lama.md DELETED
@@ -1,162 +0,0 @@
1
- <br />
2
- <h1>Download Texas Holdem Poker Deluxe Versi Lama: How to Play the Classic Version of the Popular Poker Game</h1>
3
- <p>If you are a fan of poker games, you might have heard of Texas Holdem Poker Deluxe, one of the most popular poker apps on Facebook and Android. But did you know that there is a classic version of this game, called Texas Holdem Poker Deluxe Versi Lama, that offers a different and more authentic poker experience? In this article, we will tell you everything you need to know about how to download and play Texas Holdem Poker Deluxe Versi Lama, the old-school version of the famous poker game.</p>
4
- <h2>download texas holdem poker deluxe versi lama</h2><br /><p><b><b>Download File</b> ->>->>->> <a href="https://jinyurl.com/2uNKaY">https://jinyurl.com/2uNKaY</a></b></p><br /><br />
5
- <h2>What is Texas Holdem Poker Deluxe Versi Lama?</h2>
6
- <p>Texas Holdem Poker Deluxe Versi Lama is the original version of Texas Holdem Poker Deluxe, a poker app developed by IGG.COM. It was released in 2011 and quickly became one of the top-rated poker apps on Facebook and Android. It features classic gameplay, full Facebook compatibility, and an active community of over 16 million players. It also offers exciting Las Vegas style poker on the go, with various tables, tournaments, gifts, and prizes to choose from.</p>
7
- <h3>The features and benefits of playing Texas Holdem Poker Deluxe Versi Lama</h3>
8
- <p>Some of the features and benefits of playing Texas Holdem Poker Deluxe Versi Lama are:</p>
9
- <ul>
10
- <li>It is free to download and play, with daily gifts and chip bonuses.</li>
11
- <li>It has a simple interface that is easy to navigate and use.</li>
12
- <li>It has a personalized profile and buddy list, where you can customize your avatar, name, status, and achievements.</li>
13
- <li>It has a fast registration via Facebook Connect (optional), which allows you to sync your account and play with your Facebook friends.</li>
14
- <li>It has a live in-game chat and animated emoticons, where you can communicate and interact with other players.</li>
15
- <li>It has plenty of gifts, snacks, and drinks to share with others, as well as special prizes in the Facebook app (English, Turkish, Thai and Spanish only).</li>
16
- <li>It supports multiple languages: English, Français, Deutsch, Español, Português, ภาษาไทย, Türkçe, 日本语, 繁體中文.</li>
17
- </ul>
18
- <h3>The differences between Texas Holdem Poker Deluxe Versi Lama and the newer versions</h3>
19
- <p>Although Texas Holdem Poker Deluxe Versi Lama is still available for download and play, it is no longer updated by the developer. Therefore, it has some differences from the newer versions of Texas Holdem Poker Deluxe, such as:</p>
20
- <ul>
21
- <li>It has fewer tables and tournaments to join.</li>
22
- <li>It has fewer chips and gifts to collect.</li>
23
- <li>It has fewer features and options to customize your profile and game settings.</li>
24
- <li>It has less compatibility and stability with some devices and platforms.</ <h2>How to download Texas Holdem Poker Deluxe Versi Lama on your device</h2>
25
- <p>If you want to play Texas Holdem Poker Deluxe Versi Lama, you need to download it on your device first. Depending on the type of device you have, the steps may vary slightly. Here are the general steps to download Texas Holdem Poker Deluxe Versi Lama on your device:</p>
26
- <h3>The steps to download Texas Holdem Poker Deluxe Versi Lama on Android devices</h3>
27
- <ol>
28
- <li>Go to the Google Play Store and search for "Texas Holdem Poker Deluxe Versi Lama".</li>
29
- <li>Select the app from the list and tap on "Install".</li>
30
- <li>Wait for the app to download and install on your device.</li>
31
- <li>Open the app and sign in with your Facebook account (optional) or create a new account.</li>
32
- <li>Enjoy playing Texas Holdem Poker Deluxe Versi Lama!</li>
33
- </ol>
34
- <h3>The steps to download Texas Holdem Poker Deluxe Versi Lama on iOS devices</h3>
35
- <ol>
36
- <li>Go to the App Store and search for "Texas Holdem Poker Deluxe Versi Lama".</li>
37
- <li>Select the app from the list and tap on "Get".</li>
38
- <li>Enter your Apple ID and password if prompted.</li>
39
- <li>Wait for the app to download and install on your device.</li>
40
- <li>Open the app and sign in with your Facebook account (optional) or create a new account.</li>
41
- <li>Enjoy playing Texas Holdem Poker Deluxe Versi Lama!</li>
42
- </ol>
43
- <h3>The steps to download Texas Holdem Poker Deluxe Versi Lama on PC or Mac</h3>
44
- <ol>
45
- <li>Go to the official website of Texas Holdem Poker Deluxe Versi Lama at <a href="">http://www.igg.com/product/texaspokerdlx.php</a>.</li>
46
- <li>Click on the "Download" button and choose your preferred platform (Windows or Mac).</li>
47
- <li>Save the file to your computer and run it.</li>
48
- <li>Follow the instructions to install the app on your computer.</li>
49
- <li>Open the app and sign in with your Facebook account (optional) or create a new account.</li>
50
- <li>Enjoy playing Texas Holdem Poker Deluxe Versi Lama!</li>
51
- </ol>
52
- <h2>How to play Texas Holdem Poker Deluxe Versi Lama online or offline</h2>
53
- <p>Once you have downloaded Texas Holdem Poker Deluxe Versi Lama on your device, you can start playing it online or offline. Online mode allows you to play with other players from around the world, while offline mode allows you to play with computer opponents. Here are some tips on how to play Texas Holdem Poker Deluxe Versi Lama online or offline:</p>
54
- <p>Download Texas HoldEm Poker Deluxe app for Android<br />
55
- How to play Texas HoldEm Poker Deluxe on PC with BlueStacks<br />
56
- Texas HoldEm Poker Deluxe - free online poker game with millions of players<br />
57
- Download Poker Deluxe: Texas Holdem Onl - the best poker game for mobile devices<br />
58
- Texas HoldEm Poker Deluxe - play with friends and win big prizes<br />
59
- Download Texas HoldEm Poker Deluxe mod apk - unlimited chips and gold<br />
60
- Texas HoldEm Poker Deluxe - tips and tricks to improve your poker skills<br />
61
- Download Texas HoldEm Poker Deluxe old version - enjoy the classic gameplay and graphics<br />
62
- Texas HoldEm Poker Deluxe - join the fanpage and get free gifts and bonuses<br />
63
- Download Texas HoldEm Poker Deluxe for PC Windows 10/8/7<br />
64
- Texas HoldEm Poker Deluxe - review and rating by real players<br />
65
- Download Texas HoldEm Poker Deluxe hack tool - generate free chips and gold<br />
66
- Texas HoldEm Poker Deluxe - how to play in different languages and regions<br />
67
- Download Texas HoldEm Poker Deluxe for iOS devices - iPhone and iPad<br />
68
- Texas HoldEm Poker Deluxe - compare with other popular poker games<br />
69
- Download Texas HoldEm Poker Deluxe pro version - unlock special features and benefits<br />
70
- Texas HoldEm Poker Deluxe - how to contact customer support and report issues<br />
71
- Download Texas HoldEm Poker Deluxe latest version - get the newest updates and improvements<br />
72
- Texas HoldEm Poker Deluxe - how to create and join a poker club<br />
73
- Download Texas HoldEm Poker Deluxe offline mode - play without internet connection<br />
74
- Texas HoldEm Poker Deluxe - how to invite and chat with your Facebook friends<br />
75
- Download Texas HoldEm Poker Deluxe cheat codes - get unlimited chips and gold<br />
76
- Texas HoldEm Poker Deluxe - how to participate in tournaments and events<br />
77
- Download Texas HoldEm Poker Deluxe for Mac OS devices<br />
78
- Texas HoldEm Poker Deluxe - how to customize your profile and avatar<br />
79
- Download Texas HoldEm Poker Deluxe apk file - install the game manually on your device<br />
80
- Texas HoldEm Poker Deluxe - how to redeem gift codes and coupons<br />
81
- Download Texas HoldEm Poker Deluxe for Kindle Fire devices<br />
82
- Texas HoldEm Poker Deluxe - how to earn free chips and gold daily<br />
83
- Download Texas HoldEm Poker Deluxe for Windows Phone devices<br />
84
- Texas HoldEm Poker Deluxe - how to change your username and password<br />
85
- Download Texas HoldEm Poker Deluxe from Google Play Store or App Store<br />
86
- Texas HoldEm Poker Deluxe - how to link your account with Facebook or Google<br />
87
- Download Texas HoldEm Poker Deluxe from official website or trusted sources<br />
88
- Texas HoldEm Poker Deluxe - how to transfer your account or data to another device<br />
89
- Download Texas HoldEm Poker Deluxe for Chromebook devices<br />
90
- Texas HoldEm Poker Deluxe - how to play with different poker styles and strategies<br />
91
- Download Texas HoldEm Poker Deluxe for Linux devices or operating systems<br />
92
- Texas HoldEm Poker Deluxe - how to learn the rules and hand rankings of poker<br />
93
- Download Texas HoldEm Poker Deluxe for Samsung devices or other Android brands<br />
94
- Texas HoldEm Poker Deluxe - how to use emoticons, gifts, snacks, and drinks in the game<br />
95
- Download Texas HoldEm Poker Deluxe for Blackberry devices or other mobile platforms<br />
96
- Texas HoldEm Poker Deluxe - how to manage your bankroll and chips wisely<br />
97
- Download Texas HoldEm Poker Deluxe for Roku devices or other smart TV platforms<br />
98
- Texas HoldEm Poker Deluxe - how to deal with bad beats, tilt, and bluffing in poker</p>
99
- <h3>The rules and strategies of Texas Holdem Poker Deluxe Versi Lama</h3>
100
- <p>Texas Holdem Poker Deluxe Versi Lama follows the standard rules of Texas Holdem poker, which is a variant of poker where each player is dealt two cards face down, and five community cards are dealt face up in three stages: the flop, the turn, and the river. The objective is to make the best five-card poker hand using any combination of your two cards and the five community cards. The game consists of four betting rounds: pre-flop, flop, turn, and river. Each player can choose to check, bet, call, raise, or fold depending on their cards and the actions of other players. The player with the best hand at the end of the game wins the pot.</p>
101
- <p>Some of the basic strategies of Texas Holdem poker are:</p>
102
- <ul>
103
- <li>Know your hand rankings: The best hand in poker is a royal flush, followed by a straight flush, four of a kind, full house, flush, straight, three of a kind, two pair, one pair, and high card. You should know how strong your hand is compared to other possible hands and how likely it is to improve or be beaten by other hands.</li>
104
- <li>Know your position: Your position at the table determines when you act in each betting round. The earlier you act, the less information you have about other players' actions and cards. The later you act, the more information you have and the more advantage you have. Generally, you should play more cautiously in early position and more aggressively in late position.</li>
105
- <li>Know your odds: You should be able to calculate or estimate the odds of winning or losing a hand based on your cards, the community cards, and the number of players in the game. You should also be able to calculate or estimate the pot odds, which are the ratio of the amount of money in the pot to the amount of money you need to call a bet. You should only call a bet if your pot odds are higher than your winning odds.</li>
106
- <li> <li>Know your opponents: You should be able to observe and analyze your opponents' playing styles, habits, tendencies, and patterns. You should be able to classify your opponents as tight or loose, passive or aggressive, weak or strong, and bluffing or honest. You should be able to adjust your strategy accordingly to exploit their weaknesses and avoid their strengths.</li>
107
- </ul>
108
- <h3>The tips and tricks to win more chips and tournaments in Texas Holdem Poker Deluxe Versi Lama</h3>
109
- <p>Some of the tips and tricks to win more chips and tournaments in Texas Holdem Poker Deluxe Versi Lama are:</p>
110
- <ul>
111
- <li>Play according to your bankroll: You should only play with the amount of chips that you can afford to lose. You should not risk more than 5% of your bankroll in any single game or tournament. You should also have a stop-loss limit, which is the amount of chips that you are willing to lose in a session. If you reach your limit, you should quit playing and take a break.</li>
112
- <li>Play according to your skill level: You should only play in the tables and tournaments that match your skill level. You should not play in the high-stakes tables or tournaments if you are a beginner or a casual player. You should also avoid playing in the low-stakes tables or tournaments if you are an advanced or a professional player. You should find the optimal level of challenge and competition that suits your abilities and goals.</li>
113
- <li>Play according to your mood: You should only play when you are in a good mood and have a clear mind. You should not play when you are tired, angry, sad, bored, distracted, or under the influence of alcohol or drugs. You should also avoid playing when you are on tilt, which is when you lose control of your emotions and make irrational decisions.</li>
114
- <li>Play smart and selectively: You should not play every hand that you are dealt. You should only play the hands that have a high potential of winning or improving. You should also be aware of the position, the number of players, the pot size, and the betting action when deciding whether to play or fold a hand. You should also be able to bluff occasionally, but not too often or too predictably.</li>
115
- <li>Play aggressively and confidently: You should not be afraid to bet, raise, or re-raise when you have a strong hand or a good chance of winning. You should also not be afraid to fold when you have a weak hand or a bad chance of winning. You should be able to put pressure on your opponents and make them fold or pay more to see the next card. You should also be able to show confidence and assertiveness in your actions and expressions.</li>
116
- </ul>
117
- <h3>The best ways to connect with other players and join a poker community in Texas Holdem Poker Deluxe Versi Lama</h3>
118
- <p>Some of the best ways to connect with other players and join a poker community in Texas Holdem Poker Deluxe Versi Lama are:</p>
119
- <ul>
120
- <li>Use the live chat and emoticons: You can use the live chat feature to communicate and interact with other players at your table. You can also use the animated emoticons to express your emotions and reactions during the game. You can make friends, enemies, allies, rivals, or partners with other players through the chat and emoticons.</li>
121
- <li>Use the gifts and snacks: You can use the gifts and snacks feature to share items with other players at your table. You can send or receive gifts such as flowers, rings, cars, planes, or yachts. You can also send or receive snacks such as drinks, chips, burgers, pizzas, or cakes. You can use these items to show appreciation, gratitude, admiration, respect, friendship, love, or humor to other players.</li>
122
- <li>Use the buddy list and profile: You can use the buddy list feature to add or remove other players as your buddies. You can also use the profile feature to customize your avatar, name, status, and achievements. You can view other players' profiles and see their information and statistics. You can use these features to keep in touch with your buddies and learn more about other players.</li>
123
- <li>Use the Facebook app: You can use the Facebook app feature to sync your account with your Facebook account. You can also use this feature to invite your Facebook friends to play with you or join your table. You can also use this feature to post your results, achievements, screenshots, or videos on your Facebook timeline. You can use this feature to expand your social network and reach more players.</li>
124
- </ul>
125
- <h2>Conclusion</h2>
126
- <p>Texas Holdem Poker Deluxe Versi Lama is a classic version of Texas Holdem Poker Deluxe that offers a different and more authentic poker experience. It is free to download and play on various devices and platforms. It has many features and benefits that make it fun and exciting to play with other players from around the world. It also has some differences from the newer versions of Texas Holdem Poker Deluxe that make it more challenging and rewarding to play. If you want to play Texas Holdem Poker Deluxe Versi Lama, you need to download it on your device and follow the steps to install and register. You can then play online or offline, depending on your preference and availability. You can also use various features and options to connect with other players and join a poker community. If you are looking for a classic and authentic poker game, you should definitely try Texas Holdem Poker Deluxe Versi Lama.</p>
127
- <h3>A call to action for the readers to download and play Texas Holdem Poker Deluxe Versi Lama</h3>
128
- <p>Are you ready to download and play Texas Holdem Poker Deluxe Versi Lama? If you are, you can click on the links below to get the app on your device. You can also visit the official website or the Facebook page of Texas Holdem Poker Deluxe Versi Lama for more information and updates. Don't miss this opportunity to enjoy a classic and authentic poker game that will test your skills and luck. Download and play Texas Holdem Poker Deluxe Versi Lama today and see if you can become a poker champion!</p>
129
- <ul>
130
- <li><a href="">Download Texas Holdem Poker Deluxe Versi Lama for Android</a></li>
131
- <li><a href="">Download Texas Holdem Poker Deluxe Versi Lama for iOS</a></li>
132
- <li><a href="">Download Texas Holdem Poker Deluxe Versi Lama for PC or Mac</a></li>
133
- <li><a href="">Visit the official website of Texas Holdem Poker Deluxe Versi Lama</a></li>
134
- <li><a href="">Visit the Facebook page of Texas Holdem Poker Deluxe Versi Lama</a></li>
135
- </ul>
136
- <h4>FAQs</h4>
137
- <p>Here are some of the frequently asked questions about Texas Holdem Poker Deluxe Versi Lama:</p>
138
- <ol>
139
- <li>Q: Is Texas Holdem Poker Deluxe Versi Lama safe and secure to download and play?</li>
140
- <li>A: Yes, Texas Holdem Poker Deluxe Versi Lama is safe and secure to download and play. It is developed by IGG.COM, a reputable gaming company that has been in the industry for over 10 years. It is also verified by Google Play Protect, which scans apps for malware and viruses. It does not contain any harmful or illegal content or features.</li>
141
- <li>Q: How much space does Texas Holdem Poker Deluxe Versi Lama take up on my device?</li>
142
- <li>A: Texas Holdem Poker Deluxe Versi Lama takes up about 30 MB of space on your device. However, this may vary depending on your device model, operating system, and other factors. You should make sure that you have enough free space on your device before downloading and installing the app.</li>
143
- <li>Q: How do I update Texas Holdem Poker Deluxe Versi Lama to the latest version?</li>
144
- <li>A: Texas Holdem Poker Deluxe Versi Lama is no longer updated by the developer, so there is no need to update it to the latest version. However, if you encounter any issues or bugs while playing the app, you can contact the customer service team at <a href="">[email protected]</a> for assistance.</li>
145
- <li>Q: How do I delete Texas Holdem Poker Deluxe Versi Lama from my device?</li>
146
- <li>A: If you want to delete Texas Holdem Poker Deluxe Versi Lama from your device, you can follow these steps:</li>
147
- <ul>
148
- <li>For Android devices: Go to Settings > Apps > Texas Holdem Poker Deluxe Versi Lama > Uninstall.</li>
149
- <li>For iOS devices: Tap and hold the app icon until it wiggles > Tap the "X" button > Tap "Delete".</li>
150
- <li>For PC or Mac: Go to Control Panel > Programs > Uninstall a program > Select Texas Holdem Poker Deluxe Versi Lama > Click "Uninstall".</li>
151
- </ul>
152
- <li>Q: How do I get more chips in Texas Holdem Poker Deluxe Versi Lama?</li>
153
- <li>A: There are several ways to get more chips in Texas Holdem Poker Deluxe Versi Lama, such as:</li>
154
- <ul>
155
- <li>Claiming daily gifts and chip bonuses.</li>
156
- <li>Winning games and tournaments.</li>
157
- <li>Sending and receiving gifts from other players.</li>
158
- <li>Inviting your Facebook friends to play with you.</li>
159
- <li>Purchasing chips with real money (optional).</li>
160
- </ul></p> 401be4b1e0<br />
161
- <br />
162
- <br />
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/2023Liu2023/bingo/src/components/chat-header.tsx DELETED
@@ -1,12 +0,0 @@
1
- import LogoIcon from '@/assets/images/logo.svg'
2
- import Image from 'next/image'
3
-
4
- export function ChatHeader() {
5
- return (
6
- <div className="flex flex-col items-center justify-center">
7
- <Image alt="logo" src={LogoIcon} width={60}/>
8
- <div className="mt-8 text-4xl font-bold">欢迎使用新必应</div>
9
- <div className="mt-4 mb-8 text-lg">由 AI 支持的网页版 Copilot</div>
10
- </div>
11
- )
12
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/4Taps/SadTalker/src/facerender/modules/make_animation.py DELETED
@@ -1,160 +0,0 @@
1
- from scipy.spatial import ConvexHull
2
- import torch
3
- import torch.nn.functional as F
4
- import numpy as np
5
- from tqdm import tqdm
6
-
7
- def normalize_kp(kp_source, kp_driving, kp_driving_initial, adapt_movement_scale=False,
8
- use_relative_movement=False, use_relative_jacobian=False):
9
- if adapt_movement_scale:
10
- source_area = ConvexHull(kp_source['value'][0].data.cpu().numpy()).volume
11
- driving_area = ConvexHull(kp_driving_initial['value'][0].data.cpu().numpy()).volume
12
- adapt_movement_scale = np.sqrt(source_area) / np.sqrt(driving_area)
13
- else:
14
- adapt_movement_scale = 1
15
-
16
- kp_new = {k: v for k, v in kp_driving.items()}
17
-
18
- if use_relative_movement:
19
- kp_value_diff = (kp_driving['value'] - kp_driving_initial['value'])
20
- kp_value_diff *= adapt_movement_scale
21
- kp_new['value'] = kp_value_diff + kp_source['value']
22
-
23
- if use_relative_jacobian:
24
- jacobian_diff = torch.matmul(kp_driving['jacobian'], torch.inverse(kp_driving_initial['jacobian']))
25
- kp_new['jacobian'] = torch.matmul(jacobian_diff, kp_source['jacobian'])
26
-
27
- return kp_new
28
-
29
- def headpose_pred_to_degree(pred):
30
- device = pred.device
31
- idx_tensor = [idx for idx in range(66)]
32
- idx_tensor = torch.FloatTensor(idx_tensor).to(device)
33
- pred = F.softmax(pred)
34
- degree = torch.sum(pred*idx_tensor, 1) * 3 - 99
35
- return degree
36
-
37
- def get_rotation_matrix(yaw, pitch, roll):
38
- yaw = yaw / 180 * 3.14
39
- pitch = pitch / 180 * 3.14
40
- roll = roll / 180 * 3.14
41
-
42
- roll = roll.unsqueeze(1)
43
- pitch = pitch.unsqueeze(1)
44
- yaw = yaw.unsqueeze(1)
45
-
46
- pitch_mat = torch.cat([torch.ones_like(pitch), torch.zeros_like(pitch), torch.zeros_like(pitch),
47
- torch.zeros_like(pitch), torch.cos(pitch), -torch.sin(pitch),
48
- torch.zeros_like(pitch), torch.sin(pitch), torch.cos(pitch)], dim=1)
49
- pitch_mat = pitch_mat.view(pitch_mat.shape[0], 3, 3)
50
-
51
- yaw_mat = torch.cat([torch.cos(yaw), torch.zeros_like(yaw), torch.sin(yaw),
52
- torch.zeros_like(yaw), torch.ones_like(yaw), torch.zeros_like(yaw),
53
- -torch.sin(yaw), torch.zeros_like(yaw), torch.cos(yaw)], dim=1)
54
- yaw_mat = yaw_mat.view(yaw_mat.shape[0], 3, 3)
55
-
56
- roll_mat = torch.cat([torch.cos(roll), -torch.sin(roll), torch.zeros_like(roll),
57
- torch.sin(roll), torch.cos(roll), torch.zeros_like(roll),
58
- torch.zeros_like(roll), torch.zeros_like(roll), torch.ones_like(roll)], dim=1)
59
- roll_mat = roll_mat.view(roll_mat.shape[0], 3, 3)
60
-
61
- rot_mat = torch.einsum('bij,bjk,bkm->bim', pitch_mat, yaw_mat, roll_mat)
62
-
63
- return rot_mat
64
-
65
- def keypoint_transformation(kp_canonical, he):
66
- kp = kp_canonical['value'] # (bs, k, 3)
67
- yaw, pitch, roll= he['yaw'], he['pitch'], he['roll']
68
- yaw = headpose_pred_to_degree(yaw)
69
- pitch = headpose_pred_to_degree(pitch)
70
- roll = headpose_pred_to_degree(roll)
71
-
72
- if 'yaw_c' in he:
73
- yaw = yaw + he['yaw_c']
74
- if 'pitch_c' in he:
75
- pitch = pitch + he['pitch_c']
76
- if 'roll_c' in he:
77
- roll = roll + he['roll_c']
78
-
79
- rot_mat = get_rotation_matrix(yaw, pitch, roll) # (bs, 3, 3)
80
-
81
- t, exp = he['t'], he['exp']
82
-
83
- # keypoint rotation
84
- kp_rotated = torch.einsum('bmp,bkp->bkm', rot_mat, kp)
85
-
86
- # keypoint translation
87
- t = t.unsqueeze_(1).repeat(1, kp.shape[1], 1)
88
- kp_t = kp_rotated + t
89
-
90
- # add expression deviation
91
- exp = exp.view(exp.shape[0], -1, 3)
92
- kp_transformed = kp_t + exp
93
-
94
- return {'value': kp_transformed}
95
-
96
-
97
-
98
- def make_animation(source_image, source_semantics, target_semantics,
99
- generator, kp_detector, mapping,
100
- yaw_c_seq=None, pitch_c_seq=None, roll_c_seq=None,
101
- use_exp=True):
102
- with torch.no_grad():
103
- predictions = []
104
-
105
- kp_canonical = kp_detector(source_image)
106
- he_source = mapping(source_semantics)
107
- kp_source = keypoint_transformation(kp_canonical, he_source)
108
-
109
- for frame_idx in tqdm(range(target_semantics.shape[1]), 'Face Renderer:'):
110
- target_semantics_frame = target_semantics[:, frame_idx]
111
- he_driving = mapping(target_semantics_frame)
112
- if not use_exp:
113
- he_driving['exp'] = he_driving['exp']*0
114
- if yaw_c_seq is not None:
115
- he_driving['yaw_c'] = yaw_c_seq[:, frame_idx]
116
- if pitch_c_seq is not None:
117
- he_driving['pitch_c'] = pitch_c_seq[:, frame_idx]
118
- if roll_c_seq is not None:
119
- he_driving['roll_c'] = roll_c_seq[:, frame_idx]
120
-
121
- kp_driving = keypoint_transformation(kp_canonical, he_driving)
122
-
123
- #kp_norm = normalize_kp(kp_source=kp_source, kp_driving=kp_driving,
124
- #kp_driving_initial=kp_driving_initial)
125
- kp_norm = kp_driving
126
- out = generator(source_image, kp_source=kp_source, kp_driving=kp_norm)
127
- predictions.append(out['prediction'])
128
- predictions_ts = torch.stack(predictions, dim=1)
129
- return predictions_ts
130
-
131
- class AnimateModel(torch.nn.Module):
132
- """
133
- Merge all generator related updates into single model for better multi-gpu usage
134
- """
135
-
136
- def __init__(self, generator, kp_extractor, mapping):
137
- super(AnimateModel, self).__init__()
138
- self.kp_extractor = kp_extractor
139
- self.generator = generator
140
- self.mapping = mapping
141
-
142
- self.kp_extractor.eval()
143
- self.generator.eval()
144
- self.mapping.eval()
145
-
146
- def forward(self, x):
147
-
148
- source_image = x['source_image']
149
- source_semantics = x['source_semantics']
150
- target_semantics = x['target_semantics']
151
- yaw_c_seq = x['yaw_c_seq']
152
- pitch_c_seq = x['pitch_c_seq']
153
- roll_c_seq = x['roll_c_seq']
154
-
155
- predictions_video = make_animation(source_image, source_semantics, target_semantics,
156
- self.generator, self.kp_extractor,
157
- self.mapping, use_exp = True,
158
- yaw_c_seq=yaw_c_seq, pitch_c_seq=pitch_c_seq, roll_c_seq=roll_c_seq)
159
-
160
- return predictions_video
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/52Hz/SUNet_AWGN_denoising/app.py DELETED
@@ -1,38 +0,0 @@
1
- import os
2
- import gradio as gr
3
- from PIL import Image
4
- # import torch
5
-
6
-
7
- os.system(
8
- 'wget https://github.com/FanChiMao/SUNet/releases/download/0.0/AWGN_denoising_SUNet.pth -P experiments/pretrained_models')
9
- ##
10
-
11
- def inference(img):
12
- os.system('mkdir test')
13
- #basewidth = 512
14
- #wpercent = (basewidth / float(img.size[0]))
15
- #hsize = int((float(img.size[1]) * float(wpercent)))
16
- #img = img.resize((basewidth, hsize), Image.ANTIALIAS)
17
- img.save("test/1.png", "PNG")
18
- os.system(
19
- 'python main_test_SUNet.py --input_dir test --weights experiments/pretrained_models/AWGN_denoising_SUNet.pth')
20
- return 'result/1.png'
21
-
22
-
23
- title = "SUNet: Swin Transformer with UNet for Image Denoising"
24
- description = "Gradio demo for SUNet. SUNet has competitive performance results in terms of quantitative metrics and visual quality. See the paper and project page for detailed results below. Here, we provide a demo for AWGN image denoising. To use it, simply upload your image, or click one of the examples to load them. Reference from: https://huggingface.co/akhaliq"
25
- article = "<p style='text-align: center'><a href='https://arxiv.org/abs/2202.14009' target='_blank'>SUNet: Swin Transformer with UNet for Image Denoising</a> | <a href='https://github.com/FanChiMao/SUNet' target='_blank'>Github Repo</a></p> <center><img src='https://visitor-badge.glitch.me/badge?page_id=52Hz_SUNet_AWGN_denoising' alt='visitor badge'></center>"
26
-
27
- examples = [['set5/baby.png'], ['set5/bird.png'],['set5/butterfly.png'],['set5/head.png'],['set5/woman.png']]
28
- gr.Interface(
29
- inference,
30
- [gr.inputs.Image(type="pil", label="Input")],
31
- gr.outputs.Image(type="filepath", label="Output"),
32
- title=title,
33
- description=description,
34
- article=article,
35
- allow_flagging=False,
36
- allow_screenshot=False,
37
- examples=examples
38
- ).launch(debug=True)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/74run/Predict_Car/app.py DELETED
@@ -1,141 +0,0 @@
1
- import tensorflow as tf
2
- from tensorflow import keras
3
- # # import glob
4
- # import os
5
- # from PIL import Image
6
- # import random
7
-
8
- # Helper libraries
9
- import numpy as np
10
-
11
- # car_folder = "C:/Users/74run/Desktop/Datasets/Cars/data/vehicles" # replace with the path to your first folder
12
- # nocar_folder = "C:/Users/74run/Desktop/Datasets/Cars/data/non-vehicles" # replace with the path to your second folder
13
-
14
-
15
-
16
- # # create a list of image file paths in the car folder
17
- # car_image_paths = glob.glob(os.path.join(car_folder, "*.png"))
18
-
19
- # # create a list of image file paths in the no car folder
20
- # nocar_image_paths = glob.glob(os.path.join(nocar_folder, "*.png"))
21
-
22
- # # randomly select 70% of the images from both lists combined as the train set
23
- # num_car_images = len(car_image_paths)
24
- # num_nocar_images = len(nocar_image_paths)
25
- # num_train_images = int((num_car_images + num_nocar_images) * 0.9)
26
- # train_image_paths = random.sample(car_image_paths + nocar_image_paths, num_train_images)
27
-
28
- # # use the remaining images as the test set
29
- # test_image_paths = list(set(car_image_paths + nocar_image_paths) - set(train_image_paths))
30
-
31
-
32
- # from skimage import io
33
- # from keras.utils import to_categorical
34
- # train_labels = []
35
- # train_images = []
36
- # test_images = []
37
- # for path in train_image_paths:
38
- # if "car" in path:
39
- # train_labels.append(1)
40
- # else:
41
- # train_labels.append(0)
42
-
43
- # # create a list of labels for the test images
44
- # test_labels = []
45
- # for filename in test_image_paths:
46
- # if "car" in filename:
47
- # test_labels.append(1)
48
- # else:
49
- # test_labels.append(0)
50
-
51
- # train_labels =to_categorical(train_labels)
52
- # test_labels =to_categorical(test_labels)
53
-
54
-
55
- # for i in range(len(test_image_paths)):
56
- # img = io.imread(test_image_paths[i])
57
- # test_images.append(img)
58
-
59
- # for i in range(len(train_image_paths)):
60
- # img = io.imread(train_image_paths[i])
61
-
62
- # train_images.append(img)
63
-
64
-
65
- import cv2
66
- # import os
67
-
68
-
69
- # train_images = [cv2.resize(img, (64, 64)) for img in train_images]
70
-
71
- # # Normalize pixel values
72
- # train_images = np.array(train_images) / 255.0
73
-
74
- # test_images = [cv2.resize(img, (64, 64)) for img in test_images]
75
-
76
- # # Normalize pixel values
77
- # test_images = np.array(test_images) / 255.0
78
-
79
-
80
-
81
-
82
- # # define the CNN model
83
- # model = keras.models.Sequential([
84
- # keras.layers.Conv2D(filters=32, kernel_size=3, activation='relu', input_shape=(64, 64,3)),
85
- # keras.layers.MaxPooling2D(pool_size=2),
86
- # keras.layers.Conv2D(filters=64, kernel_size=3, activation='relu'),
87
- # keras.layers.MaxPooling2D(pool_size=2),
88
- # keras.layers.Conv2D(filters=128, kernel_size=3, activation='relu'),
89
- # keras.layers.MaxPooling2D(pool_size=2),
90
- # keras.layers.Flatten(),
91
- # keras.layers.Dense(units=128, activation='relu'),
92
- # keras.layers.Dense(units=2, activation='sigmoid')
93
- # ])
94
-
95
- # # compile the model
96
- # model.compile(optimizer='adam', loss='binary_crossentropy', metrics=['accuracy'])
97
-
98
- # model.fit(train_images, train_labels, epochs=6)
99
-
100
-
101
- # Pred_test = model.predict_generator(test_images)
102
-
103
- # import cv2
104
- # import numpy as np
105
-
106
-
107
- import gradio as gr
108
-
109
-
110
- model = tf.keras.models.load_model('car_model')
111
-
112
- def car(img):
113
- img = cv2.resize(img, (64, 64))
114
-
115
-
116
- img = np.array(img) / 255.0
117
- # expand the dimensions of the image to match the expected shape of the model
118
- img = np.expand_dims(img, axis=0)
119
-
120
- # pass the image to the model for prediction
121
- pred = model.predict_generator(img)
122
- pred_label = np.argmax(pred)
123
- class_names = ['noCar', 'Car']
124
- pred_class = class_names[pred_label]
125
- probability = pred[0][pred_label]
126
-
127
-
128
-
129
-
130
- return pred_class, probability
131
-
132
-
133
- demo = gr.Interface(fn=car, inputs=gr.inputs.Image(), outputs=[gr.outputs.Textbox(label='Decision'), gr.outputs.Textbox(label='Probability')]).launch()
134
-
135
-
136
-
137
-
138
-
139
-
140
-
141
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/AIFILMS/generate_human_motion/pyrender/examples/example.py DELETED
@@ -1,157 +0,0 @@
1
- """Examples of using pyrender for viewing and offscreen rendering.
2
- """
3
- import pyglet
4
- pyglet.options['shadow_window'] = False
5
- import os
6
- import numpy as np
7
- import trimesh
8
-
9
- from pyrender import PerspectiveCamera,\
10
- DirectionalLight, SpotLight, PointLight,\
11
- MetallicRoughnessMaterial,\
12
- Primitive, Mesh, Node, Scene,\
13
- Viewer, OffscreenRenderer, RenderFlags
14
-
15
- #==============================================================================
16
- # Mesh creation
17
- #==============================================================================
18
-
19
- #------------------------------------------------------------------------------
20
- # Creating textured meshes from trimeshes
21
- #------------------------------------------------------------------------------
22
-
23
- # Fuze trimesh
24
- fuze_trimesh = trimesh.load('./models/fuze.obj')
25
- fuze_mesh = Mesh.from_trimesh(fuze_trimesh)
26
-
27
- # Drill trimesh
28
- drill_trimesh = trimesh.load('./models/drill.obj')
29
- drill_mesh = Mesh.from_trimesh(drill_trimesh)
30
- drill_pose = np.eye(4)
31
- drill_pose[0,3] = 0.1
32
- drill_pose[2,3] = -np.min(drill_trimesh.vertices[:,2])
33
-
34
- # Wood trimesh
35
- wood_trimesh = trimesh.load('./models/wood.obj')
36
- wood_mesh = Mesh.from_trimesh(wood_trimesh)
37
-
38
- # Water bottle trimesh
39
- bottle_gltf = trimesh.load('./models/WaterBottle.glb')
40
- bottle_trimesh = bottle_gltf.geometry[list(bottle_gltf.geometry.keys())[0]]
41
- bottle_mesh = Mesh.from_trimesh(bottle_trimesh)
42
- bottle_pose = np.array([
43
- [1.0, 0.0, 0.0, 0.1],
44
- [0.0, 0.0, -1.0, -0.16],
45
- [0.0, 1.0, 0.0, 0.13],
46
- [0.0, 0.0, 0.0, 1.0],
47
- ])
48
-
49
- #------------------------------------------------------------------------------
50
- # Creating meshes with per-vertex colors
51
- #------------------------------------------------------------------------------
52
- boxv_trimesh = trimesh.creation.box(extents=0.1*np.ones(3))
53
- boxv_vertex_colors = np.random.uniform(size=(boxv_trimesh.vertices.shape))
54
- boxv_trimesh.visual.vertex_colors = boxv_vertex_colors
55
- boxv_mesh = Mesh.from_trimesh(boxv_trimesh, smooth=False)
56
-
57
- #------------------------------------------------------------------------------
58
- # Creating meshes with per-face colors
59
- #------------------------------------------------------------------------------
60
- boxf_trimesh = trimesh.creation.box(extents=0.1*np.ones(3))
61
- boxf_face_colors = np.random.uniform(size=boxf_trimesh.faces.shape)
62
- boxf_trimesh.visual.face_colors = boxf_face_colors
63
- boxf_mesh = Mesh.from_trimesh(boxf_trimesh, smooth=False)
64
-
65
- #------------------------------------------------------------------------------
66
- # Creating meshes from point clouds
67
- #------------------------------------------------------------------------------
68
- points = trimesh.creation.icosphere(radius=0.05).vertices
69
- point_colors = np.random.uniform(size=points.shape)
70
- points_mesh = Mesh.from_points(points, colors=point_colors)
71
-
72
- #==============================================================================
73
- # Light creation
74
- #==============================================================================
75
-
76
- direc_l = DirectionalLight(color=np.ones(3), intensity=1.0)
77
- spot_l = SpotLight(color=np.ones(3), intensity=10.0,
78
- innerConeAngle=np.pi/16, outerConeAngle=np.pi/6)
79
- point_l = PointLight(color=np.ones(3), intensity=10.0)
80
-
81
- #==============================================================================
82
- # Camera creation
83
- #==============================================================================
84
-
85
- cam = PerspectiveCamera(yfov=(np.pi / 3.0))
86
- cam_pose = np.array([
87
- [0.0, -np.sqrt(2)/2, np.sqrt(2)/2, 0.5],
88
- [1.0, 0.0, 0.0, 0.0],
89
- [0.0, np.sqrt(2)/2, np.sqrt(2)/2, 0.4],
90
- [0.0, 0.0, 0.0, 1.0]
91
- ])
92
-
93
- #==============================================================================
94
- # Scene creation
95
- #==============================================================================
96
-
97
- scene = Scene(ambient_light=np.array([0.02, 0.02, 0.02, 1.0]))
98
-
99
- #==============================================================================
100
- # Adding objects to the scene
101
- #==============================================================================
102
-
103
- #------------------------------------------------------------------------------
104
- # By manually creating nodes
105
- #------------------------------------------------------------------------------
106
- fuze_node = Node(mesh=fuze_mesh, translation=np.array([0.1, 0.15, -np.min(fuze_trimesh.vertices[:,2])]))
107
- scene.add_node(fuze_node)
108
- boxv_node = Node(mesh=boxv_mesh, translation=np.array([-0.1, 0.10, 0.05]))
109
- scene.add_node(boxv_node)
110
- boxf_node = Node(mesh=boxf_mesh, translation=np.array([-0.1, -0.10, 0.05]))
111
- scene.add_node(boxf_node)
112
-
113
- #------------------------------------------------------------------------------
114
- # By using the add() utility function
115
- #------------------------------------------------------------------------------
116
- drill_node = scene.add(drill_mesh, pose=drill_pose)
117
- bottle_node = scene.add(bottle_mesh, pose=bottle_pose)
118
- wood_node = scene.add(wood_mesh)
119
- direc_l_node = scene.add(direc_l, pose=cam_pose)
120
- spot_l_node = scene.add(spot_l, pose=cam_pose)
121
-
122
- #==============================================================================
123
- # Using the viewer with a default camera
124
- #==============================================================================
125
-
126
- v = Viewer(scene, shadows=True)
127
-
128
- #==============================================================================
129
- # Using the viewer with a pre-specified camera
130
- #==============================================================================
131
- cam_node = scene.add(cam, pose=cam_pose)
132
- v = Viewer(scene, central_node=drill_node)
133
-
134
- #==============================================================================
135
- # Rendering offscreen from that camera
136
- #==============================================================================
137
-
138
- r = OffscreenRenderer(viewport_width=640*2, viewport_height=480*2)
139
- color, depth = r.render(scene)
140
-
141
- import matplotlib.pyplot as plt
142
- plt.figure()
143
- plt.imshow(color)
144
- plt.show()
145
-
146
- #==============================================================================
147
- # Segmask rendering
148
- #==============================================================================
149
-
150
- nm = {node: 20*(i + 1) for i, node in enumerate(scene.mesh_nodes)}
151
- seg = r.render(scene, RenderFlags.SEG, nm)[0]
152
- plt.figure()
153
- plt.imshow(seg)
154
- plt.show()
155
-
156
- r.delete()
157
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/AIGC-Audio/Make_An_Audio/ldm/modules/losses_audio/vggishish/logger.py DELETED
@@ -1,87 +0,0 @@
1
- import logging
2
- import os
3
- import time
4
- from shutil import copytree, ignore_patterns
5
-
6
- import torch
7
- from omegaconf import OmegaConf
8
- from torch.utils.tensorboard import SummaryWriter, summary
9
-
10
-
11
- class LoggerWithTBoard(SummaryWriter):
12
-
13
- def __init__(self, cfg):
14
- # current time stamp and experiment log directory
15
- self.start_time = time.strftime('%y-%m-%dT%H-%M-%S', time.localtime())
16
- self.logdir = os.path.join(cfg.logdir, self.start_time)
17
- # init tboard
18
- super().__init__(self.logdir)
19
- # backup the cfg
20
- OmegaConf.save(cfg, os.path.join(self.log_dir, 'cfg.yaml'))
21
- # backup the code state
22
- if cfg.log_code_state:
23
- dest_dir = os.path.join(self.logdir, 'code')
24
- copytree(os.getcwd(), dest_dir, ignore=ignore_patterns(*cfg.patterns_to_ignore))
25
-
26
- # init logger which handles printing and logging mostly same things to the log file
27
- self.print_logger = logging.getLogger('main')
28
- self.print_logger.setLevel(logging.INFO)
29
- msgfmt = '[%(levelname)s] %(asctime)s - %(name)s \n %(message)s'
30
- datefmt = '%d %b %Y %H:%M:%S'
31
- formatter = logging.Formatter(msgfmt, datefmt)
32
- # stdout
33
- sh = logging.StreamHandler()
34
- sh.setLevel(logging.DEBUG)
35
- sh.setFormatter(formatter)
36
- self.print_logger.addHandler(sh)
37
- # log file
38
- fh = logging.FileHandler(os.path.join(self.log_dir, 'log.txt'))
39
- fh.setLevel(logging.INFO)
40
- fh.setFormatter(formatter)
41
- self.print_logger.addHandler(fh)
42
-
43
- self.print_logger.info(f'Saving logs and checkpoints @ {self.logdir}')
44
-
45
- def log_param_num(self, model):
46
- param_num = sum(p.numel() for p in model.parameters() if p.requires_grad)
47
- self.print_logger.info(f'The number of parameters: {param_num/1e+6:.3f} mil')
48
- self.add_scalar('num_params', param_num, 0)
49
- return param_num
50
-
51
- def log_iter_loss(self, loss, iter, phase):
52
- self.add_scalar(f'{phase}/loss_iter', loss, iter)
53
-
54
- def log_epoch_loss(self, loss, epoch, phase):
55
- self.add_scalar(f'{phase}/loss', loss, epoch)
56
- self.print_logger.info(f'{phase} ({epoch}): loss {loss:.3f};')
57
-
58
- def log_epoch_metrics(self, metrics_dict, epoch, phase):
59
- for metric, val in metrics_dict.items():
60
- self.add_scalar(f'{phase}/{metric}', val, epoch)
61
- metrics_dict = {k: round(v, 4) for k, v in metrics_dict.items()}
62
- self.print_logger.info(f'{phase} ({epoch}) metrics: {metrics_dict};')
63
-
64
- def log_test_metrics(self, metrics_dict, hparams_dict, best_epoch):
65
- allowed_types = (int, float, str, bool, torch.Tensor)
66
- hparams_dict = {k: v for k, v in hparams_dict.items() if isinstance(v, allowed_types)}
67
- metrics_dict = {f'test/{k}': round(v, 4) for k, v in metrics_dict.items()}
68
- exp, ssi, sei = summary.hparams(hparams_dict, metrics_dict)
69
- self.file_writer.add_summary(exp)
70
- self.file_writer.add_summary(ssi)
71
- self.file_writer.add_summary(sei)
72
- for k, v in metrics_dict.items():
73
- self.add_scalar(k, v, best_epoch)
74
- self.print_logger.info(f'test ({best_epoch}) metrics: {metrics_dict};')
75
-
76
- def log_best_model(self, model, loss, epoch, optimizer, metrics_dict):
77
- model_name = model.__class__.__name__
78
- self.best_model_path = os.path.join(self.logdir, f'{model_name}-{self.start_time}.pt')
79
- checkpoint = {
80
- 'loss': loss,
81
- 'metrics': metrics_dict,
82
- 'epoch': epoch,
83
- 'optimizer': optimizer.state_dict(),
84
- 'model': model.state_dict(),
85
- }
86
- torch.save(checkpoint, self.best_model_path)
87
- self.print_logger.info(f'Saved model in {self.best_model_path}')
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/AIGText/GlyphControl/ldm/models/diffusion/plms.py DELETED
@@ -1,244 +0,0 @@
1
- """SAMPLING ONLY."""
2
-
3
- import torch
4
- import numpy as np
5
- from tqdm import tqdm
6
- from functools import partial
7
-
8
- from ldm.modules.diffusionmodules.util import make_ddim_sampling_parameters, make_ddim_timesteps, noise_like
9
- from ldm.models.diffusion.sampling_util import norm_thresholding
10
-
11
-
12
- class PLMSSampler(object):
13
- def __init__(self, model, schedule="linear", **kwargs):
14
- super().__init__()
15
- self.model = model
16
- self.ddpm_num_timesteps = model.num_timesteps
17
- self.schedule = schedule
18
-
19
- def register_buffer(self, name, attr):
20
- if type(attr) == torch.Tensor:
21
- if attr.device != torch.device("cuda"):
22
- attr = attr.to(torch.device("cuda"))
23
- setattr(self, name, attr)
24
-
25
- def make_schedule(self, ddim_num_steps, ddim_discretize="uniform", ddim_eta=0., verbose=True):
26
- if ddim_eta != 0:
27
- raise ValueError('ddim_eta must be 0 for PLMS')
28
- self.ddim_timesteps = make_ddim_timesteps(ddim_discr_method=ddim_discretize, num_ddim_timesteps=ddim_num_steps,
29
- num_ddpm_timesteps=self.ddpm_num_timesteps,verbose=verbose)
30
- alphas_cumprod = self.model.alphas_cumprod
31
- assert alphas_cumprod.shape[0] == self.ddpm_num_timesteps, 'alphas have to be defined for each timestep'
32
- to_torch = lambda x: x.clone().detach().to(torch.float32).to(self.model.device)
33
-
34
- self.register_buffer('betas', to_torch(self.model.betas))
35
- self.register_buffer('alphas_cumprod', to_torch(alphas_cumprod))
36
- self.register_buffer('alphas_cumprod_prev', to_torch(self.model.alphas_cumprod_prev))
37
-
38
- # calculations for diffusion q(x_t | x_{t-1}) and others
39
- self.register_buffer('sqrt_alphas_cumprod', to_torch(np.sqrt(alphas_cumprod.cpu())))
40
- self.register_buffer('sqrt_one_minus_alphas_cumprod', to_torch(np.sqrt(1. - alphas_cumprod.cpu())))
41
- self.register_buffer('log_one_minus_alphas_cumprod', to_torch(np.log(1. - alphas_cumprod.cpu())))
42
- self.register_buffer('sqrt_recip_alphas_cumprod', to_torch(np.sqrt(1. / alphas_cumprod.cpu())))
43
- self.register_buffer('sqrt_recipm1_alphas_cumprod', to_torch(np.sqrt(1. / alphas_cumprod.cpu() - 1)))
44
-
45
- # ddim sampling parameters
46
- ddim_sigmas, ddim_alphas, ddim_alphas_prev = make_ddim_sampling_parameters(alphacums=alphas_cumprod.cpu(),
47
- ddim_timesteps=self.ddim_timesteps,
48
- eta=ddim_eta,verbose=verbose)
49
- self.register_buffer('ddim_sigmas', ddim_sigmas)
50
- self.register_buffer('ddim_alphas', ddim_alphas)
51
- self.register_buffer('ddim_alphas_prev', ddim_alphas_prev)
52
- self.register_buffer('ddim_sqrt_one_minus_alphas', np.sqrt(1. - ddim_alphas))
53
- sigmas_for_original_sampling_steps = ddim_eta * torch.sqrt(
54
- (1 - self.alphas_cumprod_prev) / (1 - self.alphas_cumprod) * (
55
- 1 - self.alphas_cumprod / self.alphas_cumprod_prev))
56
- self.register_buffer('ddim_sigmas_for_original_num_steps', sigmas_for_original_sampling_steps)
57
-
58
- @torch.no_grad()
59
- def sample(self,
60
- S,
61
- batch_size,
62
- shape,
63
- conditioning=None,
64
- callback=None,
65
- normals_sequence=None,
66
- img_callback=None,
67
- quantize_x0=False,
68
- eta=0.,
69
- mask=None,
70
- x0=None,
71
- temperature=1.,
72
- noise_dropout=0.,
73
- score_corrector=None,
74
- corrector_kwargs=None,
75
- verbose=True,
76
- x_T=None,
77
- log_every_t=100,
78
- unconditional_guidance_scale=1.,
79
- unconditional_conditioning=None,
80
- # this has to come in the same format as the conditioning, # e.g. as encoded tokens, ...
81
- dynamic_threshold=None,
82
- **kwargs
83
- ):
84
- if conditioning is not None:
85
- if isinstance(conditioning, dict):
86
- cbs = conditioning[list(conditioning.keys())[0]].shape[0]
87
- if cbs != batch_size:
88
- print(f"Warning: Got {cbs} conditionings but batch-size is {batch_size}")
89
- else:
90
- if conditioning.shape[0] != batch_size:
91
- print(f"Warning: Got {conditioning.shape[0]} conditionings but batch-size is {batch_size}")
92
-
93
- self.make_schedule(ddim_num_steps=S, ddim_eta=eta, verbose=verbose)
94
- # sampling
95
- C, H, W = shape
96
- size = (batch_size, C, H, W)
97
- print(f'Data shape for PLMS sampling is {size}')
98
-
99
- samples, intermediates = self.plms_sampling(conditioning, size,
100
- callback=callback,
101
- img_callback=img_callback,
102
- quantize_denoised=quantize_x0,
103
- mask=mask, x0=x0,
104
- ddim_use_original_steps=False,
105
- noise_dropout=noise_dropout,
106
- temperature=temperature,
107
- score_corrector=score_corrector,
108
- corrector_kwargs=corrector_kwargs,
109
- x_T=x_T,
110
- log_every_t=log_every_t,
111
- unconditional_guidance_scale=unconditional_guidance_scale,
112
- unconditional_conditioning=unconditional_conditioning,
113
- dynamic_threshold=dynamic_threshold,
114
- )
115
- return samples, intermediates
116
-
117
- @torch.no_grad()
118
- def plms_sampling(self, cond, shape,
119
- x_T=None, ddim_use_original_steps=False,
120
- callback=None, timesteps=None, quantize_denoised=False,
121
- mask=None, x0=None, img_callback=None, log_every_t=100,
122
- temperature=1., noise_dropout=0., score_corrector=None, corrector_kwargs=None,
123
- unconditional_guidance_scale=1., unconditional_conditioning=None,
124
- dynamic_threshold=None):
125
- device = self.model.betas.device
126
- b = shape[0]
127
- if x_T is None:
128
- img = torch.randn(shape, device=device)
129
- else:
130
- img = x_T
131
-
132
- if timesteps is None:
133
- timesteps = self.ddpm_num_timesteps if ddim_use_original_steps else self.ddim_timesteps
134
- elif timesteps is not None and not ddim_use_original_steps:
135
- subset_end = int(min(timesteps / self.ddim_timesteps.shape[0], 1) * self.ddim_timesteps.shape[0]) - 1
136
- timesteps = self.ddim_timesteps[:subset_end]
137
-
138
- intermediates = {'x_inter': [img], 'pred_x0': [img]}
139
- time_range = list(reversed(range(0,timesteps))) if ddim_use_original_steps else np.flip(timesteps)
140
- total_steps = timesteps if ddim_use_original_steps else timesteps.shape[0]
141
- print(f"Running PLMS Sampling with {total_steps} timesteps")
142
-
143
- iterator = tqdm(time_range, desc='PLMS Sampler', total=total_steps)
144
- old_eps = []
145
-
146
- for i, step in enumerate(iterator):
147
- index = total_steps - i - 1
148
- ts = torch.full((b,), step, device=device, dtype=torch.long)
149
- ts_next = torch.full((b,), time_range[min(i + 1, len(time_range) - 1)], device=device, dtype=torch.long)
150
-
151
- if mask is not None:
152
- assert x0 is not None
153
- img_orig = self.model.q_sample(x0, ts) # TODO: deterministic forward pass?
154
- img = img_orig * mask + (1. - mask) * img
155
-
156
- outs = self.p_sample_plms(img, cond, ts, index=index, use_original_steps=ddim_use_original_steps,
157
- quantize_denoised=quantize_denoised, temperature=temperature,
158
- noise_dropout=noise_dropout, score_corrector=score_corrector,
159
- corrector_kwargs=corrector_kwargs,
160
- unconditional_guidance_scale=unconditional_guidance_scale,
161
- unconditional_conditioning=unconditional_conditioning,
162
- old_eps=old_eps, t_next=ts_next,
163
- dynamic_threshold=dynamic_threshold)
164
- img, pred_x0, e_t = outs
165
- old_eps.append(e_t)
166
- if len(old_eps) >= 4:
167
- old_eps.pop(0)
168
- if callback: callback(i)
169
- if img_callback: img_callback(pred_x0, i)
170
-
171
- if index % log_every_t == 0 or index == total_steps - 1:
172
- intermediates['x_inter'].append(img)
173
- intermediates['pred_x0'].append(pred_x0)
174
-
175
- return img, intermediates
176
-
177
- @torch.no_grad()
178
- def p_sample_plms(self, x, c, t, index, repeat_noise=False, use_original_steps=False, quantize_denoised=False,
179
- temperature=1., noise_dropout=0., score_corrector=None, corrector_kwargs=None,
180
- unconditional_guidance_scale=1., unconditional_conditioning=None, old_eps=None, t_next=None,
181
- dynamic_threshold=None):
182
- b, *_, device = *x.shape, x.device
183
-
184
- def get_model_output(x, t):
185
- if unconditional_conditioning is None or unconditional_guidance_scale == 1.:
186
- e_t = self.model.apply_model(x, t, c)
187
- else:
188
- x_in = torch.cat([x] * 2)
189
- t_in = torch.cat([t] * 2)
190
- c_in = torch.cat([unconditional_conditioning, c])
191
- e_t_uncond, e_t = self.model.apply_model(x_in, t_in, c_in).chunk(2)
192
- e_t = e_t_uncond + unconditional_guidance_scale * (e_t - e_t_uncond)
193
-
194
- if score_corrector is not None:
195
- assert self.model.parameterization == "eps"
196
- e_t = score_corrector.modify_score(self.model, e_t, x, t, c, **corrector_kwargs)
197
-
198
- return e_t
199
-
200
- alphas = self.model.alphas_cumprod if use_original_steps else self.ddim_alphas
201
- alphas_prev = self.model.alphas_cumprod_prev if use_original_steps else self.ddim_alphas_prev
202
- sqrt_one_minus_alphas = self.model.sqrt_one_minus_alphas_cumprod if use_original_steps else self.ddim_sqrt_one_minus_alphas
203
- sigmas = self.model.ddim_sigmas_for_original_num_steps if use_original_steps else self.ddim_sigmas
204
-
205
- def get_x_prev_and_pred_x0(e_t, index):
206
- # select parameters corresponding to the currently considered timestep
207
- a_t = torch.full((b, 1, 1, 1), alphas[index], device=device)
208
- a_prev = torch.full((b, 1, 1, 1), alphas_prev[index], device=device)
209
- sigma_t = torch.full((b, 1, 1, 1), sigmas[index], device=device)
210
- sqrt_one_minus_at = torch.full((b, 1, 1, 1), sqrt_one_minus_alphas[index],device=device)
211
-
212
- # current prediction for x_0
213
- pred_x0 = (x - sqrt_one_minus_at * e_t) / a_t.sqrt()
214
- if quantize_denoised:
215
- pred_x0, _, *_ = self.model.first_stage_model.quantize(pred_x0)
216
- if dynamic_threshold is not None:
217
- pred_x0 = norm_thresholding(pred_x0, dynamic_threshold)
218
- # direction pointing to x_t
219
- dir_xt = (1. - a_prev - sigma_t**2).sqrt() * e_t
220
- noise = sigma_t * noise_like(x.shape, device, repeat_noise) * temperature
221
- if noise_dropout > 0.:
222
- noise = torch.nn.functional.dropout(noise, p=noise_dropout)
223
- x_prev = a_prev.sqrt() * pred_x0 + dir_xt + noise
224
- return x_prev, pred_x0
225
-
226
- e_t = get_model_output(x, t)
227
- if len(old_eps) == 0:
228
- # Pseudo Improved Euler (2nd order)
229
- x_prev, pred_x0 = get_x_prev_and_pred_x0(e_t, index)
230
- e_t_next = get_model_output(x_prev, t_next)
231
- e_t_prime = (e_t + e_t_next) / 2
232
- elif len(old_eps) == 1:
233
- # 2nd order Pseudo Linear Multistep (Adams-Bashforth)
234
- e_t_prime = (3 * e_t - old_eps[-1]) / 2
235
- elif len(old_eps) == 2:
236
- # 3nd order Pseudo Linear Multistep (Adams-Bashforth)
237
- e_t_prime = (23 * e_t - 16 * old_eps[-1] + 5 * old_eps[-2]) / 12
238
- elif len(old_eps) >= 3:
239
- # 4nd order Pseudo Linear Multistep (Adams-Bashforth)
240
- e_t_prime = (55 * e_t - 59 * old_eps[-1] + 37 * old_eps[-2] - 9 * old_eps[-3]) / 24
241
-
242
- x_prev, pred_x0 = get_x_prev_and_pred_x0(e_t_prime, index)
243
-
244
- return x_prev, pred_x0, e_t
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/AgentVerse/agentVerse/ui/src/phaser3-rex-plugins/templates/ui/canvasinput/Factory.js DELETED
@@ -1,13 +0,0 @@
1
- import CanvasInput from './CanvasInput.js';
2
- import ObjectFactory from '../ObjectFactory.js';
3
- import SetValue from '../../../plugins/utils/object/SetValue.js';
4
-
5
- ObjectFactory.register('canvasInput', function (x, y, fixedWidth, fixedHeight, config) {
6
- var gameObject = new CanvasInput(this.scene, x, y, fixedWidth, fixedHeight, config);
7
- this.scene.add.existing(gameObject);
8
- return gameObject;
9
- });
10
-
11
- SetValue(window, 'RexPlugins.UI.CanvasInput', CanvasInput);
12
-
13
- export default CanvasInput;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/Akbartus/U2net-with-rgba/README.md DELETED
@@ -1,38 +0,0 @@
1
- ---
2
- title: U2net_rgba
3
- emoji: 📉
4
- colorFrom: yellow
5
- colorTo: yellow
6
- sdk: gradio
7
- app_file: app.py
8
- pinned: false
9
- duplicated_from: xiongjie/u2net_rgba
10
- ---
11
-
12
- # Configuration
13
-
14
- `title`: _string_
15
- Display title for the Space
16
-
17
- `emoji`: _string_
18
- Space emoji (emoji-only character allowed)
19
-
20
- `colorFrom`: _string_
21
- Color for Thumbnail gradient (red, yellow, green, blue, indigo, purple, pink, gray)
22
-
23
- `colorTo`: _string_
24
- Color for Thumbnail gradient (red, yellow, green, blue, indigo, purple, pink, gray)
25
-
26
- `sdk`: _string_
27
- Can be either `gradio` or `streamlit`
28
-
29
- `sdk_version` : _string_
30
- Only applicable for `streamlit` SDK.
31
- See [doc](https://hf.co/docs/hub/spaces) for more info on supported versions.
32
-
33
- `app_file`: _string_
34
- Path to your main application file (which contains either `gradio` or `streamlit` Python code).
35
- Path is relative to the root of the repository.
36
-
37
- `pinned`: _boolean_
38
- Whether the Space stays on top of your list.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/AlanMars/QYL-AI-Space/modules/pdf_func.py DELETED
@@ -1,180 +0,0 @@
1
- from types import SimpleNamespace
2
- import pdfplumber
3
- import logging
4
- from llama_index import Document
5
-
6
- def prepare_table_config(crop_page):
7
- """Prepare table查找边界, 要求page为原始page
8
-
9
- From https://github.com/jsvine/pdfplumber/issues/242
10
- """
11
- page = crop_page.root_page # root/parent
12
- cs = page.curves + page.edges
13
- def curves_to_edges():
14
- """See https://github.com/jsvine/pdfplumber/issues/127"""
15
- edges = []
16
- for c in cs:
17
- edges += pdfplumber.utils.rect_to_edges(c)
18
- return edges
19
- edges = curves_to_edges()
20
- return {
21
- "vertical_strategy": "explicit",
22
- "horizontal_strategy": "explicit",
23
- "explicit_vertical_lines": edges,
24
- "explicit_horizontal_lines": edges,
25
- "intersection_y_tolerance": 10,
26
- }
27
-
28
- def get_text_outside_table(crop_page):
29
- ts = prepare_table_config(crop_page)
30
- if len(ts["explicit_vertical_lines"]) == 0 or len(ts["explicit_horizontal_lines"]) == 0:
31
- return crop_page
32
-
33
- ### Get the bounding boxes of the tables on the page.
34
- bboxes = [table.bbox for table in crop_page.root_page.find_tables(table_settings=ts)]
35
- def not_within_bboxes(obj):
36
- """Check if the object is in any of the table's bbox."""
37
- def obj_in_bbox(_bbox):
38
- """See https://github.com/jsvine/pdfplumber/blob/stable/pdfplumber/table.py#L404"""
39
- v_mid = (obj["top"] + obj["bottom"]) / 2
40
- h_mid = (obj["x0"] + obj["x1"]) / 2
41
- x0, top, x1, bottom = _bbox
42
- return (h_mid >= x0) and (h_mid < x1) and (v_mid >= top) and (v_mid < bottom)
43
- return not any(obj_in_bbox(__bbox) for __bbox in bboxes)
44
-
45
- return crop_page.filter(not_within_bboxes)
46
- # 请使用 LaTeX 表达公式,行内公式以 $ 包裹,行间公式以 $$ 包裹
47
-
48
- extract_words = lambda page: page.extract_words(keep_blank_chars=True, y_tolerance=0, x_tolerance=1, extra_attrs=["fontname", "size", "object_type"])
49
- # dict_keys(['text', 'x0', 'x1', 'top', 'doctop', 'bottom', 'upright', 'direction', 'fontname', 'size'])
50
-
51
- def get_title_with_cropped_page(first_page):
52
- title = [] # 处理标题
53
- x0,top,x1,bottom = first_page.bbox # 获取页面边框
54
-
55
- for word in extract_words(first_page):
56
- word = SimpleNamespace(**word)
57
-
58
- if word.size >= 14:
59
- title.append(word.text)
60
- title_bottom = word.bottom
61
- elif word.text == "Abstract": # 获取页面abstract
62
- top = word.top
63
-
64
- user_info = [i["text"] for i in extract_words(first_page.within_bbox((x0,title_bottom,x1,top)))]
65
- # 裁剪掉上半部分, within_bbox: full_included; crop: partial_included
66
- return title, user_info, first_page.within_bbox((x0,top,x1,bottom))
67
-
68
- def get_column_cropped_pages(pages, two_column=True):
69
- new_pages = []
70
- for page in pages:
71
- if two_column:
72
- left = page.within_bbox((0, 0, page.width/2, page.height),relative=True)
73
- right = page.within_bbox((page.width/2, 0, page.width, page.height), relative=True)
74
- new_pages.append(left)
75
- new_pages.append(right)
76
- else:
77
- new_pages.append(page)
78
-
79
- return new_pages
80
-
81
- def parse_pdf(filename, two_column = True):
82
- level = logging.getLogger().level
83
- if level == logging.getLevelName("DEBUG"):
84
- logging.getLogger().setLevel("INFO")
85
-
86
- with pdfplumber.open(filename) as pdf:
87
- title, user_info, first_page = get_title_with_cropped_page(pdf.pages[0])
88
- new_pages = get_column_cropped_pages([first_page] + pdf.pages[1:], two_column)
89
-
90
- chapters = []
91
- # tuple (chapter_name, [pageid] (start,stop), chapter_text)
92
- create_chapter = lambda page_start,name_top,name_bottom: SimpleNamespace(
93
- name=[],
94
- name_top=name_top,
95
- name_bottom=name_bottom,
96
- record_chapter_name = True,
97
-
98
- page_start=page_start,
99
- page_stop=None,
100
-
101
- text=[],
102
- )
103
- cur_chapter = None
104
-
105
- # 按页遍历PDF文档
106
- for idx, page in enumerate(new_pages):
107
- page = get_text_outside_table(page)
108
-
109
- # 按行遍历页面文本
110
- for word in extract_words(page):
111
- word = SimpleNamespace(**word)
112
-
113
- # 检查行文本是否以12号字体打印,如果是,则将其作为新章节开始
114
- if word.size >= 11: # 出现chapter name
115
- if cur_chapter is None:
116
- cur_chapter = create_chapter(page.page_number, word.top, word.bottom)
117
- elif not cur_chapter.record_chapter_name or (cur_chapter.name_bottom != cur_chapter.name_bottom and cur_chapter.name_top != cur_chapter.name_top):
118
- # 不再继续写chapter name
119
- cur_chapter.page_stop = page.page_number # stop id
120
- chapters.append(cur_chapter)
121
- # 重置当前chapter信息
122
- cur_chapter = create_chapter(page.page_number, word.top, word.bottom)
123
-
124
- # print(word.size, word.top, word.bottom, word.text)
125
- cur_chapter.name.append(word.text)
126
- else:
127
- cur_chapter.record_chapter_name = False # chapter name 结束
128
- cur_chapter.text.append(word.text)
129
- else:
130
- # 处理最后一个章节
131
- cur_chapter.page_stop = page.page_number # stop id
132
- chapters.append(cur_chapter)
133
-
134
- for i in chapters:
135
- logging.info(f"section: {i.name} pages:{i.page_start, i.page_stop} word-count:{len(i.text)}")
136
- logging.debug(" ".join(i.text))
137
-
138
- title = " ".join(title)
139
- user_info = " ".join(user_info)
140
- text = f"Article Title: {title}, Information:{user_info}\n"
141
- for idx, chapter in enumerate(chapters):
142
- chapter.name = " ".join(chapter.name)
143
- text += f"The {idx}th Chapter {chapter.name}: " + " ".join(chapter.text) + "\n"
144
-
145
- logging.getLogger().setLevel(level)
146
- return Document(text=text, extra_info={"title": title})
147
-
148
- BASE_POINTS = """
149
- 1. Who are the authors?
150
- 2. What is the process of the proposed method?
151
- 3. What is the performance of the proposed method? Please note down its performance metrics.
152
- 4. What are the baseline models and their performances? Please note down these baseline methods.
153
- 5. What dataset did this paper use?
154
- """
155
-
156
- READING_PROMPT = """
157
- You are a researcher helper bot. You can help the user with research paper reading and summarizing. \n
158
- Now I am going to send you a paper. You need to read it and summarize it for me part by part. \n
159
- When you are reading, You need to focus on these key points:{}
160
- """
161
-
162
- READING_PROMT_V2 = """
163
- You are a researcher helper bot. You can help the user with research paper reading and summarizing. \n
164
- Now I am going to send you a paper. You need to read it and summarize it for me part by part. \n
165
- When you are reading, You need to focus on these key points:{},
166
-
167
- And You need to generate a brief but informative title for this part.
168
- Your return format:
169
- - title: '...'
170
- - summary: '...'
171
- """
172
-
173
- SUMMARY_PROMPT = "You are a researcher helper bot. Now you need to read the summaries of a research paper."
174
-
175
-
176
- if __name__ == '__main__':
177
- # Test code
178
- z = parse_pdf("./build/test.pdf")
179
- print(z["user_info"])
180
- print(z["title"])
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/Alican/pixera/options/test_options.py DELETED
@@ -1,23 +0,0 @@
1
- from .base_options import BaseOptions
2
-
3
-
4
- class TestOptions(BaseOptions):
5
- """This class includes test options.
6
-
7
- It also includes shared options defined in BaseOptions.
8
- """
9
-
10
- def initialize(self, parser):
11
- parser = BaseOptions.initialize(self, parser) # define shared options
12
- parser.add_argument('--results_dir', type=str, default='./results/', help='saves results here.')
13
- parser.add_argument('--aspect_ratio', type=float, default=1.0, help='aspect ratio of result images')
14
- parser.add_argument('--phase', type=str, default='test', help='train, val, test, etc')
15
- # Dropout and Batchnorm has different behavioir during training and test.
16
- parser.add_argument('--eval', action='store_true', help='use eval mode during test time.')
17
- parser.add_argument('--num_test', type=int, default=50, help='how many test images to run')
18
- # rewrite devalue values
19
- parser.set_defaults(model='test')
20
- # To avoid cropping, the load_size should be the same as crop_size
21
- parser.set_defaults(load_size=parser.get_default('crop_size'))
22
- self.isTrain = False
23
- return parser
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/Alpaca233/SadTalker/src/face3d/models/arcface_torch/configs/glint360k_r50.py DELETED
@@ -1,26 +0,0 @@
1
- from easydict import EasyDict as edict
2
-
3
- # make training faster
4
- # our RAM is 256G
5
- # mount -t tmpfs -o size=140G tmpfs /train_tmp
6
-
7
- config = edict()
8
- config.loss = "cosface"
9
- config.network = "r50"
10
- config.resume = False
11
- config.output = None
12
- config.embedding_size = 512
13
- config.sample_rate = 1.0
14
- config.fp16 = True
15
- config.momentum = 0.9
16
- config.weight_decay = 5e-4
17
- config.batch_size = 128
18
- config.lr = 0.1 # batch size is 512
19
-
20
- config.rec = "/train_tmp/glint360k"
21
- config.num_classes = 360232
22
- config.num_image = 17091657
23
- config.num_epoch = 20
24
- config.warmup_epoch = -1
25
- config.decay_epoch = [8, 12, 15, 18]
26
- config.val_targets = ["lfw", "cfp_fp", "agedb_30"]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/Alpaca233/SadTalker/src/facerender/modules/discriminator.py DELETED
@@ -1,90 +0,0 @@
1
- from torch import nn
2
- import torch.nn.functional as F
3
- from facerender.modules.util import kp2gaussian
4
- import torch
5
-
6
-
7
- class DownBlock2d(nn.Module):
8
- """
9
- Simple block for processing video (encoder).
10
- """
11
-
12
- def __init__(self, in_features, out_features, norm=False, kernel_size=4, pool=False, sn=False):
13
- super(DownBlock2d, self).__init__()
14
- self.conv = nn.Conv2d(in_channels=in_features, out_channels=out_features, kernel_size=kernel_size)
15
-
16
- if sn:
17
- self.conv = nn.utils.spectral_norm(self.conv)
18
-
19
- if norm:
20
- self.norm = nn.InstanceNorm2d(out_features, affine=True)
21
- else:
22
- self.norm = None
23
- self.pool = pool
24
-
25
- def forward(self, x):
26
- out = x
27
- out = self.conv(out)
28
- if self.norm:
29
- out = self.norm(out)
30
- out = F.leaky_relu(out, 0.2)
31
- if self.pool:
32
- out = F.avg_pool2d(out, (2, 2))
33
- return out
34
-
35
-
36
- class Discriminator(nn.Module):
37
- """
38
- Discriminator similar to Pix2Pix
39
- """
40
-
41
- def __init__(self, num_channels=3, block_expansion=64, num_blocks=4, max_features=512,
42
- sn=False, **kwargs):
43
- super(Discriminator, self).__init__()
44
-
45
- down_blocks = []
46
- for i in range(num_blocks):
47
- down_blocks.append(
48
- DownBlock2d(num_channels if i == 0 else min(max_features, block_expansion * (2 ** i)),
49
- min(max_features, block_expansion * (2 ** (i + 1))),
50
- norm=(i != 0), kernel_size=4, pool=(i != num_blocks - 1), sn=sn))
51
-
52
- self.down_blocks = nn.ModuleList(down_blocks)
53
- self.conv = nn.Conv2d(self.down_blocks[-1].conv.out_channels, out_channels=1, kernel_size=1)
54
- if sn:
55
- self.conv = nn.utils.spectral_norm(self.conv)
56
-
57
- def forward(self, x):
58
- feature_maps = []
59
- out = x
60
-
61
- for down_block in self.down_blocks:
62
- feature_maps.append(down_block(out))
63
- out = feature_maps[-1]
64
- prediction_map = self.conv(out)
65
-
66
- return feature_maps, prediction_map
67
-
68
-
69
- class MultiScaleDiscriminator(nn.Module):
70
- """
71
- Multi-scale (scale) discriminator
72
- """
73
-
74
- def __init__(self, scales=(), **kwargs):
75
- super(MultiScaleDiscriminator, self).__init__()
76
- self.scales = scales
77
- discs = {}
78
- for scale in scales:
79
- discs[str(scale).replace('.', '-')] = Discriminator(**kwargs)
80
- self.discs = nn.ModuleDict(discs)
81
-
82
- def forward(self, x):
83
- out_dict = {}
84
- for scale, disc in self.discs.items():
85
- scale = str(scale).replace('-', '.')
86
- key = 'prediction_' + scale
87
- feature_maps, prediction_map = disc(x[key])
88
- out_dict['feature_maps_' + scale] = feature_maps
89
- out_dict['prediction_map_' + scale] = prediction_map
90
- return out_dict
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/Amrrs/DragGan-Inversion/stylegan_human/style_mixing.py DELETED
@@ -1,114 +0,0 @@
1
- # Copyright (c) SenseTime Research. All rights reserved.
2
-
3
- # Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved.
4
- # NVIDIA CORPORATION and its licensors retain all intellectual property
5
- # and proprietary rights in and to this software, related documentation
6
- # and any modifications thereto. Any use, reproduction, disclosure or
7
- # distribution of this software and related documentation without an express
8
- # license agreement from NVIDIA CORPORATION is strictly prohibited.
9
- #
10
-
11
-
12
- import os
13
- import re
14
- from typing import List
15
- import legacy
16
-
17
- import click
18
- import dnnlib
19
- import numpy as np
20
- import PIL.Image
21
- import torch
22
-
23
- """
24
- Style mixing using pretrained network pickle.
25
-
26
- Examples:
27
-
28
- \b
29
- python style_mixing.py --network=pretrained_models/stylegan_human_v2_1024.pkl --rows=85,100,75,458,1500 \\
30
- --cols=55,821,1789,293 --styles=0-3 --outdir=outputs/stylemixing
31
- """
32
-
33
-
34
- @click.command()
35
- @click.option('--network', 'network_pkl', help='Network pickle filename', required=True)
36
- @click.option('--rows', 'row_seeds', type=legacy.num_range, help='Random seeds to use for image rows', required=True)
37
- @click.option('--cols', 'col_seeds', type=legacy.num_range, help='Random seeds to use for image columns', required=True)
38
- @click.option('--styles', 'col_styles', type=legacy.num_range, help='Style layer range', default='0-6', show_default=True)
39
- @click.option('--trunc', 'truncation_psi', type=float, help='Truncation psi', default=0.8, show_default=True)
40
- @click.option('--noise-mode', help='Noise mode', type=click.Choice(['const', 'random', 'none']), default='const', show_default=True)
41
- @click.option('--outdir', type=str, required=True, default='outputs/stylemixing')
42
- def generate_style_mix(
43
- network_pkl: str,
44
- row_seeds: List[int],
45
- col_seeds: List[int],
46
- col_styles: List[int],
47
- truncation_psi: float,
48
- noise_mode: str,
49
- outdir: str
50
- ):
51
-
52
- print('Loading networks from "%s"...' % network_pkl)
53
- device = torch.device('cuda')
54
- with dnnlib.util.open_url(network_pkl) as f:
55
- G = legacy.load_network_pkl(f)['G_ema'].to(device)
56
-
57
- os.makedirs(outdir, exist_ok=True)
58
-
59
- print('Generating W vectors...')
60
- all_seeds = list(set(row_seeds + col_seeds))
61
- all_z = np.stack([np.random.RandomState(seed).randn(G.z_dim)
62
- for seed in all_seeds])
63
- all_w = G.mapping(torch.from_numpy(all_z).to(device), None)
64
- w_avg = G.mapping.w_avg
65
- all_w = w_avg + (all_w - w_avg) * truncation_psi
66
- w_dict = {seed: w for seed, w in zip(all_seeds, list(all_w))}
67
-
68
- print('Generating images...')
69
- all_images = G.synthesis(all_w, noise_mode=noise_mode)
70
- all_images = (all_images.permute(0, 2, 3, 1) * 127.5 +
71
- 128).clamp(0, 255).to(torch.uint8).cpu().numpy()
72
- image_dict = {(seed, seed): image for seed,
73
- image in zip(all_seeds, list(all_images))}
74
-
75
- print('Generating style-mixed images...')
76
- for row_seed in row_seeds:
77
- for col_seed in col_seeds:
78
- w = w_dict[row_seed].clone()
79
- w[col_styles] = w_dict[col_seed][col_styles]
80
- image = G.synthesis(w[np.newaxis], noise_mode=noise_mode)
81
- image = (image.permute(0, 2, 3, 1) * 127.5 +
82
- 128).clamp(0, 255).to(torch.uint8)
83
- image_dict[(row_seed, col_seed)] = image[0].cpu().numpy()
84
-
85
- os.makedirs(outdir, exist_ok=True)
86
- # print('Saving images...')
87
- # for (row_seed, col_seed), image in image_dict.items():
88
- # PIL.Image.fromarray(image, 'RGB').save(f'{outdir}/{row_seed}-{col_seed}.png')
89
-
90
- print('Saving image grid...')
91
- W = G.img_resolution // 2
92
- H = G.img_resolution
93
- canvas = PIL.Image.new(
94
- 'RGB', (W * (len(col_seeds) + 1), H * (len(row_seeds) + 1)), 'black')
95
- for row_idx, row_seed in enumerate([0] + row_seeds):
96
- for col_idx, col_seed in enumerate([0] + col_seeds):
97
- if row_idx == 0 and col_idx == 0:
98
- continue
99
- key = (row_seed, col_seed)
100
- if row_idx == 0:
101
- key = (col_seed, col_seed)
102
- if col_idx == 0:
103
- key = (row_seed, row_seed)
104
- canvas.paste(PIL.Image.fromarray(
105
- image_dict[key], 'RGB'), (W * col_idx, H * row_idx))
106
- canvas.save(f'{outdir}/grid.png')
107
-
108
-
109
- # ----------------------------------------------------------------------------
110
-
111
- if __name__ == "__main__":
112
- generate_style_mix() # pylint: disable=no-value-for-parameter
113
-
114
- # ----------------------------------------------------------------------------
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/Andy1621/uniformer_image_segmentation/configs/_base_/datasets/pascal_context.py DELETED
@@ -1,60 +0,0 @@
1
- # dataset settings
2
- dataset_type = 'PascalContextDataset'
3
- data_root = 'data/VOCdevkit/VOC2010/'
4
- img_norm_cfg = dict(
5
- mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_rgb=True)
6
-
7
- img_scale = (520, 520)
8
- crop_size = (480, 480)
9
-
10
- train_pipeline = [
11
- dict(type='LoadImageFromFile'),
12
- dict(type='LoadAnnotations'),
13
- dict(type='Resize', img_scale=img_scale, ratio_range=(0.5, 2.0)),
14
- dict(type='RandomCrop', crop_size=crop_size, cat_max_ratio=0.75),
15
- dict(type='RandomFlip', prob=0.5),
16
- dict(type='PhotoMetricDistortion'),
17
- dict(type='Normalize', **img_norm_cfg),
18
- dict(type='Pad', size=crop_size, pad_val=0, seg_pad_val=255),
19
- dict(type='DefaultFormatBundle'),
20
- dict(type='Collect', keys=['img', 'gt_semantic_seg']),
21
- ]
22
- test_pipeline = [
23
- dict(type='LoadImageFromFile'),
24
- dict(
25
- type='MultiScaleFlipAug',
26
- img_scale=img_scale,
27
- # img_ratios=[0.5, 0.75, 1.0, 1.25, 1.5, 1.75],
28
- flip=False,
29
- transforms=[
30
- dict(type='Resize', keep_ratio=True),
31
- dict(type='RandomFlip'),
32
- dict(type='Normalize', **img_norm_cfg),
33
- dict(type='ImageToTensor', keys=['img']),
34
- dict(type='Collect', keys=['img']),
35
- ])
36
- ]
37
- data = dict(
38
- samples_per_gpu=4,
39
- workers_per_gpu=4,
40
- train=dict(
41
- type=dataset_type,
42
- data_root=data_root,
43
- img_dir='JPEGImages',
44
- ann_dir='SegmentationClassContext',
45
- split='ImageSets/SegmentationContext/train.txt',
46
- pipeline=train_pipeline),
47
- val=dict(
48
- type=dataset_type,
49
- data_root=data_root,
50
- img_dir='JPEGImages',
51
- ann_dir='SegmentationClassContext',
52
- split='ImageSets/SegmentationContext/val.txt',
53
- pipeline=test_pipeline),
54
- test=dict(
55
- type=dataset_type,
56
- data_root=data_root,
57
- img_dir='JPEGImages',
58
- ann_dir='SegmentationClassContext',
59
- split='ImageSets/SegmentationContext/val.txt',
60
- pipeline=test_pipeline))
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/Ani1712full/Estimacion_tasa_morosidad/app.py DELETED
@@ -1,43 +0,0 @@
1
- import gradio as gr
2
- from joblib import load
3
- import pandas as pd
4
- from sklearn.svm import SVC
5
- import tensorflow as tf
6
- from tensorflow import keras
7
- from tensorflow.keras import layers
8
- import numpy as np
9
- import streamlit as st
10
- import matplotlib.pyplot as plt
11
-
12
-
13
-
14
- model = load('Red_nueronal_morosidad.joblib')
15
-
16
-
17
- def run_my_model(Var_Trim_TIIE_91,Var_Trim_FIX,Var_Trim_PIB):
18
- X_new = (Var_Trim_TIIE_91,Var_Trim_FIX,Var_Trim_PIB)
19
- Y_pred = str(4.84 +(1+float(model.predict(np.array([X_new])))))
20
- return "Estimación de tasa de tasa de incumplimiento: " + Y_pred
21
-
22
- theme = "darkgrass"
23
- interface = gr.Interface(
24
- fn = run_my_model,
25
- inputs = [
26
- gr.inputs.Slider(minimum = -10, maximum = 30),
27
- gr.inputs.Slider(minimum = -10, maximum = 10),
28
- gr.inputs.Slider(minimum = -10, maximum = 10)
29
- ],
30
- datatype = ['number','number','number'],
31
- outputs = "text",
32
- live = True,
33
- title = "Predicción de Tasa de Incumplimiento",
34
- css = """
35
- body{background-color:aliceblue}
36
- """
37
-
38
- )
39
-
40
- interface.launch(inbrowser = True)
41
-
42
-
43
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/Anonymous-sub/Rerender/ControlNet/annotator/uniformer/configs/_base_/datasets/pascal_context.py DELETED
@@ -1,60 +0,0 @@
1
- # dataset settings
2
- dataset_type = 'PascalContextDataset'
3
- data_root = 'data/VOCdevkit/VOC2010/'
4
- img_norm_cfg = dict(
5
- mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_rgb=True)
6
-
7
- img_scale = (520, 520)
8
- crop_size = (480, 480)
9
-
10
- train_pipeline = [
11
- dict(type='LoadImageFromFile'),
12
- dict(type='LoadAnnotations'),
13
- dict(type='Resize', img_scale=img_scale, ratio_range=(0.5, 2.0)),
14
- dict(type='RandomCrop', crop_size=crop_size, cat_max_ratio=0.75),
15
- dict(type='RandomFlip', prob=0.5),
16
- dict(type='PhotoMetricDistortion'),
17
- dict(type='Normalize', **img_norm_cfg),
18
- dict(type='Pad', size=crop_size, pad_val=0, seg_pad_val=255),
19
- dict(type='DefaultFormatBundle'),
20
- dict(type='Collect', keys=['img', 'gt_semantic_seg']),
21
- ]
22
- test_pipeline = [
23
- dict(type='LoadImageFromFile'),
24
- dict(
25
- type='MultiScaleFlipAug',
26
- img_scale=img_scale,
27
- # img_ratios=[0.5, 0.75, 1.0, 1.25, 1.5, 1.75],
28
- flip=False,
29
- transforms=[
30
- dict(type='Resize', keep_ratio=True),
31
- dict(type='RandomFlip'),
32
- dict(type='Normalize', **img_norm_cfg),
33
- dict(type='ImageToTensor', keys=['img']),
34
- dict(type='Collect', keys=['img']),
35
- ])
36
- ]
37
- data = dict(
38
- samples_per_gpu=4,
39
- workers_per_gpu=4,
40
- train=dict(
41
- type=dataset_type,
42
- data_root=data_root,
43
- img_dir='JPEGImages',
44
- ann_dir='SegmentationClassContext',
45
- split='ImageSets/SegmentationContext/train.txt',
46
- pipeline=train_pipeline),
47
- val=dict(
48
- type=dataset_type,
49
- data_root=data_root,
50
- img_dir='JPEGImages',
51
- ann_dir='SegmentationClassContext',
52
- split='ImageSets/SegmentationContext/val.txt',
53
- pipeline=test_pipeline),
54
- test=dict(
55
- type=dataset_type,
56
- data_root=data_root,
57
- img_dir='JPEGImages',
58
- ann_dir='SegmentationClassContext',
59
- split='ImageSets/SegmentationContext/val.txt',
60
- pipeline=test_pipeline))
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/Anthony7906/MengHuiMXD_GPT/ChuanhuChatbot.py DELETED
@@ -1,470 +0,0 @@
1
- # -*- coding:utf-8 -*-
2
- import os
3
- import logging
4
- import sys
5
-
6
- import gradio as gr
7
-
8
- from modules import config
9
- from modules.config import *
10
- from modules.utils import *
11
- from modules.presets import *
12
- from modules.overwrites import *
13
- from modules.models import get_model
14
-
15
-
16
- gr.Chatbot._postprocess_chat_messages = postprocess_chat_messages
17
- gr.Chatbot.postprocess = postprocess
18
- PromptHelper.compact_text_chunks = compact_text_chunks
19
-
20
- with open("assets/custom.css", "r", encoding="utf-8") as f:
21
- customCSS = f.read()
22
-
23
- def create_new_model():
24
- return get_model(model_name = MODELS[DEFAULT_MODEL], access_key = my_api_key)[0]
25
-
26
- with gr.Blocks(css=customCSS, theme=small_and_beautiful_theme) as demo:
27
- user_name = gr.State("")
28
- promptTemplates = gr.State(load_template(get_template_names(plain=True)[0], mode=2))
29
- user_question = gr.State("")
30
- user_api_key = gr.State(my_api_key)
31
- current_model = gr.State(create_new_model)
32
-
33
- topic = gr.State(i18n("未命名对话历史记录"))
34
-
35
- with gr.Row():
36
- gr.HTML(CHUANHU_TITLE, elem_id="app_title")
37
- status_display = gr.Markdown(get_geoip(), elem_id="status_display")
38
- with gr.Row(elem_id="float_display"):
39
- user_info = gr.Markdown(value="getting user info...", elem_id="user_info")
40
-
41
- # https://github.com/gradio-app/gradio/pull/3296
42
- def create_greeting(request: gr.Request):
43
- if hasattr(request, "username") and request.username: # is not None or is not ""
44
- logging.info(f"Get User Name: {request.username}")
45
- return gr.Markdown.update(value=f"User: {request.username}"), request.username
46
- else:
47
- return gr.Markdown.update(value=f"User: default", visible=False), ""
48
- demo.load(create_greeting, inputs=None, outputs=[user_info, user_name])
49
-
50
- with gr.Row().style(equal_height=True):
51
- with gr.Column(scale=5):
52
- with gr.Row():
53
- chatbot = gr.Chatbot(elem_id="chuanhu_chatbot").style(height="100%")
54
- with gr.Row():
55
- with gr.Column(min_width=225, scale=12):
56
- user_input = gr.Textbox(
57
- elem_id="user_input_tb",
58
- show_label=False, placeholder=i18n("在这里输入")
59
- ).style(container=False)
60
- with gr.Column(min_width=42, scale=1):
61
- submitBtn = gr.Button(value="", variant="primary", elem_id="submit_btn")
62
- cancelBtn = gr.Button(value="", variant="secondary", visible=False, elem_id="cancel_btn")
63
- with gr.Row():
64
- emptyBtn = gr.Button(
65
- i18n("🧹 新的对话"),
66
- )
67
- retryBtn = gr.Button(i18n("🔄 重新生成"))
68
- delFirstBtn = gr.Button(i18n("🗑️ 删除最旧对话"))
69
- delLastBtn = gr.Button(i18n("🗑️ 删除最新对话"))
70
- with gr.Row(visible=False) as like_dislike_area:
71
- with gr.Column(min_width=20, scale=1):
72
- likeBtn = gr.Button(i18n("👍"))
73
- with gr.Column(min_width=20, scale=1):
74
- dislikeBtn = gr.Button(i18n("👎"))
75
-
76
- with gr.Column():
77
- with gr.Column(min_width=50, scale=1):
78
- with gr.Tab(label=i18n("模型")):
79
- keyTxt = gr.Textbox(
80
- show_label=True,
81
- placeholder=f"Your API-key...",
82
- value=hide_middle_chars(user_api_key.value),
83
- type="password",
84
- visible=not HIDE_MY_KEY,
85
- label="API-Key",
86
- )
87
- if multi_api_key:
88
- usageTxt = gr.Markdown(i18n("多账号模式已开启,无需输入key,可直接开始对话"), elem_id="usage_display", elem_classes="insert_block")
89
- else:
90
- usageTxt = gr.Markdown(i18n("**发送消息** 或 **提交key** 以显示额度"), elem_id="usage_display", elem_classes="insert_block")
91
- model_select_dropdown = gr.Dropdown(
92
- label=i18n("选择模型"), choices=MODELS, multiselect=False, value=MODELS[DEFAULT_MODEL], interactive=True
93
- )
94
- lora_select_dropdown = gr.Dropdown(
95
- label=i18n("选择LoRA模型"), choices=[], multiselect=False, interactive=True, visible=False
96
- )
97
- with gr.Row():
98
- use_streaming_checkbox = gr.Checkbox(
99
- label=i18n("实时传输回答"), value=True, visible=ENABLE_STREAMING_OPTION
100
- )
101
- single_turn_checkbox = gr.Checkbox(label=i18n("单轮对话"), value=False)
102
- use_websearch_checkbox = gr.Checkbox(label=i18n("使用在线搜索"), value=False)
103
- language_select_dropdown = gr.Dropdown(
104
- label=i18n("选择回复语言(针对搜索&索引功能)"),
105
- choices=REPLY_LANGUAGES,
106
- multiselect=False,
107
- value=REPLY_LANGUAGES[0],
108
- )
109
- index_files = gr.Files(label=i18n("上传"), type="file")
110
- two_column = gr.Checkbox(label=i18n("双栏pdf"), value=advance_docs["pdf"].get("two_column", False))
111
- # TODO: 公式ocr
112
- # formula_ocr = gr.Checkbox(label=i18n("识别公式"), value=advance_docs["pdf"].get("formula_ocr", False))
113
-
114
- with gr.Tab(label="Prompt"):
115
- systemPromptTxt = gr.Textbox(
116
- show_label=True,
117
- placeholder=i18n("在这里输入System Prompt..."),
118
- label="System prompt",
119
- value=INITIAL_SYSTEM_PROMPT,
120
- lines=10,
121
- ).style(container=False)
122
- with gr.Accordion(label=i18n("加载Prompt模板"), open=True):
123
- with gr.Column():
124
- with gr.Row():
125
- with gr.Column(scale=6):
126
- templateFileSelectDropdown = gr.Dropdown(
127
- label=i18n("选择Prompt模板集合文件"),
128
- choices=get_template_names(plain=True),
129
- multiselect=False,
130
- value=get_template_names(plain=True)[0],
131
- ).style(container=False)
132
- with gr.Column(scale=1):
133
- templateRefreshBtn = gr.Button(i18n("🔄 刷新"))
134
- with gr.Row():
135
- with gr.Column():
136
- templateSelectDropdown = gr.Dropdown(
137
- label=i18n("从Prompt模板中加载"),
138
- choices=load_template(
139
- get_template_names(plain=True)[0], mode=1
140
- ),
141
- multiselect=False,
142
- ).style(container=False)
143
-
144
- with gr.Tab(label=i18n("保存/加载")):
145
- with gr.Accordion(label=i18n("保存/加载对话历史记录"), open=True):
146
- with gr.Column():
147
- with gr.Row():
148
- with gr.Column(scale=6):
149
- historyFileSelectDropdown = gr.Dropdown(
150
- label=i18n("从列表中加载对话"),
151
- choices=get_history_names(plain=True),
152
- multiselect=False,
153
- value=get_history_names(plain=True)[0],
154
- )
155
- with gr.Column(scale=1):
156
- historyRefreshBtn = gr.Button(i18n("🔄 刷新"))
157
- with gr.Row():
158
- with gr.Column(scale=6):
159
- saveFileName = gr.Textbox(
160
- show_label=True,
161
- placeholder=i18n("设置文件名: 默认为.json,可选为.md"),
162
- label=i18n("设置保存文件名"),
163
- value=i18n("对话历史记录"),
164
- ).style(container=True)
165
- with gr.Column(scale=1):
166
- saveHistoryBtn = gr.Button(i18n("💾 保存对话"))
167
- exportMarkdownBtn = gr.Button(i18n("📝 导出为Markdown"))
168
- gr.Markdown(i18n("默认保存于history文件夹"))
169
- with gr.Row():
170
- with gr.Column():
171
- downloadFile = gr.File(interactive=True)
172
-
173
- with gr.Tab(label=i18n("高级")):
174
- gr.Markdown(i18n("# ⚠️ 务必谨慎更改 ⚠️\n\n如果无法使用请恢复默认设置"))
175
- gr.HTML(APPEARANCE_SWITCHER, elem_classes="insert_block")
176
- with gr.Accordion(i18n("参数"), open=False):
177
- temperature_slider = gr.Slider(
178
- minimum=-0,
179
- maximum=2.0,
180
- value=1.0,
181
- step=0.1,
182
- interactive=True,
183
- label="temperature",
184
- )
185
- top_p_slider = gr.Slider(
186
- minimum=-0,
187
- maximum=1.0,
188
- value=1.0,
189
- step=0.05,
190
- interactive=True,
191
- label="top-p",
192
- )
193
- n_choices_slider = gr.Slider(
194
- minimum=1,
195
- maximum=10,
196
- value=1,
197
- step=1,
198
- interactive=True,
199
- label="n choices",
200
- )
201
- stop_sequence_txt = gr.Textbox(
202
- show_label=True,
203
- placeholder=i18n("在这里输入停止符,用英文逗号隔开..."),
204
- label="stop",
205
- value="",
206
- lines=1,
207
- )
208
- max_context_length_slider = gr.Slider(
209
- minimum=1,
210
- maximum=32768,
211
- value=2000,
212
- step=1,
213
- interactive=True,
214
- label="max context",
215
- )
216
- max_generation_slider = gr.Slider(
217
- minimum=1,
218
- maximum=32768,
219
- value=1000,
220
- step=1,
221
- interactive=True,
222
- label="max generations",
223
- )
224
- presence_penalty_slider = gr.Slider(
225
- minimum=-2.0,
226
- maximum=2.0,
227
- value=0.0,
228
- step=0.01,
229
- interactive=True,
230
- label="presence penalty",
231
- )
232
- frequency_penalty_slider = gr.Slider(
233
- minimum=-2.0,
234
- maximum=2.0,
235
- value=0.0,
236
- step=0.01,
237
- interactive=True,
238
- label="frequency penalty",
239
- )
240
- logit_bias_txt = gr.Textbox(
241
- show_label=True,
242
- placeholder=f"word:likelihood",
243
- label="logit bias",
244
- value="",
245
- lines=1,
246
- )
247
- user_identifier_txt = gr.Textbox(
248
- show_label=True,
249
- placeholder=i18n("用于定位滥用行为"),
250
- label=i18n("用户名"),
251
- value=user_name.value,
252
- lines=1,
253
- )
254
-
255
- with gr.Accordion(i18n("网络设置"), open=False):
256
- # 优先展示自定义的api_host
257
- apihostTxt = gr.Textbox(
258
- show_label=True,
259
- placeholder=i18n("在这里输入API-Host..."),
260
- label="API-Host",
261
- value=config.api_host or shared.API_HOST,
262
- lines=1,
263
- )
264
- changeAPIURLBtn = gr.Button(i18n("🔄 切换API地址"))
265
- proxyTxt = gr.Textbox(
266
- show_label=True,
267
- placeholder=i18n("在这里输入代理地址..."),
268
- label=i18n("代理地址(示例:http://127.0.0.1:10809)"),
269
- value="",
270
- lines=2,
271
- )
272
- changeProxyBtn = gr.Button(i18n("🔄 设置代理地址"))
273
- default_btn = gr.Button(i18n("🔙 恢复默认设置"))
274
-
275
- gr.Markdown(CHUANHU_DESCRIPTION, elem_id="description")
276
- gr.HTML(FOOTER.format(versions=versions_html()), elem_id="footer")
277
- demo.load(refresh_ui_elements_on_load, [current_model, model_select_dropdown], [like_dislike_area], show_progress=False)
278
- chatgpt_predict_args = dict(
279
- fn=predict,
280
- inputs=[
281
- current_model,
282
- user_question,
283
- chatbot,
284
- use_streaming_checkbox,
285
- use_websearch_checkbox,
286
- index_files,
287
- language_select_dropdown,
288
- ],
289
- outputs=[chatbot, status_display],
290
- show_progress=True,
291
- )
292
-
293
- start_outputing_args = dict(
294
- fn=start_outputing,
295
- inputs=[],
296
- outputs=[submitBtn, cancelBtn],
297
- show_progress=True,
298
- )
299
-
300
- end_outputing_args = dict(
301
- fn=end_outputing, inputs=[], outputs=[submitBtn, cancelBtn]
302
- )
303
-
304
- reset_textbox_args = dict(
305
- fn=reset_textbox, inputs=[], outputs=[user_input]
306
- )
307
-
308
- transfer_input_args = dict(
309
- fn=transfer_input, inputs=[user_input], outputs=[user_question, user_input, submitBtn, cancelBtn], show_progress=True
310
- )
311
-
312
- get_usage_args = dict(
313
- fn=billing_info, inputs=[current_model], outputs=[usageTxt], show_progress=False
314
- )
315
-
316
- load_history_from_file_args = dict(
317
- fn=load_chat_history,
318
- inputs=[current_model, historyFileSelectDropdown, chatbot, user_name],
319
- outputs=[saveFileName, systemPromptTxt, chatbot]
320
- )
321
-
322
-
323
- # Chatbot
324
- cancelBtn.click(interrupt, [current_model], [])
325
-
326
- user_input.submit(**transfer_input_args).then(**chatgpt_predict_args).then(**end_outputing_args)
327
- user_input.submit(**get_usage_args)
328
-
329
- submitBtn.click(**transfer_input_args).then(**chatgpt_predict_args).then(**end_outputing_args)
330
- submitBtn.click(**get_usage_args)
331
-
332
- index_files.change(handle_file_upload, [current_model, index_files, chatbot], [index_files, chatbot, status_display])
333
-
334
- emptyBtn.click(
335
- reset,
336
- inputs=[current_model],
337
- outputs=[chatbot, status_display],
338
- show_progress=True,
339
- )
340
-
341
- retryBtn.click(**start_outputing_args).then(
342
- retry,
343
- [
344
- current_model,
345
- chatbot,
346
- use_streaming_checkbox,
347
- use_websearch_checkbox,
348
- index_files,
349
- language_select_dropdown,
350
- ],
351
- [chatbot, status_display],
352
- show_progress=True,
353
- ).then(**end_outputing_args)
354
- retryBtn.click(**get_usage_args)
355
-
356
- delFirstBtn.click(
357
- delete_first_conversation,
358
- [current_model],
359
- [status_display],
360
- )
361
-
362
- delLastBtn.click(
363
- delete_last_conversation,
364
- [current_model, chatbot],
365
- [chatbot, status_display],
366
- show_progress=False
367
- )
368
-
369
- likeBtn.click(
370
- like,
371
- [current_model],
372
- [status_display],
373
- show_progress=False
374
- )
375
-
376
- dislikeBtn.click(
377
- dislike,
378
- [current_model],
379
- [status_display],
380
- show_progress=False
381
- )
382
-
383
- two_column.change(update_doc_config, [two_column], None)
384
-
385
- # LLM Models
386
- keyTxt.change(set_key, [current_model, keyTxt], [user_api_key, status_display]).then(**get_usage_args)
387
- keyTxt.submit(**get_usage_args)
388
- single_turn_checkbox.change(set_single_turn, [current_model, single_turn_checkbox], None)
389
- model_select_dropdown.change(get_model, [model_select_dropdown, lora_select_dropdown, user_api_key, temperature_slider, top_p_slider, systemPromptTxt], [current_model, status_display, lora_select_dropdown], show_progress=True)
390
- model_select_dropdown.change(toggle_like_btn_visibility, [model_select_dropdown], [like_dislike_area], show_progress=False)
391
- lora_select_dropdown.change(get_model, [model_select_dropdown, lora_select_dropdown, user_api_key, temperature_slider, top_p_slider, systemPromptTxt], [current_model, status_display], show_progress=True)
392
-
393
- # Template
394
- systemPromptTxt.change(set_system_prompt, [current_model, systemPromptTxt], None)
395
- templateRefreshBtn.click(get_template_names, None, [templateFileSelectDropdown])
396
- templateFileSelectDropdown.change(
397
- load_template,
398
- [templateFileSelectDropdown],
399
- [promptTemplates, templateSelectDropdown],
400
- show_progress=True,
401
- )
402
- templateSelectDropdown.change(
403
- get_template_content,
404
- [promptTemplates, templateSelectDropdown, systemPromptTxt],
405
- [systemPromptTxt],
406
- show_progress=True,
407
- )
408
-
409
- # S&L
410
- saveHistoryBtn.click(
411
- save_chat_history,
412
- [current_model, saveFileName, chatbot, user_name],
413
- downloadFile,
414
- show_progress=True,
415
- )
416
- saveHistoryBtn.click(get_history_names, [gr.State(False), user_name], [historyFileSelectDropdown])
417
- exportMarkdownBtn.click(
418
- export_markdown,
419
- [current_model, saveFileName, chatbot, user_name],
420
- downloadFile,
421
- show_progress=True,
422
- )
423
- historyRefreshBtn.click(get_history_names, [gr.State(False), user_name], [historyFileSelectDropdown])
424
- historyFileSelectDropdown.change(**load_history_from_file_args)
425
- downloadFile.change(**load_history_from_file_args)
426
-
427
- # Advanced
428
- max_context_length_slider.change(set_token_upper_limit, [current_model, max_context_length_slider], None)
429
- temperature_slider.change(set_temperature, [current_model, temperature_slider], None)
430
- top_p_slider.change(set_top_p, [current_model, top_p_slider], None)
431
- n_choices_slider.change(set_n_choices, [current_model, n_choices_slider], None)
432
- stop_sequence_txt.change(set_stop_sequence, [current_model, stop_sequence_txt], None)
433
- max_generation_slider.change(set_max_tokens, [current_model, max_generation_slider], None)
434
- presence_penalty_slider.change(set_presence_penalty, [current_model, presence_penalty_slider], None)
435
- frequency_penalty_slider.change(set_frequency_penalty, [current_model, frequency_penalty_slider], None)
436
- logit_bias_txt.change(set_logit_bias, [current_model, logit_bias_txt], None)
437
- user_identifier_txt.change(set_user_identifier, [current_model, user_identifier_txt], None)
438
-
439
- default_btn.click(
440
- reset_default, [], [apihostTxt, proxyTxt, status_display], show_progress=True
441
- )
442
- changeAPIURLBtn.click(
443
- change_api_host,
444
- [apihostTxt],
445
- [status_display],
446
- show_progress=True,
447
- )
448
- changeProxyBtn.click(
449
- change_proxy,
450
- [proxyTxt],
451
- [status_display],
452
- show_progress=True,
453
- )
454
-
455
- logging.info(
456
- colorama.Back.GREEN
457
- + "\n川虎的温馨提示:访问 http://localhost:7860 查看界面"
458
- + colorama.Style.RESET_ALL
459
- )
460
- # 默认开启本地服务器,默认可以直接从IP访问,默认不创建公开分享链接
461
- demo.title = i18n("川虎Chat 🚀")
462
-
463
- if __name__ == "__main__":
464
- reload_javascript()
465
- demo.queue(concurrency_count=CONCURRENT_COUNT).launch(
466
- favicon_path="./assets/favicon.ico",
467
- )
468
- # demo.queue(concurrency_count=CONCURRENT_COUNT).launch(server_name="0.0.0.0", server_port=7860, share=False) # 可自定义端口
469
- # demo.queue(concurrency_count=CONCURRENT_COUNT).launch(server_name="0.0.0.0", server_port=7860,auth=("在这里填写用户名", "在这里填写密码")) # 可设置用户名与密码
470
- # demo.queue(concurrency_count=CONCURRENT_COUNT).launch(auth=("在这里填写用户名", "在这里填写密码")) # 适合Nginx反向代理
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/Arnx/MusicGenXvAKN/audiocraft/utils/__init__.py DELETED
@@ -1,5 +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.
 
 
 
 
 
 
spaces/Awiny/Image2Paragraph/models/grit_src/third_party/CenterNet2/detectron2/layers/csrc/box_iou_rotated/box_iou_rotated_cpu.cpp DELETED
@@ -1,39 +0,0 @@
1
- // Copyright (c) Facebook, Inc. and its affiliates.
2
- #include "box_iou_rotated.h"
3
- #include "box_iou_rotated_utils.h"
4
-
5
- namespace detectron2 {
6
-
7
- template <typename T>
8
- void box_iou_rotated_cpu_kernel(
9
- const at::Tensor& boxes1,
10
- const at::Tensor& boxes2,
11
- at::Tensor& ious) {
12
- auto num_boxes1 = boxes1.size(0);
13
- auto num_boxes2 = boxes2.size(0);
14
-
15
- for (int i = 0; i < num_boxes1; i++) {
16
- for (int j = 0; j < num_boxes2; j++) {
17
- ious[i * num_boxes2 + j] = single_box_iou_rotated<T>(
18
- boxes1[i].data_ptr<T>(), boxes2[j].data_ptr<T>());
19
- }
20
- }
21
- }
22
-
23
- at::Tensor box_iou_rotated_cpu(
24
- // input must be contiguous:
25
- const at::Tensor& boxes1,
26
- const at::Tensor& boxes2) {
27
- auto num_boxes1 = boxes1.size(0);
28
- auto num_boxes2 = boxes2.size(0);
29
- at::Tensor ious =
30
- at::empty({num_boxes1 * num_boxes2}, boxes1.options().dtype(at::kFloat));
31
-
32
- box_iou_rotated_cpu_kernel<float>(boxes1, boxes2, ious);
33
-
34
- // reshape from 1d array to 2d array
35
- auto shape = std::vector<int64_t>{num_boxes1, num_boxes2};
36
- return ious.reshape(shape);
37
- }
38
-
39
- } // namespace detectron2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/Awiny/Image2Paragraph/models/grit_src/third_party/CenterNet2/detectron2/layers/roi_align_rotated.py DELETED
@@ -1,91 +0,0 @@
1
- # Copyright (c) Facebook, Inc. and its affiliates.
2
- import torch
3
- from torch import nn
4
- from torch.autograd import Function
5
- from torch.autograd.function import once_differentiable
6
- from torch.nn.modules.utils import _pair
7
-
8
-
9
- class _ROIAlignRotated(Function):
10
- @staticmethod
11
- def forward(ctx, input, roi, output_size, spatial_scale, sampling_ratio):
12
- ctx.save_for_backward(roi)
13
- ctx.output_size = _pair(output_size)
14
- ctx.spatial_scale = spatial_scale
15
- ctx.sampling_ratio = sampling_ratio
16
- ctx.input_shape = input.size()
17
- output = torch.ops.detectron2.roi_align_rotated_forward(
18
- input, roi, spatial_scale, output_size[0], output_size[1], sampling_ratio
19
- )
20
- return output
21
-
22
- @staticmethod
23
- @once_differentiable
24
- def backward(ctx, grad_output):
25
- (rois,) = ctx.saved_tensors
26
- output_size = ctx.output_size
27
- spatial_scale = ctx.spatial_scale
28
- sampling_ratio = ctx.sampling_ratio
29
- bs, ch, h, w = ctx.input_shape
30
- grad_input = torch.ops.detectron2.roi_align_rotated_backward(
31
- grad_output,
32
- rois,
33
- spatial_scale,
34
- output_size[0],
35
- output_size[1],
36
- bs,
37
- ch,
38
- h,
39
- w,
40
- sampling_ratio,
41
- )
42
- return grad_input, None, None, None, None, None
43
-
44
-
45
- roi_align_rotated = _ROIAlignRotated.apply
46
-
47
-
48
- class ROIAlignRotated(nn.Module):
49
- def __init__(self, output_size, spatial_scale, sampling_ratio):
50
- """
51
- Args:
52
- output_size (tuple): h, w
53
- spatial_scale (float): scale the input boxes by this number
54
- sampling_ratio (int): number of inputs samples to take for each output
55
- sample. 0 to take samples densely.
56
-
57
- Note:
58
- ROIAlignRotated supports continuous coordinate by default:
59
- Given a continuous coordinate c, its two neighboring pixel indices (in our
60
- pixel model) are computed by floor(c - 0.5) and ceil(c - 0.5). For example,
61
- c=1.3 has pixel neighbors with discrete indices [0] and [1] (which are sampled
62
- from the underlying signal at continuous coordinates 0.5 and 1.5).
63
- """
64
- super(ROIAlignRotated, self).__init__()
65
- self.output_size = output_size
66
- self.spatial_scale = spatial_scale
67
- self.sampling_ratio = sampling_ratio
68
-
69
- def forward(self, input, rois):
70
- """
71
- Args:
72
- input: NCHW images
73
- rois: Bx6 boxes. First column is the index into N.
74
- The other 5 columns are (x_ctr, y_ctr, width, height, angle_degrees).
75
- """
76
- assert rois.dim() == 2 and rois.size(1) == 6
77
- orig_dtype = input.dtype
78
- if orig_dtype == torch.float16:
79
- input = input.float()
80
- rois = rois.float()
81
- return roi_align_rotated(
82
- input, rois, self.output_size, self.spatial_scale, self.sampling_ratio
83
- ).to(dtype=orig_dtype)
84
-
85
- def __repr__(self):
86
- tmpstr = self.__class__.__name__ + "("
87
- tmpstr += "output_size=" + str(self.output_size)
88
- tmpstr += ", spatial_scale=" + str(self.spatial_scale)
89
- tmpstr += ", sampling_ratio=" + str(self.sampling_ratio)
90
- tmpstr += ")"
91
- return tmpstr
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/Bart92/RVC_HF/infer/lib/uvr5_pack/lib_v5/layers_123821KB.py DELETED
@@ -1,118 +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 SeperableConv2DBNActiv(nn.Module):
30
- def __init__(self, nin, nout, ksize=3, stride=1, pad=1, dilation=1, activ=nn.ReLU):
31
- super(SeperableConv2DBNActiv, self).__init__()
32
- self.conv = nn.Sequential(
33
- nn.Conv2d(
34
- nin,
35
- nin,
36
- kernel_size=ksize,
37
- stride=stride,
38
- padding=pad,
39
- dilation=dilation,
40
- groups=nin,
41
- bias=False,
42
- ),
43
- nn.Conv2d(nin, nout, kernel_size=1, bias=False),
44
- nn.BatchNorm2d(nout),
45
- activ(),
46
- )
47
-
48
- def __call__(self, x):
49
- return self.conv(x)
50
-
51
-
52
- class Encoder(nn.Module):
53
- def __init__(self, nin, nout, ksize=3, stride=1, pad=1, activ=nn.LeakyReLU):
54
- super(Encoder, self).__init__()
55
- self.conv1 = Conv2DBNActiv(nin, nout, ksize, 1, pad, activ=activ)
56
- self.conv2 = Conv2DBNActiv(nout, nout, ksize, stride, pad, activ=activ)
57
-
58
- def __call__(self, x):
59
- skip = self.conv1(x)
60
- h = self.conv2(skip)
61
-
62
- return h, skip
63
-
64
-
65
- class Decoder(nn.Module):
66
- def __init__(
67
- self, nin, nout, ksize=3, stride=1, pad=1, activ=nn.ReLU, dropout=False
68
- ):
69
- super(Decoder, self).__init__()
70
- self.conv = Conv2DBNActiv(nin, nout, ksize, 1, pad, activ=activ)
71
- self.dropout = nn.Dropout2d(0.1) if dropout else None
72
-
73
- def __call__(self, x, skip=None):
74
- x = F.interpolate(x, scale_factor=2, mode="bilinear", align_corners=True)
75
- if skip is not None:
76
- skip = spec_utils.crop_center(skip, x)
77
- x = torch.cat([x, skip], dim=1)
78
- h = self.conv(x)
79
-
80
- if self.dropout is not None:
81
- h = self.dropout(h)
82
-
83
- return h
84
-
85
-
86
- class ASPPModule(nn.Module):
87
- def __init__(self, nin, nout, dilations=(4, 8, 16), activ=nn.ReLU):
88
- super(ASPPModule, self).__init__()
89
- self.conv1 = nn.Sequential(
90
- nn.AdaptiveAvgPool2d((1, None)),
91
- Conv2DBNActiv(nin, nin, 1, 1, 0, activ=activ),
92
- )
93
- self.conv2 = Conv2DBNActiv(nin, nin, 1, 1, 0, activ=activ)
94
- self.conv3 = SeperableConv2DBNActiv(
95
- nin, nin, 3, 1, dilations[0], dilations[0], activ=activ
96
- )
97
- self.conv4 = SeperableConv2DBNActiv(
98
- nin, nin, 3, 1, dilations[1], dilations[1], activ=activ
99
- )
100
- self.conv5 = SeperableConv2DBNActiv(
101
- nin, nin, 3, 1, dilations[2], dilations[2], activ=activ
102
- )
103
- self.bottleneck = nn.Sequential(
104
- Conv2DBNActiv(nin * 5, nout, 1, 1, 0, activ=activ), nn.Dropout2d(0.1)
105
- )
106
-
107
- def forward(self, x):
108
- _, _, h, w = x.size()
109
- feat1 = F.interpolate(
110
- self.conv1(x), size=(h, w), mode="bilinear", align_corners=True
111
- )
112
- feat2 = self.conv2(x)
113
- feat3 = self.conv3(x)
114
- feat4 = self.conv4(x)
115
- feat5 = self.conv5(x)
116
- out = torch.cat((feat1, feat2, feat3, feat4, feat5), dim=1)
117
- bottle = self.bottleneck(out)
118
- return bottle
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/Benson/text-generation/Examples/Descargar Bgmi Battleground Mobile India Logo Png.md DELETED
@@ -1,75 +0,0 @@
1
-
2
- <h1>Cómo descargar BGMI Battleground Mobile India Logo PNG</h1>
3
- <p>Si eres un fan del popular juego battle royale PUBG Mobile, es posible que hayas oído hablar de su versión india, Battlegrounds Mobile India (BGMI). Este juego es desarrollado y publicado por Krafton, una compañía de juegos surcoreana, exclusivamente para jugadores en la India. Cuenta con diversos mapas, modos, armas y personajes, así como un ecosistema exclusivo de esports para el mercado indio. </p>
4
- <p>Una de las características más distintivas de BGMI es su logotipo, que representa una cabeza de león estilizada en colores naranja y blanco. El logotipo representa el espíritu de coraje, fuerza y orgullo de los jugadores indios. Si desea descargar este logo en formato PNG, o cualquier otro formato de imagen, ha venido al lugar correcto. En este artículo, le mostraremos cómo descargar el logotipo de BGMI en formatos PNG y SVG, así como cómo convertirlo de un formato a otro. También le daremos algunos consejos sobre cómo usar el logotipo para diferentes propósitos. </p>
5
- <h2>descargar bgmi battleground mobile india logo png</h2><br /><p><b><b>DOWNLOAD</b> &#9734;&#9734;&#9734;&#9734;&#9734; <a href="https://bltlly.com/2v6LSC">https://bltlly.com/2v6LSC</a></b></p><br /><br />
6
- <h2>Qué es PNG y por qué usarlo para logotipos</h2>
7
- <p>PNG significa Portable Network Graphics, y es un formato de imagen raster que admite compresión sin pérdidas, transparencia y profundidad de color. Una imagen raster se compone de píxeles, o pequeños puntos de color, que forman una imagen cuando se ve a una determinada resolución. La compresión sin pérdidas significa que no se pierden datos cuando la imagen se comprime o descomprime, por lo que la calidad permanece intacta. La transparencia significa que la imagen puede tener un fondo transparente o partes que permiten que la capa subyacente se muestre. La profundidad de color significa que la imagen puede mostrar un gran número de colores, hasta 16 millones. </p>
8
-
9
- <h2>Qué es SVG y por qué usarlo para logotipos</h2>
10
- <p>SVG significa gráficos vectoriales escalables, y es un formato de imagen vectorial que admite escalabilidad, animación e interactividad. Una imagen vectorial se compone de ecuaciones matemáticas que definen las formas, curvas, colores y posiciones de los elementos en la imagen. La escalabilidad significa que la imagen puede ser redimensionada sin perder calidad o resolución. Animación significa que la imagen puede tener efectos o movimientos dinámicos. Interactividad significa que la imagen puede responder a las acciones o entradas del usuario. </p>
11
- <p>SVG es una gran opción para logotipos porque puede crear imágenes nítidas y claras en cualquier tamaño o resolución. También puede apoyar la animación y la interactividad, lo que puede hacer que los logotipos sean más atractivos y atractivos. Además, SVG tiene un pequeño tamaño de archivo y una alta compatibilidad con navegadores y dispositivos modernos. </p>
12
- <h2>PNG vs SVG: Cuál elegir para el logotipo de BGMI</h2>
13
- <p>Tanto PNG como SVG tienen sus ventajas y desventajas cuando se trata de logotipos. Aquí hay algunos factores a considerar al elegir entre ellos:</p>
14
- <ul>
15
- <li><strong>Calidad:</strong> Los archivos PNG pueden mantener la calidad original del logotipo, pero también pueden ser pixelados o borrosos cuando se escalan hacia arriba o hacia abajo. Los archivos SVG pueden mantener el logotipo nítido y suave en cualquier tamaño, pero también pueden perder algunos detalles o efectos cuando se convierten de otros formatos. </li>
16
- <li><strong>Compatibilidad:</strong> Los archivos PNG son ampliamente soportados por la mayoría de navegadores y dispositivos, pero también pueden tener algunos problemas con la transparencia o la visualización de color en algunas plataformas. Los archivos SVG son compatibles con navegadores y dispositivos modernos, pero también pueden tener algunos problemas con los más antiguos o menos populares. </li>
17
-
18
- </ul>
19
- <p>Basado en estos factores, puede decidir qué formato es el mejor para su logotipo de BGMI. Sin embargo, no tiene que limitarse a un formato. También puedes descargar ambos formatos y usarlos para diferentes propósitos. </p>
20
- <h2>Cómo descargar el logo de BGMI en formato PNG</h2>
21
- <p>Si quieres descargar el logo de BGMI en formato PNG, puedes seguir estos sencillos pasos:</p>
22
- <ol>
23
- <li>Ir al sitio web oficial de BGMI en <a href="">https://www.battlegrsmobileindia.com/</a></li>
24
- <li>Haga clic derecho en el logotipo en la esquina superior izquierda de la página de inicio y seleccione "Guardar imagen como..."</li>
25
- <li>Elija una ubicación y un nombre para el archivo y haga clic en "Guardar"</li>
26
- <li>Usted tendrá el logo de BGMI en formato PNG guardado en su computadora</li>
27
- </ol>
28
- <p>También puede utilizar este enlace para descargar el logo directamente: <a href="">https://www.battlegrsmobileindia.com/assets/images/logo.png</a></p>
29
- <h2>Cómo descargar el logo de BGMI en formato SVG</h2>
30
- <p>Si quieres descargar el logo de BGMI en formato SVG, puedes seguir estos sencillos pasos:</p>
31
- <p></p>
32
- <ol>
33
- <li>Ir a este sitio web que ofrece logos SVG gratuitos de varias marcas: <a href="">https://worldvectorlogo.com/</a></li>
34
- <li>Escriba "BGMI" en el cuadro de búsqueda y pulse enter</li>
35
- <li>Haga clic en el logo que coincida con el oficial y seleccione "Descargar SVG"</li>
36
- <li>Usted tendrá el logo de BGMI en formato SVG descargado en su computadora</li>
37
- </ol>
38
- <h2>Cómo convertir el logotipo de BGMI de PNG a SVG o viceversa</h2>
39
- <p>Si ya tienes el logotipo de BGMI en un formato y quieres convertirlo a otro, puedes usar algunas herramientas en línea o software que te puede ayudar con eso. Aquí hay algunos ejemplos:</p>
40
- <ul>
41
- <li><a href="">PNG to SVG Converter</a>: Esta es una herramienta gratuita en línea que puede convertir imágenes PNG a gráficos vectoriales SVG. Solo necesitas subir tu archivo PNG, ajustar algunos ajustes y descargar tu archivo SVG. </li>
42
-
43
- <li><a href="">Inkscape</a>: Este es un editor de gráficos vectoriales libre y de código abierto que puede funcionar con formatos PNG y SVG. Puede usarlo para crear, editar o convertir su logotipo BGMI como desee. </li>
44
- <li><a href="">Adobe Illustrator</a>: Este es un editor de gráficos vectoriales profesional y de pago que también puede manejar formatos PNG y SVG. Puede usarlo para diseñar, modificar o convertir su logotipo BGMI con funciones y opciones más avanzadas. </li>
45
- </ul>
46
- <p>Antes de convertir su logotipo BGMI de un formato a otro, asegúrese de comprobar la calidad y compatibilidad del archivo de salida. Es posible que necesite ajustar algunos ajustes o parámetros para obtener los mejores resultados. </p>
47
- <h2>Cómo usar el logo de BGMI para diferentes propósitos</h2>
48
- <p>Ahora que ha descargado o convertido su logotipo BGMI en el formato que desee, puede usarlo para diversos fines. Aquí hay algunos ejemplos de cómo puedes usar el logo:</p>
49
- <ul>
50
- <li><strong>Diseño web:</strong> Puede utilizar el logotipo como un favicon, un encabezado, un pie de página, un banner o un botón en su sitio web. También puede usarlo como un enlace o un icono para sus cuentas de redes sociales u otras plataformas. Asegúrese de utilizar el tamaño y la resolución adecuados para su diseño web. </li>
51
- <li><strong>Redes sociales:</strong> Puedes usar el logo como una foto de perfil, una foto de portada, una historia o una publicación en tus redes sociales. También puede usarlo como pegatina, filtro o marco para sus fotos o videos. Asegúrate de seguir las pautas y reglas de cada plataforma de redes sociales. </li>
52
- <li><strong>Gaming:</strong> Puedes usar el logo como fondo de pantalla, protector de pantalla, tema o piel para tu computadora o dispositivo móvil. También puedes usarlo como avatar, insignia, banner o logotipo de clan para tu cuenta de juego o equipo. Asegúrate de respetar los términos y condiciones de cada juego o servicio. </li>
53
-
54
- </ul>
55
- <p>Hagas lo que hagas con el logo, asegúrate de mostrar tu amor y apoyo a BGMI y su comunidad. También puedes compartir tus creaciones con otros fans y jugadores online. </p>
56
- <h1>Conclusión</h1>
57
- <p>En este artículo, le hemos mostrado cómo descargar el logotipo de BGMI Battleground Mobile India en formatos PNG y SVG, así como cómo convertirlo de un formato a otro. También le hemos dado algunos consejos sobre cómo utilizar el logotipo para diferentes propósitos. Esperamos que haya encontrado este artículo útil e informativo. </p>
58
- <p>BGMI es un juego increíble que ofrece una experiencia emocionante e inmersiva para los jugadores indios. El logotipo es un símbolo de la identidad y los valores del juego. Al descargar y usar el logo, puedes expresar tu pasión y entusiasmo por BGMI y unirte a su creciente comunidad. </p>
59
- <p>Si tiene alguna pregunta o comentario sobre este artículo o BGMI en general, no dude en dejar un comentario a continuación. Nos encantaría saber de usted. </p>
60
- <h2>Preguntas frecuentes</h2>
61
- <p>Aquí hay algunas preguntas y respuestas frecuentes sobre el logo de BGMI:</p>
62
- <ol>
63
- <li><strong>Q: ¿Dónde puedo descargar el logo oficial de BGMI? </strong></li>
64
- <li>A: Puede descargar el logo oficial de BGMI desde su sitio web en <a href="">https://www.battlegroundsmobileindia.com/</a>. También puede encontrarlo en otros sitios web que ofrecen logotipos gratuitos de varias marcas. </li>
65
- <li><strong>Q: ¿En qué formato está el logotipo oficial de BGMI? </strong></li>
66
- <li>A: El logotipo oficial de BGMI está en formato PNG, que es un formato de imagen raster que admite compresión sin pérdidas, transparencia y profundidad de color. También puede descargarlo en formato SVG, que es un formato de imagen vectorial que admite escalabilidad, animación e interactividad. </li>
67
- <li><strong>Q: ¿Cómo puedo convertir el logotipo de BGMI de PNG a SVG o viceversa? </strong></li>
68
-
69
- <li><strong>Q: ¿Cómo puedo usar el logotipo de BGMI para diferentes propósitos? </strong></li>
70
- <li>A: Puede utilizar el logotipo de BGMI para diversos fines, como diseño web, redes sociales, juegos u otros. También puede personalizar el logotipo de acuerdo a sus necesidades y preferencias. Sin embargo, siempre debe respetar los derechos y las reglas de uso del logotipo y dar el crédito adecuado a la fuente original. </li>
71
- <li><strong>Q: ¿BGMI logo es libre de usar? </strong></li>
72
- <li>A: Sí, el logotipo de BGMI es libre de usar para fines personales o no comerciales. Sin embargo, no debe usarlo para ninguna actividad ilegal o poco ética, o reclamarlo como propio. Tampoco debe modificar o alterar el logotipo de ninguna manera que pueda dañar su reputación o integridad. </li>
73
- </ol></p> 64aa2da5cf<br />
74
- <br />
75
- <br />
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/BetterAPI/BetterChat/src/lib/types/SharedConversation.ts DELETED
@@ -1,11 +0,0 @@
1
- import type { Message } from "./Message";
2
- import type { Timestamps } from "./Timestamps";
3
-
4
- export interface SharedConversation extends Timestamps {
5
- _id: string;
6
-
7
- hash: string;
8
-
9
- title: string;
10
- messages: Message[];
11
- }
 
 
 
 
 
 
 
 
 
 
 
 
spaces/Big-Web/MMSD/env/Lib/site-packages/botocore/docs/method.py DELETED
@@ -1,328 +0,0 @@
1
- # Copyright 2015 Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
- #
3
- # Licensed under the Apache License, Version 2.0 (the "License"). You
4
- # may not use this file except in compliance with the License. A copy of
5
- # the License is located at
6
- #
7
- # http://aws.amazon.com/apache2.0/
8
- #
9
- # or in the "license" file accompanying this file. This file is
10
- # distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
11
- # ANY KIND, either express or implied. See the License for the specific
12
- # language governing permissions and limitations under the License.
13
- import inspect
14
- import types
15
-
16
- from botocore.docs.example import (
17
- RequestExampleDocumenter,
18
- ResponseExampleDocumenter,
19
- )
20
- from botocore.docs.params import (
21
- RequestParamsDocumenter,
22
- ResponseParamsDocumenter,
23
- )
24
-
25
- AWS_DOC_BASE = 'https://docs.aws.amazon.com/goto/WebAPI'
26
-
27
-
28
- def get_instance_public_methods(instance):
29
- """Retrieves an objects public methods
30
-
31
- :param instance: The instance of the class to inspect
32
- :rtype: dict
33
- :returns: A dictionary that represents an instance's methods where
34
- the keys are the name of the methods and the
35
- values are the handler to the method.
36
- """
37
- instance_members = inspect.getmembers(instance)
38
- instance_methods = {}
39
- for name, member in instance_members:
40
- if not name.startswith('_'):
41
- if inspect.ismethod(member):
42
- instance_methods[name] = member
43
- return instance_methods
44
-
45
-
46
- def document_model_driven_signature(
47
- section, name, operation_model, include=None, exclude=None
48
- ):
49
- """Documents the signature of a model-driven method
50
-
51
- :param section: The section to write the documentation to.
52
-
53
- :param name: The name of the method
54
-
55
- :param operation_model: The operation model for the method
56
-
57
- :type include: Dictionary where keys are parameter names and
58
- values are the shapes of the parameter names.
59
- :param include: The parameter shapes to include in the documentation.
60
-
61
- :type exclude: List of the names of the parameters to exclude.
62
- :param exclude: The names of the parameters to exclude from
63
- documentation.
64
- """
65
- params = {}
66
- if operation_model.input_shape:
67
- params = operation_model.input_shape.members
68
-
69
- parameter_names = list(params.keys())
70
-
71
- if include is not None:
72
- for member in include:
73
- parameter_names.append(member.name)
74
-
75
- if exclude is not None:
76
- for member in exclude:
77
- if member in parameter_names:
78
- parameter_names.remove(member)
79
-
80
- signature_params = ''
81
- if parameter_names:
82
- signature_params = '**kwargs'
83
- section.style.start_sphinx_py_method(name, signature_params)
84
-
85
-
86
- def document_custom_signature(
87
- section, name, method, include=None, exclude=None
88
- ):
89
- """Documents the signature of a custom method
90
-
91
- :param section: The section to write the documentation to.
92
-
93
- :param name: The name of the method
94
-
95
- :param method: The handle to the method being documented
96
-
97
- :type include: Dictionary where keys are parameter names and
98
- values are the shapes of the parameter names.
99
- :param include: The parameter shapes to include in the documentation.
100
-
101
- :type exclude: List of the names of the parameters to exclude.
102
- :param exclude: The names of the parameters to exclude from
103
- documentation.
104
- """
105
- signature = inspect.signature(method)
106
- # "raw" class methods are FunctionType and they include "self" param
107
- # object methods are MethodType and they skip the "self" param
108
- if isinstance(method, types.FunctionType):
109
- self_param = next(iter(signature.parameters))
110
- self_kind = signature.parameters[self_param].kind
111
- # safety check that we got the right parameter
112
- assert self_kind == inspect.Parameter.POSITIONAL_OR_KEYWORD
113
- new_params = signature.parameters.copy()
114
- del new_params[self_param]
115
- signature = signature.replace(parameters=new_params.values())
116
- signature_params = str(signature).lstrip('(')
117
- signature_params = signature_params.rstrip(')')
118
- section.style.start_sphinx_py_method(name, signature_params)
119
-
120
-
121
- def document_custom_method(section, method_name, method):
122
- """Documents a non-data driven method
123
-
124
- :param section: The section to write the documentation to.
125
-
126
- :param method_name: The name of the method
127
-
128
- :param method: The handle to the method being documented
129
- """
130
- full_method_name = f"{section.context.get('qualifier', '')}{method_name}"
131
- document_custom_signature(section, full_method_name, method)
132
- method_intro_section = section.add_new_section('method-intro')
133
- method_intro_section.writeln('')
134
- doc_string = inspect.getdoc(method)
135
- if doc_string is not None:
136
- method_intro_section.style.write_py_doc_string(doc_string)
137
-
138
-
139
- def document_model_driven_method(
140
- section,
141
- method_name,
142
- operation_model,
143
- event_emitter,
144
- method_description=None,
145
- example_prefix=None,
146
- include_input=None,
147
- include_output=None,
148
- exclude_input=None,
149
- exclude_output=None,
150
- document_output=True,
151
- include_signature=True,
152
- ):
153
- """Documents an individual method
154
-
155
- :param section: The section to write to
156
-
157
- :param method_name: The name of the method
158
-
159
- :param operation_model: The model of the operation
160
-
161
- :param event_emitter: The event emitter to use to emit events
162
-
163
- :param example_prefix: The prefix to use in the method example.
164
-
165
- :type include_input: Dictionary where keys are parameter names and
166
- values are the shapes of the parameter names.
167
- :param include_input: The parameter shapes to include in the
168
- input documentation.
169
-
170
- :type include_output: Dictionary where keys are parameter names and
171
- values are the shapes of the parameter names.
172
- :param include_input: The parameter shapes to include in the
173
- output documentation.
174
-
175
- :type exclude_input: List of the names of the parameters to exclude.
176
- :param exclude_input: The names of the parameters to exclude from
177
- input documentation.
178
-
179
- :type exclude_output: List of the names of the parameters to exclude.
180
- :param exclude_input: The names of the parameters to exclude from
181
- output documentation.
182
-
183
- :param document_output: A boolean flag to indicate whether to
184
- document the output.
185
-
186
- :param include_signature: Whether or not to include the signature.
187
- It is useful for generating docstrings.
188
- """
189
- # Add the signature if specified.
190
- if include_signature:
191
- document_model_driven_signature(
192
- section,
193
- method_name,
194
- operation_model,
195
- include=include_input,
196
- exclude=exclude_input,
197
- )
198
-
199
- # Add the description for the method.
200
- method_intro_section = section.add_new_section('method-intro')
201
- method_intro_section.include_doc_string(method_description)
202
- if operation_model.deprecated:
203
- method_intro_section.style.start_danger()
204
- method_intro_section.writeln(
205
- 'This operation is deprecated and may not function as '
206
- 'expected. This operation should not be used going forward '
207
- 'and is only kept for the purpose of backwards compatiblity.'
208
- )
209
- method_intro_section.style.end_danger()
210
- service_uid = operation_model.service_model.metadata.get('uid')
211
- if service_uid is not None:
212
- method_intro_section.style.new_paragraph()
213
- method_intro_section.write("See also: ")
214
- link = f"{AWS_DOC_BASE}/{service_uid}/{operation_model.name}"
215
- method_intro_section.style.external_link(
216
- title="AWS API Documentation", link=link
217
- )
218
- method_intro_section.writeln('')
219
-
220
- # Add the example section.
221
- example_section = section.add_new_section('request-example')
222
- example_section.style.new_paragraph()
223
- example_section.style.bold('Request Syntax')
224
-
225
- context = {
226
- 'special_shape_types': {
227
- 'streaming_input_shape': operation_model.get_streaming_input(),
228
- 'streaming_output_shape': operation_model.get_streaming_output(),
229
- 'eventstream_output_shape': operation_model.get_event_stream_output(),
230
- },
231
- }
232
-
233
- if operation_model.input_shape:
234
- RequestExampleDocumenter(
235
- service_name=operation_model.service_model.service_name,
236
- operation_name=operation_model.name,
237
- event_emitter=event_emitter,
238
- context=context,
239
- ).document_example(
240
- example_section,
241
- operation_model.input_shape,
242
- prefix=example_prefix,
243
- include=include_input,
244
- exclude=exclude_input,
245
- )
246
- else:
247
- example_section.style.new_paragraph()
248
- example_section.style.start_codeblock()
249
- example_section.write(example_prefix + '()')
250
-
251
- # Add the request parameter documentation.
252
- request_params_section = section.add_new_section('request-params')
253
- if operation_model.input_shape:
254
- RequestParamsDocumenter(
255
- service_name=operation_model.service_model.service_name,
256
- operation_name=operation_model.name,
257
- event_emitter=event_emitter,
258
- context=context,
259
- ).document_params(
260
- request_params_section,
261
- operation_model.input_shape,
262
- include=include_input,
263
- exclude=exclude_input,
264
- )
265
-
266
- # Add the return value documentation
267
- return_section = section.add_new_section('return')
268
- return_section.style.new_line()
269
- if operation_model.output_shape is not None and document_output:
270
- return_section.write(':rtype: dict')
271
- return_section.style.new_line()
272
- return_section.write(':returns: ')
273
- return_section.style.indent()
274
- return_section.style.new_line()
275
-
276
- # If the operation is an event stream, describe the tagged union
277
- event_stream_output = operation_model.get_event_stream_output()
278
- if event_stream_output:
279
- event_section = return_section.add_new_section('event-stream')
280
- event_section.style.new_paragraph()
281
- event_section.write(
282
- 'The response of this operation contains an '
283
- ':class:`.EventStream` member. When iterated the '
284
- ':class:`.EventStream` will yield events based on the '
285
- 'structure below, where only one of the top level keys '
286
- 'will be present for any given event.'
287
- )
288
- event_section.style.new_line()
289
-
290
- # Add an example return value
291
- return_example_section = return_section.add_new_section(
292
- 'response-example'
293
- )
294
- return_example_section.style.new_line()
295
- return_example_section.style.bold('Response Syntax')
296
- return_example_section.style.new_paragraph()
297
- ResponseExampleDocumenter(
298
- service_name=operation_model.service_model.service_name,
299
- operation_name=operation_model.name,
300
- event_emitter=event_emitter,
301
- context=context,
302
- ).document_example(
303
- return_example_section,
304
- operation_model.output_shape,
305
- include=include_output,
306
- exclude=exclude_output,
307
- )
308
-
309
- # Add a description for the return value
310
- return_description_section = return_section.add_new_section(
311
- 'description'
312
- )
313
- return_description_section.style.new_line()
314
- return_description_section.style.bold('Response Structure')
315
- return_description_section.style.new_paragraph()
316
- ResponseParamsDocumenter(
317
- service_name=operation_model.service_model.service_name,
318
- operation_name=operation_model.name,
319
- event_emitter=event_emitter,
320
- context=context,
321
- ).document_params(
322
- return_description_section,
323
- operation_model.output_shape,
324
- include=include_output,
325
- exclude=exclude_output,
326
- )
327
- else:
328
- return_section.write(':returns: None')
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/Big-Web/MMSD/env/Lib/site-packages/dateutil/parser/__init__.py DELETED
@@ -1,61 +0,0 @@
1
- # -*- coding: utf-8 -*-
2
- from ._parser import parse, parser, parserinfo, ParserError
3
- from ._parser import DEFAULTPARSER, DEFAULTTZPARSER
4
- from ._parser import UnknownTimezoneWarning
5
-
6
- from ._parser import __doc__
7
-
8
- from .isoparser import isoparser, isoparse
9
-
10
- __all__ = ['parse', 'parser', 'parserinfo',
11
- 'isoparse', 'isoparser',
12
- 'ParserError',
13
- 'UnknownTimezoneWarning']
14
-
15
-
16
- ###
17
- # Deprecate portions of the private interface so that downstream code that
18
- # is improperly relying on it is given *some* notice.
19
-
20
-
21
- def __deprecated_private_func(f):
22
- from functools import wraps
23
- import warnings
24
-
25
- msg = ('{name} is a private function and may break without warning, '
26
- 'it will be moved and or renamed in future versions.')
27
- msg = msg.format(name=f.__name__)
28
-
29
- @wraps(f)
30
- def deprecated_func(*args, **kwargs):
31
- warnings.warn(msg, DeprecationWarning)
32
- return f(*args, **kwargs)
33
-
34
- return deprecated_func
35
-
36
- def __deprecate_private_class(c):
37
- import warnings
38
-
39
- msg = ('{name} is a private class and may break without warning, '
40
- 'it will be moved and or renamed in future versions.')
41
- msg = msg.format(name=c.__name__)
42
-
43
- class private_class(c):
44
- __doc__ = c.__doc__
45
-
46
- def __init__(self, *args, **kwargs):
47
- warnings.warn(msg, DeprecationWarning)
48
- super(private_class, self).__init__(*args, **kwargs)
49
-
50
- private_class.__name__ = c.__name__
51
-
52
- return private_class
53
-
54
-
55
- from ._parser import _timelex, _resultbase
56
- from ._parser import _tzparser, _parsetz
57
-
58
- _timelex = __deprecate_private_class(_timelex)
59
- _tzparser = __deprecate_private_class(_tzparser)
60
- _resultbase = __deprecate_private_class(_resultbase)
61
- _parsetz = __deprecated_private_func(_parsetz)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/Big-Web/MMSD/env/Lib/site-packages/pip/_internal/models/selection_prefs.py DELETED
@@ -1,51 +0,0 @@
1
- from typing import Optional
2
-
3
- from pip._internal.models.format_control import FormatControl
4
-
5
-
6
- class SelectionPreferences:
7
- """
8
- Encapsulates the candidate selection preferences for downloading
9
- and installing files.
10
- """
11
-
12
- __slots__ = [
13
- "allow_yanked",
14
- "allow_all_prereleases",
15
- "format_control",
16
- "prefer_binary",
17
- "ignore_requires_python",
18
- ]
19
-
20
- # Don't include an allow_yanked default value to make sure each call
21
- # site considers whether yanked releases are allowed. This also causes
22
- # that decision to be made explicit in the calling code, which helps
23
- # people when reading the code.
24
- def __init__(
25
- self,
26
- allow_yanked: bool,
27
- allow_all_prereleases: bool = False,
28
- format_control: Optional[FormatControl] = None,
29
- prefer_binary: bool = False,
30
- ignore_requires_python: Optional[bool] = None,
31
- ) -> None:
32
- """Create a SelectionPreferences object.
33
-
34
- :param allow_yanked: Whether files marked as yanked (in the sense
35
- of PEP 592) are permitted to be candidates for install.
36
- :param format_control: A FormatControl object or None. Used to control
37
- the selection of source packages / binary packages when consulting
38
- the index and links.
39
- :param prefer_binary: Whether to prefer an old, but valid, binary
40
- dist over a new source dist.
41
- :param ignore_requires_python: Whether to ignore incompatible
42
- "Requires-Python" values in links. Defaults to False.
43
- """
44
- if ignore_requires_python is None:
45
- ignore_requires_python = False
46
-
47
- self.allow_yanked = allow_yanked
48
- self.allow_all_prereleases = allow_all_prereleases
49
- self.format_control = format_control
50
- self.prefer_binary = prefer_binary
51
- self.ignore_requires_python = ignore_requires_python
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/Big-Web/MMSD/env/Lib/site-packages/pip/_vendor/packaging/tags.py DELETED
@@ -1,487 +0,0 @@
1
- # This file is dual licensed under the terms of the Apache License, Version
2
- # 2.0, and the BSD License. See the LICENSE file in the root of this repository
3
- # for complete details.
4
-
5
- import logging
6
- import platform
7
- import sys
8
- import sysconfig
9
- from importlib.machinery import EXTENSION_SUFFIXES
10
- from typing import (
11
- Dict,
12
- FrozenSet,
13
- Iterable,
14
- Iterator,
15
- List,
16
- Optional,
17
- Sequence,
18
- Tuple,
19
- Union,
20
- cast,
21
- )
22
-
23
- from . import _manylinux, _musllinux
24
-
25
- logger = logging.getLogger(__name__)
26
-
27
- PythonVersion = Sequence[int]
28
- MacVersion = Tuple[int, int]
29
-
30
- INTERPRETER_SHORT_NAMES: Dict[str, str] = {
31
- "python": "py", # Generic.
32
- "cpython": "cp",
33
- "pypy": "pp",
34
- "ironpython": "ip",
35
- "jython": "jy",
36
- }
37
-
38
-
39
- _32_BIT_INTERPRETER = sys.maxsize <= 2 ** 32
40
-
41
-
42
- class Tag:
43
- """
44
- A representation of the tag triple for a wheel.
45
-
46
- Instances are considered immutable and thus are hashable. Equality checking
47
- is also supported.
48
- """
49
-
50
- __slots__ = ["_interpreter", "_abi", "_platform", "_hash"]
51
-
52
- def __init__(self, interpreter: str, abi: str, platform: str) -> None:
53
- self._interpreter = interpreter.lower()
54
- self._abi = abi.lower()
55
- self._platform = platform.lower()
56
- # The __hash__ of every single element in a Set[Tag] will be evaluated each time
57
- # that a set calls its `.disjoint()` method, which may be called hundreds of
58
- # times when scanning a page of links for packages with tags matching that
59
- # Set[Tag]. Pre-computing the value here produces significant speedups for
60
- # downstream consumers.
61
- self._hash = hash((self._interpreter, self._abi, self._platform))
62
-
63
- @property
64
- def interpreter(self) -> str:
65
- return self._interpreter
66
-
67
- @property
68
- def abi(self) -> str:
69
- return self._abi
70
-
71
- @property
72
- def platform(self) -> str:
73
- return self._platform
74
-
75
- def __eq__(self, other: object) -> bool:
76
- if not isinstance(other, Tag):
77
- return NotImplemented
78
-
79
- return (
80
- (self._hash == other._hash) # Short-circuit ASAP for perf reasons.
81
- and (self._platform == other._platform)
82
- and (self._abi == other._abi)
83
- and (self._interpreter == other._interpreter)
84
- )
85
-
86
- def __hash__(self) -> int:
87
- return self._hash
88
-
89
- def __str__(self) -> str:
90
- return f"{self._interpreter}-{self._abi}-{self._platform}"
91
-
92
- def __repr__(self) -> str:
93
- return f"<{self} @ {id(self)}>"
94
-
95
-
96
- def parse_tag(tag: str) -> FrozenSet[Tag]:
97
- """
98
- Parses the provided tag (e.g. `py3-none-any`) into a frozenset of Tag instances.
99
-
100
- Returning a set is required due to the possibility that the tag is a
101
- compressed tag set.
102
- """
103
- tags = set()
104
- interpreters, abis, platforms = tag.split("-")
105
- for interpreter in interpreters.split("."):
106
- for abi in abis.split("."):
107
- for platform_ in platforms.split("."):
108
- tags.add(Tag(interpreter, abi, platform_))
109
- return frozenset(tags)
110
-
111
-
112
- def _get_config_var(name: str, warn: bool = False) -> Union[int, str, None]:
113
- value = sysconfig.get_config_var(name)
114
- if value is None and warn:
115
- logger.debug(
116
- "Config variable '%s' is unset, Python ABI tag may be incorrect", name
117
- )
118
- return value
119
-
120
-
121
- def _normalize_string(string: str) -> str:
122
- return string.replace(".", "_").replace("-", "_")
123
-
124
-
125
- def _abi3_applies(python_version: PythonVersion) -> bool:
126
- """
127
- Determine if the Python version supports abi3.
128
-
129
- PEP 384 was first implemented in Python 3.2.
130
- """
131
- return len(python_version) > 1 and tuple(python_version) >= (3, 2)
132
-
133
-
134
- def _cpython_abis(py_version: PythonVersion, warn: bool = False) -> List[str]:
135
- py_version = tuple(py_version) # To allow for version comparison.
136
- abis = []
137
- version = _version_nodot(py_version[:2])
138
- debug = pymalloc = ucs4 = ""
139
- with_debug = _get_config_var("Py_DEBUG", warn)
140
- has_refcount = hasattr(sys, "gettotalrefcount")
141
- # Windows doesn't set Py_DEBUG, so checking for support of debug-compiled
142
- # extension modules is the best option.
143
- # https://github.com/pypa/pip/issues/3383#issuecomment-173267692
144
- has_ext = "_d.pyd" in EXTENSION_SUFFIXES
145
- if with_debug or (with_debug is None and (has_refcount or has_ext)):
146
- debug = "d"
147
- if py_version < (3, 8):
148
- with_pymalloc = _get_config_var("WITH_PYMALLOC", warn)
149
- if with_pymalloc or with_pymalloc is None:
150
- pymalloc = "m"
151
- if py_version < (3, 3):
152
- unicode_size = _get_config_var("Py_UNICODE_SIZE", warn)
153
- if unicode_size == 4 or (
154
- unicode_size is None and sys.maxunicode == 0x10FFFF
155
- ):
156
- ucs4 = "u"
157
- elif debug:
158
- # Debug builds can also load "normal" extension modules.
159
- # We can also assume no UCS-4 or pymalloc requirement.
160
- abis.append(f"cp{version}")
161
- abis.insert(
162
- 0,
163
- "cp{version}{debug}{pymalloc}{ucs4}".format(
164
- version=version, debug=debug, pymalloc=pymalloc, ucs4=ucs4
165
- ),
166
- )
167
- return abis
168
-
169
-
170
- def cpython_tags(
171
- python_version: Optional[PythonVersion] = None,
172
- abis: Optional[Iterable[str]] = None,
173
- platforms: Optional[Iterable[str]] = None,
174
- *,
175
- warn: bool = False,
176
- ) -> Iterator[Tag]:
177
- """
178
- Yields the tags for a CPython interpreter.
179
-
180
- The tags consist of:
181
- - cp<python_version>-<abi>-<platform>
182
- - cp<python_version>-abi3-<platform>
183
- - cp<python_version>-none-<platform>
184
- - cp<less than python_version>-abi3-<platform> # Older Python versions down to 3.2.
185
-
186
- If python_version only specifies a major version then user-provided ABIs and
187
- the 'none' ABItag will be used.
188
-
189
- If 'abi3' or 'none' are specified in 'abis' then they will be yielded at
190
- their normal position and not at the beginning.
191
- """
192
- if not python_version:
193
- python_version = sys.version_info[:2]
194
-
195
- interpreter = f"cp{_version_nodot(python_version[:2])}"
196
-
197
- if abis is None:
198
- if len(python_version) > 1:
199
- abis = _cpython_abis(python_version, warn)
200
- else:
201
- abis = []
202
- abis = list(abis)
203
- # 'abi3' and 'none' are explicitly handled later.
204
- for explicit_abi in ("abi3", "none"):
205
- try:
206
- abis.remove(explicit_abi)
207
- except ValueError:
208
- pass
209
-
210
- platforms = list(platforms or platform_tags())
211
- for abi in abis:
212
- for platform_ in platforms:
213
- yield Tag(interpreter, abi, platform_)
214
- if _abi3_applies(python_version):
215
- yield from (Tag(interpreter, "abi3", platform_) for platform_ in platforms)
216
- yield from (Tag(interpreter, "none", platform_) for platform_ in platforms)
217
-
218
- if _abi3_applies(python_version):
219
- for minor_version in range(python_version[1] - 1, 1, -1):
220
- for platform_ in platforms:
221
- interpreter = "cp{version}".format(
222
- version=_version_nodot((python_version[0], minor_version))
223
- )
224
- yield Tag(interpreter, "abi3", platform_)
225
-
226
-
227
- def _generic_abi() -> Iterator[str]:
228
- abi = sysconfig.get_config_var("SOABI")
229
- if abi:
230
- yield _normalize_string(abi)
231
-
232
-
233
- def generic_tags(
234
- interpreter: Optional[str] = None,
235
- abis: Optional[Iterable[str]] = None,
236
- platforms: Optional[Iterable[str]] = None,
237
- *,
238
- warn: bool = False,
239
- ) -> Iterator[Tag]:
240
- """
241
- Yields the tags for a generic interpreter.
242
-
243
- The tags consist of:
244
- - <interpreter>-<abi>-<platform>
245
-
246
- The "none" ABI will be added if it was not explicitly provided.
247
- """
248
- if not interpreter:
249
- interp_name = interpreter_name()
250
- interp_version = interpreter_version(warn=warn)
251
- interpreter = "".join([interp_name, interp_version])
252
- if abis is None:
253
- abis = _generic_abi()
254
- platforms = list(platforms or platform_tags())
255
- abis = list(abis)
256
- if "none" not in abis:
257
- abis.append("none")
258
- for abi in abis:
259
- for platform_ in platforms:
260
- yield Tag(interpreter, abi, platform_)
261
-
262
-
263
- def _py_interpreter_range(py_version: PythonVersion) -> Iterator[str]:
264
- """
265
- Yields Python versions in descending order.
266
-
267
- After the latest version, the major-only version will be yielded, and then
268
- all previous versions of that major version.
269
- """
270
- if len(py_version) > 1:
271
- yield f"py{_version_nodot(py_version[:2])}"
272
- yield f"py{py_version[0]}"
273
- if len(py_version) > 1:
274
- for minor in range(py_version[1] - 1, -1, -1):
275
- yield f"py{_version_nodot((py_version[0], minor))}"
276
-
277
-
278
- def compatible_tags(
279
- python_version: Optional[PythonVersion] = None,
280
- interpreter: Optional[str] = None,
281
- platforms: Optional[Iterable[str]] = None,
282
- ) -> Iterator[Tag]:
283
- """
284
- Yields the sequence of tags that are compatible with a specific version of Python.
285
-
286
- The tags consist of:
287
- - py*-none-<platform>
288
- - <interpreter>-none-any # ... if `interpreter` is provided.
289
- - py*-none-any
290
- """
291
- if not python_version:
292
- python_version = sys.version_info[:2]
293
- platforms = list(platforms or platform_tags())
294
- for version in _py_interpreter_range(python_version):
295
- for platform_ in platforms:
296
- yield Tag(version, "none", platform_)
297
- if interpreter:
298
- yield Tag(interpreter, "none", "any")
299
- for version in _py_interpreter_range(python_version):
300
- yield Tag(version, "none", "any")
301
-
302
-
303
- def _mac_arch(arch: str, is_32bit: bool = _32_BIT_INTERPRETER) -> str:
304
- if not is_32bit:
305
- return arch
306
-
307
- if arch.startswith("ppc"):
308
- return "ppc"
309
-
310
- return "i386"
311
-
312
-
313
- def _mac_binary_formats(version: MacVersion, cpu_arch: str) -> List[str]:
314
- formats = [cpu_arch]
315
- if cpu_arch == "x86_64":
316
- if version < (10, 4):
317
- return []
318
- formats.extend(["intel", "fat64", "fat32"])
319
-
320
- elif cpu_arch == "i386":
321
- if version < (10, 4):
322
- return []
323
- formats.extend(["intel", "fat32", "fat"])
324
-
325
- elif cpu_arch == "ppc64":
326
- # TODO: Need to care about 32-bit PPC for ppc64 through 10.2?
327
- if version > (10, 5) or version < (10, 4):
328
- return []
329
- formats.append("fat64")
330
-
331
- elif cpu_arch == "ppc":
332
- if version > (10, 6):
333
- return []
334
- formats.extend(["fat32", "fat"])
335
-
336
- if cpu_arch in {"arm64", "x86_64"}:
337
- formats.append("universal2")
338
-
339
- if cpu_arch in {"x86_64", "i386", "ppc64", "ppc", "intel"}:
340
- formats.append("universal")
341
-
342
- return formats
343
-
344
-
345
- def mac_platforms(
346
- version: Optional[MacVersion] = None, arch: Optional[str] = None
347
- ) -> Iterator[str]:
348
- """
349
- Yields the platform tags for a macOS system.
350
-
351
- The `version` parameter is a two-item tuple specifying the macOS version to
352
- generate platform tags for. The `arch` parameter is the CPU architecture to
353
- generate platform tags for. Both parameters default to the appropriate value
354
- for the current system.
355
- """
356
- version_str, _, cpu_arch = platform.mac_ver()
357
- if version is None:
358
- version = cast("MacVersion", tuple(map(int, version_str.split(".")[:2])))
359
- else:
360
- version = version
361
- if arch is None:
362
- arch = _mac_arch(cpu_arch)
363
- else:
364
- arch = arch
365
-
366
- if (10, 0) <= version and version < (11, 0):
367
- # Prior to Mac OS 11, each yearly release of Mac OS bumped the
368
- # "minor" version number. The major version was always 10.
369
- for minor_version in range(version[1], -1, -1):
370
- compat_version = 10, minor_version
371
- binary_formats = _mac_binary_formats(compat_version, arch)
372
- for binary_format in binary_formats:
373
- yield "macosx_{major}_{minor}_{binary_format}".format(
374
- major=10, minor=minor_version, binary_format=binary_format
375
- )
376
-
377
- if version >= (11, 0):
378
- # Starting with Mac OS 11, each yearly release bumps the major version
379
- # number. The minor versions are now the midyear updates.
380
- for major_version in range(version[0], 10, -1):
381
- compat_version = major_version, 0
382
- binary_formats = _mac_binary_formats(compat_version, arch)
383
- for binary_format in binary_formats:
384
- yield "macosx_{major}_{minor}_{binary_format}".format(
385
- major=major_version, minor=0, binary_format=binary_format
386
- )
387
-
388
- if version >= (11, 0):
389
- # Mac OS 11 on x86_64 is compatible with binaries from previous releases.
390
- # Arm64 support was introduced in 11.0, so no Arm binaries from previous
391
- # releases exist.
392
- #
393
- # However, the "universal2" binary format can have a
394
- # macOS version earlier than 11.0 when the x86_64 part of the binary supports
395
- # that version of macOS.
396
- if arch == "x86_64":
397
- for minor_version in range(16, 3, -1):
398
- compat_version = 10, minor_version
399
- binary_formats = _mac_binary_formats(compat_version, arch)
400
- for binary_format in binary_formats:
401
- yield "macosx_{major}_{minor}_{binary_format}".format(
402
- major=compat_version[0],
403
- minor=compat_version[1],
404
- binary_format=binary_format,
405
- )
406
- else:
407
- for minor_version in range(16, 3, -1):
408
- compat_version = 10, minor_version
409
- binary_format = "universal2"
410
- yield "macosx_{major}_{minor}_{binary_format}".format(
411
- major=compat_version[0],
412
- minor=compat_version[1],
413
- binary_format=binary_format,
414
- )
415
-
416
-
417
- def _linux_platforms(is_32bit: bool = _32_BIT_INTERPRETER) -> Iterator[str]:
418
- linux = _normalize_string(sysconfig.get_platform())
419
- if is_32bit:
420
- if linux == "linux_x86_64":
421
- linux = "linux_i686"
422
- elif linux == "linux_aarch64":
423
- linux = "linux_armv7l"
424
- _, arch = linux.split("_", 1)
425
- yield from _manylinux.platform_tags(linux, arch)
426
- yield from _musllinux.platform_tags(arch)
427
- yield linux
428
-
429
-
430
- def _generic_platforms() -> Iterator[str]:
431
- yield _normalize_string(sysconfig.get_platform())
432
-
433
-
434
- def platform_tags() -> Iterator[str]:
435
- """
436
- Provides the platform tags for this installation.
437
- """
438
- if platform.system() == "Darwin":
439
- return mac_platforms()
440
- elif platform.system() == "Linux":
441
- return _linux_platforms()
442
- else:
443
- return _generic_platforms()
444
-
445
-
446
- def interpreter_name() -> str:
447
- """
448
- Returns the name of the running interpreter.
449
- """
450
- name = sys.implementation.name
451
- return INTERPRETER_SHORT_NAMES.get(name) or name
452
-
453
-
454
- def interpreter_version(*, warn: bool = False) -> str:
455
- """
456
- Returns the version of the running interpreter.
457
- """
458
- version = _get_config_var("py_version_nodot", warn=warn)
459
- if version:
460
- version = str(version)
461
- else:
462
- version = _version_nodot(sys.version_info[:2])
463
- return version
464
-
465
-
466
- def _version_nodot(version: PythonVersion) -> str:
467
- return "".join(map(str, version))
468
-
469
-
470
- def sys_tags(*, warn: bool = False) -> Iterator[Tag]:
471
- """
472
- Returns the sequence of tag triples for the running interpreter.
473
-
474
- The order of the sequence corresponds to priority order for the
475
- interpreter, from most to least important.
476
- """
477
-
478
- interp_name = interpreter_name()
479
- if interp_name == "cp":
480
- yield from cpython_tags(warn=warn)
481
- else:
482
- yield from generic_tags()
483
-
484
- if interp_name == "pp":
485
- yield from compatible_tags(interpreter="pp3")
486
- else:
487
- yield from compatible_tags()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/Bingyunhu/hoping/Dockerfile DELETED
@@ -1,34 +0,0 @@
1
- # Build Stage
2
- # 使用 golang:alpine 作为构建阶段的基础镜像
3
- FROM golang:alpine AS builder
4
-
5
- # 添加 git,以便之后能从GitHub克隆项目
6
- RUN apk --no-cache add git
7
-
8
- # 从 GitHub 克隆 go-proxy-bingai 项目到 /workspace/app 目录下
9
- RUN git clone https://github.com/Harry-zklcdc/go-proxy-bingai.git /workspace/app
10
-
11
- # 设置工作目录为之前克隆的项目目录
12
- WORKDIR /workspace/app
13
-
14
- # 编译 go 项目。-ldflags="-s -w" 是为了减少编译后的二进制大小
15
- RUN go build -ldflags="-s -w" -tags netgo -trimpath -o go-proxy-bingai main.go
16
-
17
- # Runtime Stage
18
- # 使用轻量级的 alpine 镜像作为运行时的基础镜像
19
- FROM alpine
20
-
21
- # 设置工作目录
22
- WORKDIR /workspace/app
23
-
24
- # 从构建阶段复制编译后的二进制文件到运行时镜像中
25
- COPY --from=builder /workspace/app/go-proxy-bingai .
26
-
27
- # 设置环境变量,此处为随机字符
28
- ENV Go_Proxy_BingAI_USER_TOKEN_1="kJs8hD92ncMzLaoQWYtX5rG6bE3fZ4iO"
29
-
30
- # 暴露8080端口
31
- EXPOSE 8080
32
-
33
- # 容器启动时运行的命令
34
- CMD ["/workspace/app/go-proxy-bingai"]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/Boadiwaa/Recipes/openai/wandb_logger.py DELETED
@@ -1,299 +0,0 @@
1
- try:
2
- import wandb
3
-
4
- WANDB_AVAILABLE = True
5
- except:
6
- WANDB_AVAILABLE = False
7
-
8
-
9
- if WANDB_AVAILABLE:
10
- import datetime
11
- import io
12
- import json
13
- import re
14
- from pathlib import Path
15
-
16
- import numpy as np
17
- import pandas as pd
18
-
19
- from openai import File, FineTune
20
-
21
-
22
- class WandbLogger:
23
- """
24
- Log fine-tunes to [Weights & Biases](https://wandb.me/openai-docs)
25
- """
26
-
27
- if not WANDB_AVAILABLE:
28
- print("Logging requires wandb to be installed. Run `pip install wandb`.")
29
- else:
30
- _wandb_api = None
31
- _logged_in = False
32
-
33
- @classmethod
34
- def sync(
35
- cls,
36
- id=None,
37
- n_fine_tunes=None,
38
- project="GPT-3",
39
- entity=None,
40
- force=False,
41
- **kwargs_wandb_init,
42
- ):
43
- """
44
- Sync fine-tunes to Weights & Biases.
45
- :param id: The id of the fine-tune (optional)
46
- :param n_fine_tunes: Number of most recent fine-tunes to log when an id is not provided. By default, every fine-tune is synced.
47
- :param project: Name of the project where you're sending runs. By default, it is "GPT-3".
48
- :param entity: Username or team name where you're sending runs. By default, your default entity is used, which is usually your username.
49
- :param force: Forces logging and overwrite existing wandb run of the same fine-tune.
50
- """
51
-
52
- if not WANDB_AVAILABLE:
53
- return
54
-
55
- if id:
56
- fine_tune = FineTune.retrieve(id=id)
57
- fine_tune.pop("events", None)
58
- fine_tunes = [fine_tune]
59
-
60
- else:
61
- # get list of fine_tune to log
62
- fine_tunes = FineTune.list()
63
- if not fine_tunes or fine_tunes.get("data") is None:
64
- print("No fine-tune has been retrieved")
65
- return
66
- fine_tunes = fine_tunes["data"][
67
- -n_fine_tunes if n_fine_tunes is not None else None :
68
- ]
69
-
70
- # log starting from oldest fine_tune
71
- show_individual_warnings = (
72
- False if id is None and n_fine_tunes is None else True
73
- )
74
- fine_tune_logged = [
75
- cls._log_fine_tune(
76
- fine_tune,
77
- project,
78
- entity,
79
- force,
80
- show_individual_warnings,
81
- **kwargs_wandb_init,
82
- )
83
- for fine_tune in fine_tunes
84
- ]
85
-
86
- if not show_individual_warnings and not any(fine_tune_logged):
87
- print("No new successful fine-tunes were found")
88
-
89
- return "🎉 wandb sync completed successfully"
90
-
91
- @classmethod
92
- def _log_fine_tune(
93
- cls,
94
- fine_tune,
95
- project,
96
- entity,
97
- force,
98
- show_individual_warnings,
99
- **kwargs_wandb_init,
100
- ):
101
- fine_tune_id = fine_tune.get("id")
102
- status = fine_tune.get("status")
103
-
104
- # check run completed successfully
105
- if status != "succeeded":
106
- if show_individual_warnings:
107
- print(
108
- f'Fine-tune {fine_tune_id} has the status "{status}" and will not be logged'
109
- )
110
- return
111
-
112
- # check results are present
113
- try:
114
- results_id = fine_tune["result_files"][0]["id"]
115
- results = File.download(id=results_id).decode("utf-8")
116
- except:
117
- if show_individual_warnings:
118
- print(f"Fine-tune {fine_tune_id} has no results and will not be logged")
119
- return
120
-
121
- # check run has not been logged already
122
- run_path = f"{project}/{fine_tune_id}"
123
- if entity is not None:
124
- run_path = f"{entity}/{run_path}"
125
- wandb_run = cls._get_wandb_run(run_path)
126
- if wandb_run:
127
- wandb_status = wandb_run.summary.get("status")
128
- if show_individual_warnings:
129
- if wandb_status == "succeeded":
130
- print(
131
- f"Fine-tune {fine_tune_id} has already been logged successfully at {wandb_run.url}"
132
- )
133
- if not force:
134
- print(
135
- 'Use "--force" in the CLI or "force=True" in python if you want to overwrite previous run'
136
- )
137
- else:
138
- print(
139
- f"A run for fine-tune {fine_tune_id} was previously created but didn't end successfully"
140
- )
141
- if wandb_status != "succeeded" or force:
142
- print(
143
- f"A new wandb run will be created for fine-tune {fine_tune_id} and previous run will be overwritten"
144
- )
145
- if wandb_status == "succeeded" and not force:
146
- return
147
-
148
- # start a wandb run
149
- wandb.init(
150
- job_type="fine-tune",
151
- config=cls._get_config(fine_tune),
152
- project=project,
153
- entity=entity,
154
- name=fine_tune_id,
155
- id=fine_tune_id,
156
- **kwargs_wandb_init,
157
- )
158
-
159
- # log results
160
- df_results = pd.read_csv(io.StringIO(results))
161
- for _, row in df_results.iterrows():
162
- metrics = {k: v for k, v in row.items() if not np.isnan(v)}
163
- step = metrics.pop("step")
164
- if step is not None:
165
- step = int(step)
166
- wandb.log(metrics, step=step)
167
- fine_tuned_model = fine_tune.get("fine_tuned_model")
168
- if fine_tuned_model is not None:
169
- wandb.summary["fine_tuned_model"] = fine_tuned_model
170
-
171
- # training/validation files and fine-tune details
172
- cls._log_artifacts(fine_tune, project, entity)
173
-
174
- # mark run as complete
175
- wandb.summary["status"] = "succeeded"
176
-
177
- wandb.finish()
178
- return True
179
-
180
- @classmethod
181
- def _ensure_logged_in(cls):
182
- if not cls._logged_in:
183
- if wandb.login():
184
- cls._logged_in = True
185
- else:
186
- raise Exception("You need to log in to wandb")
187
-
188
- @classmethod
189
- def _get_wandb_run(cls, run_path):
190
- cls._ensure_logged_in()
191
- try:
192
- if cls._wandb_api is None:
193
- cls._wandb_api = wandb.Api()
194
- return cls._wandb_api.run(run_path)
195
- except Exception:
196
- return None
197
-
198
- @classmethod
199
- def _get_wandb_artifact(cls, artifact_path):
200
- cls._ensure_logged_in()
201
- try:
202
- if cls._wandb_api is None:
203
- cls._wandb_api = wandb.Api()
204
- return cls._wandb_api.artifact(artifact_path)
205
- except Exception:
206
- return None
207
-
208
- @classmethod
209
- def _get_config(cls, fine_tune):
210
- config = dict(fine_tune)
211
- for key in ("training_files", "validation_files", "result_files"):
212
- if config.get(key) and len(config[key]):
213
- config[key] = config[key][0]
214
- if config.get("created_at"):
215
- config["created_at"] = datetime.datetime.fromtimestamp(config["created_at"])
216
- return config
217
-
218
- @classmethod
219
- def _log_artifacts(cls, fine_tune, project, entity):
220
- # training/validation files
221
- training_file = (
222
- fine_tune["training_files"][0]
223
- if fine_tune.get("training_files") and len(fine_tune["training_files"])
224
- else None
225
- )
226
- validation_file = (
227
- fine_tune["validation_files"][0]
228
- if fine_tune.get("validation_files") and len(fine_tune["validation_files"])
229
- else None
230
- )
231
- for file, prefix, artifact_type in (
232
- (training_file, "train", "training_files"),
233
- (validation_file, "valid", "validation_files"),
234
- ):
235
- if file is not None:
236
- cls._log_artifact_inputs(file, prefix, artifact_type, project, entity)
237
-
238
- # fine-tune details
239
- fine_tune_id = fine_tune.get("id")
240
- artifact = wandb.Artifact(
241
- "fine_tune_details",
242
- type="fine_tune_details",
243
- metadata=fine_tune,
244
- )
245
- with artifact.new_file("fine_tune_details.json") as f:
246
- json.dump(fine_tune, f, indent=2)
247
- wandb.run.log_artifact(
248
- artifact,
249
- aliases=["latest", fine_tune_id],
250
- )
251
-
252
- @classmethod
253
- def _log_artifact_inputs(cls, file, prefix, artifact_type, project, entity):
254
- file_id = file["id"]
255
- filename = Path(file["filename"]).name
256
- stem = Path(file["filename"]).stem
257
-
258
- # get input artifact
259
- artifact_name = f"{prefix}-{filename}"
260
- # sanitize name to valid wandb artifact name
261
- artifact_name = re.sub(r"[^a-zA-Z0-9_\-.]", "_", artifact_name)
262
- artifact_alias = file_id
263
- artifact_path = f"{project}/{artifact_name}:{artifact_alias}"
264
- if entity is not None:
265
- artifact_path = f"{entity}/{artifact_path}"
266
- artifact = cls._get_wandb_artifact(artifact_path)
267
-
268
- # create artifact if file not already logged previously
269
- if artifact is None:
270
- # get file content
271
- try:
272
- file_content = File.download(id=file_id).decode("utf-8")
273
- except:
274
- print(
275
- f"File {file_id} could not be retrieved. Make sure you are allowed to download training/validation files"
276
- )
277
- return
278
- artifact = wandb.Artifact(artifact_name, type=artifact_type, metadata=file)
279
- with artifact.new_file(filename, mode="w") as f:
280
- f.write(file_content)
281
-
282
- # create a Table
283
- try:
284
- table, n_items = cls._make_table(file_content)
285
- artifact.add(table, stem)
286
- wandb.config.update({f"n_{prefix}": n_items})
287
- artifact.metadata["items"] = n_items
288
- except:
289
- print(f"File {file_id} could not be read as a valid JSON file")
290
- else:
291
- # log number of items
292
- wandb.config.update({f"n_{prefix}": artifact.metadata.get("items")})
293
-
294
- wandb.run.use_artifact(artifact, aliases=["latest", artifact_alias])
295
-
296
- @classmethod
297
- def _make_table(cls, file_content):
298
- df = pd.read_json(io.StringIO(file_content), orient="records", lines=True)
299
- return wandb.Table(dataframe=df), len(df)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/CVPR/Dual-Key_Backdoor_Attacks/datagen/detectron2/detectron2/export/patcher.py DELETED
@@ -1,153 +0,0 @@
1
- # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
2
-
3
- import contextlib
4
- import mock
5
- import torch
6
-
7
- from detectron2.modeling import poolers
8
- from detectron2.modeling.proposal_generator import rpn
9
- from detectron2.modeling.roi_heads import keypoint_head, mask_head
10
- from detectron2.modeling.roi_heads.fast_rcnn import FastRCNNOutputLayers
11
-
12
- from .c10 import (
13
- Caffe2Compatible,
14
- Caffe2FastRCNNOutputsInference,
15
- Caffe2KeypointRCNNInference,
16
- Caffe2MaskRCNNInference,
17
- Caffe2ROIPooler,
18
- Caffe2RPN,
19
- )
20
-
21
-
22
- class GenericMixin(object):
23
- pass
24
-
25
-
26
- class Caffe2CompatibleConverter(object):
27
- """
28
- A GenericUpdater which implements the `create_from` interface, by modifying
29
- module object and assign it with another class replaceCls.
30
- """
31
-
32
- def __init__(self, replaceCls):
33
- self.replaceCls = replaceCls
34
-
35
- def create_from(self, module):
36
- # update module's class to the new class
37
- assert isinstance(module, torch.nn.Module)
38
- if issubclass(self.replaceCls, GenericMixin):
39
- # replaceCls should act as mixin, create a new class on-the-fly
40
- new_class = type(
41
- "{}MixedWith{}".format(self.replaceCls.__name__, module.__class__.__name__),
42
- (self.replaceCls, module.__class__),
43
- {}, # {"new_method": lambda self: ...},
44
- )
45
- module.__class__ = new_class
46
- else:
47
- # replaceCls is complete class, this allow arbitrary class swap
48
- module.__class__ = self.replaceCls
49
-
50
- # initialize Caffe2Compatible
51
- if isinstance(module, Caffe2Compatible):
52
- module.tensor_mode = False
53
-
54
- return module
55
-
56
-
57
- def patch(model, target, updater, *args, **kwargs):
58
- """
59
- recursively (post-order) update all modules with the target type and its
60
- subclasses, make a initialization/composition/inheritance/... via the
61
- updater.create_from.
62
- """
63
- for name, module in model.named_children():
64
- model._modules[name] = patch(module, target, updater, *args, **kwargs)
65
- if isinstance(model, target):
66
- return updater.create_from(model, *args, **kwargs)
67
- return model
68
-
69
-
70
- def patch_generalized_rcnn(model):
71
- ccc = Caffe2CompatibleConverter
72
- model = patch(model, rpn.RPN, ccc(Caffe2RPN))
73
- model = patch(model, poolers.ROIPooler, ccc(Caffe2ROIPooler))
74
-
75
- return model
76
-
77
-
78
- @contextlib.contextmanager
79
- def mock_fastrcnn_outputs_inference(
80
- tensor_mode, check=True, box_predictor_type=FastRCNNOutputLayers
81
- ):
82
- with mock.patch.object(
83
- box_predictor_type,
84
- "inference",
85
- autospec=True,
86
- side_effect=Caffe2FastRCNNOutputsInference(tensor_mode),
87
- ) as mocked_func:
88
- yield
89
- if check:
90
- assert mocked_func.call_count > 0
91
-
92
-
93
- @contextlib.contextmanager
94
- def mock_mask_rcnn_inference(tensor_mode, patched_module, check=True):
95
- with mock.patch(
96
- "{}.mask_rcnn_inference".format(patched_module), side_effect=Caffe2MaskRCNNInference()
97
- ) as mocked_func:
98
- yield
99
- if check:
100
- assert mocked_func.call_count > 0
101
-
102
-
103
- @contextlib.contextmanager
104
- def mock_keypoint_rcnn_inference(tensor_mode, patched_module, use_heatmap_max_keypoint, check=True):
105
- with mock.patch(
106
- "{}.keypoint_rcnn_inference".format(patched_module),
107
- side_effect=Caffe2KeypointRCNNInference(use_heatmap_max_keypoint),
108
- ) as mocked_func:
109
- yield
110
- if check:
111
- assert mocked_func.call_count > 0
112
-
113
-
114
- class ROIHeadsPatcher:
115
- def __init__(self, cfg, heads):
116
- self.heads = heads
117
-
118
- self.use_heatmap_max_keypoint = cfg.EXPORT_CAFFE2.USE_HEATMAP_MAX_KEYPOINT
119
-
120
- @contextlib.contextmanager
121
- def mock_roi_heads(self, tensor_mode=True):
122
- """
123
- Patching several inference functions inside ROIHeads and its subclasses
124
-
125
- Args:
126
- tensor_mode (bool): whether the inputs/outputs are caffe2's tensor
127
- format or not. Default to True.
128
- """
129
- # NOTE: this requries the `keypoint_rcnn_inference` and `mask_rcnn_inference`
130
- # are called inside the same file as BaseXxxHead due to using mock.patch.
131
- kpt_heads_mod = keypoint_head.BaseKeypointRCNNHead.__module__
132
- mask_head_mod = mask_head.BaseMaskRCNNHead.__module__
133
-
134
- mock_ctx_managers = [
135
- mock_fastrcnn_outputs_inference(
136
- tensor_mode=tensor_mode,
137
- check=True,
138
- box_predictor_type=type(self.heads.box_predictor),
139
- )
140
- ]
141
- if getattr(self.heads, "keypoint_on", False):
142
- mock_ctx_managers += [
143
- mock_keypoint_rcnn_inference(
144
- tensor_mode, kpt_heads_mod, self.use_heatmap_max_keypoint
145
- )
146
- ]
147
- if getattr(self.heads, "mask_on", False):
148
- mock_ctx_managers += [mock_mask_rcnn_inference(tensor_mode, mask_head_mod)]
149
-
150
- with contextlib.ExitStack() as stack: # python 3.3+
151
- for mgr in mock_ctx_managers:
152
- stack.enter_context(mgr)
153
- yield
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/CVPR/Dual-Key_Backdoor_Attacks/datagen/detectron2/detectron2/solver/lr_scheduler.py DELETED
@@ -1,116 +0,0 @@
1
- # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
2
- import math
3
- from bisect import bisect_right
4
- from typing import List
5
- import torch
6
-
7
- # NOTE: PyTorch's LR scheduler interface uses names that assume the LR changes
8
- # only on epoch boundaries. We typically use iteration based schedules instead.
9
- # As a result, "epoch" (e.g., as in self.last_epoch) should be understood to mean
10
- # "iteration" instead.
11
-
12
- # FIXME: ideally this would be achieved with a CombinedLRScheduler, separating
13
- # MultiStepLR with WarmupLR but the current LRScheduler design doesn't allow it.
14
-
15
-
16
- class WarmupMultiStepLR(torch.optim.lr_scheduler._LRScheduler):
17
- def __init__(
18
- self,
19
- optimizer: torch.optim.Optimizer,
20
- milestones: List[int],
21
- gamma: float = 0.1,
22
- warmup_factor: float = 0.001,
23
- warmup_iters: int = 1000,
24
- warmup_method: str = "linear",
25
- last_epoch: int = -1,
26
- ):
27
- if not list(milestones) == sorted(milestones):
28
- raise ValueError(
29
- "Milestones should be a list of" " increasing integers. Got {}", milestones
30
- )
31
- self.milestones = milestones
32
- self.gamma = gamma
33
- self.warmup_factor = warmup_factor
34
- self.warmup_iters = warmup_iters
35
- self.warmup_method = warmup_method
36
- super().__init__(optimizer, last_epoch)
37
-
38
- def get_lr(self) -> List[float]:
39
- warmup_factor = _get_warmup_factor_at_iter(
40
- self.warmup_method, self.last_epoch, self.warmup_iters, self.warmup_factor
41
- )
42
- return [
43
- base_lr * warmup_factor * self.gamma ** bisect_right(self.milestones, self.last_epoch)
44
- for base_lr in self.base_lrs
45
- ]
46
-
47
- def _compute_values(self) -> List[float]:
48
- # The new interface
49
- return self.get_lr()
50
-
51
-
52
- class WarmupCosineLR(torch.optim.lr_scheduler._LRScheduler):
53
- def __init__(
54
- self,
55
- optimizer: torch.optim.Optimizer,
56
- max_iters: int,
57
- warmup_factor: float = 0.001,
58
- warmup_iters: int = 1000,
59
- warmup_method: str = "linear",
60
- last_epoch: int = -1,
61
- ):
62
- self.max_iters = max_iters
63
- self.warmup_factor = warmup_factor
64
- self.warmup_iters = warmup_iters
65
- self.warmup_method = warmup_method
66
- super().__init__(optimizer, last_epoch)
67
-
68
- def get_lr(self) -> List[float]:
69
- warmup_factor = _get_warmup_factor_at_iter(
70
- self.warmup_method, self.last_epoch, self.warmup_iters, self.warmup_factor
71
- )
72
- # Different definitions of half-cosine with warmup are possible. For
73
- # simplicity we multiply the standard half-cosine schedule by the warmup
74
- # factor. An alternative is to start the period of the cosine at warmup_iters
75
- # instead of at 0. In the case that warmup_iters << max_iters the two are
76
- # very close to each other.
77
- return [
78
- base_lr
79
- * warmup_factor
80
- * 0.5
81
- * (1.0 + math.cos(math.pi * self.last_epoch / self.max_iters))
82
- for base_lr in self.base_lrs
83
- ]
84
-
85
- def _compute_values(self) -> List[float]:
86
- # The new interface
87
- return self.get_lr()
88
-
89
-
90
- def _get_warmup_factor_at_iter(
91
- method: str, iter: int, warmup_iters: int, warmup_factor: float
92
- ) -> float:
93
- """
94
- Return the learning rate warmup factor at a specific iteration.
95
- See https://arxiv.org/abs/1706.02677 for more details.
96
-
97
- Args:
98
- method (str): warmup method; either "constant" or "linear".
99
- iter (int): iteration at which to calculate the warmup factor.
100
- warmup_iters (int): the number of warmup iterations.
101
- warmup_factor (float): the base warmup factor (the meaning changes according
102
- to the method used).
103
-
104
- Returns:
105
- float: the effective warmup factor at the given iteration.
106
- """
107
- if iter >= warmup_iters:
108
- return 1.0
109
-
110
- if method == "constant":
111
- return warmup_factor
112
- elif method == "linear":
113
- alpha = iter / warmup_iters
114
- return warmup_factor * (1 - alpha) + alpha
115
- else:
116
- raise ValueError("Unknown warmup method: {}".format(method))
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/CVPR/LIVE/thrust/testing/unittest/exceptions.h DELETED
@@ -1,56 +0,0 @@
1
- #pragma once
2
-
3
- #include <string>
4
- #include <iostream>
5
- #include <sstream>
6
-
7
- namespace unittest
8
- {
9
-
10
- class UnitTestException
11
- {
12
- public:
13
- std::string message;
14
-
15
- UnitTestException() {}
16
- UnitTestException(const std::string& msg) : message(msg) {}
17
-
18
- friend std::ostream& operator<<(std::ostream& os, const UnitTestException& e)
19
- {
20
- return os << e.message;
21
- }
22
-
23
- template <typename T>
24
- UnitTestException& operator<<(const T& t)
25
- {
26
- std::ostringstream oss;
27
- oss << t;
28
- message += oss.str();
29
- return *this;
30
- }
31
- };
32
-
33
-
34
- class UnitTestError : public UnitTestException
35
- {
36
- public:
37
- UnitTestError() {}
38
- UnitTestError(const std::string& msg) : UnitTestException(msg) {}
39
- };
40
-
41
- class UnitTestFailure : public UnitTestException
42
- {
43
- public:
44
- UnitTestFailure() {}
45
- UnitTestFailure(const std::string& msg) : UnitTestException(msg) {}
46
- };
47
-
48
- class UnitTestKnownFailure : public UnitTestException
49
- {
50
- public:
51
- UnitTestKnownFailure() {}
52
- UnitTestKnownFailure(const std::string& msg) : UnitTestException(msg) {}
53
- };
54
-
55
-
56
- }; //end namespace unittest
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/CVPR/LIVE/thrust/thrust/system/detail/sequential/sequence.h DELETED
@@ -1,22 +0,0 @@
1
- /*
2
- * Copyright 2008-2013 NVIDIA Corporation
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * http://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
15
- */
16
-
17
- #pragma once
18
-
19
- #include <thrust/detail/config.h>
20
-
21
- // this system has no special sequence functions
22
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/CVPR/WALT/mmdet/core/bbox/samplers/combined_sampler.py DELETED
@@ -1,20 +0,0 @@
1
- from ..builder import BBOX_SAMPLERS, build_sampler
2
- from .base_sampler import BaseSampler
3
-
4
-
5
- @BBOX_SAMPLERS.register_module()
6
- class CombinedSampler(BaseSampler):
7
- """A sampler that combines positive sampler and negative sampler."""
8
-
9
- def __init__(self, pos_sampler, neg_sampler, **kwargs):
10
- super(CombinedSampler, self).__init__(**kwargs)
11
- self.pos_sampler = build_sampler(pos_sampler, **kwargs)
12
- self.neg_sampler = build_sampler(neg_sampler, **kwargs)
13
-
14
- def _sample_pos(self, **kwargs):
15
- """Sample positive samples."""
16
- raise NotImplementedError
17
-
18
- def _sample_neg(self, **kwargs):
19
- """Sample negative samples."""
20
- raise NotImplementedError
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/CVPR/WALT/mmdet/datasets/pipelines/auto_augment.py DELETED
@@ -1,890 +0,0 @@
1
- import copy
2
-
3
- import cv2
4
- import mmcv
5
- import numpy as np
6
-
7
- from ..builder import PIPELINES
8
- from .compose import Compose
9
-
10
- _MAX_LEVEL = 10
11
-
12
-
13
- def level_to_value(level, max_value):
14
- """Map from level to values based on max_value."""
15
- return (level / _MAX_LEVEL) * max_value
16
-
17
-
18
- def enhance_level_to_value(level, a=1.8, b=0.1):
19
- """Map from level to values."""
20
- return (level / _MAX_LEVEL) * a + b
21
-
22
-
23
- def random_negative(value, random_negative_prob):
24
- """Randomly negate value based on random_negative_prob."""
25
- return -value if np.random.rand() < random_negative_prob else value
26
-
27
-
28
- def bbox2fields():
29
- """The key correspondence from bboxes to labels, masks and
30
- segmentations."""
31
- bbox2label = {
32
- 'gt_bboxes': 'gt_labels',
33
- 'gt_bboxes_ignore': 'gt_labels_ignore'
34
- }
35
- bbox2mask = {
36
- 'gt_bboxes': 'gt_masks',
37
- 'gt_bboxes_ignore': 'gt_masks_ignore'
38
- }
39
- bbox2seg = {
40
- 'gt_bboxes': 'gt_semantic_seg',
41
- }
42
- return bbox2label, bbox2mask, bbox2seg
43
-
44
-
45
- @PIPELINES.register_module()
46
- class AutoAugment(object):
47
- """Auto augmentation.
48
-
49
- This data augmentation is proposed in `Learning Data Augmentation
50
- Strategies for Object Detection <https://arxiv.org/pdf/1906.11172>`_.
51
-
52
- TODO: Implement 'Shear', 'Sharpness' and 'Rotate' transforms
53
-
54
- Args:
55
- policies (list[list[dict]]): The policies of auto augmentation. Each
56
- policy in ``policies`` is a specific augmentation policy, and is
57
- composed by several augmentations (dict). When AutoAugment is
58
- called, a random policy in ``policies`` will be selected to
59
- augment images.
60
-
61
- Examples:
62
- >>> replace = (104, 116, 124)
63
- >>> policies = [
64
- >>> [
65
- >>> dict(type='Sharpness', prob=0.0, level=8),
66
- >>> dict(
67
- >>> type='Shear',
68
- >>> prob=0.4,
69
- >>> level=0,
70
- >>> replace=replace,
71
- >>> axis='x')
72
- >>> ],
73
- >>> [
74
- >>> dict(
75
- >>> type='Rotate',
76
- >>> prob=0.6,
77
- >>> level=10,
78
- >>> replace=replace),
79
- >>> dict(type='Color', prob=1.0, level=6)
80
- >>> ]
81
- >>> ]
82
- >>> augmentation = AutoAugment(policies)
83
- >>> img = np.ones(100, 100, 3)
84
- >>> gt_bboxes = np.ones(10, 4)
85
- >>> results = dict(img=img, gt_bboxes=gt_bboxes)
86
- >>> results = augmentation(results)
87
- """
88
-
89
- def __init__(self, policies):
90
- assert isinstance(policies, list) and len(policies) > 0, \
91
- 'Policies must be a non-empty list.'
92
- for policy in policies:
93
- assert isinstance(policy, list) and len(policy) > 0, \
94
- 'Each policy in policies must be a non-empty list.'
95
- for augment in policy:
96
- assert isinstance(augment, dict) and 'type' in augment, \
97
- 'Each specific augmentation must be a dict with key' \
98
- ' "type".'
99
-
100
- self.policies = copy.deepcopy(policies)
101
- self.transforms = [Compose(policy) for policy in self.policies]
102
-
103
- def __call__(self, results):
104
- transform = np.random.choice(self.transforms)
105
- return transform(results)
106
-
107
- def __repr__(self):
108
- return f'{self.__class__.__name__}(policies={self.policies})'
109
-
110
-
111
- @PIPELINES.register_module()
112
- class Shear(object):
113
- """Apply Shear Transformation to image (and its corresponding bbox, mask,
114
- segmentation).
115
-
116
- Args:
117
- level (int | float): The level should be in range [0,_MAX_LEVEL].
118
- img_fill_val (int | float | tuple): The filled values for image border.
119
- If float, the same fill value will be used for all the three
120
- channels of image. If tuple, the should be 3 elements.
121
- seg_ignore_label (int): The fill value used for segmentation map.
122
- Note this value must equals ``ignore_label`` in ``semantic_head``
123
- of the corresponding config. Default 255.
124
- prob (float): The probability for performing Shear and should be in
125
- range [0, 1].
126
- direction (str): The direction for shear, either "horizontal"
127
- or "vertical".
128
- max_shear_magnitude (float): The maximum magnitude for Shear
129
- transformation.
130
- random_negative_prob (float): The probability that turns the
131
- offset negative. Should be in range [0,1]
132
- interpolation (str): Same as in :func:`mmcv.imshear`.
133
- """
134
-
135
- def __init__(self,
136
- level,
137
- img_fill_val=128,
138
- seg_ignore_label=255,
139
- prob=0.5,
140
- direction='horizontal',
141
- max_shear_magnitude=0.3,
142
- random_negative_prob=0.5,
143
- interpolation='bilinear'):
144
- assert isinstance(level, (int, float)), 'The level must be type ' \
145
- f'int or float, got {type(level)}.'
146
- assert 0 <= level <= _MAX_LEVEL, 'The level should be in range ' \
147
- f'[0,{_MAX_LEVEL}], got {level}.'
148
- if isinstance(img_fill_val, (float, int)):
149
- img_fill_val = tuple([float(img_fill_val)] * 3)
150
- elif isinstance(img_fill_val, tuple):
151
- assert len(img_fill_val) == 3, 'img_fill_val as tuple must ' \
152
- f'have 3 elements. got {len(img_fill_val)}.'
153
- img_fill_val = tuple([float(val) for val in img_fill_val])
154
- else:
155
- raise ValueError(
156
- 'img_fill_val must be float or tuple with 3 elements.')
157
- assert np.all([0 <= val <= 255 for val in img_fill_val]), 'all ' \
158
- 'elements of img_fill_val should between range [0,255].' \
159
- f'got {img_fill_val}.'
160
- assert 0 <= prob <= 1.0, 'The probability of shear should be in ' \
161
- f'range [0,1]. got {prob}.'
162
- assert direction in ('horizontal', 'vertical'), 'direction must ' \
163
- f'in be either "horizontal" or "vertical". got {direction}.'
164
- assert isinstance(max_shear_magnitude, float), 'max_shear_magnitude ' \
165
- f'should be type float. got {type(max_shear_magnitude)}.'
166
- assert 0. <= max_shear_magnitude <= 1., 'Defaultly ' \
167
- 'max_shear_magnitude should be in range [0,1]. ' \
168
- f'got {max_shear_magnitude}.'
169
- self.level = level
170
- self.magnitude = level_to_value(level, max_shear_magnitude)
171
- self.img_fill_val = img_fill_val
172
- self.seg_ignore_label = seg_ignore_label
173
- self.prob = prob
174
- self.direction = direction
175
- self.max_shear_magnitude = max_shear_magnitude
176
- self.random_negative_prob = random_negative_prob
177
- self.interpolation = interpolation
178
-
179
- def _shear_img(self,
180
- results,
181
- magnitude,
182
- direction='horizontal',
183
- interpolation='bilinear'):
184
- """Shear the image.
185
-
186
- Args:
187
- results (dict): Result dict from loading pipeline.
188
- magnitude (int | float): The magnitude used for shear.
189
- direction (str): The direction for shear, either "horizontal"
190
- or "vertical".
191
- interpolation (str): Same as in :func:`mmcv.imshear`.
192
- """
193
- for key in results.get('img_fields', ['img']):
194
- img = results[key]
195
- img_sheared = mmcv.imshear(
196
- img,
197
- magnitude,
198
- direction,
199
- border_value=self.img_fill_val,
200
- interpolation=interpolation)
201
- results[key] = img_sheared.astype(img.dtype)
202
-
203
- def _shear_bboxes(self, results, magnitude):
204
- """Shear the bboxes."""
205
- h, w, c = results['img_shape']
206
- if self.direction == 'horizontal':
207
- shear_matrix = np.stack([[1, magnitude],
208
- [0, 1]]).astype(np.float32) # [2, 2]
209
- else:
210
- shear_matrix = np.stack([[1, 0], [magnitude,
211
- 1]]).astype(np.float32)
212
- for key in results.get('bbox_fields', []):
213
- min_x, min_y, max_x, max_y = np.split(
214
- results[key], results[key].shape[-1], axis=-1)
215
- coordinates = np.stack([[min_x, min_y], [max_x, min_y],
216
- [min_x, max_y],
217
- [max_x, max_y]]) # [4, 2, nb_box, 1]
218
- coordinates = coordinates[..., 0].transpose(
219
- (2, 1, 0)).astype(np.float32) # [nb_box, 2, 4]
220
- new_coords = np.matmul(shear_matrix[None, :, :],
221
- coordinates) # [nb_box, 2, 4]
222
- min_x = np.min(new_coords[:, 0, :], axis=-1)
223
- min_y = np.min(new_coords[:, 1, :], axis=-1)
224
- max_x = np.max(new_coords[:, 0, :], axis=-1)
225
- max_y = np.max(new_coords[:, 1, :], axis=-1)
226
- min_x = np.clip(min_x, a_min=0, a_max=w)
227
- min_y = np.clip(min_y, a_min=0, a_max=h)
228
- max_x = np.clip(max_x, a_min=min_x, a_max=w)
229
- max_y = np.clip(max_y, a_min=min_y, a_max=h)
230
- results[key] = np.stack([min_x, min_y, max_x, max_y],
231
- axis=-1).astype(results[key].dtype)
232
-
233
- def _shear_masks(self,
234
- results,
235
- magnitude,
236
- direction='horizontal',
237
- fill_val=0,
238
- interpolation='bilinear'):
239
- """Shear the masks."""
240
- h, w, c = results['img_shape']
241
- for key in results.get('mask_fields', []):
242
- masks = results[key]
243
- results[key] = masks.shear((h, w),
244
- magnitude,
245
- direction,
246
- border_value=fill_val,
247
- interpolation=interpolation)
248
-
249
- def _shear_seg(self,
250
- results,
251
- magnitude,
252
- direction='horizontal',
253
- fill_val=255,
254
- interpolation='bilinear'):
255
- """Shear the segmentation maps."""
256
- for key in results.get('seg_fields', []):
257
- seg = results[key]
258
- results[key] = mmcv.imshear(
259
- seg,
260
- magnitude,
261
- direction,
262
- border_value=fill_val,
263
- interpolation=interpolation).astype(seg.dtype)
264
-
265
- def _filter_invalid(self, results, min_bbox_size=0):
266
- """Filter bboxes and corresponding masks too small after shear
267
- augmentation."""
268
- bbox2label, bbox2mask, _ = bbox2fields()
269
- for key in results.get('bbox_fields', []):
270
- bbox_w = results[key][:, 2] - results[key][:, 0]
271
- bbox_h = results[key][:, 3] - results[key][:, 1]
272
- valid_inds = (bbox_w > min_bbox_size) & (bbox_h > min_bbox_size)
273
- valid_inds = np.nonzero(valid_inds)[0]
274
- results[key] = results[key][valid_inds]
275
- # label fields. e.g. gt_labels and gt_labels_ignore
276
- label_key = bbox2label.get(key)
277
- if label_key in results:
278
- results[label_key] = results[label_key][valid_inds]
279
- # mask fields, e.g. gt_masks and gt_masks_ignore
280
- mask_key = bbox2mask.get(key)
281
- if mask_key in results:
282
- results[mask_key] = results[mask_key][valid_inds]
283
-
284
- def __call__(self, results):
285
- """Call function to shear images, bounding boxes, masks and semantic
286
- segmentation maps.
287
-
288
- Args:
289
- results (dict): Result dict from loading pipeline.
290
-
291
- Returns:
292
- dict: Sheared results.
293
- """
294
- if np.random.rand() > self.prob:
295
- return results
296
- magnitude = random_negative(self.magnitude, self.random_negative_prob)
297
- self._shear_img(results, magnitude, self.direction, self.interpolation)
298
- self._shear_bboxes(results, magnitude)
299
- # fill_val set to 0 for background of mask.
300
- self._shear_masks(
301
- results,
302
- magnitude,
303
- self.direction,
304
- fill_val=0,
305
- interpolation=self.interpolation)
306
- self._shear_seg(
307
- results,
308
- magnitude,
309
- self.direction,
310
- fill_val=self.seg_ignore_label,
311
- interpolation=self.interpolation)
312
- self._filter_invalid(results)
313
- return results
314
-
315
- def __repr__(self):
316
- repr_str = self.__class__.__name__
317
- repr_str += f'(level={self.level}, '
318
- repr_str += f'img_fill_val={self.img_fill_val}, '
319
- repr_str += f'seg_ignore_label={self.seg_ignore_label}, '
320
- repr_str += f'prob={self.prob}, '
321
- repr_str += f'direction={self.direction}, '
322
- repr_str += f'max_shear_magnitude={self.max_shear_magnitude}, '
323
- repr_str += f'random_negative_prob={self.random_negative_prob}, '
324
- repr_str += f'interpolation={self.interpolation})'
325
- return repr_str
326
-
327
-
328
- @PIPELINES.register_module()
329
- class Rotate(object):
330
- """Apply Rotate Transformation to image (and its corresponding bbox, mask,
331
- segmentation).
332
-
333
- Args:
334
- level (int | float): The level should be in range (0,_MAX_LEVEL].
335
- scale (int | float): Isotropic scale factor. Same in
336
- ``mmcv.imrotate``.
337
- center (int | float | tuple[float]): Center point (w, h) of the
338
- rotation in the source image. If None, the center of the
339
- image will be used. Same in ``mmcv.imrotate``.
340
- img_fill_val (int | float | tuple): The fill value for image border.
341
- If float, the same value will be used for all the three
342
- channels of image. If tuple, the should be 3 elements (e.g.
343
- equals the number of channels for image).
344
- seg_ignore_label (int): The fill value used for segmentation map.
345
- Note this value must equals ``ignore_label`` in ``semantic_head``
346
- of the corresponding config. Default 255.
347
- prob (float): The probability for perform transformation and
348
- should be in range 0 to 1.
349
- max_rotate_angle (int | float): The maximum angles for rotate
350
- transformation.
351
- random_negative_prob (float): The probability that turns the
352
- offset negative.
353
- """
354
-
355
- def __init__(self,
356
- level,
357
- scale=1,
358
- center=None,
359
- img_fill_val=128,
360
- seg_ignore_label=255,
361
- prob=0.5,
362
- max_rotate_angle=30,
363
- random_negative_prob=0.5):
364
- assert isinstance(level, (int, float)), \
365
- f'The level must be type int or float. got {type(level)}.'
366
- assert 0 <= level <= _MAX_LEVEL, \
367
- f'The level should be in range (0,{_MAX_LEVEL}]. got {level}.'
368
- assert isinstance(scale, (int, float)), \
369
- f'The scale must be type int or float. got type {type(scale)}.'
370
- if isinstance(center, (int, float)):
371
- center = (center, center)
372
- elif isinstance(center, tuple):
373
- assert len(center) == 2, 'center with type tuple must have '\
374
- f'2 elements. got {len(center)} elements.'
375
- else:
376
- assert center is None, 'center must be None or type int, '\
377
- f'float or tuple, got type {type(center)}.'
378
- if isinstance(img_fill_val, (float, int)):
379
- img_fill_val = tuple([float(img_fill_val)] * 3)
380
- elif isinstance(img_fill_val, tuple):
381
- assert len(img_fill_val) == 3, 'img_fill_val as tuple must '\
382
- f'have 3 elements. got {len(img_fill_val)}.'
383
- img_fill_val = tuple([float(val) for val in img_fill_val])
384
- else:
385
- raise ValueError(
386
- 'img_fill_val must be float or tuple with 3 elements.')
387
- assert np.all([0 <= val <= 255 for val in img_fill_val]), \
388
- 'all elements of img_fill_val should between range [0,255]. '\
389
- f'got {img_fill_val}.'
390
- assert 0 <= prob <= 1.0, 'The probability should be in range [0,1]. '\
391
- 'got {prob}.'
392
- assert isinstance(max_rotate_angle, (int, float)), 'max_rotate_angle '\
393
- f'should be type int or float. got type {type(max_rotate_angle)}.'
394
- self.level = level
395
- self.scale = scale
396
- # Rotation angle in degrees. Positive values mean
397
- # clockwise rotation.
398
- self.angle = level_to_value(level, max_rotate_angle)
399
- self.center = center
400
- self.img_fill_val = img_fill_val
401
- self.seg_ignore_label = seg_ignore_label
402
- self.prob = prob
403
- self.max_rotate_angle = max_rotate_angle
404
- self.random_negative_prob = random_negative_prob
405
-
406
- def _rotate_img(self, results, angle, center=None, scale=1.0):
407
- """Rotate the image.
408
-
409
- Args:
410
- results (dict): Result dict from loading pipeline.
411
- angle (float): Rotation angle in degrees, positive values
412
- mean clockwise rotation. Same in ``mmcv.imrotate``.
413
- center (tuple[float], optional): Center point (w, h) of the
414
- rotation. Same in ``mmcv.imrotate``.
415
- scale (int | float): Isotropic scale factor. Same in
416
- ``mmcv.imrotate``.
417
- """
418
- for key in results.get('img_fields', ['img']):
419
- img = results[key].copy()
420
- img_rotated = mmcv.imrotate(
421
- img, angle, center, scale, border_value=self.img_fill_val)
422
- results[key] = img_rotated.astype(img.dtype)
423
-
424
- def _rotate_bboxes(self, results, rotate_matrix):
425
- """Rotate the bboxes."""
426
- h, w, c = results['img_shape']
427
- for key in results.get('bbox_fields', []):
428
- min_x, min_y, max_x, max_y = np.split(
429
- results[key], results[key].shape[-1], axis=-1)
430
- coordinates = np.stack([[min_x, min_y], [max_x, min_y],
431
- [min_x, max_y],
432
- [max_x, max_y]]) # [4, 2, nb_bbox, 1]
433
- # pad 1 to convert from format [x, y] to homogeneous
434
- # coordinates format [x, y, 1]
435
- coordinates = np.concatenate(
436
- (coordinates,
437
- np.ones((4, 1, coordinates.shape[2], 1), coordinates.dtype)),
438
- axis=1) # [4, 3, nb_bbox, 1]
439
- coordinates = coordinates.transpose(
440
- (2, 0, 1, 3)) # [nb_bbox, 4, 3, 1]
441
- rotated_coords = np.matmul(rotate_matrix,
442
- coordinates) # [nb_bbox, 4, 2, 1]
443
- rotated_coords = rotated_coords[..., 0] # [nb_bbox, 4, 2]
444
- min_x, min_y = np.min(
445
- rotated_coords[:, :, 0], axis=1), np.min(
446
- rotated_coords[:, :, 1], axis=1)
447
- max_x, max_y = np.max(
448
- rotated_coords[:, :, 0], axis=1), np.max(
449
- rotated_coords[:, :, 1], axis=1)
450
- min_x, min_y = np.clip(
451
- min_x, a_min=0, a_max=w), np.clip(
452
- min_y, a_min=0, a_max=h)
453
- max_x, max_y = np.clip(
454
- max_x, a_min=min_x, a_max=w), np.clip(
455
- max_y, a_min=min_y, a_max=h)
456
- results[key] = np.stack([min_x, min_y, max_x, max_y],
457
- axis=-1).astype(results[key].dtype)
458
-
459
- def _rotate_masks(self,
460
- results,
461
- angle,
462
- center=None,
463
- scale=1.0,
464
- fill_val=0):
465
- """Rotate the masks."""
466
- h, w, c = results['img_shape']
467
- for key in results.get('mask_fields', []):
468
- masks = results[key]
469
- results[key] = masks.rotate((h, w), angle, center, scale, fill_val)
470
-
471
- def _rotate_seg(self,
472
- results,
473
- angle,
474
- center=None,
475
- scale=1.0,
476
- fill_val=255):
477
- """Rotate the segmentation map."""
478
- for key in results.get('seg_fields', []):
479
- seg = results[key].copy()
480
- results[key] = mmcv.imrotate(
481
- seg, angle, center, scale,
482
- border_value=fill_val).astype(seg.dtype)
483
-
484
- def _filter_invalid(self, results, min_bbox_size=0):
485
- """Filter bboxes and corresponding masks too small after rotate
486
- augmentation."""
487
- bbox2label, bbox2mask, _ = bbox2fields()
488
- for key in results.get('bbox_fields', []):
489
- bbox_w = results[key][:, 2] - results[key][:, 0]
490
- bbox_h = results[key][:, 3] - results[key][:, 1]
491
- valid_inds = (bbox_w > min_bbox_size) & (bbox_h > min_bbox_size)
492
- valid_inds = np.nonzero(valid_inds)[0]
493
- results[key] = results[key][valid_inds]
494
- # label fields. e.g. gt_labels and gt_labels_ignore
495
- label_key = bbox2label.get(key)
496
- if label_key in results:
497
- results[label_key] = results[label_key][valid_inds]
498
- # mask fields, e.g. gt_masks and gt_masks_ignore
499
- mask_key = bbox2mask.get(key)
500
- if mask_key in results:
501
- results[mask_key] = results[mask_key][valid_inds]
502
-
503
- def __call__(self, results):
504
- """Call function to rotate images, bounding boxes, masks and semantic
505
- segmentation maps.
506
-
507
- Args:
508
- results (dict): Result dict from loading pipeline.
509
-
510
- Returns:
511
- dict: Rotated results.
512
- """
513
- if np.random.rand() > self.prob:
514
- return results
515
- h, w = results['img'].shape[:2]
516
- center = self.center
517
- if center is None:
518
- center = ((w - 1) * 0.5, (h - 1) * 0.5)
519
- angle = random_negative(self.angle, self.random_negative_prob)
520
- self._rotate_img(results, angle, center, self.scale)
521
- rotate_matrix = cv2.getRotationMatrix2D(center, -angle, self.scale)
522
- self._rotate_bboxes(results, rotate_matrix)
523
- self._rotate_masks(results, angle, center, self.scale, fill_val=0)
524
- self._rotate_seg(
525
- results, angle, center, self.scale, fill_val=self.seg_ignore_label)
526
- self._filter_invalid(results)
527
- return results
528
-
529
- def __repr__(self):
530
- repr_str = self.__class__.__name__
531
- repr_str += f'(level={self.level}, '
532
- repr_str += f'scale={self.scale}, '
533
- repr_str += f'center={self.center}, '
534
- repr_str += f'img_fill_val={self.img_fill_val}, '
535
- repr_str += f'seg_ignore_label={self.seg_ignore_label}, '
536
- repr_str += f'prob={self.prob}, '
537
- repr_str += f'max_rotate_angle={self.max_rotate_angle}, '
538
- repr_str += f'random_negative_prob={self.random_negative_prob})'
539
- return repr_str
540
-
541
-
542
- @PIPELINES.register_module()
543
- class Translate(object):
544
- """Translate the images, bboxes, masks and segmentation maps horizontally
545
- or vertically.
546
-
547
- Args:
548
- level (int | float): The level for Translate and should be in
549
- range [0,_MAX_LEVEL].
550
- prob (float): The probability for performing translation and
551
- should be in range [0, 1].
552
- img_fill_val (int | float | tuple): The filled value for image
553
- border. If float, the same fill value will be used for all
554
- the three channels of image. If tuple, the should be 3
555
- elements (e.g. equals the number of channels for image).
556
- seg_ignore_label (int): The fill value used for segmentation map.
557
- Note this value must equals ``ignore_label`` in ``semantic_head``
558
- of the corresponding config. Default 255.
559
- direction (str): The translate direction, either "horizontal"
560
- or "vertical".
561
- max_translate_offset (int | float): The maximum pixel's offset for
562
- Translate.
563
- random_negative_prob (float): The probability that turns the
564
- offset negative.
565
- min_size (int | float): The minimum pixel for filtering
566
- invalid bboxes after the translation.
567
- """
568
-
569
- def __init__(self,
570
- level,
571
- prob=0.5,
572
- img_fill_val=128,
573
- seg_ignore_label=255,
574
- direction='horizontal',
575
- max_translate_offset=250.,
576
- random_negative_prob=0.5,
577
- min_size=0):
578
- assert isinstance(level, (int, float)), \
579
- 'The level must be type int or float.'
580
- assert 0 <= level <= _MAX_LEVEL, \
581
- 'The level used for calculating Translate\'s offset should be ' \
582
- 'in range [0,_MAX_LEVEL]'
583
- assert 0 <= prob <= 1.0, \
584
- 'The probability of translation should be in range [0, 1].'
585
- if isinstance(img_fill_val, (float, int)):
586
- img_fill_val = tuple([float(img_fill_val)] * 3)
587
- elif isinstance(img_fill_val, tuple):
588
- assert len(img_fill_val) == 3, \
589
- 'img_fill_val as tuple must have 3 elements.'
590
- img_fill_val = tuple([float(val) for val in img_fill_val])
591
- else:
592
- raise ValueError('img_fill_val must be type float or tuple.')
593
- assert np.all([0 <= val <= 255 for val in img_fill_val]), \
594
- 'all elements of img_fill_val should between range [0,255].'
595
- assert direction in ('horizontal', 'vertical'), \
596
- 'direction should be "horizontal" or "vertical".'
597
- assert isinstance(max_translate_offset, (int, float)), \
598
- 'The max_translate_offset must be type int or float.'
599
- # the offset used for translation
600
- self.offset = int(level_to_value(level, max_translate_offset))
601
- self.level = level
602
- self.prob = prob
603
- self.img_fill_val = img_fill_val
604
- self.seg_ignore_label = seg_ignore_label
605
- self.direction = direction
606
- self.max_translate_offset = max_translate_offset
607
- self.random_negative_prob = random_negative_prob
608
- self.min_size = min_size
609
-
610
- def _translate_img(self, results, offset, direction='horizontal'):
611
- """Translate the image.
612
-
613
- Args:
614
- results (dict): Result dict from loading pipeline.
615
- offset (int | float): The offset for translate.
616
- direction (str): The translate direction, either "horizontal"
617
- or "vertical".
618
- """
619
- for key in results.get('img_fields', ['img']):
620
- img = results[key].copy()
621
- results[key] = mmcv.imtranslate(
622
- img, offset, direction, self.img_fill_val).astype(img.dtype)
623
-
624
- def _translate_bboxes(self, results, offset):
625
- """Shift bboxes horizontally or vertically, according to offset."""
626
- h, w, c = results['img_shape']
627
- for key in results.get('bbox_fields', []):
628
- min_x, min_y, max_x, max_y = np.split(
629
- results[key], results[key].shape[-1], axis=-1)
630
- if self.direction == 'horizontal':
631
- min_x = np.maximum(0, min_x + offset)
632
- max_x = np.minimum(w, max_x + offset)
633
- elif self.direction == 'vertical':
634
- min_y = np.maximum(0, min_y + offset)
635
- max_y = np.minimum(h, max_y + offset)
636
-
637
- # the boxes translated outside of image will be filtered along with
638
- # the corresponding masks, by invoking ``_filter_invalid``.
639
- results[key] = np.concatenate([min_x, min_y, max_x, max_y],
640
- axis=-1)
641
-
642
- def _translate_masks(self,
643
- results,
644
- offset,
645
- direction='horizontal',
646
- fill_val=0):
647
- """Translate masks horizontally or vertically."""
648
- h, w, c = results['img_shape']
649
- for key in results.get('mask_fields', []):
650
- masks = results[key]
651
- results[key] = masks.translate((h, w), offset, direction, fill_val)
652
-
653
- def _translate_seg(self,
654
- results,
655
- offset,
656
- direction='horizontal',
657
- fill_val=255):
658
- """Translate segmentation maps horizontally or vertically."""
659
- for key in results.get('seg_fields', []):
660
- seg = results[key].copy()
661
- results[key] = mmcv.imtranslate(seg, offset, direction,
662
- fill_val).astype(seg.dtype)
663
-
664
- def _filter_invalid(self, results, min_size=0):
665
- """Filter bboxes and masks too small or translated out of image."""
666
- bbox2label, bbox2mask, _ = bbox2fields()
667
- for key in results.get('bbox_fields', []):
668
- bbox_w = results[key][:, 2] - results[key][:, 0]
669
- bbox_h = results[key][:, 3] - results[key][:, 1]
670
- valid_inds = (bbox_w > min_size) & (bbox_h > min_size)
671
- valid_inds = np.nonzero(valid_inds)[0]
672
- results[key] = results[key][valid_inds]
673
- # label fields. e.g. gt_labels and gt_labels_ignore
674
- label_key = bbox2label.get(key)
675
- if label_key in results:
676
- results[label_key] = results[label_key][valid_inds]
677
- # mask fields, e.g. gt_masks and gt_masks_ignore
678
- mask_key = bbox2mask.get(key)
679
- if mask_key in results:
680
- results[mask_key] = results[mask_key][valid_inds]
681
- return results
682
-
683
- def __call__(self, results):
684
- """Call function to translate images, bounding boxes, masks and
685
- semantic segmentation maps.
686
-
687
- Args:
688
- results (dict): Result dict from loading pipeline.
689
-
690
- Returns:
691
- dict: Translated results.
692
- """
693
- if np.random.rand() > self.prob:
694
- return results
695
- offset = random_negative(self.offset, self.random_negative_prob)
696
- self._translate_img(results, offset, self.direction)
697
- self._translate_bboxes(results, offset)
698
- # fill_val defaultly 0 for BitmapMasks and None for PolygonMasks.
699
- self._translate_masks(results, offset, self.direction)
700
- # fill_val set to ``seg_ignore_label`` for the ignored value
701
- # of segmentation map.
702
- self._translate_seg(
703
- results, offset, self.direction, fill_val=self.seg_ignore_label)
704
- self._filter_invalid(results, min_size=self.min_size)
705
- return results
706
-
707
-
708
- @PIPELINES.register_module()
709
- class ColorTransform(object):
710
- """Apply Color transformation to image. The bboxes, masks, and
711
- segmentations are not modified.
712
-
713
- Args:
714
- level (int | float): Should be in range [0,_MAX_LEVEL].
715
- prob (float): The probability for performing Color transformation.
716
- """
717
-
718
- def __init__(self, level, prob=0.5):
719
- assert isinstance(level, (int, float)), \
720
- 'The level must be type int or float.'
721
- assert 0 <= level <= _MAX_LEVEL, \
722
- 'The level should be in range [0,_MAX_LEVEL].'
723
- assert 0 <= prob <= 1.0, \
724
- 'The probability should be in range [0,1].'
725
- self.level = level
726
- self.prob = prob
727
- self.factor = enhance_level_to_value(level)
728
-
729
- def _adjust_color_img(self, results, factor=1.0):
730
- """Apply Color transformation to image."""
731
- for key in results.get('img_fields', ['img']):
732
- # NOTE defaultly the image should be BGR format
733
- img = results[key]
734
- results[key] = mmcv.adjust_color(img, factor).astype(img.dtype)
735
-
736
- def __call__(self, results):
737
- """Call function for Color transformation.
738
-
739
- Args:
740
- results (dict): Result dict from loading pipeline.
741
-
742
- Returns:
743
- dict: Colored results.
744
- """
745
- if np.random.rand() > self.prob:
746
- return results
747
- self._adjust_color_img(results, self.factor)
748
- return results
749
-
750
- def __repr__(self):
751
- repr_str = self.__class__.__name__
752
- repr_str += f'(level={self.level}, '
753
- repr_str += f'prob={self.prob})'
754
- return repr_str
755
-
756
-
757
- @PIPELINES.register_module()
758
- class EqualizeTransform(object):
759
- """Apply Equalize transformation to image. The bboxes, masks and
760
- segmentations are not modified.
761
-
762
- Args:
763
- prob (float): The probability for performing Equalize transformation.
764
- """
765
-
766
- def __init__(self, prob=0.5):
767
- assert 0 <= prob <= 1.0, \
768
- 'The probability should be in range [0,1].'
769
- self.prob = prob
770
-
771
- def _imequalize(self, results):
772
- """Equalizes the histogram of one image."""
773
- for key in results.get('img_fields', ['img']):
774
- img = results[key]
775
- results[key] = mmcv.imequalize(img).astype(img.dtype)
776
-
777
- def __call__(self, results):
778
- """Call function for Equalize transformation.
779
-
780
- Args:
781
- results (dict): Results dict from loading pipeline.
782
-
783
- Returns:
784
- dict: Results after the transformation.
785
- """
786
- if np.random.rand() > self.prob:
787
- return results
788
- self._imequalize(results)
789
- return results
790
-
791
- def __repr__(self):
792
- repr_str = self.__class__.__name__
793
- repr_str += f'(prob={self.prob})'
794
-
795
-
796
- @PIPELINES.register_module()
797
- class BrightnessTransform(object):
798
- """Apply Brightness transformation to image. The bboxes, masks and
799
- segmentations are not modified.
800
-
801
- Args:
802
- level (int | float): Should be in range [0,_MAX_LEVEL].
803
- prob (float): The probability for performing Brightness transformation.
804
- """
805
-
806
- def __init__(self, level, prob=0.5):
807
- assert isinstance(level, (int, float)), \
808
- 'The level must be type int or float.'
809
- assert 0 <= level <= _MAX_LEVEL, \
810
- 'The level should be in range [0,_MAX_LEVEL].'
811
- assert 0 <= prob <= 1.0, \
812
- 'The probability should be in range [0,1].'
813
- self.level = level
814
- self.prob = prob
815
- self.factor = enhance_level_to_value(level)
816
-
817
- def _adjust_brightness_img(self, results, factor=1.0):
818
- """Adjust the brightness of image."""
819
- for key in results.get('img_fields', ['img']):
820
- img = results[key]
821
- results[key] = mmcv.adjust_brightness(img,
822
- factor).astype(img.dtype)
823
-
824
- def __call__(self, results):
825
- """Call function for Brightness transformation.
826
-
827
- Args:
828
- results (dict): Results dict from loading pipeline.
829
-
830
- Returns:
831
- dict: Results after the transformation.
832
- """
833
- if np.random.rand() > self.prob:
834
- return results
835
- self._adjust_brightness_img(results, self.factor)
836
- return results
837
-
838
- def __repr__(self):
839
- repr_str = self.__class__.__name__
840
- repr_str += f'(level={self.level}, '
841
- repr_str += f'prob={self.prob})'
842
- return repr_str
843
-
844
-
845
- @PIPELINES.register_module()
846
- class ContrastTransform(object):
847
- """Apply Contrast transformation to image. The bboxes, masks and
848
- segmentations are not modified.
849
-
850
- Args:
851
- level (int | float): Should be in range [0,_MAX_LEVEL].
852
- prob (float): The probability for performing Contrast transformation.
853
- """
854
-
855
- def __init__(self, level, prob=0.5):
856
- assert isinstance(level, (int, float)), \
857
- 'The level must be type int or float.'
858
- assert 0 <= level <= _MAX_LEVEL, \
859
- 'The level should be in range [0,_MAX_LEVEL].'
860
- assert 0 <= prob <= 1.0, \
861
- 'The probability should be in range [0,1].'
862
- self.level = level
863
- self.prob = prob
864
- self.factor = enhance_level_to_value(level)
865
-
866
- def _adjust_contrast_img(self, results, factor=1.0):
867
- """Adjust the image contrast."""
868
- for key in results.get('img_fields', ['img']):
869
- img = results[key]
870
- results[key] = mmcv.adjust_contrast(img, factor).astype(img.dtype)
871
-
872
- def __call__(self, results):
873
- """Call function for Contrast transformation.
874
-
875
- Args:
876
- results (dict): Results dict from loading pipeline.
877
-
878
- Returns:
879
- dict: Results after the transformation.
880
- """
881
- if np.random.rand() > self.prob:
882
- return results
883
- self._adjust_contrast_img(results, self.factor)
884
- return results
885
-
886
- def __repr__(self):
887
- repr_str = self.__class__.__name__
888
- repr_str += f'(level={self.level}, '
889
- repr_str += f'prob={self.prob})'
890
- return repr_str
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/CVPR/lama-example/models/ade20k/segm_lib/nn/parallel/__init__.py DELETED
@@ -1 +0,0 @@
1
- from .data_parallel import UserScatteredDataParallel, user_scattered_collate, async_copy_to
 
 
spaces/CVPR/monoscene_lite/monoscene/config.py DELETED
@@ -1,26 +0,0 @@
1
- from transformers import PretrainedConfig
2
- from typing import List
3
-
4
-
5
- class MonoSceneConfig(PretrainedConfig):
6
-
7
- def __init__(
8
- self,
9
- dataset="kitti",
10
- n_classes=20,
11
- feature=64,
12
- project_scale=2,
13
- full_scene_size=(256, 256, 32),
14
- **kwargs,
15
- ):
16
- self.dataset = dataset
17
- self.n_classes = n_classes
18
- self.feature = feature
19
- self.project_scale = project_scale
20
- self.full_scene_size = full_scene_size
21
- super().__init__(**kwargs)
22
-
23
-
24
-
25
-
26
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/CikeyQI/Yunzai/Yunzai/plugins/ws-plugin/components/index.js DELETED
@@ -1,20 +0,0 @@
1
- import Version from './Version.js'
2
- import YamlReader from './YamlReader.js'
3
- import Config from './Config.js'
4
- import { initWebSocket, createWebSocket, allSocketList, setAllSocketList, sendSocketList, clearWebSocket, modifyWebSocket } from './WebSocket.js'
5
- import Render from './Render.js'
6
- const Path = process.cwd()
7
- export {
8
- Version,
9
- Path,
10
- YamlReader,
11
- Config,
12
- initWebSocket,
13
- clearWebSocket,
14
- createWebSocket,
15
- modifyWebSocket,
16
- allSocketList,
17
- setAllSocketList,
18
- sendSocketList,
19
- Render
20
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/CikeyQI/meme-api/meme_generator/memes/bocchi_draft/__init__.py DELETED
@@ -1,42 +0,0 @@
1
- from pathlib import Path
2
- from typing import List
3
-
4
- from PIL.Image import Image as IMG
5
- from pil_utils import BuildImage
6
-
7
- from meme_generator import add_meme
8
- from meme_generator.utils import save_gif
9
-
10
- img_dir = Path(__file__).parent / "images"
11
-
12
-
13
- def bocchi_draft(images: List[BuildImage], texts, args):
14
- img = images[0].convert("RGBA").resize((350, 400), keep_ratio=True)
15
- params = [
16
- (((54, 62), (353, 1), (379, 382), (1, 399)), (146, 173)),
17
- (((54, 61), (349, 1), (379, 381), (1, 398)), (146, 174)),
18
- (((54, 61), (349, 1), (379, 381), (1, 398)), (152, 174)),
19
- (((54, 61), (335, 1), (379, 381), (1, 398)), (158, 167)),
20
- (((54, 61), (335, 1), (370, 381), (1, 398)), (157, 149)),
21
- (((41, 59), (321, 1), (357, 379), (1, 396)), (167, 108)),
22
- (((41, 57), (315, 1), (357, 377), (1, 394)), (173, 69)),
23
- (((41, 56), (309, 1), (353, 380), (1, 393)), (175, 43)),
24
- (((41, 56), (314, 1), (353, 380), (1, 393)), (174, 30)),
25
- (((41, 50), (312, 1), (348, 367), (1, 387)), (171, 18)),
26
- (((35, 50), (306, 1), (342, 367), (1, 386)), (178, 14)),
27
- ]
28
- # fmt: off
29
- idx = [
30
- 0, 0, 0, 0, 0, 0, 0, 1, 1, 2, 2, 2, 3, 4, 5, 6, 7, 8, 9, 10, 10, 10, 10,
31
- ]
32
- # fmt: on
33
- frames: List[IMG] = []
34
- for i in range(23):
35
- frame = BuildImage.open(img_dir / f"{i}.png")
36
- points, pos = params[idx[i]]
37
- frame.paste(img.perspective(points), pos, below=True)
38
- frames.append(frame.image)
39
- return save_gif(frames, 0.08)
40
-
41
-
42
- add_meme("bocchi_draft", bocchi_draft, min_images=1, max_images=1, keywords=["波奇手稿"])
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/ClassCat/mnist-classification-ja/README.md DELETED
@@ -1,12 +0,0 @@
1
- ---
2
- title: Mnist Classification Ja
3
- emoji: 🌖
4
- colorFrom: indigo
5
- colorTo: purple
6
- sdk: gradio
7
- sdk_version: 3.16.1
8
- app_file: app.py
9
- pinned: false
10
- ---
11
-
12
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/ClassCat/wide-resnet-cifar10-classification/app.py DELETED
@@ -1,190 +0,0 @@
1
-
2
- # common
3
- import os, sys
4
- import math
5
- #import numpy as np
6
-
7
- #from random import randrange
8
-
9
- # torch
10
- import torch
11
- from torch import nn
12
- #from torch import einsum
13
-
14
- import torch.nn.functional as F
15
-
16
- #from torch import optim
17
- #from torch.optim import lr_scheduler
18
-
19
- #from torch.utils.data import DataLoader
20
- #from torch.utils.data.sampler import SubsetRandomSampler
21
-
22
- # torchVision
23
- import torchvision
24
- from torchvision import transforms
25
- #from torchvision import models
26
- #from torchvision.datasets import CIFAR10, CIFAR100
27
-
28
- # torchinfo
29
- #from torchinfo import summary
30
-
31
- # Define model
32
- class WideBasic(nn.Module):
33
- def __init__(self, in_channels, out_channels, stride=1):
34
- super().__init__()
35
- self.residual = nn.Sequential(
36
- nn.BatchNorm2d(in_channels),
37
- nn.ReLU(inplace=True),
38
- nn.Conv2d(
39
- in_channels,
40
- out_channels,
41
- kernel_size=3,
42
- stride=stride,
43
- padding=1
44
- ),
45
- nn.BatchNorm2d(out_channels),
46
- nn.ReLU(inplace=True),
47
- nn.Dropout(),
48
- nn.Conv2d(
49
- out_channels,
50
- out_channels,
51
- kernel_size=3,
52
- stride=1,
53
- padding=1
54
- )
55
- )
56
-
57
- self.shortcut = nn.Sequential()
58
-
59
- if in_channels != out_channels or stride != 1:
60
- self.shortcut = nn.Sequential(
61
- nn.Conv2d(in_channels, out_channels, 1, stride=stride)
62
- )
63
-
64
- def forward(self, x):
65
- residual = self.residual(x)
66
- shortcut = self.shortcut(x)
67
-
68
- return residual + shortcut
69
-
70
- class WideResNet(nn.Module):
71
- def __init__(self, num_classes, block, depth=50, widen_factor=1):
72
- super().__init__()
73
-
74
- self.depth = depth
75
- k = widen_factor
76
- l = int((depth - 4) / 6)
77
- self.in_channels = 16
78
- self.init_conv = nn.Conv2d(3, self.in_channels, 3, 1, padding=1)
79
- self.conv2 = self._make_layer(block, 16 * k, l, 1)
80
- self.conv3 = self._make_layer(block, 32 * k, l, 2)
81
- self.conv4 = self._make_layer(block, 64 * k, l, 2)
82
- self.bn = nn.BatchNorm2d(64 * k)
83
- self.relu = nn.ReLU(inplace=True)
84
- self.avg_pool = nn.AdaptiveAvgPool2d((1, 1))
85
- self.linear = nn.Linear(64 * k, num_classes)
86
-
87
- def forward(self, x):
88
- x = self.init_conv(x)
89
- x = self.conv2(x)
90
- x = self.conv3(x)
91
- x = self.conv4(x)
92
- x = self.bn(x)
93
- x = self.relu(x)
94
- x = self.avg_pool(x)
95
- x = x.view(x.size(0), -1)
96
- x = self.linear(x)
97
-
98
- return x
99
-
100
- def _make_layer(self, block, out_channels, num_blocks, stride):
101
- strides = [stride] + [1] * (num_blocks - 1)
102
- layers = []
103
- for stride in strides:
104
- layers.append(block(self.in_channels, out_channels, stride))
105
- self.in_channels = out_channels
106
-
107
- return nn.Sequential(*layers)
108
-
109
-
110
- model = WideResNet(10, WideBasic, depth=40, widen_factor=10)
111
- model.load_state_dict(
112
- torch.load("weights/cifar10_wide_resnet_model.pt",
113
- map_location=torch.device('cpu'))
114
- )
115
-
116
- model.eval()
117
-
118
- import gradio as gr
119
- from torchvision import transforms
120
-
121
- import os
122
- import glob
123
-
124
- examples_dir = './examples'
125
- example_files = glob.glob(os.path.join(examples_dir, '*.png'))
126
-
127
- normalize = transforms.Normalize(
128
- mean=[0.4914, 0.4822, 0.4465],
129
- std=[0.2470, 0.2435, 0.2616],
130
- )
131
-
132
- transform = transforms.Compose([
133
- transforms.ToTensor(),
134
- normalize,
135
- ])
136
-
137
- classes = [
138
- "airplane",
139
- "automobile",
140
- "bird",
141
- "cat",
142
- "deer",
143
- "dog",
144
- "frog",
145
- "horse",
146
- "ship",
147
- "truck",
148
- ]
149
-
150
- def predict(image):
151
- tsr_image = transform(image).unsqueeze(dim=0)
152
-
153
- model.eval()
154
- with torch.no_grad():
155
- pred = model(tsr_image)
156
- prob = torch.nn.functional.softmax(pred[0], dim=0)
157
-
158
- confidences = {classes[i]: float(prob[i]) for i in range(10)}
159
- return confidences
160
-
161
-
162
- with gr.Blocks(css=".gradio-container {background:honeydew;}", title="WideResNet - CIFAR10 Classification"
163
- ) as demo:
164
- gr.HTML("""<div style="font-family:'Times New Roman', 'Serif'; font-size:16pt; font-weight:bold; text-align:center; color:royalblue;">WideResNet - CIFAR10 Classification</div>""")
165
-
166
- with gr.Row():
167
- input_image = gr.Image(type="pil", image_mode="RGB", shape=(32, 32))
168
-
169
- output_label=gr.Label(label="Probabilities", num_top_classes=3)
170
-
171
- send_btn = gr.Button("Infer")
172
-
173
- with gr.Row():
174
- gr.Examples(['./examples/cifar10_test00.png'], label='Sample images : dog', inputs=input_image)
175
- gr.Examples(['./examples/cifar10_test01.png'], label='ship', inputs=input_image)
176
- gr.Examples(['./examples/cifar10_test02.png'], label='airplane', inputs=input_image)
177
- gr.Examples(['./examples/cifar10_test03.png'], label='frog', inputs=input_image)
178
- gr.Examples(['./examples/cifar10_test04.png'], label='truck', inputs=input_image)
179
- gr.Examples(['./examples/cifar10_test05.png'], label='automobile', inputs=input_image)
180
-
181
- #gr.Examples(example_files, inputs=input_image)
182
- #gr.Examples(['examples/sample02.png', 'examples/sample04.png'], inputs=input_image2)
183
-
184
- send_btn.click(fn=predict, inputs=input_image, outputs=output_label)
185
-
186
- # demo.queue(concurrency_count=3)
187
- demo.launch()
188
-
189
-
190
- ### EOF ###
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/CofAI/chat/client/css/buttons.css DELETED
@@ -1,4 +0,0 @@
1
- .buttons {
2
- display: flex;
3
- justify-content: left;
4
- }