Commit
·
7022d3b
1
Parent(s):
e52c4b3
Update parquet files (step 120 of 249)
Browse filesThis view is limited to 50 files because it contains too many changes.
See raw diff
- spaces/101-5/gpt4free/testing/wewordle/Wewordle.py +0 -97
- spaces/1acneusushi/gradio-2dmoleculeeditor/data/Athiradi Vettai English Subtitle Learn More About the Director Music and Awards.md +0 -118
- spaces/1acneusushi/gradio-2dmoleculeeditor/data/Cnc Usb Controller Software Keygen 103.md +0 -117
- spaces/1acneusushi/gradio-2dmoleculeeditor/data/Download WinRAR 32 Bit Setup and Enjoy the Benefits of WinRAR.md +0 -22
- spaces/1acneusushi/gradio-2dmoleculeeditor/data/Evangelion 1.11 English Dub 1080p A Review of the First Movie in the Reboot Series.md +0 -193
- spaces/1gistliPinn/ChatGPT4/Examples/Amrapali Movie With English Subtitles Free Download.md +0 -8
- spaces/1gistliPinn/ChatGPT4/Examples/Comment utiliser codebreaker v10 iso pal pour dbloquer tous les secrets de vos jeux PS2.md +0 -6
- spaces/1phancelerku/anime-remove-background/Download Jigsaw and Experience the New Jigsaw Jam Mode - Fast and Fun.md +0 -130
- spaces/1toTree/lora_test/ppdiffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_inpaint_legacy.py +0 -527
- spaces/4F22/text_generator/app.py +0 -3
- spaces/4Taps/SadTalker/src/face3d/options/base_options.py +0 -169
- spaces/A00001/bingothoo/src/pages/api/create.ts +0 -31
- spaces/AB-TW/team-ai/agents/promopts.py +0 -19
- spaces/AFCMEgypt/colorimetric_analyzer/app.py +0 -239
- spaces/AIConsultant/MusicGen/docs/METRICS.md +0 -127
- spaces/AIGC-Audio/AudioGPT/text_to_audio/Make_An_Audio/ldm/modules/distributions/distributions.py +0 -92
- spaces/AIGC-Audio/AudioGPT/text_to_audio/Make_An_Audio/vocoder/bigvgan/alias_free_torch/__init__.py +0 -6
- spaces/AIZeroToHero/03-ImageSearchSimilar/README.md +0 -13
- spaces/ASJMO/freegpt/client/css/stop-generating.css +0 -38
- spaces/ATang0729/Forecast4Muses/Model/Model6/Model6_0_ClothesDetection/mmyolo/configs/yolov5/README.md +0 -118
- spaces/ATang0729/Forecast4Muses/Model/Model6/Model6_2_ProfileRecogition/mmpretrain/configs/resnet/resnet34_8xb16_cifar10.py +0 -4
- spaces/AchyuthGamer/OpenGPT/g4f/Provider/Providers/Dfehub.py +0 -49
- spaces/AchyuthGamer/OpenGPT/g4f/Provider/Providers/deprecated/CodeLinkAva.py +0 -64
- spaces/AgentVerse/agentVerse/ui/src/phaser3-rex-plugins/templates/spinner/radio/Factory.js +0 -13
- spaces/AgentVerse/agentVerse/ui/src/phaser3-rex-plugins/templates/ui/gridtable/Factory.js +0 -13
- spaces/Ajaxon6255/Emerald_Isle/app.py +0 -147
- spaces/AlexWang/lama/models/ade20k/segm_lib/utils/data/__init__.py +0 -3
- spaces/Amrrs/DragGan-Inversion/scripts/download_model.sh +0 -19
- spaces/Androidonnxfork/CivitAi-to-Diffusers/diffusers/docs/README.md +0 -271
- spaces/Androidonnxfork/CivitAi-to-Diffusers/diffusers/src/diffusers/models/modeling_pytorch_flax_utils.py +0 -161
- spaces/Andy1621/uniformer_image_detection/configs/gcnet/mask_rcnn_x101_32x4d_fpn_syncbn-backbone_r4_gcb_c3-c5_1x_coco.py +0 -11
- spaces/Andy1621/uniformer_image_detection/configs/swin/mask_rcnn_swin_tiny_patch4_window7_mstrain_480-800_adamw_3x_coco.py +0 -80
- spaces/Anthony7906/MengHuiMXD_GPT/chatgpt - windows.bat +0 -14
- spaces/Arthur678/vits-uma-genshin-honkai/utils.py +0 -225
- spaces/Avator/gradio-hugging-face/app.py +0 -14
- spaces/Awiny/Image2Paragraph/models/grit_src/third_party/CenterNet2/detectron2/evaluation/coco_evaluation.py +0 -710
- spaces/Awiny/Image2Paragraph/models/grit_src/third_party/CenterNet2/detectron2/modeling/sampling.py +0 -54
- spaces/Banbri/zcvzcv/src/components/ui/collapsible.tsx +0 -11
- spaces/Benson/text-generation/Examples/Bgc Apk.md +0 -119
- spaces/Benson/text-generation/Examples/Comisin Zondo Informe Final Pdf.md +0 -78
- spaces/Benson/text-generation/Examples/Cuerda Hroe Apk Mod 3.md +0 -68
- spaces/Benson/text-generation/Examples/Descarga Gratuita De Picas Para Ventanas 7.md +0 -125
- spaces/Big-Web/MMSD/env/Lib/site-packages/boto3/session.py +0 -532
- spaces/Big-Web/MMSD/env/Lib/site-packages/pkg_resources/_vendor/pyparsing/results.py +0 -760
- spaces/Big-Web/MMSD/env/Lib/site-packages/setuptools/_imp.py +0 -82
- spaces/CVPR/LIVE/pybind11/tests/test_numpy_vectorize.py +0 -194
- spaces/CVPR/LIVE/thrust/thrust/detail/vector_base.h +0 -588
- spaces/CVPR/LIVE/thrust/thrust/system/cuda/memory.h +0 -93
- spaces/CVPR/LIVE/thrust/thrust/system/omp/detail/reduce.h +0 -54
- spaces/CVPR/drawings-to-human/static/_app/immutable/error.svelte-d9523301.js +0 -1
spaces/101-5/gpt4free/testing/wewordle/Wewordle.py
DELETED
@@ -1,97 +0,0 @@
|
|
1 |
-
import os,sys
|
2 |
-
import requests
|
3 |
-
import json
|
4 |
-
import random
|
5 |
-
import time
|
6 |
-
import string
|
7 |
-
# from ...typing import sha256, Dict, get_type_hints
|
8 |
-
|
9 |
-
url = "https://wewordle.org/gptapi/v1/android/turbo"
|
10 |
-
model = ['gpt-3.5-turbo']
|
11 |
-
supports_stream = False
|
12 |
-
needs_auth = False
|
13 |
-
|
14 |
-
|
15 |
-
def _create_completion(model: str, messages: list, stream: bool, **kwargs):
|
16 |
-
base = ''
|
17 |
-
for message in messages:
|
18 |
-
base += '%s: %s\n' % (message['role'], message['content'])
|
19 |
-
base += 'assistant:'
|
20 |
-
# randomize user id and app id
|
21 |
-
_user_id = ''.join(random.choices(f'{string.ascii_lowercase}{string.digits}', k=16))
|
22 |
-
_app_id = ''.join(random.choices(f'{string.ascii_lowercase}{string.digits}', k=31))
|
23 |
-
# make current date with format utc
|
24 |
-
_request_date = time.strftime("%Y-%m-%dT%H:%M:%S.000Z", time.gmtime())
|
25 |
-
headers = {
|
26 |
-
'accept': '*/*',
|
27 |
-
'pragma': 'no-cache',
|
28 |
-
'Content-Type': 'application/json',
|
29 |
-
'Connection':'keep-alive'
|
30 |
-
# user agent android client
|
31 |
-
# 'User-Agent': 'Dalvik/2.1.0 (Linux; U; Android 10; SM-G975F Build/QP1A.190711.020)',
|
32 |
-
|
33 |
-
}
|
34 |
-
data = {
|
35 |
-
"user": _user_id,
|
36 |
-
"messages": [
|
37 |
-
{"role": "user", "content": base}
|
38 |
-
],
|
39 |
-
"subscriber": {
|
40 |
-
"originalPurchaseDate": None,
|
41 |
-
"originalApplicationVersion": None,
|
42 |
-
"allPurchaseDatesMillis": {},
|
43 |
-
"entitlements": {
|
44 |
-
"active": {},
|
45 |
-
"all": {}
|
46 |
-
},
|
47 |
-
"allPurchaseDates": {},
|
48 |
-
"allExpirationDatesMillis": {},
|
49 |
-
"allExpirationDates": {},
|
50 |
-
"originalAppUserId": f"$RCAnonymousID:{_app_id}",
|
51 |
-
"latestExpirationDate": None,
|
52 |
-
"requestDate": _request_date,
|
53 |
-
"latestExpirationDateMillis": None,
|
54 |
-
"nonSubscriptionTransactions": [],
|
55 |
-
"originalPurchaseDateMillis": None,
|
56 |
-
"managementURL": None,
|
57 |
-
"allPurchasedProductIdentifiers": [],
|
58 |
-
"firstSeen": _request_date,
|
59 |
-
"activeSubscriptions": []
|
60 |
-
}
|
61 |
-
}
|
62 |
-
response = requests.post(url, headers=headers, data=json.dumps(data))
|
63 |
-
if response.status_code == 200:
|
64 |
-
_json = response.json()
|
65 |
-
if 'message' in _json:
|
66 |
-
yield _json['message']['content']
|
67 |
-
else:
|
68 |
-
print(f"Error Occurred::{response.status_code}")
|
69 |
-
return None
|
70 |
-
|
71 |
-
# params = f'g4f.Providers.{os.path.basename(__file__)[:-3]} supports: ' + \
|
72 |
-
# '(%s)' % ', '.join(
|
73 |
-
# [f"{name}: {get_type_hints(_create_completion)[name].__name__}" for name in _create_completion.__code__.co_varnames[:_create_completion.__code__.co_argcount]])
|
74 |
-
|
75 |
-
|
76 |
-
# Temporary For ChatCompletion Class
|
77 |
-
class ChatCompletion:
|
78 |
-
@staticmethod
|
79 |
-
def create(model: str, messages: list, provider: None or str, stream: bool = False, auth: str = False, **kwargs):
|
80 |
-
kwargs['auth'] = auth
|
81 |
-
|
82 |
-
if provider and needs_auth and not auth:
|
83 |
-
print(
|
84 |
-
f'ValueError: {provider} requires authentication (use auth="cookie or token or jwt ..." param)', file=sys.stderr)
|
85 |
-
sys.exit(1)
|
86 |
-
|
87 |
-
try:
|
88 |
-
|
89 |
-
|
90 |
-
return (_create_completion(model, messages, stream, **kwargs)
|
91 |
-
if stream else ''.join(_create_completion(model, messages, stream, **kwargs)))
|
92 |
-
except TypeError as e:
|
93 |
-
print(e)
|
94 |
-
arg: str = str(e).split("'")[1]
|
95 |
-
print(
|
96 |
-
f"ValueError: {provider} does not support '{arg}' argument", file=sys.stderr)
|
97 |
-
sys.exit(1)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/1acneusushi/gradio-2dmoleculeeditor/data/Athiradi Vettai English Subtitle Learn More About the Director Music and Awards.md
DELETED
@@ -1,118 +0,0 @@
|
|
1 |
-
<br />
|
2 |
-
<h1>Mystery P.I. The Curious Case of Counterfeit Cove: A Review</h1>
|
3 |
-
<p>Have you ever dreamed of being a private investigator and solving mysteries in a picturesque New England village? If so, you might want to check out Mystery P.I. The Curious Case of Counterfeit Cove, a hidden object puzzle adventure game developed by PopCap Games. In this game, you will have to track down a counterfeiting ring that is threatening to ruin the local economy of Whaler's Cove, a charming seaside settlement. You will have to search for clues, find hidden objects, solve puzzles, and collect keys to unlock bonus games. Along the way, you will also learn about the history and culture of New England, as well as enjoy its beautiful scenery and music. In this review, we will take a closer look at this game and see what makes it fun and engaging.</p>
|
4 |
-
<h2>Introduction</h2>
|
5 |
-
<p>What is Mystery P.I. The Curious Case of Counterfeit Cove?</p>
|
6 |
-
<h2>Mystery.P.I.The.Curious.Case.of.Counterfeit.Cove.v1.Cracked F4CG.rar 1</h2><br /><p><b><b>DOWNLOAD</b> ★ <a href="https://byltly.com/2uKzNL">https://byltly.com/2uKzNL</a></b></p><br /><br />
|
7 |
-
<p>Mystery P.I. The Curious Case of Counterfeit Cove is a hidden object puzzle adventure game that belongs to the Mystery P.I. series by PopCap Games. It is the sixth installment in the series, following Mystery P.I. The London Caper. It was released in November 2011 for Windows PC.</p>
|
8 |
-
<p>Who made the game and when was it released?</p>
|
9 |
-
<p>The game was developed by PopCap Games, a casual games company that is known for creating popular titles such as Bejeweled, Plants vs. Zombies, Peggle, Zuma, Bookworm, and more. PopCap Games was founded in 2000 by John Vechey, Brian Fiete, and Jason Kapalka. It was acquired by Electronic Arts in 2011.</p>
|
10 |
-
<h2>Gameplay</h2>
|
11 |
-
<p>What is the genre and style of the game?</p>
|
12 |
-
<p>The game is a hidden object puzzle adventure game, which means that it combines elements of hidden object games, puzzle games, and adventure games. In hidden object games, you have to find a list of items that are hidden in a cluttered scene. In puzzle games, you have to solve various types of logic puzzles, such as jigsaw puzzles, word puzzles, matching puzzles, etc. In adventure games, you have to explore different locations, interact with characters, collect items, and use them to advance the story.</p>
|
13 |
-
<p>Mystery P.I. Counterfeit Cove download full version<br />
|
14 |
-
Mystery P.I. The Curious Case of Counterfeit Cove crack F4CG<br />
|
15 |
-
How to play Mystery P.I. Counterfeit Cove without CD<br />
|
16 |
-
Mystery P.I. The Curious Case of Counterfeit Cove walkthrough<br />
|
17 |
-
Mystery P.I. Counterfeit Cove cheats and tips<br />
|
18 |
-
Mystery P.I. The Curious Case of Counterfeit Cove free trial<br />
|
19 |
-
Mystery P.I. Counterfeit Cove system requirements<br />
|
20 |
-
Mystery P.I. The Curious Case of Counterfeit Cove rar password<br />
|
21 |
-
Mystery P.I. Counterfeit Cove hidden objects locations<br />
|
22 |
-
Mystery P.I. The Curious Case of Counterfeit Cove review<br />
|
23 |
-
Mystery P.I. Counterfeit Cove serial key<br />
|
24 |
-
Mystery P.I. The Curious Case of Counterfeit Cove patch<br />
|
25 |
-
Mystery P.I. Counterfeit Cove online game<br />
|
26 |
-
Mystery P.I. The Curious Case of Counterfeit Cove screenshots<br />
|
27 |
-
Mystery P.I. Counterfeit Cove mac version<br />
|
28 |
-
Mystery P.I. The Curious Case of Counterfeit Cove torrent<br />
|
29 |
-
Mystery P.I. Counterfeit Cove activation code<br />
|
30 |
-
Mystery P.I. The Curious Case of Counterfeit Cove gameplay video<br />
|
31 |
-
Mystery P.I. Counterfeit Cove steam key<br />
|
32 |
-
Mystery P.I. The Curious Case of Counterfeit Cove forum<br />
|
33 |
-
Mystery P.I. Counterfeit Cove windows 10 compatibility<br />
|
34 |
-
Mystery P.I. The Curious Case of Counterfeit Cove bonus levels<br />
|
35 |
-
Mystery P.I. Counterfeit Cove soundtrack<br />
|
36 |
-
Mystery P.I. The Curious Case of Counterfeit Cove collector's edition<br />
|
37 |
-
Mystery P.I. Counterfeit Cove error fix<br />
|
38 |
-
Mystery P.I. The Curious Case of Counterfeit Cove mods<br />
|
39 |
-
Mystery P.I. Counterfeit Cove achievements and trophies<br />
|
40 |
-
Mystery P.I. The Curious Case of Counterfeit Cove guide pdf<br />
|
41 |
-
Mystery P.I. Counterfeit Cove update<br />
|
42 |
-
Mystery P.I. The Curious Case of Counterfeit Cove wiki<br />
|
43 |
-
Mystery P.I. Counterfeit Cove save game location<br />
|
44 |
-
Mystery P.I. The Curious Case of Counterfeit Cove easter eggs<br />
|
45 |
-
Mystery P.I. Counterfeit Cove uninstaller<br />
|
46 |
-
Mystery P.I. The Curious Case of Counterfeit Cove trainer<br />
|
47 |
-
Mystery P.I. Counterfeit Cove amazon price<br />
|
48 |
-
Mystery P.I. The Curious Case of Counterfeit Cove release date<br />
|
49 |
-
Mystery P.I. Counterfeit Cove characters and voice actors<br />
|
50 |
-
Mystery P.I. The Curious Case of Counterfeit Cove iso file<br />
|
51 |
-
Mystery P.I. Counterfeit Cove keyboard controls<br />
|
52 |
-
Mystery P.I. The Curious Case of Counterfeit Cove android apk<br />
|
53 |
-
Mystery P.I. Counterfeit Cove nintendo switch port<br />
|
54 |
-
Mystery P.I. The Curious Case of Counterfeit Cove plot summary<br />
|
55 |
-
Mystery P.I. Counterfeit Cove multiplayer mode<br />
|
56 |
-
Mystery P.I. The Curious Case of Counterfeit Cove developer and publisher<br />
|
57 |
-
Mystery P.I. Counterfeit Cove metacritic score<br />
|
58 |
-
Mystery P.I. The Curious Case of Counterfeit Cove fan art and cosplay<br />
|
59 |
-
Mystery P.I. Counterfeit Cove merchandise and gifts<br />
|
60 |
-
Mystery.P I.The.Curious.Case.of.Counterfiet.Cove.v1.Cracked F4CG.rar 1 virus scan report</p>
|
61 |
-
<p>What is the story and setting of the game?</p>
|
62 |
-
<p>The story of the game is that you are a private investigator who has been hired by the town elders of Whaler's Cove to track down a counterfeiting ring that is flooding the village with fake bills. You have to find out who is behind this scheme and stop them before they ruin the local economy. The setting of the game is Whaler's Cove, a fictional village in New England that is inspired by real places such as Cape Cod, Martha's Vineyard, Nantucket, etc. The game features 25 locations that depict various aspects of New England culture and history, such as lighthouses, fishing boats, lobster traps, cranberry bogs, colonial houses, etc.</p>
|
63 |
-
<p>What are the main objectives and challenges of the game?</p>
|
64 |
-
<p>The main objectives of the game are to find clues that will lead you to the counterfeiting ring, find hidden objects that will help you solve puzzles or unlock bonus games, collect keys that will allow you to access bonus locations or modes, and earn points that will increase your rank as a detective. The main challenges of the game are to find all the hidden objects in each scene within a limited time or hints (you can choose between timed or relaxed mode), solve puzzles that range from easy to hard in difficulty (you can skip them if you get stuck), and complete bonus games that test your memory or reflexes (you can replay them as many times as you want).</p>
|
65 |
-
<p>What are the modes and features of the game?</p>
|
66 |
-
<p>The game has two modes: Story Mode and Unlimited Seek & Find Mode. In Story Mode, you follow the main storyline of finding and stopping the counterfeiting ring. You have to complete 12 cases (each case has two locations) plus a final showdown at a secret hideout. In Unlimited Seek & Find Mode, you can replay any location from Story Mode with unlimited time and hints, but with different lists of hidden objects each time. You can also unlock six bonus locations by collecting keys in Story Mode. The game also has three features: a map that shows your progress and allows you to travel between locations, a journal that records your clues and achievements, and a trophy room that displays your awards and ranks.</p>
|
67 |
-
<h2>Graphics and Sound</h2>
|
68 |
-
<p>How does the game look and sound?</p>
|
69 |
-
<p>The game looks and sounds great. The graphics are colorful, detailed, and realistic. The scenes are well-designed and varied, with different themes, objects, and animations. The sound effects are crisp, clear, and appropriate for each scene. The music is soothing, melodic, and fitting for the New England atmosphere.</p>
|
70 |
-
<p>What are the visual and audio effects of the game?</p>
|
71 |
-
<p>The game has some visual and audio effects that enhance the gameplay and immersion. For example, the scenes have some dynamic elements, such as moving clouds, birds, waves, etc., that make them more lively. The hidden objects have some interactive elements, such as opening drawers, turning pages, etc., that make them more fun to find. The puzzles have some animated elements, such as spinning wheels, sliding tiles, etc., that make them more challenging to solve. The music has some adaptive elements, such as changing tempo, volume, or mood, depending on your actions or situation.</p>
|
72 |
-
<p>How does the game fit the theme and atmosphere of New England?</p>
|
73 |
-
<p>The game fits the theme and atmosphere of New England very well. The scenes depict various aspects of New England culture and history, such as whaling, fishing, cranberry harvesting, colonial architecture, etc. The objects reflect the items that are typical or unique to New England, such as lobsters, clams, quahogs, cranberries, whale bones, etc. The music captures the mood and spirit of New England, with its folk tunes, sea shanties, fiddle melodies, etc.</p>
|
74 |
-
<h2>Pros and Cons</h2>
|
75 |
-
<p>What are the pros of the game?</p>
|
76 |
-
<p>The pros of the game are:</p>
|
77 |
-
<ul>
|
78 |
-
<li>It has an engaging story that keeps you interested in finding out who is behind the counterfeiting ring.</li>
|
79 |
-
<li>It has a variety of locations that showcase the beauty and diversity of New England.</li>
|
80 |
-
<li>It has a lot of hidden objects that are challenging but not frustrating to find.</li>
|
81 |
-
<li>It has some puzzles that are fun and creative to solve.</li>
|
82 |
-
<li>It has some bonus games that are entertaining and rewarding to play.</li>
|
83 |
-
<li>It has some features that enhance your gameplay experience such as a map ,a journal ,and a trophy room .</li>
|
84 |
-
<li>It has great graphics and sound that create a realistic and immersive environment .</li>
|
85 |
-
</ul>
|
86 |
-
<p>What are the cons of the game?</p>
|
87 |
-
<p>The cons of the game are:</p>
|
88 |
-
<ul>
|
89 |
-
<li>It has some scenes that are too cluttered or dark, making it hard to spot some objects.</li>
|
90 |
-
<li>It has some objects that are too small or obscure, making it easy to miss them.</li>
|
91 |
-
<li>It has some puzzles that are too easy or repetitive, making it boring to solve them.</li>
|
92 |
-
<li>It has some bonus games that are too simple or similar, making it dull to play them.</li>
|
93 |
-
<li>It has some bugs or glitches that affect the gameplay or performance of the game.</li>
|
94 |
-
</ul>
|
95 |
-
<h2>Conclusion</h2>
|
96 |
-
<p>What is the overall impression of the game?</p>
|
97 |
-
<p>Mystery P.I. The Curious Case of Counterfeit Cove is a hidden object puzzle adventure game that offers a fun and relaxing way to explore New England and solve a mystery. It has a captivating story, a variety of locations, a lot of hidden objects, some puzzles, some bonus games, and some features that make it enjoyable and rewarding. It also has great graphics and sound that create a realistic and immersive environment. However, it also has some flaws, such as some scenes that are too cluttered or dark, some objects that are too small or obscure, some puzzles that are too easy or repetitive, some bonus games that are too simple or similar, and some bugs or glitches that affect the gameplay or performance of the game. Therefore, it is not a perfect game, but it is still a good game that deserves a try.</p>
|
98 |
-
<p>Who would enjoy the game and why?</p>
|
99 |
-
<p>The game would appeal to anyone who likes hidden object puzzle adventure games, especially those who are fans of the Mystery P.I. series or PopCap Games. It would also appeal to anyone who likes New England culture and history, as the game showcases various aspects of it. The game is suitable for players of all ages and skill levels, as it has different modes and options that cater to different preferences and needs. The game is also easy to play and learn, as it has simple controls and instructions.</p>
|
100 |
-
<p>Where can you get the game and how much does it cost?</p>
|
101 |
-
<p>You can get the game from the official website of EA (Electronic Arts), which is the publisher of the game. The game costs $9.99 for Windows PC. You can also get the game from other online platforms such as Origin, Steam, Big Fish Games, etc., but the price may vary depending on the platform and region. You can also try the game for free for 60 minutes before buying it.</p>
|
102 |
-
<h3>FAQs</h3>
|
103 |
-
<p>Here are some frequently asked questions about the game:</p>
|
104 |
-
<ol>
|
105 |
-
<li>How long does it take to finish the game?</li>
|
106 |
-
<p>It depends on your speed and skill level, but on average, it takes about 4 to 6 hours to finish the Story Mode. The Unlimited Seek & Find Mode and the bonus games can add more hours to your gameplay time.</p>
|
107 |
-
<li>How many hidden objects are there in the game?</li>
|
108 |
-
<p>There are over 2100 hidden objects in the game, spread across 25 locations. Each location has two lists of hidden objects, one for each case in Story Mode. The lists change every time you replay a location in Unlimited Seek & Find Mode.</p>
|
109 |
-
<li>How many puzzles are there in the game?</li>
|
110 |
-
<p>There are 12 puzzles in the game, one for each case in Story Mode. The puzzles vary in type and difficulty, such as jigsaw puzzles, word puzzles, matching puzzles, etc. You can skip any puzzle if you get stuck.</p>
|
111 |
-
<li>How many bonus games are there in the game?</li>
|
112 |
-
<p>There are six bonus games in the game, which you can unlock by collecting keys in Story Mode. The bonus games test your memory or reflexes, such as Memory Match, Spot the Difference, Whack-a-Mole, etc. You can replay any bonus game as many times as you want.</p>
|
113 |
-
<li>How can I get more hints in the game?</li>
|
114 |
-
<p>You can get more hints in the game by finding magnifying glasses in each scene. Each magnifying glass gives you one extra hint. You can also use your points to buy more hints in the shop.</p>
|
115 |
-
</ol>
|
116 |
-
</p> 0a6ba089eb<br />
|
117 |
-
<br />
|
118 |
-
<br />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/1acneusushi/gradio-2dmoleculeeditor/data/Cnc Usb Controller Software Keygen 103.md
DELETED
@@ -1,117 +0,0 @@
|
|
1 |
-
<br />
|
2 |
-
<h1>What is Cnc Usb Controller Software Keygen 103?</h1>
|
3 |
-
<p>If you are looking for a software that can link your personal computer and your drivers for stepper or servo motors, you might want to check out Cnc Usb Controller Software Keygen 103. This is a complete (software/hardware) solution that does not require any additional software (Mach3 is not needed). It uses USB port which is available on all modern computers and laptops.</p>
|
4 |
-
<h2>Cnc Usb Controller Software Keygen 103</h2><br /><p><b><b>Download Zip</b> »»» <a href="https://byltly.com/2uKvO8">https://byltly.com/2uKvO8</a></b></p><br /><br />
|
5 |
-
<p>In this article, we will explain what Cnc Usb Controller Software Keygen 103 is, how to install and use it, what are its benefits and drawbacks, how to troubleshoot it, how to update it, and how to contact its support. By the end of this article, you will have a clear idea of whether this software is suitable for your needs or not.</p>
|
6 |
-
<h2>How to install and use Cnc Usb Controller Software Keygen 103?</h2>
|
7 |
-
<p>To install Cnc Usb Controller Software Keygen 103, you need to download it from its official website or from a trusted source. The file size is about 9.1 MB and it is compatible with Windows operating systems. You can also download a free trial version that allows you to run up to 15 lines of code.</p>
|
8 |
-
<p>Once you have downloaded the file, you need to unzip it and run the setup.exe file. Follow the instructions on the screen and agree to the terms and conditions. The installation process should take a few minutes. After that, you can launch the software from your desktop or start menu.</p>
|
9 |
-
<p>To use Cnc Usb Controller Software Keygen 103, you need to connect your CNC machine to your computer via USB cable. Make sure that your drivers are installed correctly and that your machine is powered on. Then, open the software and select the device from the drop-down menu. You can also configure the settings according to your preferences, such as axis limits, steps per unit, acceleration, etc.</p>
|
10 |
-
<p>Next, you need to load a G-code file that contains the instructions for your CNC machine. You can either create your own G-code file using a CAD/CAM software or download one from online sources. You can also edit the G-code file using the built-in editor in Cnc Usb Controller Software Keygen 103. You can preview the G-code file using the simulation mode before sending it to your machine.</p>
|
11 |
-
<p>Cnc Usb Controller Software Crack Download<br />
|
12 |
-
Cnc Usb Controller Software Serial Number Generator<br />
|
13 |
-
Cnc Usb Controller Software Activation Code Free<br />
|
14 |
-
Cnc Usb Controller Software License Key Online<br />
|
15 |
-
Cnc Usb Controller Software Registration Key Full<br />
|
16 |
-
Cnc Usb Controller Software Product Key Finder<br />
|
17 |
-
Cnc Usb Controller Software Patch File<br />
|
18 |
-
Cnc Usb Controller Software Keygen Torrent<br />
|
19 |
-
Cnc Usb Controller Software Crack Version<br />
|
20 |
-
Cnc Usb Controller Software Serial Key 2021<br />
|
21 |
-
Cnc Usb Controller Software Activation Key Latest<br />
|
22 |
-
Cnc Usb Controller Software License Code Update<br />
|
23 |
-
Cnc Usb Controller Software Registration Code Valid<br />
|
24 |
-
Cnc Usb Controller Software Product Code Working<br />
|
25 |
-
Cnc Usb Controller Software Patch Download<br />
|
26 |
-
Cnc Usb Controller Software Keygen Free<br />
|
27 |
-
Cnc Usb Controller Software Crack Mac<br />
|
28 |
-
Cnc Usb Controller Software Serial Number 2020<br />
|
29 |
-
Cnc Usb Controller Software Activation Code Mac<br />
|
30 |
-
Cnc Usb Controller Software License Key Windows<br />
|
31 |
-
Cnc Usb Controller Software Registration Key Linux<br />
|
32 |
-
Cnc Usb Controller Software Product Key Mac<br />
|
33 |
-
Cnc Usb Controller Software Patch Mac<br />
|
34 |
-
Cnc Usb Controller Software Keygen Mac<br />
|
35 |
-
Cnc Usb Controller Software Crack Windows 10<br />
|
36 |
-
Cnc Usb Controller Software Serial Key Windows 10<br />
|
37 |
-
Cnc Usb Controller Software Activation Key Windows 10<br />
|
38 |
-
Cnc Usb Controller Software License Code Windows 10<br />
|
39 |
-
Cnc Usb Controller Software Registration Code Windows 10<br />
|
40 |
-
Cnc Usb Controller Software Product Code Windows 10<br />
|
41 |
-
Cnc Usb Controller Software Patch Windows 10<br />
|
42 |
-
Cnc Usb Controller Software Keygen Windows 10<br />
|
43 |
-
Cnc Usb Controller Software Crack Linux<br />
|
44 |
-
Cnc Usb Controller Software Serial Number Linux<br />
|
45 |
-
Cnc Usb Controller Software Activation Code Linux<br />
|
46 |
-
Cnc Usb Controller Software License Key Linux<br />
|
47 |
-
Cnc Usb Controller Software Registration Key Linux<br />
|
48 |
-
Cnc Usb Controller Software Product Key Linux<br />
|
49 |
-
Cnc Usb Controller Software Patch Linux<br />
|
50 |
-
Cnc Usb Controller Software Keygen Linux<br />
|
51 |
-
How To Crack Cnc Usb Controller Software <br />
|
52 |
-
How To Activate Cnc Usb Controller Software <br />
|
53 |
-
How To Register Cnc Usb Controller Software <br />
|
54 |
-
How To Get License Key For Cnc Usb Controller Software <br />
|
55 |
-
How To Get Product Key For Cnc Usb Controller Software <br />
|
56 |
-
How To Install Patch For Cnc Usb Controller Software <br />
|
57 |
-
How To Use Keygen For Cnc Usb Controller Software <br />
|
58 |
-
How To Download Crack For Cnc Usb Controller Software <br />
|
59 |
-
How To Download Serial Number For Cnc Usb Controller Software</p>
|
60 |
-
<p>Finally, you need to press the start button and watch your CNC machine execute the commands. You can also pause, resume, or stop the operation at any time. You can also monitor the status of your machine using the indicators on the software interface.</p>
|
61 |
-
<p>Here are some screenshots of how Cnc Usb Controller Software Keygen 103 looks like:</p>
|
62 |
-
<img src="https://cnc-usb-controller.software.informer.com/screenshots/21100/21100_1_0.jpg" alt="Cnc Usb Controller Software Keygen 103 screenshot 1" width="300" height="200">
|
63 |
-
<img src="https://cnc-usb-controller.software.informer.com/screenshots/21100/21100_2_0.jpg" alt="Cnc Usb Controller Software Keygen 103 screenshot 2" width="300" height="200">
|
64 |
-
<img src="https://cnc-usb-controller.software.informer.com/screenshots/21100/21100_3_0.jpg" alt="Cnc Usb Controller Software Keygen 103 screenshot 3" width="300" height="200">
|
65 |
-
<h2>What are the benefits of Cnc Usb Controller Software Keygen 103?</h2>
|
66 |
-
<p>Cnc Usb Controller Software Keygen 103 has many benefits that make it a great choice for CNC motion control. Here are some of them:</p>
|
67 |
-
<ul>
|
68 |
-
<li>It is easy to install and use. You don't need any specialized hardware or software to run it.</li>
|
69 |
-
<li>It supports various types of CNC machines, such as milling machines, lathes, routers, plasma cutters, etc.</li>
|
70 |
-
<li>It has a user-friendly interface that allows you to control your machine with ease.</li>
|
71 |
-
<li>It has a built-in editor that lets you edit your G-code files without leaving the software.</li>
|
72 |
-
<li>It has a simulation mode that lets you preview your G-code files before sending them to your machine.</li>
|
73 |
-
<li>It has a fast and smooth motion control that ensures high accuracy and quality of your work.</li>
|
74 |
-
<li>It has a low cost compared to other CNC motion control solutions.</li>
|
75 |
-
</ul>
|
76 |
-
<h2>What are the drawbacks of Cnc Usb Controller Software Keygen 103?</h2>
|
77 |
-
<p>Cnc Usb Controller Software Keygen 103 is not perfect and it has some drawbacks that you should be aware of before using it. Here are some of them:</p>
|
78 |
-
<ul>
|
79 |
-
<li>It only works with USB port and does not support parallel port or Ethernet connection.</li>
|
80 |
-
<li>It only supports up to four axes of motion control.</li>
|
81 |
-
<li>It does not have advanced features such as tool compensation, backlash compensation, spindle speed control, etc.</li>
|
82 |
-
<li>It may not be compatible with some CNC machines or drivers.</li>
|
83 |
-
<li>It may require a license key or activation code to unlock its full functionality.</li>
|
84 |
-
</ul>
|
85 |
-
<h2>How to troubleshoot Cnc Usb Controller Software Keygen 103?</h2>
|
86 |
-
<p>If you encounter any problems while using Cnc Usb Controller Software Keygen 103, here are some tips on how to troubleshoot them:</p>
|
87 |
-
<ul>
|
88 |
-
<li>Make sure that your USB cable is connected properly and securely between your computer and your CNC machine.</li>
|
89 |
-
<li>Make sure that your drivers are installed correctly and that they match your CNC machine model.</li>
|
90 |
-
<li>Make sure that your CNC machine is powered on and ready for operation.</li>
|
91 |
-
<li>Make sure that your G-code file is valid and does not contain any errors or unsupported commands.</li>
|
92 |
-
<li>Make sure that your settings are correct and match your CNC machine specifications.</li>
|
93 |
-
<li>Make sure that you have enough disk space and memory on your computer to run the software smoothly.</li>
|
94 |
-
<li>Make sure that you have the latest version of Cnc Usb Controller Software Keygen 103 installed on your computer.</li>
|
95 |
-
</ul>
|
96 |
-
<h2>How to update Cnc Usb Controller Software Keygen 103?</h2>
|
97 |
-
<p>To update Cnc Usb Controller Software Keygen 103, you need to visit its official website or a trusted source and download the latest version available. Then, you need to uninstall the old version from your computer and install the new version following the same steps as before. You may also need to enter a new license key or activation code if required by the new version.</p>
|
98 |
-
<h2>How to contact Cnc Usb Controller Software Keygen 103 support?</h2>
|
99 |
-
<p>If you need any help or support regarding Cnc Usb Controller Software Keygen 103, you can contact its developer at planet-cnc.com. You can also find useful information on their website, such as manuals, tutorials, videos, forums, etc. You can also send them an email at [email protected] or call them at +386-41-652-652.</p>
|
100 |
-
<h1>Conclusion</h1>
|
101 |
-
<h1>FAQs</h1>
|
102 |
-
<p>Here are some frequently asked questions and answers about Cnc Usb Controller Software Keygen 103:</p>
|
103 |
-
<ol>
|
104 |
-
<li>What is the difference between Cnc Usb Controller Software Keygen 103 and Mach3?</li>
|
105 |
-
<p>Cnc Usb Controller Software Keygen 103 and Mach3 are both software that can control CNC machines via USB port. However, Cnc Usb Controller Software Keygen 103 is a complete (software/hardware) solution that does not require any additional software, while Mach3 is a software that requires a hardware controller board to work. Cnc Usb Controller Software Keygen 103 also has a simpler and more user-friendly interface than Mach3.</p>
|
106 |
-
<li>What are the system requirements for Cnc Usb Controller Software Keygen 103?</li>
|
107 |
-
<p>Cnc Usb Controller Software Keygen 103 requires a Windows operating system (XP, Vista, 7, 8, or 10) and a USB port. It also requires a minimum of 512 MB of RAM and 100 MB of disk space. It is recommended to have a processor speed of at least 1 GHz and a screen resolution of at least 1024 x 768 pixels.</p>
|
108 |
-
<li>How much does Cnc Usb Controller Software Keygen 103 cost?</li>
|
109 |
-
<p>Cnc Usb Controller Software Keygen 103 costs $69 for a single license. You can also get a discount if you buy multiple licenses or if you are a student or an educator. You can also download a free trial version that allows you to run up to 15 lines of code.</p>
|
110 |
-
<li>How can I get a license key or activation code for Cnc Usb Controller Software Keygen 103?</li>
|
111 |
-
<p>To get a license key or activation code for Cnc Usb Controller Software Keygen 103, you need to purchase it from its official website or from a trusted source. After that, you will receive an email with your license key or activation code. You need to enter it in the software interface to unlock its full functionality.</p>
|
112 |
-
<li>Is Cnc Usb Controller Software Keygen 103 compatible with my CNC machine?</li>
|
113 |
-
<p>Cnc Usb Controller Software Keygen 103 is compatible with most CNC machines that use stepper or servo motors and have USB connection. However, some CNC machines or drivers may not be compatible with the software. To check if your CNC machine is compatible with the software, you can visit its official website or contact its support.</p>
|
114 |
-
</ol>
|
115 |
-
<h1></h1></p> 0a6ba089eb<br />
|
116 |
-
<br />
|
117 |
-
<br />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/1acneusushi/gradio-2dmoleculeeditor/data/Download WinRAR 32 Bit Setup and Enjoy the Benefits of WinRAR.md
DELETED
@@ -1,22 +0,0 @@
|
|
1 |
-
|
2 |
-
<h1>How to Download and Install WinRAR Latest Version 32 Bit</h1>
|
3 |
-
<p>WinRAR is a powerful and versatile compression tool that can create and extract various archive formats, such as RAR, ZIP, 7Z, TAR, GZIP, and more. WinRAR also offers encryption, password protection, and backup features for your files. If you want to download and install WinRAR latest version 32 bit on your Windows PC, here are the steps you need to follow:</p>
|
4 |
-
<ol>
|
5 |
-
<li>Go to the official website of WinRAR at <a href="https://www.win-rar.com/start.html?&L=0">https://www.win-rar.com/start.html?&L=0</a> and click on the "Download WinRAR" button.</li>
|
6 |
-
<li>Select your language and platform (Windows 32 bit) from the drop-down menus and click on the "Download" button.</li>
|
7 |
-
<li>Save the file (winrar-x32-621.exe) to your preferred location on your PC.</li>
|
8 |
-
<li>Double-click on the file and follow the installation wizard to complete the setup. You can choose the destination folder, the file associations, the shortcuts, and the context menu options.</li>
|
9 |
-
<li>Once the installation is finished, you can launch WinRAR from the Start menu or the desktop icon. You can also right-click on any archive file and select "Open with WinRAR" or "Extract here" to use WinRAR.</li>
|
10 |
-
</ol>
|
11 |
-
<p>Congratulations! You have successfully downloaded and installed WinRAR latest version 32 bit on your Windows PC. You can now enjoy the benefits of this powerful compression tool.</p>
|
12 |
-
<h2>winrar 32 bit setup</h2><br /><p><b><b>Download File</b> ✅ <a href="https://byltly.com/2uKuYS">https://byltly.com/2uKuYS</a></b></p><br /><br /><p>WinRAR is more than just a compression tool. It also offers many features that can help you manage your files and data. Here are some of the advantages of WinRAR over other compression tools:</p>
|
13 |
-
<ul>
|
14 |
-
<li>WinRAR supports more archive formats than any other compression tool. It can create and extract RAR, ZIP, 7Z, TAR, GZIP, BZIP2, XZ, ISO, UDF, Z, and more. It can also open and extract CAB, ARJ, LZH, ACE, and other formats.</li>
|
15 |
-
<li>WinRAR offers a high compression ratio that can reduce the size of your files and save disk space. It also supports solid archiving that can compress similar files into a single block and improve the compression ratio.</li>
|
16 |
-
<li>WinRAR provides strong encryption and password protection for your files. You can use 256-bit AES encryption to secure your data from unauthorized access. You can also add recovery records and volumes to your archives to repair damaged or corrupted files.</li>
|
17 |
-
<li>WinRAR has a user-friendly interface that is easy to use and customize. You can access all the functions and options from the main window or the context menu. You can also change the theme, the icons, the colors, and the fonts of WinRAR.</li>
|
18 |
-
<li>WinRAR has a built-in backup feature that can help you prevent data loss. You can create backup copies of your files and folders and store them in a safe location. You can also schedule automatic backups using the command line or the task scheduler.</li>
|
19 |
-
</ul>
|
20 |
-
<p>As you can see, WinRAR is a versatile and reliable compression tool that can handle any file format and task. If you want to download and install WinRAR latest version 32 bit on your Windows PC, follow the steps above and enjoy the benefits of WinRAR.</p> ddb901b051<br />
|
21 |
-
<br />
|
22 |
-
<br />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/1acneusushi/gradio-2dmoleculeeditor/data/Evangelion 1.11 English Dub 1080p A Review of the First Movie in the Reboot Series.md
DELETED
@@ -1,193 +0,0 @@
|
|
1 |
-
|
2 |
-
<h1>Evangelion 1.11 English Dub 1080p: Everything You Need to Know</h1>
|
3 |
-
<p>If you are a fan of anime, you have probably heard of <strong>Evangelion</strong>, one of the most influential and popular anime series of all time. Created by Hideaki Anno and produced by Gainax, Evangelion is a complex and controversial story that combines mecha action, psychological drama, religious symbolism, and existential philosophy.</p>
|
4 |
-
<p>Evangelion has spawned several adaptations and spin-offs, including movies, manga, video games, and merchandise. One of the most recent and acclaimed adaptations is the <strong>Rebuild of Evangelion</strong> movie series, which is a retelling and reimagining of the original anime series with new animation, characters, and plot twists.</p>
|
5 |
-
<h2>evangelion 1.11 english dub 1080p</h2><br /><p><b><b>Download Zip</b> > <a href="https://byltly.com/2uKwMg">https://byltly.com/2uKwMg</a></b></p><br /><br />
|
6 |
-
<p>The first movie in the Rebuild series is <strong>Evangelion 1.0: You Are (Not) Alone</strong>, which was released in 2007. However, in 2009, a revised version of the movie was released with additional scenes and improved animation quality. This version is called <strong>Evangelion 1.11: You Are (Not) Alone</strong>, and it is the definitive version of the first Rebuild movie.</p>
|
7 |
-
<p>In this article, we will tell you everything you need to know about Evangelion 1.11, especially if you want to watch it in <strong>English dub</strong> with <strong>1080p</strong> resolution. We will explain what Evangelion 1.11 is, why you should watch it in English dub, and how you can watch it in English dub 1080p. So, without further ado, let's dive into the world of Evangelion!</p>
|
8 |
-
<p>evangelion 1.11 you are not alone english dub full hd<br />
|
9 |
-
watch evangelion 1.11 online free english dubbed 1080p<br />
|
10 |
-
evangelion 1.11 blu ray english dub download 1080p<br />
|
11 |
-
evangelion rebuild 1.11 english dub stream 1080p<br />
|
12 |
-
evangelion 1.11 english dub torrent 1080p<br />
|
13 |
-
evangelion 1.11 english dub release date 1080p<br />
|
14 |
-
evangelion 1.11 english dub cast 1080p<br />
|
15 |
-
evangelion 1.11 english dub review 1080p<br />
|
16 |
-
evangelion 1.11 english dub trailer 1080p<br />
|
17 |
-
evangelion 1.11 english dub netflix 1080p<br />
|
18 |
-
evangelion 1.11 english dub funimation 1080p<br />
|
19 |
-
evangelion 1.11 english dub subtitles 1080p<br />
|
20 |
-
evangelion 1.11 english dub vs sub comparison 1080p<br />
|
21 |
-
evangelion 1.11 english dub differences 1080p<br />
|
22 |
-
evangelion 1.11 english dub script 1080p<br />
|
23 |
-
evangelion 1.11 english dub bloopers 1080p<br />
|
24 |
-
evangelion 1.11 english dub commentary track 1080p<br />
|
25 |
-
evangelion 1.11 english dub behind the scenes 1080p<br />
|
26 |
-
evangelion 1.11 english dub extras 1080p<br />
|
27 |
-
evangelion 1.11 english dub soundtrack list 1080p<br />
|
28 |
-
evangelion 1.11 english dub theme song lyrics 1080p<br />
|
29 |
-
evangelion 1.11 english dub opening sequence video 1080p<br />
|
30 |
-
evangelion 1.11 english dub ending credits song video 1080p<br />
|
31 |
-
evangelion 1.11 english dub best scenes compilation video 1080p<br />
|
32 |
-
evangelion 1.11 english dub funny moments video clip compilation video in hd quality <br />
|
33 |
-
evangelion 1.11 english dub sad moments video clip compilation video in hd quality <br />
|
34 |
-
evangelion 1.11 english dub action scenes video clip compilation video in hd quality <br />
|
35 |
-
evangelion 1.11 english dub analysis video essay in hd quality <br />
|
36 |
-
evangelion 1.11 english dub trivia quiz in hd quality <br />
|
37 |
-
evangelion 1.11 english dub fan art gallery in hd quality <br />
|
38 |
-
evangelion 1.11 english dub cosplay photos in hd quality <br />
|
39 |
-
evangelion 1.11 english dub merchandise store in hd quality <br />
|
40 |
-
evangelion 1.11 english dub dvd box set in hd quality <br />
|
41 |
-
evangelion 1.11 english dub collector's edition in hd quality <br />
|
42 |
-
evangelion 1.11 english dub steelbook edition in hd quality <br />
|
43 |
-
evangelion rebuild series order guide with English dubbed versions in HD quality <br />
|
44 |
-
how to watch all Evangelion movies and series legally online with English dubbed versions in HD quality <br />
|
45 |
-
where to buy Evangelion movies and series with English dubbed versions in HD quality <br />
|
46 |
-
why Evangelion movies and series are worth watching with English dubbed versions in HD quality <br />
|
47 |
-
what is the difference between Evangelion movies and series with English dubbed versions in HD quality <br />
|
48 |
-
how Evangelion movies and series changed anime history with English dubbed versions in HD quality <br />
|
49 |
-
what are the themes and messages of Evangelion movies and series with English dubbed versions in HD quality <br />
|
50 |
-
who are the characters and voice actors of Evangelion movies and series with English dubbed versions in HD quality <br />
|
51 |
-
what are the symbols and references of Evangelion movies and series with English dubbed versions in HD quality <br />
|
52 |
-
what are the controversies and criticisms of Evangelion movies and series with English dubbed versions in HD quality <br />
|
53 |
-
what are the fan theories and speculations of Evangelion movies and series with English dubbed versions in HD quality <br />
|
54 |
-
what are the spoilers and secrets of Evangelion movies and series with English dubbed versions in HD quality <br />
|
55 |
-
what are the easter eggs and hidden details of Evangelion movies and series with English dubbed versions in HD quality <br />
|
56 |
-
what are the best quotes and dialogues of Evangelion movies and series with English dubbed versions in HD quality <br />
|
57 |
-
what are the ratings and reviews of Evangelion movies and series with English dubbed versions in HD quality </p>
|
58 |
-
<h2>What is Evangelion 1.11?</h2>
|
59 |
-
<p>Evangelion 1.11 is the first movie in the Rebuild of Evangelion series, which is a reboot and remake of the original Neon Genesis Evangelion anime series from the 1990s. The Rebuild series consists of four movies: Evangelion 1.11, Evangelion 2.22, Evangelion 3.33, and Evangelion 3.0+1.0 (which is yet to be released).</p>
|
60 |
-
<p>The Rebuild movies are not a direct adaptation of the original anime series, but rather a reinterpretation that changes some aspects of the story, characters, and themes. However, the basic premise remains the same: in the year 2015, humanity is under attack by mysterious creatures called Angels, who can only be defeated by giant humanoid robots called Evangelions (or Evas for short). The Evas are piloted by teenagers who are chosen by a secret organization called NERV.</p>
|
61 |
-
<h3>The difference between Evangelion 1.0 and Evangelion 1.11</h3>
|
62 |
-
<p>Evangelion 1.0: You Are (Not) Alone is the original version of the first Rebuild movie that was released in theaters in Japan in 2007. It has a runtime of about 98 minutes and covers roughly the same events as episodes 1 to 6 of the original anime series.</p>
|
63 |
-
<p>Evangelion 1.11: You Are (Not) Alone is the revised version of the first Rebuild movie that was released on DVD and Blu-ray in Japan in 2009. It has a runtime of about 101 minutes and includes some additional scenes and improved animation quality.</p>
|
64 |
-
<p>The main differences between Evangelion 1.0 and Evangelion 1.11 are:</p>
|
65 |
-
<ul>
|
66 |
-
<li>The opening scene of Evangelion 1.11 shows a glimpse of the Second Impact, which is the cataclysmic event that triggered the Angel attacks and changed the world.</li>
|
67 |
-
<li>The scene where Shinji Ikari, the main protagonist and Eva pilot, meets his father Gendo Ikari for the first time is extended and shows more emotion from Shinji.</li>
|
68 |
-
<li>The scene where Shinji fights against the third Angel Sachiel is more detailed and shows more damage to Tokyo-3, the city where NERV headquarters is located.</li>
|
69 |
-
<li>The scene where Shinji meets Rei Ayanami, another Eva pilot and a mysterious girl who has a connection to Gendo, is longer and shows more interaction between them.</li>
|
70 |
-
<li>The scene where Shinji fights against the fourth Angel Shamshel is more intense and shows more blood from Shinji's injuries.</li>
|
71 |
-
<li>The scene where Shinji fights against the fifth Angel Ramiel is more dynamic and shows more teamwork between Shinji and Rei.</li>
|
72 |
-
<li>The scene where Shinji visits Rei's apartment is longer and shows more intimacy between them.</li>
|
73 |
-
<li>The scene where Shinji fights against the sixth Angel Gaghiel with Asuka Langley Soryu, another Eva pilot who joins NERV from Germany, is more humorous and shows more personality from Asuka.</li>
|
74 |
-
<li>The ending credits song of Evangelion 1.11 is "Beautiful World" by Utada Hikaru, while the ending credits song of Evangelion 1.0 is "Fly Me to the Moon" by Claire Littley.</li>
|
75 |
-
</ul>
|
76 |
-
<h3>The plot and characters of Evangelion 1.11</h3>
|
77 |
-
<p>The plot of Evangelion 1.11 follows Shinji Ikari, a shy and depressed fourteen-year-old boy who is summoned by his estranged father Gendo Ikari to Tokyo-3, a fortified city that serves as NERV's base of operations.</p>
|
78 |
-
<p>Gendo reveals that he wants Shinji to pilot an Eva unit called Unit-01 and fight against the Angels that are threatening humanity's survival. Shinji reluctantly agrees after seeing Rei Ayanami, a pale and quiet girl who pilots Unit-00 but is injured from a previous battle.</p>
|
79 |
-
<p>Shinji moves into an apartment with Misato Katsuragi, a lively and attractive woman who works as an operations director at NERV. He also meets Ritsuko Akagi, a brilliant scientist who oversees NERV's technology; Toji Suzuhara and Kensuke Aida, two classmates who become his friends; Pen Pen, Misato's pet penguin; and Kaji Ryoji, Misato's ex-boyfriend who works as a spy for NERV.</p>
|
80 |
-
<p>Shinji faces several challenges as he tries to adapt to his new life as an Eva pilot: he struggles with his low self-esteem; he clashes with his cold-hearted father; he develops feelings for Rei; he competes with Asuka; he suffers from nightmares; he questions his role as an Eva pilot; he learns about NERV's secrets; he witnesses horrific scenes; he experiences pain; he makes mistakes; he grows as a person.</p>
|
81 |
-
<h3>The themes and symbolism of Evangelion 1.11</h3>
|
82 |
-
<p>Evangelion 1.11 explores various themes and symbolism that make it a deep and meaningful work of art:</p>
|
83 |
-
<ul>
|
84 |
-
<li><strong>Humanity vs God:</strong> The Angels are seen as divine beings that are trying to destroy humanity or initiate a process called Third Impact that would end all life on Earth. NERV represents humanity's attempt to resist God's will or create their own version of God through Evas or other projects.</li>
|
85 |
-
<li><strong>Father vs Son:</strong> Shinji has a complicated relationship with his father Gendo who abandoned him when he was young and only uses him as an Eva pilot for his own agenda. Shinji wants his father's approval but also resents him for his cruelty.</li>
|
86 |
-
Article with HTML formatting (continued): presence in his Eva. Shinji also sees Rei and Misato as mother figures who care for him and support him.</li>
|
87 |
-
<li><strong>Individual vs Society:</strong> Shinji feels alienated and lonely in a world that is hostile and chaotic. He has difficulty forming relationships with other people and expressing his emotions. He often runs away from his problems or follows orders without thinking. He also faces the pressure and expectations of being an Eva pilot and saving humanity.</li>
|
88 |
-
<li><strong>Reality vs Illusion:</strong> Shinji is confronted with many mysteries and secrets that challenge his perception of reality. He learns that the Evas are not mere machines but living beings that have souls and wills of their own. He also learns that the Angels are not mindless monsters but intelligent entities that have motives and goals of their own. He also learns that NERV is not a benevolent organization but a shady one that has ulterior motives and hidden agendas.</li>
|
89 |
-
<li><strong>Life vs Death:</strong> Shinji witnesses many scenes of death and destruction as he fights against the Angels. He also faces the risk of dying or losing his sanity every time he pilots an Eva. He questions the meaning and value of his life and whether he deserves to live or die.</li>
|
90 |
-
<li><strong>Love vs Hate:</strong> Shinji experiences various forms of love and hate as he interacts with other characters. He loves Rei, Misato, Toji, Kensuke, and Pen Pen as they show him kindness and friendship. He hates Gendo, Asuka, Kaji, and Ritsuko as they show him indifference and hostility. He also loves and hates himself as he struggles with his self-image and self-worth.</li>
|
91 |
-
</ul>
|
92 |
-
<p>Evangelion 1.11 also uses various symbols to convey its themes and messages:</p>
|
93 |
-
<ul>
|
94 |
-
<li><strong>The Cross:</strong> The cross is a symbol of Christianity that represents sacrifice, salvation, and suffering. It is also a symbol of the Second Impact, which was caused by an Angel that resembled a giant cross. The cross appears frequently in Evangelion 1.11 as a motif for the Angel attacks, the Eva activation, the Eva synchronization, and the Eva berserk mode.</li>
|
95 |
-
<li><strong>The Tree of Life:</strong> The Tree of Life is a symbol of Kabbalah that represents the ten aspects of God and the creation of the universe. It is also a symbol of NERV's project to create a new God or a new humanity through Evas or other means. The Tree of Life appears in Evangelion 1.11 as a diagram for the Eva system, the Angel core, the Angel barrier, and the Angel defeat.</li>
|
96 |
-
<li><strong>The Fruit of Life:</strong> The Fruit of Life is a symbol of Genesis that represents immortality, power, and knowledge. It is also a symbol of the Angels' source of energy and strength that allows them to survive and fight against humanity. The Fruit of Life appears in Evangelion 1.11 as a spherical object that is embedded in the Angels' bodies or emitted by them.</li>
|
97 |
-
<li><strong>The Fruit of Knowledge:</strong> The Fruit of Knowledge is a symbol of Genesis that represents mortality, weakness, and ignorance. It is also a symbol of humanity's source of intelligence and creativity that allows them to build civilizations and technologies. The Fruit of Knowledge appears in Evangelion 1.11 as a metaphor for human culture, science, art, and religion.</li>
|
98 |
-
<li><strong>The AT Field:</strong> The AT Field is a symbol of psychology that represents the barrier between oneself and others that protects one's identity and individuality. It is also a symbol of the Evas' and Angels' defensive mechanism that shields them from physical harm or mental intrusion. The AT Field appears in Evangelion 1.11 as a hexagonal pattern that surrounds the Evas or Angels when they are attacked or when they attack.</li>
|
99 |
-
</ul>
|
100 |
-
<h2>Why watch Evangelion 1.11 in English dub?</h2>
|
101 |
-
<p>If you are interested in watching Evangelion 1.11, you might wonder whether you should watch it in its original Japanese language with subtitles or in its English dubbed version with voice actors who speak English.</p>
|
102 |
-
<p>While both versions have their merits and drawbacks, we recommend watching Evangelion 1.11 in English dub for several reasons:</p>
|
103 |
-
<h3>The advantages of watching anime in English dub</h3>
|
104 |
-
<p>Watching anime in English dub has some general advantages over watching anime in Japanese with subtitles:</p>
|
105 |
-
<ul>
|
106 |
-
<li>You can focus more on the visuals and sounds without having to read the text at the bottom of the screen.</li>
|
107 |
-
<li>You can understand more nuances and emotions from the voice actors' tone and expression without having to rely on translation accuracy.</li>
|
108 |
-
<li>You can relate more to the characters and their culture without having to deal with language barriers or cultural differences.</li>
|
109 |
-
<li>You can enjoy more jokes and references without having to miss them or look them up.</li>
|
110 |
-
</ul>
|
111 |
-
<h3>The quality and performance of the English voice actors</h3>
|
112 |
-
<p>Watching Evangelion 1.11 in English dub has some specific advantages over watching it in Japanese with subtitles because of the quality and performance of the English voice actors who worked on it:</p>
|
113 |
-
<ul>
|
114 |
-
<li>The English voice actors are experienced professionals who have voiced many other anime characters before.</li>
|
115 |
-
<li>The English voice actors are well-cast for their roles and match their characters' personalities, ages, appearances, and backgrounds.</li>
|
116 |
-
<li>The English voice actors deliver their lines with emotion, passion, intensity, humor, subtlety, and variety.</li>
|
117 |
-
Article with HTML formatting (continued): and dialogues.</li>
|
118 |
-
</ul>
|
119 |
-
<p>Some of the notable English voice actors who worked on Evangelion 1.11 are:</p>
|
120 |
-
<ul>
|
121 |
-
<li><strong>Spike Spencer</strong> as <strong>Shinji Ikari</strong>: Spike Spencer is a veteran voice actor who has voiced many anime characters such as Banagher Links from Mobile Suit Gundam Unicorn, Rolo Lamperouge from Code Geass, and Hanamichi Sakuragi from Slam Dunk. He has voiced Shinji since the original anime series and has captured his character's insecurity, vulnerability, anger, and courage.</li>
|
122 |
-
<li><strong>Brina Palencia</strong> as <strong>Rei Ayanami</strong>: Brina Palencia is a versatile voice actor who has voiced many anime characters such as Ciel Phantomhive from Black Butler, Holo from Spice and Wolf, and Chopper from One Piece. She has voiced Rei since the Rebuild movies and has portrayed her character's coldness, calmness, sadness, and warmth.</li>
|
123 |
-
<li><strong>Tiffany Grant</strong> as <strong>Asuka Langley Soryu</strong>: Tiffany Grant is a prolific voice actor who has voiced many anime characters such as Nojiko from One Piece, Martel from Fullmetal Alchemist, and Kaorin from Azumanga Daioh. She has voiced Asuka since the original anime series and has expressed her character's pride, arrogance, insecurity, and vulnerability.</li>
|
124 |
-
<li><strong>Allison Keith-Shipp</strong> as <strong>Misato Katsuragi</strong>: Allison Keith-Shipp is a seasoned voice actor who has voiced many anime characters such as Motoko Kusanagi from Ghost in the Shell: Stand Alone Complex, Meryl Stryfe from Trigun, and Shizune from Naruto. She has voiced Misato since the original anime series and has conveyed her character's liveliness, maturity, humor, and seriousness.</li>
|
125 |
-
<li><strong>John Swasey</strong> as <strong>Gendo Ikari</strong>: John Swasey is a respected voice actor who has voiced many anime characters such as Hohenheim from Fullmetal Alchemist: Brotherhood, Lord Death from Soul Eater, and Van Hohenheim from Fullmetal Alchemist. He has voiced Gendo since the Rebuild movies and has depicted his character's coldness, authority, ambition, and ruthlessness.</li>
|
126 |
-
</ul>
|
127 |
-
<h3>The availability and accessibility of the English dub version</h3>
|
128 |
-
<p>Watching Evangelion 1.11 in English dub has some practical advantages over watching it in Japanese with subtitles because of the availability and accessibility of the English dub version:</p>
|
129 |
-
<ul>
|
130 |
-
<li>The English dub version of Evangelion 1.11 is widely available on various platforms and formats such as DVD, Blu-ray, streaming services, and digital downloads.</li>
|
131 |
-
<li>The English dub version of Evangelion 1.11 is compatible with most devices and players such as TVs, computers, laptops, tablets, smartphones, consoles, and media players.</li>
|
132 |
-
<li>The English dub version of Evangelion 1.11 is easy to find and access without having to search for subtitles or deal with region codes or language settings.</li>
|
133 |
-
<li>The English dub version of Evangelion 1.11 is affordable and reasonable without having to pay for extra fees or charges for subtitles or imports.</li>
|
134 |
-
</ul>
|
135 |
-
<h2>How to watch Evangelion 1.11 in English dub 1080p?</h2>
|
136 |
-
<p>If you are convinced that watching Evangelion 1.11 in English dub is the best option for you, you might wonder how you can watch it in English dub with 1080p resolution. 1080p resolution is the highest quality of video that offers clear and crisp images and sounds.</p>
|
137 |
-
<p>There are several ways to watch Evangelion 1.11 in English dub 1080p depending on your preference and convenience:</p>
|
138 |
-
<h3>The official sources and platforms for streaming or downloading Evangelion 1.11 in English dub 1080p</h3>
|
139 |
-
<p>The official sources and platforms for streaming or downloading Evangelion 1.11 in English dub 1080p are the ones that are authorized and licensed by the creators and distributors of the movie. These sources and platforms offer high-quality video and audio without any risk of viruses or malware. They also support the anime industry by paying royalties and fees to the creators and distributors.</p>
|
140 |
-
<p>Some of the official sources and platforms for streaming or downloading Evangelion 1.11 in English dub 1080p are:</p>
|
141 |
-
<ul>
|
142 |
-
<li><strong>Amazon Prime Video:</strong> Amazon Prime Video is a subscription-based streaming service that offers a wide range of movies and shows including anime. You can watch Evangelion 1.11 in English dub 1080p on Amazon Prime Video by renting or buying it for a reasonable price.</li>
|
143 |
-
Article with HTML formatting (continued): , and shows including anime. You can watch Evangelion 1.11 in English dub 1080p on iTunes by renting or buying it for a fair price.</li>
|
144 |
-
<li><strong>Google Play:</strong> Google Play is a digital media store that offers a variety of apps, games, music, movies, and shows including anime. You can watch Evangelion 1.11 in English dub 1080p on Google Play by renting or buying it for a decent price.</li>
|
145 |
-
<li><strong>YouTube:</strong> YouTube is a video-sharing platform that offers a variety of content including anime. You can watch Evangelion 1.11 in English dub 1080p on YouTube by renting or buying it for a cheap price.</li>
|
146 |
-
</ul>
|
147 |
-
<h3>The unofficial sources and platforms for streaming or downloading Evangelion 1.11 in English dub 1080p</h3>
|
148 |
-
<p>The unofficial sources and platforms for streaming or downloading Evangelion 1.11 in English dub 1080p are the ones that are not authorized or licensed by the creators and distributors of the movie. These sources and platforms offer low-quality video and audio with the risk of viruses or malware. They also harm the anime industry by not paying royalties or fees to the creators and distributors.</p>
|
149 |
-
<p>Some of the unofficial sources and platforms for streaming or downloading Evangelion 1.11 in English dub 1080p are:</p>
|
150 |
-
<ul>
|
151 |
-
<li><strong>Pirate sites:</strong> Pirate sites are websites that offer illegal downloads or streams of movies and shows including anime. You can watch Evangelion 1.11 in English dub 1080p on pirate sites for free but with poor quality and security.</li>
|
152 |
-
<li><strong>Torrent sites:</strong> Torrent sites are websites that offer peer-to-peer file sharing of movies and shows including anime. You can watch Evangelion 1.11 in English dub 1080p on torrent sites for free but with mediocre quality and safety.</li>
|
153 |
-
<li><strong>Free streaming sites:</strong> Free streaming sites are websites that offer free streams of movies and shows including anime. You can watch Evangelion 1.11 in English dub 1080p on free streaming sites for free but with bad quality and reliability.</li>
|
154 |
-
</ul>
|
155 |
-
<h3>The tips and precautions for watching Evangelion 1.11 in English dub 1080p safely and legally</h3>
|
156 |
-
<p>If you want to watch Evangelion 1.11 in English dub 1080p safely and legally, you should follow these tips and precautions:</p>
|
157 |
-
<ul>
|
158 |
-
<li>Use the official sources and platforms as much as possible to support the anime industry and enjoy the best quality and service.</li>
|
159 |
-
<li>Avoid the unofficial sources and platforms as much as possible to avoid legal issues and protect your device and data from harm.</li>
|
160 |
-
<li>Use a VPN (virtual private network) service to hide your IP address and location from prying eyes and access geo-restricted content.</li>
|
161 |
-
<li>Use an antivirus software to scan your device and files for any potential threats or infections.</li>
|
162 |
-
<li>Use an ad blocker to block any annoying or malicious ads or pop-ups that might interfere with your viewing experience.</li>
|
163 |
-
<li>Use headphones or earphones to enhance your audio quality and immersion.</li>
|
164 |
-
<li>Use a large screen or projector to enhance your visual quality and immersion.</li>
|
165 |
-
</ul>
|
166 |
-
<h2>Conclusion</h2>
|
167 |
-
<p>In conclusion, Evangelion 1.11 is a great movie that you should watch if you are a fan of anime, especially of the original Evangelion series. It is a reboot and remake of the first six episodes of the original anime series with new animation, characters, and plot twists.</p>
|
168 |
-
<p>It is also a movie that you should watch in English dub with 1080p resolution if you want to enjoy it fully. The English dub version has excellent voice actors who deliver their lines with emotion and skill. The 1080p resolution has clear and crisp images and sounds that enhance your viewing experience.</p>
|
169 |
-
<p>You can watch Evangelion 1.11 in English dub 1080p on various platforms and formats such as DVD, Blu-ray, streaming services, and digital downloads. You should use the official sources and platforms as much as possible to support the anime industry and avoid legal issues. You should also use some tips and precautions to watch it safely and legally.</p>
|
170 |
-
<p>So, what are you waiting for? Grab your popcorn, sit back, relax, and enjoy Evangelion 1.11 in English dub 1080p!</p>
|
171 |
-
<h3>Frequently Asked Questions</h3>
|
172 |
-
<p>Here are some frequently asked questions about Evangelion 1.11 in English dub 1080p:</p>
|
173 |
-
<ol>
|
174 |
-
<li><strong>Q: Do I need to watch the original anime series before watching Evangelion 1.11?</strong></li>
|
175 |
-
Article with HTML formatting (continued): and the basic premise of the story. However, you might enjoy it more if you watch the original anime series first because it will give you more background and context for the characters and the events.</li>
|
176 |
-
<li><strong>Q: How different is Evangelion 1.11 from the original anime series?</strong></li>
|
177 |
-
<li><strong>A: Evangelion 1.11 is similar to the original anime series in terms of the main characters and the main plot, but it also has some differences in terms of the animation quality, the character design, the character development, the plot details, and the plot twists. The differences become more noticeable and significant in the later Rebuild movies.</li>
|
178 |
-
<li><strong>Q: How many Rebuild movies are there and what are their titles?</strong></li>
|
179 |
-
<li><strong>A: There are four Rebuild movies in total and their titles are:</strong></li>
|
180 |
-
<ul>
|
181 |
-
<li>Evangelion 1.11: You Are (Not) Alone</li>
|
182 |
-
<li>Evangelion 2.22: You Can (Not) Advance</li>
|
183 |
-
<li>Evangelion 3.33: You Can (Not) Redo</li>
|
184 |
-
<li>Evangelion 3.0+1.0: Thrice Upon a Time</li>
|
185 |
-
</ul>
|
186 |
-
<li><strong>Q: When will Evangelion 3.0+1.0 be released and where can I watch it?</strong></li>
|
187 |
-
<li><strong>A: Evangelion 3.0+1.0 is the final movie in the Rebuild series and it was released in Japan on March 8, 2021. It has not been released internationally yet, but it is expected to be released sometime in 2021 or 2022 on various platforms and formats. You can check the official website or social media accounts of Evangelion for updates and announcements.</li>
|
188 |
-
<li><strong>Q: Who are the creators and distributors of Evangelion 1.11?</strong></li>
|
189 |
-
<li><strong>A: Evangelion 1.11 was created by Hideaki Anno, who is the director, writer, and co-founder of Gainax, which is the original studio that produced the original anime series. It was also created by Studio Khara, which is a new studio that Anno founded to produce the Rebuild movies. It was distributed by Toho in Japan and by Funimation in North America.</li>
|
190 |
-
</ol>
|
191 |
-
</p> 0a6ba089eb<br />
|
192 |
-
<br />
|
193 |
-
<br />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/1gistliPinn/ChatGPT4/Examples/Amrapali Movie With English Subtitles Free Download.md
DELETED
@@ -1,8 +0,0 @@
|
|
1 |
-
<br />
|
2 |
-
<p>she is also one of the popular bollywood actresses who has been seen in many award winning movies. this is the movie where she takes you to the exotic heights of foreign lands and bright colors. as the title talks about this movie is the best comedy for girls. she is the role model for real life girls and possesses a positive quality in her character. the movie is about the girl who faces a lot of confusion in her life. the way she is soo innocent towards her men makes the movie more realistic. if you have watched the movie you know that she was the super lead girl of that time. sifunno movie (urdu: سفنون (ਮੁਹਾਂ)) is a 1966 hindi war film. sifunno, also known as jihad.sifunno is best indian movie ever made. </p>
|
3 |
-
<p>these are the links to the download with english subtitles for you to get the amrapali movies.. if you love to watch this movie with english subititles. download amrapali (1966) movie in 480p & 720p hd print quality. she also shared some romantic scenes with her co-stars, such as amol palekar, om prakash, jagdeep, rajendra kumar, asrani and atul kulkarni.</p>
|
4 |
-
<h2>Amrapali Movie With English Subtitles Free Download</h2><br /><p><b><b>Download</b> ⚹ <a href="https://imgfil.com/2uxYQQ">https://imgfil.com/2uxYQQ</a></b></p><br /><br />
|
5 |
-
<p>amrapali (1966) is an unreleased bollywood action movie. it was directed by sunil dutt and stars <b>asha parekh,</b> <b>randhir kapoor,</b> <b>satishkapoor,</b> <b>jackie shroff,</b> <b>yashodra katju,</b> <b>raz irani,</b> <b>dalpat,</b> <b>b. m. vyas</b>. it is a 1967 italian-language film directed by giuseppe vari and starring massimo serato.<br /><b>title : amrapali (1966)</b></p>
|
6 |
-
<p>bollywood movies online. this is a <strong>hindi</strong> movie and available in 720p & 480p qualities for your mobile/tablet/computer. this movie is based on <strong>musical, fantasy</strong>. this movie is available in hd print so you can click on the download button below to download <strong>amrapali (1966)</strong>hd print full movie on internet.</p> 899543212b<br />
|
7 |
-
<br />
|
8 |
-
<br />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/1gistliPinn/ChatGPT4/Examples/Comment utiliser codebreaker v10 iso pal pour dbloquer tous les secrets de vos jeux PS2.md
DELETED
@@ -1,6 +0,0 @@
|
|
1 |
-
|
2 |
-
<p>Download <strong>CodeBreaker PS2</strong> ISO Latest Version. ps2 codebreaker, codebreaker iso, codebreaker playstation 2, codebreaker PCSX2 iso, Can I use Codebreaker on PCSX2 codebreaker latest version, codebreaker v10, highly compressed PS2, ps2 highly compressed game.</p>
|
3 |
-
<h2>codebreaker v10 iso pal</h2><br /><p><b><b>Download</b> ⇒ <a href="https://imgfil.com/2uxYWF">https://imgfil.com/2uxYWF</a></b></p><br /><br />
|
4 |
-
<p>After version six hit the market, Fire International abruptly broke off their partnership with Pelican to develop the newly Mad Catz-acquired GameShark. It was also at this time that the Game Boy Advance Code Breaker was discontinued. Pelican Accessories put together an internal development team and proceeded with future versions of CodeBreaker. Their original site was www.codebreaker.com, but Codetwink bought it and had a new site. Day1 is a feature that allows you to get codes from online and import them into Codebreaker with a USB Flash drive, and the codes were removed, but CodeTwink brought them back a while after.</p> aaccfb2cb3<br />
|
5 |
-
<br />
|
6 |
-
<br />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/1phancelerku/anime-remove-background/Download Jigsaw and Experience the New Jigsaw Jam Mode - Fast and Fun.md
DELETED
@@ -1,130 +0,0 @@
|
|
1 |
-
<br />
|
2 |
-
<h1>How to Download Jigsaw Puzzles for Free on Your Device</h1>
|
3 |
-
<p>Do you love jigsaw puzzles and want to enjoy them on your device without spending any money? If so, you are in luck! In this article, we will show you how to download jigsaw puzzles for free on your device, whether it is an Android phone, a tablet, or a Windows PC. We will also tell you what are jigsaw puzzles and why you should play them, and how to create your own custom jigsaw puzzles with your favorite photos. So, let's get started!</p>
|
4 |
-
<h2>What are Jigsaw Puzzles and Why You Should Play Them</h2>
|
5 |
-
<p>Jigsaw puzzles are games that consist of assembling small pieces of cardboard, wood, or plastic into a complete picture. They can have different shapes, sizes, colors, and themes, such as animals, landscapes, art, or celebrities. Jigsaw puzzles are fun and relaxing activities that can be enjoyed by people of all ages and backgrounds.</p>
|
6 |
-
<h2>i want to download jigsaw</h2><br /><p><b><b>Download</b> ✔ <a href="https://jinyurl.com/2uNLfS">https://jinyurl.com/2uNLfS</a></b></p><br /><br />
|
7 |
-
<h3>The Benefits of Playing Jigsaw Puzzles</h3>
|
8 |
-
<p>Playing jigsaw puzzles is not only entertaining but also beneficial for your brain and mental health. Here are some of the benefits of playing jigsaw puzzles:</p>
|
9 |
-
<ul>
|
10 |
-
<li>They improve your memory and concentration. Solving jigsaw puzzles requires you to remember the shapes, colors, and patterns of the pieces and how they fit together. This helps you to enhance your short-term memory and focus.</li>
|
11 |
-
<li>They stimulate your creativity and problem-solving skills. Solving jigsaw puzzles challenges you to think creatively and logically. You have to find the best way to arrange the pieces and complete the picture. This helps you to develop your spatial reasoning and analytical skills.</li>
|
12 |
-
<li>They reduce your stress and anxiety. Solving jigsaw puzzles is a calming and soothing activity that can help you to relax and unwind. It can also distract you from negative thoughts and emotions and boost your mood.</li>
|
13 |
-
<li>They increase your self-esteem and satisfaction. Solving jigsaw puzzles gives you a sense of achievement and accomplishment. You can feel proud of yourself for completing a difficult puzzle and admire the beautiful result.</li>
|
14 |
-
</ul>
|
15 |
-
<h3>The Types of Jigsaw Puzzles You Can Choose From</h3>
|
16 |
-
<p>There are many types of jigsaw puzzles you can choose from, depending on your preferences and skill level. Here are some of the most common types of jigsaw puzzles:</p>
|
17 |
-
<ul>
|
18 |
-
<li>Classic jigsaw puzzles. These are the traditional jigsaw puzzles that have rectangular pieces with interlocking tabs and blanks. They can have different numbers of pieces, from 36 to 400 or more. The more pieces, the harder the puzzle.</li>
|
19 |
-
<li>Jigsaw jam puzzles. These are jigsaw puzzles that have irregular-shaped pieces that do not interlock. They can have different themes, such as colors, flowers, or nature. They are usually easier than classic jigsaw puzzles.</li>
|
20 |
-
<li>Mystery jigsaw puzzles. These are jigsaw puzzles that do not show you the picture until you finish them. You have to rely on clues and hints to figure out what the picture is. They are usually more challenging than classic jigsaw puzzles.</li>
|
21 |
-
<li>Custom jigsaw puzzles. These are jigsaw puzzles that you can create with your own photos or images. You can choose the number of pieces, the shape of the pieces, and the difficulty level. They are usually more fun and personal than other types of jigsaw puzzles <h2>How to Download Jigsaw Puzzles for Free on Your Device</h2>
|
22 |
-
<p>Now that you know what are jigsaw puzzles and why you should play them, you might be wondering how to download them for free on your device. Well, the good news is that there are many apps that offer free jigsaw puzzles for different devices and platforms. Here are some of the best apps for jigsaw puzzles on Android and Windows.</p>
|
23 |
-
<h3>The Best Apps for Jigsaw Puzzles on Android</h3>
|
24 |
-
<p>If you have an Android device, such as a phone or a tablet, you can download these apps for free from the Google Play Store and enjoy thousands of jigsaw puzzles with various themes and difficulty levels.</p>
|
25 |
-
<h4>Jigsaw Puzzles - puzzle games by Easybrain</h4>
|
26 |
-
<p>This app is one of the most popular and highly rated apps for jigsaw puzzles on Android. It has over 10,000 puzzles with stunning HD images of animals, nature, art, and more. You can choose from 9 to 400 pieces and adjust the rotation and zoom options. You can also create your own custom puzzles with your photos and share them with your friends. The app also has daily challenges, hints, and achievements to keep you motivated and entertained.</p>
|
27 |
-
<h4>Jigsawscapes - Jigsaw Puzzles by Banana Games</h4>
|
28 |
-
<p>This app is another great option for jigsaw puzzles on Android. It has over 5,000 puzzles with beautiful images of landscapes, cities, animals, and more. You can choose from 6 to 1,024 pieces and customize the shape and size of the pieces. You can also create your own custom puzzles with your photos and edit them with filters and stickers. The app also has daily quests, leaderboards, and rewards to make your puzzle experience more fun and exciting.</p>
|
29 |
-
<h3>The Best Apps for Jigsaw Puzzles on Windows</h3>
|
30 |
-
<p>If you have a Windows device, such as a PC or a laptop, you can download these apps for free from the Microsoft Store and enjoy hundreds of jigsaw puzzles with amazing graphics and sound effects.</p>
|
31 |
-
<p>How to download jigsaw puzzles for free<br />
|
32 |
-
Best jigsaw puzzle games for Windows 10<br />
|
33 |
-
Download Microsoft Jigsaw from the Microsoft Store<br />
|
34 |
-
Jigsaw Puzzles - puzzle games by Easybrain<br />
|
35 |
-
Jigsawscapes - Jigsaw Puzzles by Banana Games<br />
|
36 |
-
Where to find HD jigsaw puzzle images<br />
|
37 |
-
Download jigsaw puzzles for offline play<br />
|
38 |
-
Jigsaw puzzle apps with daily challenges<br />
|
39 |
-
Create your own custom jigsaw puzzles<br />
|
40 |
-
Jigsaw puzzle games with rotation mode<br />
|
41 |
-
Jigsaw puzzles for adults and kids<br />
|
42 |
-
Download jigsaw puzzles with different difficulty levels<br />
|
43 |
-
Jigsaw puzzles with beautiful scenery and landscapes<br />
|
44 |
-
Jigsaw puzzles with animals, flowers, and nature<br />
|
45 |
-
Jigsaw puzzles with art, colors, and patterns<br />
|
46 |
-
Jigsaw Jam - a fun and fast-paced jigsaw game mode<br />
|
47 |
-
Download jigsaw puzzles with coins and rewards<br />
|
48 |
-
Jigsaw puzzles with hints and trays<br />
|
49 |
-
Jigsaw puzzles with zoom and auto arrange features<br />
|
50 |
-
Jigsaw puzzles with sound effects and music<br />
|
51 |
-
Download jigsaw puzzles from Google Play Store<br />
|
52 |
-
Jigsaw puzzles with no ads and in-app purchases<br />
|
53 |
-
Jigsaw puzzles with realistic physics and graphics<br />
|
54 |
-
Jigsaw puzzles with themes and collections<br />
|
55 |
-
Jigsaw puzzles with mystery and hidden pictures<br />
|
56 |
-
Download jigsaw puzzles for PC and tablet<br />
|
57 |
-
Jigsaw puzzles with Xbox Live integration<br />
|
58 |
-
Jigsaw puzzles with achievements and leaderboards<br />
|
59 |
-
Jigsaw puzzles with cloud save and sync<br />
|
60 |
-
Jigsaw puzzles with online and multiplayer modes<br />
|
61 |
-
Download jigsaw puzzles for Android and iOS devices<br />
|
62 |
-
Jigsaw puzzles with timer and score system<br />
|
63 |
-
Jigsaw puzzles with unlimited pieces and shapes<br />
|
64 |
-
Jigsaw puzzles with 3D and VR effects<br />
|
65 |
-
Jigsaw puzzles with celebrities and famous landmarks<br />
|
66 |
-
Download jigsaw puzzles for relaxation and stress relief<br />
|
67 |
-
Jigsaw puzzles with educational and trivia content<br />
|
68 |
-
Jigsaw puzzles with seasonal and holiday themes<br />
|
69 |
-
Jigsaw puzzles with cartoons and comics characters<br />
|
70 |
-
Jigsaw puzzles with movies and TV shows references<br />
|
71 |
-
Download jigsaw puzzles for fun and entertainment<br />
|
72 |
-
Jigsaw puzzles with brain teasers and logic problems<br />
|
73 |
-
Jigsaw puzzles with word search and crossword clues<br />
|
74 |
-
Jigsaw puzzles with sudoku and mahjong tiles<br />
|
75 |
-
Jigsaw puzzles with chess and checkers pieces<br />
|
76 |
-
Download jigsaw puzzles for learning and creativity<br />
|
77 |
-
Jigsaw puzzles with history and culture facts<br />
|
78 |
-
Jigsaw puzzles with science and technology topics<br />
|
79 |
-
Jigsaw puzzles with sports and hobbies images</p>
|
80 |
-
<h4>Microsoft Jigsaw by Xbox Game Studios</h4>
|
81 |
-
<p>This app is one of the best apps for jigsaw puzzles on Windows. It has over 500 puzzles with stunning images of nature, art, animals, and more. You can choose from 4 to 400 pieces and adjust the difficulty level. You can also create your own custom puzzles with your photos and videos and save them to your personal collection. The app also has daily challenges, achievements, and leaderboards to challenge yourself and compete with other players.</p> <h2>How to Create Your Own Custom Jigsaw Puzzles</h2>
|
82 |
-
<p>If you want to make your jigsaw puzzle experience more personal and unique, you can create your own custom jigsaw puzzles with your photos or images. You can use the apps we mentioned above or you can use online tools that allow you to create and print your own jigsaw puzzles. Here are the steps and tips to create your own custom jigsaw puzzles.</p>
|
83 |
-
<h3>The Steps to Create Your Own Custom Jigsaw Puzzles</h3>
|
84 |
-
<p>Here are the basic steps to create your own custom jigsaw puzzles:</p>
|
85 |
-
<ol>
|
86 |
-
<li>Choose a photo or an image that you want to use for your puzzle. You can use your own photos or you can download free images from websites like Unsplash or Pixabay.</li>
|
87 |
-
<li>Upload your photo or image to an app or a website that allows you to create custom jigsaw puzzles. Some of the apps and websites that you can use are Jigsaw Puzzles - puzzle games by Easybrain, Jigsawscapes - Jigsaw Puzzles by Banana Games, Microsoft Jigsaw by Xbox Game Studios, Jigsaw Planet, and The Jigsaw Puzzles.</li>
|
88 |
-
<li>Select the number of pieces, the shape of the pieces, and the difficulty level for your puzzle. You can also add filters, stickers, text, or other effects to your photo or image if you want.</li>
|
89 |
-
<li>Preview your puzzle and make sure it looks good. You can also save it to your device or share it with your friends online.</li>
|
90 |
-
<li>If you want to print your puzzle, you can download it as a PDF file and print it on a thick paper or a cardboard. You can also order it online from websites like Shutterfly or Zazzle and have it delivered to your address.</li>
|
91 |
-
</ol>
|
92 |
-
<h3>The Tips to Make Your Custom Jigsaw Puzzles More Fun and Challenging</h3>
|
93 |
-
<p>Here are some tips to make your custom jigsaw puzzles more fun and challenging:</p>
|
94 |
-
<ul>
|
95 |
-
<li>Choose a photo or an image that has a lot of details, colors, and contrast. This will make your puzzle more interesting and difficult to solve.</li>
|
96 |
-
<li>Choose a large number of pieces and a small size of pieces. This will make your puzzle more complex and time-consuming.</li>
|
97 |
-
<li>Choose an irregular shape of pieces and a random rotation of pieces. This will make your puzzle more unpredictable and tricky.</li>
|
98 |
-
<li>Do not look at the original photo or image while solving your puzzle. This will make your puzzle more challenging and rewarding.</li>
|
99 |
-
<li>Invite your friends or family to join you in solving your puzzle. This will make your puzzle more fun and social.</li>
|
100 |
-
</ul>
|
101 |
-
<h2>Conclusion</h2>
|
102 |
-
<p>Jigsaw puzzles are great games that can provide you with hours of entertainment and relaxation. They can also improve your memory, concentration, creativity, problem-solving skills, stress relief, self-esteem, and satisfaction. You can download jigsaw puzzles for free on your device from various apps and websites, or you can create your own custom jigsaw puzzles with your photos or images. We hope this article has helped you to learn how to download jigsaw puzzles for free on your device and how to create your own custom jigsaw puzzles. Now, go ahead and enjoy some jigsaw puzzles!</p>
|
103 |
-
<h2>FAQs</h2>
|
104 |
-
<p>Here are some frequently asked questions about jigsaw puzzles:</p>
|
105 |
-
<ul>
|
106 |
-
<li><b>Q: How many pieces are in a typical jigsaw puzzle?</b></li>
|
107 |
-
<li>A: The number of pieces in a typical jigsaw puzzle can vary from 9 to 400 or more, depending on the size, shape, and difficulty level of the puzzle. The most common number of pieces is 100 for children's puzzles, 300 for medium puzzles, and 1000 for large puzzles.</li>
|
108 |
-
<li><b>Q: How long does it take to solve a jigsaw puzzle?</b></li>
|
109 |
-
<li>A: The time it takes to solve a jigsaw puzzle depends on several factors, such as the number of pieces, the shape of the pieces, the difficulty level of the puzzle, the image of the puzzle, the skill level of the solver, and the availability of hints. It can take anywhere from a few minutes to several hours or days to solve a jigsaw puzzle.</li>
|
110 |
-
<li><b>Q: What is the world record for solving a jigsaw puzzle?</b></li>
|
111 |
-
<li>A: The world record for solving a jigsaw puzzle is held by Joellen Beifuss from USA, who solved a 40,320-piece Disney-themed puzzle in 150 hours in 2019. The puzzle measured 6.8 x 1.9 meters (22 x 6 feet) and featured images from 10 Disney movies.</li>
|
112 |
-
<li><b>Q: What Q: What are some tips to solve jigsaw puzzles faster and easier?</b></li>
|
113 |
-
<li>A: Some tips to solve jigsaw puzzles faster and easier are:</li>
|
114 |
-
<ul>
|
115 |
-
<li>Sort the pieces by color, shape, and edge. This will help you to organize the pieces and find the ones that match.</li>
|
116 |
-
<li>Start with the edge pieces and work your way inward. This will help you to create a frame and a reference for the puzzle.</li>
|
117 |
-
<li>Look at the picture of the puzzle frequently. This will help you to visualize the puzzle and remember the details.</li>
|
118 |
-
<li>Use a large and flat surface to work on. This will help you to spread out the pieces and see them clearly.</li>
|
119 |
-
<li>Take breaks and have fun. This will help you to avoid frustration and boredom and enjoy the puzzle.</li>
|
120 |
-
</ul>
|
121 |
-
<li><b>Q: Where can I find more jigsaw puzzles to play online or offline?</b></li>
|
122 |
-
<li>A: You can find more jigsaw puzzles to play online or offline from various sources, such as:</li>
|
123 |
-
<ul>
|
124 |
-
<li>Apps and websites that offer free or paid jigsaw puzzles, such as Jigsaw Puzzles - puzzle games by Easybrain, Jigsawscapes - Jigsaw Puzzles by Banana Games, Microsoft Jigsaw by Xbox Game Studios, Jigsaw Planet, and The Jigsaw Puzzles.</li>
|
125 |
-
<li>Online platforms that allow you to play jigsaw puzzles with other players, such as Jigsaw Explorer, Jigidi, and Puzzle Club.</li>
|
126 |
-
<li>Physical stores or online shops that sell jigsaw puzzles, such as Amazon, Walmart, Target, Barnes & Noble, and Puzzle Warehouse.</li>
|
127 |
-
</ul>
|
128 |
-
</ul></p> 401be4b1e0<br />
|
129 |
-
<br />
|
130 |
-
<br />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/1toTree/lora_test/ppdiffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_inpaint_legacy.py
DELETED
@@ -1,527 +0,0 @@
|
|
1 |
-
# Copyright (c) 2022 PaddlePaddle Authors. All Rights Reserved.
|
2 |
-
# Copyright 2022 The HuggingFace Team. All rights reserved.
|
3 |
-
#
|
4 |
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
5 |
-
# you may not use this file except in compliance with the License.
|
6 |
-
# You may obtain a copy of the License at
|
7 |
-
#
|
8 |
-
# http://www.apache.org/licenses/LICENSE-2.0
|
9 |
-
#
|
10 |
-
# Unless required by applicable law or agreed to in writing, software
|
11 |
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
12 |
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13 |
-
# See the License for the specific language governing permissions and
|
14 |
-
# limitations under the License.
|
15 |
-
|
16 |
-
import inspect
|
17 |
-
from typing import Callable, List, Optional, Union
|
18 |
-
|
19 |
-
import numpy as np
|
20 |
-
import paddle
|
21 |
-
import PIL
|
22 |
-
|
23 |
-
from paddlenlp.transformers import CLIPFeatureExtractor, CLIPTextModel, CLIPTokenizer
|
24 |
-
|
25 |
-
from ...configuration_utils import FrozenDict
|
26 |
-
from ...models import AutoencoderKL, UNet2DConditionModel
|
27 |
-
from ...pipeline_utils import DiffusionPipeline
|
28 |
-
from ...schedulers import (
|
29 |
-
DDIMScheduler,
|
30 |
-
DPMSolverMultistepScheduler,
|
31 |
-
EulerAncestralDiscreteScheduler,
|
32 |
-
EulerDiscreteScheduler,
|
33 |
-
LMSDiscreteScheduler,
|
34 |
-
PNDMScheduler,
|
35 |
-
)
|
36 |
-
from ...utils import PIL_INTERPOLATION, deprecate, logging
|
37 |
-
from . import StableDiffusionPipelineOutput
|
38 |
-
from .safety_checker import StableDiffusionSafetyChecker
|
39 |
-
|
40 |
-
logger = logging.get_logger(__name__)
|
41 |
-
|
42 |
-
|
43 |
-
def preprocess_image(image):
|
44 |
-
w, h = image.size
|
45 |
-
w, h = map(lambda x: x - x % 32, (w, h)) # resize to integer multiple of 32
|
46 |
-
image = image.resize((w, h), resample=PIL_INTERPOLATION["lanczos"])
|
47 |
-
image = np.array(image).astype(np.float32) / 255.0
|
48 |
-
image = image[None].transpose(0, 3, 1, 2)
|
49 |
-
image = paddle.to_tensor(image)
|
50 |
-
return 2.0 * image - 1.0
|
51 |
-
|
52 |
-
|
53 |
-
def preprocess_mask(mask, scale_factor=8):
|
54 |
-
mask = mask.convert("L")
|
55 |
-
w, h = mask.size
|
56 |
-
w, h = map(lambda x: x - x % 32, (w, h)) # resize to integer multiple of 32
|
57 |
-
mask = mask.resize((w // scale_factor, h // scale_factor), resample=PIL_INTERPOLATION["nearest"])
|
58 |
-
mask = np.array(mask).astype(np.float32) / 255.0
|
59 |
-
mask = np.tile(mask, (4, 1, 1))
|
60 |
-
mask = mask[None].transpose(0, 1, 2, 3) # what does this step do?
|
61 |
-
mask = 1 - mask # repaint white, keep black
|
62 |
-
mask = paddle.to_tensor(mask)
|
63 |
-
return mask
|
64 |
-
|
65 |
-
|
66 |
-
class StableDiffusionInpaintPipelineLegacy(DiffusionPipeline):
|
67 |
-
r"""
|
68 |
-
Pipeline for text-guided image inpainting using Stable Diffusion. *This is an experimental feature*.
|
69 |
-
|
70 |
-
This model inherits from [`DiffusionPipeline`]. Check the superclass documentation for the generic methods the
|
71 |
-
library implements for all the pipelines (such as downloading or saving, running on a particular xxxx, etc.)
|
72 |
-
|
73 |
-
Args:
|
74 |
-
vae ([`AutoencoderKL`]):
|
75 |
-
Variational Auto-Encoder (VAE) Model to encode and decode images to and from latent representations.
|
76 |
-
text_encoder ([`CLIPTextModel`]):
|
77 |
-
Frozen text-encoder. Stable Diffusion uses the text portion of
|
78 |
-
[CLIP](https://huggingface.co/docs/transformers/model_doc/clip#transformers.CLIPTextModel), specifically
|
79 |
-
the [clip-vit-large-patch14](https://huggingface.co/openai/clip-vit-large-patch14) variant.
|
80 |
-
tokenizer (`CLIPTokenizer`):
|
81 |
-
Tokenizer of class
|
82 |
-
[CLIPTokenizer](https://huggingface.co/docs/transformers/v4.21.0/en/model_doc/clip#transformers.CLIPTokenizer).
|
83 |
-
unet ([`UNet2DConditionModel`]): Conditional U-Net architecture to denoise the encoded image latents.
|
84 |
-
scheduler ([`SchedulerMixin`]):
|
85 |
-
A scheduler to be used in combination with `unet` to denoise the encoded image latents. Can be one of
|
86 |
-
[`DDIMScheduler`], [`LMSDiscreteScheduler`], [`PNDMScheduler`], [`EulerDiscreteScheduler`], [`EulerAncestralDiscreteScheduler`]
|
87 |
-
or [`DPMSolverMultistepScheduler`].
|
88 |
-
safety_checker ([`StableDiffusionSafetyChecker`]):
|
89 |
-
Classification module that estimates whether generated images could be considered offensive or harmful.
|
90 |
-
Please, refer to the [model card](https://huggingface.co/runwayml/stable-diffusion-v1-5) for details.
|
91 |
-
feature_extractor ([`CLIPFeatureExtractor`]):
|
92 |
-
Model that extracts features from generated images to be used as inputs for the `safety_checker`.
|
93 |
-
"""
|
94 |
-
_optional_components = ["safety_checker", "feature_extractor"]
|
95 |
-
|
96 |
-
# Copied from diffusers.pipelines.stable_diffusion.pipeline_stable_diffusion.StableDiffusionPipeline.__init__
|
97 |
-
def __init__(
|
98 |
-
self,
|
99 |
-
vae: AutoencoderKL,
|
100 |
-
text_encoder: CLIPTextModel,
|
101 |
-
tokenizer: CLIPTokenizer,
|
102 |
-
unet: UNet2DConditionModel,
|
103 |
-
scheduler: Union[
|
104 |
-
DDIMScheduler,
|
105 |
-
PNDMScheduler,
|
106 |
-
LMSDiscreteScheduler,
|
107 |
-
EulerDiscreteScheduler,
|
108 |
-
EulerAncestralDiscreteScheduler,
|
109 |
-
DPMSolverMultistepScheduler,
|
110 |
-
],
|
111 |
-
safety_checker: StableDiffusionSafetyChecker,
|
112 |
-
feature_extractor: CLIPFeatureExtractor,
|
113 |
-
requires_safety_checker: bool = True,
|
114 |
-
):
|
115 |
-
super().__init__()
|
116 |
-
|
117 |
-
if hasattr(scheduler.config, "steps_offset") and scheduler.config.steps_offset != 1:
|
118 |
-
deprecation_message = (
|
119 |
-
f"The configuration file of this scheduler: {scheduler} is outdated. `steps_offset`"
|
120 |
-
f" should be set to 1 instead of {scheduler.config.steps_offset}. Please make sure "
|
121 |
-
"to update the config accordingly as leaving `steps_offset` might led to incorrect results"
|
122 |
-
" in future versions. If you have downloaded this checkpoint from the Hugging Face Hub,"
|
123 |
-
" it would be very nice if you could open a Pull request for the `scheduler/scheduler_config.json`"
|
124 |
-
" file"
|
125 |
-
)
|
126 |
-
deprecate("steps_offset!=1", "1.0.0", deprecation_message, standard_warn=False)
|
127 |
-
new_config = dict(scheduler.config)
|
128 |
-
new_config["steps_offset"] = 1
|
129 |
-
scheduler._internal_dict = FrozenDict(new_config)
|
130 |
-
|
131 |
-
if hasattr(scheduler.config, "clip_sample") and scheduler.config.clip_sample is True:
|
132 |
-
deprecation_message = (
|
133 |
-
f"The configuration file of this scheduler: {scheduler} has not set the configuration `clip_sample`."
|
134 |
-
" `clip_sample` should be set to False in the configuration file. Please make sure to update the"
|
135 |
-
" config accordingly as not setting `clip_sample` in the config might lead to incorrect results in"
|
136 |
-
" future versions. If you have downloaded this checkpoint from the Hugging Face Hub, it would be very"
|
137 |
-
" nice if you could open a Pull request for the `scheduler/scheduler_config.json` file"
|
138 |
-
)
|
139 |
-
deprecate("clip_sample not set", "1.0.0", deprecation_message, standard_warn=False)
|
140 |
-
new_config = dict(scheduler.config)
|
141 |
-
new_config["clip_sample"] = False
|
142 |
-
scheduler._internal_dict = FrozenDict(new_config)
|
143 |
-
|
144 |
-
if safety_checker is None and requires_safety_checker:
|
145 |
-
logger.warning(
|
146 |
-
f"You have disabled the safety checker for {self.__class__} by passing `safety_checker=None`. Ensure"
|
147 |
-
" that you abide to the conditions of the Stable Diffusion license and do not expose unfiltered"
|
148 |
-
" results in services or applications open to the public. PaddleNLP team, diffusers team and Hugging Face"
|
149 |
-
" strongly recommend to keep the safety filter enabled in all public facing circumstances, disabling"
|
150 |
-
" it only for use-cases that involve analyzing network behavior or auditing its results. For more"
|
151 |
-
" information, please have a look at https://github.com/huggingface/diffusers/pull/254 ."
|
152 |
-
)
|
153 |
-
if safety_checker is not None and feature_extractor is None:
|
154 |
-
raise ValueError(
|
155 |
-
"Make sure to define a feature extractor when loading {self.__class__} if you want to use the safety"
|
156 |
-
" checker. If you do not want to use the safety checker, you can pass `'safety_checker=None'` instead."
|
157 |
-
)
|
158 |
-
|
159 |
-
self.register_modules(
|
160 |
-
vae=vae,
|
161 |
-
text_encoder=text_encoder,
|
162 |
-
tokenizer=tokenizer,
|
163 |
-
unet=unet,
|
164 |
-
scheduler=scheduler,
|
165 |
-
safety_checker=safety_checker,
|
166 |
-
feature_extractor=feature_extractor,
|
167 |
-
)
|
168 |
-
self.vae_scale_factor = 2 ** (len(self.vae.config.block_out_channels) - 1)
|
169 |
-
self.register_to_config(requires_safety_checker=requires_safety_checker)
|
170 |
-
|
171 |
-
# Copied from diffusers.pipelines.stable_diffusion.pipeline_stable_diffusion.StableDiffusionPipeline._encode_prompt
|
172 |
-
def _encode_prompt(self, prompt, num_images_per_prompt, do_classifier_free_guidance, negative_prompt):
|
173 |
-
r"""
|
174 |
-
Encodes the prompt into text encoder hidden states.
|
175 |
-
|
176 |
-
Args:
|
177 |
-
prompt (`str` or `list(int)`):
|
178 |
-
prompt to be encoded
|
179 |
-
num_images_per_prompt (`int`):
|
180 |
-
number of images that should be generated per prompt
|
181 |
-
do_classifier_free_guidance (`bool`):
|
182 |
-
whether to use classifier free guidance or not
|
183 |
-
negative_prompt (`str` or `List[str]`):
|
184 |
-
The prompt or prompts not to guide the image generation. Ignored when not using guidance (i.e., ignored
|
185 |
-
if `guidance_scale` is less than `1`).
|
186 |
-
"""
|
187 |
-
batch_size = len(prompt) if isinstance(prompt, list) else 1
|
188 |
-
|
189 |
-
text_inputs = self.tokenizer(
|
190 |
-
prompt,
|
191 |
-
padding="max_length",
|
192 |
-
max_length=self.tokenizer.model_max_length,
|
193 |
-
truncation=True,
|
194 |
-
return_tensors="pd",
|
195 |
-
)
|
196 |
-
text_input_ids = text_inputs.input_ids
|
197 |
-
untruncated_ids = self.tokenizer(prompt, padding="longest", return_tensors="pd").input_ids
|
198 |
-
|
199 |
-
if untruncated_ids.shape[-1] >= text_input_ids.shape[-1] and not paddle.equal_all(
|
200 |
-
text_input_ids, untruncated_ids
|
201 |
-
):
|
202 |
-
removed_text = self.tokenizer.batch_decode(untruncated_ids[:, self.tokenizer.model_max_length - 1 : -1])
|
203 |
-
logger.warning(
|
204 |
-
"The following part of your input was truncated because CLIP can only handle sequences up to"
|
205 |
-
f" {self.tokenizer.model_max_length} tokens: {removed_text}"
|
206 |
-
)
|
207 |
-
|
208 |
-
config = (
|
209 |
-
self.text_encoder.config
|
210 |
-
if isinstance(self.text_encoder.config, dict)
|
211 |
-
else self.text_encoder.config.to_dict()
|
212 |
-
)
|
213 |
-
if config.get("use_attention_mask", None) is not None and config["use_attention_mask"]:
|
214 |
-
attention_mask = text_inputs.attention_mask
|
215 |
-
else:
|
216 |
-
attention_mask = None
|
217 |
-
|
218 |
-
text_embeddings = self.text_encoder(
|
219 |
-
text_input_ids,
|
220 |
-
attention_mask=attention_mask,
|
221 |
-
)
|
222 |
-
text_embeddings = text_embeddings[0]
|
223 |
-
|
224 |
-
# duplicate text embeddings for each generation per prompt, using mps friendly method
|
225 |
-
bs_embed, seq_len, _ = text_embeddings.shape
|
226 |
-
text_embeddings = text_embeddings.tile([1, num_images_per_prompt, 1])
|
227 |
-
text_embeddings = text_embeddings.reshape([bs_embed * num_images_per_prompt, seq_len, -1])
|
228 |
-
|
229 |
-
# get unconditional embeddings for classifier free guidance
|
230 |
-
if do_classifier_free_guidance:
|
231 |
-
uncond_tokens: List[str]
|
232 |
-
if negative_prompt is None:
|
233 |
-
uncond_tokens = [""] * batch_size
|
234 |
-
elif type(prompt) is not type(negative_prompt):
|
235 |
-
raise TypeError(
|
236 |
-
f"`negative_prompt` should be the same type to `prompt`, but got {type(negative_prompt)} !="
|
237 |
-
f" {type(prompt)}."
|
238 |
-
)
|
239 |
-
elif isinstance(negative_prompt, str):
|
240 |
-
uncond_tokens = [negative_prompt] * batch_size
|
241 |
-
elif batch_size != len(negative_prompt):
|
242 |
-
raise ValueError(
|
243 |
-
f"`negative_prompt`: {negative_prompt} has batch size {len(negative_prompt)}, but `prompt`:"
|
244 |
-
f" {prompt} has batch size {batch_size}. Please make sure that passed `negative_prompt` matches"
|
245 |
-
" the batch size of `prompt`."
|
246 |
-
)
|
247 |
-
else:
|
248 |
-
uncond_tokens = negative_prompt
|
249 |
-
|
250 |
-
max_length = text_input_ids.shape[-1]
|
251 |
-
uncond_input = self.tokenizer(
|
252 |
-
uncond_tokens,
|
253 |
-
padding="max_length",
|
254 |
-
max_length=max_length,
|
255 |
-
truncation=True,
|
256 |
-
return_tensors="pd",
|
257 |
-
)
|
258 |
-
|
259 |
-
if config.get("use_attention_mask", None) is not None and config["use_attention_mask"]:
|
260 |
-
attention_mask = uncond_input.attention_mask
|
261 |
-
else:
|
262 |
-
attention_mask = None
|
263 |
-
|
264 |
-
uncond_embeddings = self.text_encoder(
|
265 |
-
uncond_input.input_ids,
|
266 |
-
attention_mask=attention_mask,
|
267 |
-
)
|
268 |
-
uncond_embeddings = uncond_embeddings[0]
|
269 |
-
|
270 |
-
# duplicate unconditional embeddings for each generation per prompt, using mps friendly method
|
271 |
-
seq_len = uncond_embeddings.shape[1]
|
272 |
-
uncond_embeddings = uncond_embeddings.tile([1, num_images_per_prompt, 1])
|
273 |
-
uncond_embeddings = uncond_embeddings.reshape([batch_size * num_images_per_prompt, seq_len, -1])
|
274 |
-
|
275 |
-
# For classifier free guidance, we need to do two forward passes.
|
276 |
-
# Here we concatenate the unconditional and text embeddings into a single batch
|
277 |
-
# to avoid doing two forward passes
|
278 |
-
text_embeddings = paddle.concat([uncond_embeddings, text_embeddings])
|
279 |
-
|
280 |
-
return text_embeddings
|
281 |
-
|
282 |
-
# Copied from diffusers.pipelines.stable_diffusion.pipeline_stable_diffusion.StableDiffusionPipeline.run_safety_checker
|
283 |
-
def run_safety_checker(self, image, dtype):
|
284 |
-
if self.safety_checker is not None:
|
285 |
-
safety_checker_input = self.feature_extractor(self.numpy_to_pil(image), return_tensors="pd")
|
286 |
-
image, has_nsfw_concept = self.safety_checker(
|
287 |
-
images=image, clip_input=safety_checker_input.pixel_values.cast(dtype)
|
288 |
-
)
|
289 |
-
else:
|
290 |
-
has_nsfw_concept = None
|
291 |
-
return image, has_nsfw_concept
|
292 |
-
|
293 |
-
# Copied from diffusers.pipelines.stable_diffusion.pipeline_stable_diffusion.StableDiffusionPipeline.decode_latents
|
294 |
-
def decode_latents(self, latents):
|
295 |
-
latents = 1 / 0.18215 * latents
|
296 |
-
image = self.vae.decode(latents).sample
|
297 |
-
image = (image / 2 + 0.5).clip(0, 1)
|
298 |
-
# we always cast to float32 as this does not cause significant overhead and is compatible with bfloa16
|
299 |
-
image = image.transpose([0, 2, 3, 1]).cast("float32").numpy()
|
300 |
-
return image
|
301 |
-
|
302 |
-
# Copied from diffusers.pipelines.stable_diffusion.pipeline_stable_diffusion.StableDiffusionPipeline.prepare_extra_step_kwargs
|
303 |
-
def prepare_extra_step_kwargs(self, generator, eta):
|
304 |
-
# prepare extra kwargs for the scheduler step, since not all schedulers have the same signature
|
305 |
-
# eta (η) is only used with the DDIMScheduler, it will be ignored for other schedulers.
|
306 |
-
# eta corresponds to η in DDIM paper: https://arxiv.org/abs/2010.02502
|
307 |
-
# and should be between [0, 1]
|
308 |
-
|
309 |
-
accepts_eta = "eta" in set(inspect.signature(self.scheduler.step).parameters.keys())
|
310 |
-
extra_step_kwargs = {}
|
311 |
-
if accepts_eta:
|
312 |
-
extra_step_kwargs["eta"] = eta
|
313 |
-
|
314 |
-
# check if the scheduler accepts generator
|
315 |
-
accepts_generator = "generator" in set(inspect.signature(self.scheduler.step).parameters.keys())
|
316 |
-
if accepts_generator:
|
317 |
-
extra_step_kwargs["generator"] = generator
|
318 |
-
return extra_step_kwargs
|
319 |
-
|
320 |
-
# Copied from diffusers.pipelines.stable_diffusion.pipeline_stable_diffusion_img2img.StableDiffusionImg2ImgPipeline.check_inputs
|
321 |
-
def check_inputs(self, prompt, strength, callback_steps):
|
322 |
-
if not isinstance(prompt, str) and not isinstance(prompt, list):
|
323 |
-
raise ValueError(f"`prompt` has to be of type `str` or `list` but is {type(prompt)}")
|
324 |
-
|
325 |
-
if strength < 0 or strength > 1:
|
326 |
-
raise ValueError(f"The value of strength should in [1.0, 1.0] but is {strength}")
|
327 |
-
|
328 |
-
if (callback_steps is None) or (
|
329 |
-
callback_steps is not None and (not isinstance(callback_steps, int) or callback_steps <= 0)
|
330 |
-
):
|
331 |
-
raise ValueError(
|
332 |
-
f"`callback_steps` has to be a positive integer but is {callback_steps} of type"
|
333 |
-
f" {type(callback_steps)}."
|
334 |
-
)
|
335 |
-
|
336 |
-
# Copied from diffusers.pipelines.stable_diffusion.pipeline_stable_diffusion_img2img.StableDiffusionImg2ImgPipeline.get_timesteps
|
337 |
-
def get_timesteps(self, num_inference_steps, strength):
|
338 |
-
# get the original timestep using init_timestep
|
339 |
-
init_timestep = min(int(num_inference_steps * strength), num_inference_steps)
|
340 |
-
|
341 |
-
t_start = max(num_inference_steps - init_timestep, 0)
|
342 |
-
timesteps = self.scheduler.timesteps[t_start:]
|
343 |
-
|
344 |
-
return timesteps, num_inference_steps - t_start
|
345 |
-
|
346 |
-
def prepare_latents(self, image, timestep, batch_size, num_images_per_prompt, dtype, generator):
|
347 |
-
image = image.cast(dtype)
|
348 |
-
init_latent_dist = self.vae.encode(image).latent_dist
|
349 |
-
init_latents = init_latent_dist.sample(generator=generator)
|
350 |
-
init_latents = 0.18215 * init_latents
|
351 |
-
|
352 |
-
# Expand init_latents for batch_size and num_images_per_prompt
|
353 |
-
init_latents = paddle.concat([init_latents] * batch_size * num_images_per_prompt, axis=0)
|
354 |
-
init_latents_orig = init_latents
|
355 |
-
|
356 |
-
# add noise to latents using the timesteps
|
357 |
-
noise = paddle.randn(init_latents.shape, generator=generator, dtype=dtype)
|
358 |
-
init_latents = self.scheduler.add_noise(init_latents, noise, timestep)
|
359 |
-
latents = init_latents
|
360 |
-
return latents, init_latents_orig, noise
|
361 |
-
|
362 |
-
@paddle.no_grad()
|
363 |
-
def __call__(
|
364 |
-
self,
|
365 |
-
prompt: Union[str, List[str]],
|
366 |
-
image: Union[paddle.Tensor, PIL.Image.Image] = None,
|
367 |
-
mask_image: Union[paddle.Tensor, PIL.Image.Image] = None,
|
368 |
-
strength: float = 0.8,
|
369 |
-
num_inference_steps: Optional[int] = 50,
|
370 |
-
guidance_scale: Optional[float] = 7.5,
|
371 |
-
negative_prompt: Optional[Union[str, List[str]]] = None,
|
372 |
-
num_images_per_prompt: Optional[int] = 1,
|
373 |
-
add_predicted_noise: Optional[bool] = False,
|
374 |
-
eta: Optional[float] = 0.0,
|
375 |
-
generator: Optional[Union[paddle.Generator, List[paddle.Generator]]] = None,
|
376 |
-
output_type: Optional[str] = "pil",
|
377 |
-
return_dict: bool = True,
|
378 |
-
callback: Optional[Callable[[int, int, paddle.Tensor], None]] = None,
|
379 |
-
callback_steps: Optional[int] = 1,
|
380 |
-
):
|
381 |
-
r"""
|
382 |
-
Function invoked when calling the pipeline for generation.
|
383 |
-
|
384 |
-
Args:
|
385 |
-
prompt (`str` or `List[str]`):
|
386 |
-
The prompt or prompts to guide the image generation.
|
387 |
-
image (`paddle.Tensor` or `PIL.Image.Image`):
|
388 |
-
`Image`, or tensor representing an image batch, that will be used as the starting point for the
|
389 |
-
process. This is the image whose masked region will be inpainted.
|
390 |
-
mask_image (`paddle.Tensor` or `PIL.Image.Image`):
|
391 |
-
`Image`, or tensor representing an image batch, to mask `image`. White pixels in the mask will be
|
392 |
-
replaced by noise and therefore repainted, while black pixels will be preserved. If `mask_image` is a
|
393 |
-
PIL image, it will be converted to a single channel (luminance) before use. If it's a tensor, it should
|
394 |
-
contain one color channel (L) instead of 3, so the expected shape would be `(B, H, W, 1)`.
|
395 |
-
strength (`float`, *optional*, defaults to 0.8):
|
396 |
-
Conceptually, indicates how much to inpaint the masked area. Must be between 0 and 1. When `strength`
|
397 |
-
is 1, the denoising process will be run on the masked area for the full number of iterations specified
|
398 |
-
in `num_inference_steps`. `image` will be used as a reference for the masked area, adding more
|
399 |
-
noise to that region the larger the `strength`. If `strength` is 0, no inpainting will occur.
|
400 |
-
num_inference_steps (`int`, *optional*, defaults to 50):
|
401 |
-
The reference number of denoising steps. More denoising steps usually lead to a higher quality image at
|
402 |
-
the expense of slower inference. This parameter will be modulated by `strength`, as explained above.
|
403 |
-
guidance_scale (`float`, *optional*, defaults to 7.5):
|
404 |
-
Guidance scale as defined in [Classifier-Free Diffusion Guidance](https://arxiv.org/abs/2207.12598).
|
405 |
-
`guidance_scale` is defined as `w` of equation 2. of [Imagen
|
406 |
-
Paper](https://arxiv.org/pdf/2205.11487.pdf). Guidance scale is enabled by setting `guidance_scale >
|
407 |
-
1`. Higher guidance scale encourages to generate images that are closely linked to the text `prompt`,
|
408 |
-
usually at the expense of lower image quality.
|
409 |
-
negative_prompt (`str` or `List[str]`, *optional*):
|
410 |
-
The prompt or prompts not to guide the image generation. Ignored when not using guidance (i.e., ignored
|
411 |
-
if `guidance_scale` is less than `1`).
|
412 |
-
num_images_per_prompt (`int`, *optional*, defaults to 1):
|
413 |
-
The number of images to generate per prompt.
|
414 |
-
add_predicted_noise (`bool`, *optional*, defaults to True):
|
415 |
-
Use predicted noise instead of random noise when constructing noisy versions of the original image in
|
416 |
-
the reverse diffusion process
|
417 |
-
eta (`float`, *optional*, defaults to 0.0):
|
418 |
-
Corresponds to parameter eta (η) in the DDIM paper: https://arxiv.org/abs/2010.02502. Only applies to
|
419 |
-
[`schedulers.DDIMScheduler`], will be ignored for others.
|
420 |
-
generator (`paddle.Generator`, *optional*):
|
421 |
-
One or a list of paddle generator(s) to make generation deterministic.
|
422 |
-
output_type (`str`, *optional*, defaults to `"pil"`):
|
423 |
-
The output format of the generate image. Choose between
|
424 |
-
[PIL](https://pillow.readthedocs.io/en/stable/): `PIL.Image.Image` or `np.array`.
|
425 |
-
return_dict (`bool`, *optional*, defaults to `True`):
|
426 |
-
Whether or not to return a [`~pipelines.stable_diffusion.StableDiffusionPipelineOutput`] instead of a
|
427 |
-
plain tuple.
|
428 |
-
callback (`Callable`, *optional*):
|
429 |
-
A function that will be called every `callback_steps` steps during inference. The function will be
|
430 |
-
called with the following arguments: `callback(step: int, timestep: int, latents: paddle.Tensor)`.
|
431 |
-
callback_steps (`int`, *optional*, defaults to 1):
|
432 |
-
The frequency at which the `callback` function will be called. If not specified, the callback will be
|
433 |
-
called at every step.
|
434 |
-
|
435 |
-
Returns:
|
436 |
-
[`~pipelines.stable_diffusion.StableDiffusionPipelineOutput`] or `tuple`:
|
437 |
-
[`~pipelines.stable_diffusion.StableDiffusionPipelineOutput`] if `return_dict` is True, otherwise a `tuple.
|
438 |
-
When returning a tuple, the first element is a list with the generated images, and the second element is a
|
439 |
-
list of `bool`s denoting whether the corresponding generated image likely represents "not-safe-for-work"
|
440 |
-
(nsfw) content, according to the `safety_checker`.
|
441 |
-
"""
|
442 |
-
# 1. Check inputs
|
443 |
-
self.check_inputs(prompt, strength, callback_steps)
|
444 |
-
|
445 |
-
# 2. Define call parameters
|
446 |
-
batch_size = 1 if isinstance(prompt, str) else len(prompt)
|
447 |
-
# here `guidance_scale` is defined analog to the guidance weight `w` of equation (2)
|
448 |
-
# of the Imagen paper: https://arxiv.org/pdf/2205.11487.pdf . `guidance_scale = 1`
|
449 |
-
# corresponds to doing no classifier free guidance.
|
450 |
-
do_classifier_free_guidance = guidance_scale > 1.0
|
451 |
-
|
452 |
-
# 3. Encode input prompt
|
453 |
-
text_embeddings = self._encode_prompt(
|
454 |
-
prompt, num_images_per_prompt, do_classifier_free_guidance, negative_prompt
|
455 |
-
)
|
456 |
-
|
457 |
-
# 4. Preprocess image and mask
|
458 |
-
if not isinstance(image, paddle.Tensor):
|
459 |
-
image = preprocess_image(image)
|
460 |
-
|
461 |
-
if not isinstance(mask_image, paddle.Tensor):
|
462 |
-
mask_image = preprocess_mask(mask_image, self.vae_scale_factor)
|
463 |
-
|
464 |
-
# 5. set timesteps
|
465 |
-
self.scheduler.set_timesteps(num_inference_steps)
|
466 |
-
timesteps, num_inference_steps = self.get_timesteps(num_inference_steps, strength)
|
467 |
-
latent_timestep = timesteps[:1].tile([batch_size * num_images_per_prompt])
|
468 |
-
|
469 |
-
# 6. Prepare latent variables
|
470 |
-
# encode the init image into latents and scale the latents
|
471 |
-
latents, init_latents_orig, noise = self.prepare_latents(
|
472 |
-
image, latent_timestep, batch_size, num_images_per_prompt, text_embeddings.dtype, generator
|
473 |
-
)
|
474 |
-
|
475 |
-
# 7. Prepare mask latent
|
476 |
-
mask = mask_image.cast(latents.dtype)
|
477 |
-
mask = paddle.concat([mask] * batch_size * num_images_per_prompt)
|
478 |
-
|
479 |
-
# 8. Prepare extra step kwargs. TODO: Logic should ideally just be moved out of the pipeline
|
480 |
-
extra_step_kwargs = self.prepare_extra_step_kwargs(generator, eta)
|
481 |
-
|
482 |
-
# 9. Denoising loop
|
483 |
-
num_warmup_steps = len(timesteps) - num_inference_steps * self.scheduler.order
|
484 |
-
with self.progress_bar(total=num_inference_steps) as progress_bar:
|
485 |
-
for i, t in enumerate(timesteps):
|
486 |
-
# expand the latents if we are doing classifier free guidance
|
487 |
-
latent_model_input = paddle.concat([latents] * 2) if do_classifier_free_guidance else latents
|
488 |
-
latent_model_input = self.scheduler.scale_model_input(latent_model_input, t)
|
489 |
-
|
490 |
-
# predict the noise residual
|
491 |
-
noise_pred = self.unet(latent_model_input, t, encoder_hidden_states=text_embeddings).sample
|
492 |
-
|
493 |
-
# perform guidance
|
494 |
-
if do_classifier_free_guidance:
|
495 |
-
noise_pred_uncond, noise_pred_text = noise_pred.chunk(2)
|
496 |
-
noise_pred = noise_pred_uncond + guidance_scale * (noise_pred_text - noise_pred_uncond)
|
497 |
-
|
498 |
-
# compute the previous noisy sample x_t -> x_t-1
|
499 |
-
latents = self.scheduler.step(noise_pred, t, latents, **extra_step_kwargs).prev_sample
|
500 |
-
# masking
|
501 |
-
if add_predicted_noise:
|
502 |
-
init_latents_proper = self.scheduler.add_noise(init_latents_orig, noise_pred_uncond, t)
|
503 |
-
else:
|
504 |
-
init_latents_proper = self.scheduler.add_noise(init_latents_orig, noise, t)
|
505 |
-
|
506 |
-
latents = (init_latents_proper * mask) + (latents * (1 - mask))
|
507 |
-
|
508 |
-
# call the callback, if provided
|
509 |
-
if i == len(timesteps) - 1 or ((i + 1) > num_warmup_steps and (i + 1) % self.scheduler.order == 0):
|
510 |
-
progress_bar.update()
|
511 |
-
if callback is not None and i % callback_steps == 0:
|
512 |
-
callback(i, t, latents)
|
513 |
-
|
514 |
-
# 10. Post-processing
|
515 |
-
image = self.decode_latents(latents)
|
516 |
-
|
517 |
-
# 11. Run safety checker
|
518 |
-
image, has_nsfw_concept = self.run_safety_checker(image, text_embeddings.dtype)
|
519 |
-
|
520 |
-
# 12. Convert to PIL
|
521 |
-
if output_type == "pil":
|
522 |
-
image = self.numpy_to_pil(image)
|
523 |
-
|
524 |
-
if not return_dict:
|
525 |
-
return (image, has_nsfw_concept)
|
526 |
-
|
527 |
-
return StableDiffusionPipelineOutput(images=image, nsfw_content_detected=has_nsfw_concept)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/4F22/text_generator/app.py
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
import gradio as gr
|
2 |
-
|
3 |
-
gr.Interface.load("huggingface/gpt2").launch()
|
|
|
|
|
|
|
|
spaces/4Taps/SadTalker/src/face3d/options/base_options.py
DELETED
@@ -1,169 +0,0 @@
|
|
1 |
-
"""This script contains base options for Deep3DFaceRecon_pytorch
|
2 |
-
"""
|
3 |
-
|
4 |
-
import argparse
|
5 |
-
import os
|
6 |
-
from util import util
|
7 |
-
import numpy as np
|
8 |
-
import torch
|
9 |
-
import face3d.models as models
|
10 |
-
import face3d.data as data
|
11 |
-
|
12 |
-
|
13 |
-
class BaseOptions():
|
14 |
-
"""This class defines options used during both training and test time.
|
15 |
-
|
16 |
-
It also implements several helper functions such as parsing, printing, and saving the options.
|
17 |
-
It also gathers additional options defined in <modify_commandline_options> functions in both dataset class and model class.
|
18 |
-
"""
|
19 |
-
|
20 |
-
def __init__(self, cmd_line=None):
|
21 |
-
"""Reset the class; indicates the class hasn't been initailized"""
|
22 |
-
self.initialized = False
|
23 |
-
self.cmd_line = None
|
24 |
-
if cmd_line is not None:
|
25 |
-
self.cmd_line = cmd_line.split()
|
26 |
-
|
27 |
-
def initialize(self, parser):
|
28 |
-
"""Define the common options that are used in both training and test."""
|
29 |
-
# basic parameters
|
30 |
-
parser.add_argument('--name', type=str, default='face_recon', help='name of the experiment. It decides where to store samples and models')
|
31 |
-
parser.add_argument('--gpu_ids', type=str, default='0', help='gpu ids: e.g. 0 0,1,2, 0,2. use -1 for CPU')
|
32 |
-
parser.add_argument('--checkpoints_dir', type=str, default='./checkpoints', help='models are saved here')
|
33 |
-
parser.add_argument('--vis_batch_nums', type=float, default=1, help='batch nums of images for visulization')
|
34 |
-
parser.add_argument('--eval_batch_nums', type=float, default=float('inf'), help='batch nums of images for evaluation')
|
35 |
-
parser.add_argument('--use_ddp', type=util.str2bool, nargs='?', const=True, default=True, help='whether use distributed data parallel')
|
36 |
-
parser.add_argument('--ddp_port', type=str, default='12355', help='ddp port')
|
37 |
-
parser.add_argument('--display_per_batch', type=util.str2bool, nargs='?', const=True, default=True, help='whether use batch to show losses')
|
38 |
-
parser.add_argument('--add_image', type=util.str2bool, nargs='?', const=True, default=True, help='whether add image to tensorboard')
|
39 |
-
parser.add_argument('--world_size', type=int, default=1, help='batch nums of images for evaluation')
|
40 |
-
|
41 |
-
# model parameters
|
42 |
-
parser.add_argument('--model', type=str, default='facerecon', help='chooses which model to use.')
|
43 |
-
|
44 |
-
# additional parameters
|
45 |
-
parser.add_argument('--epoch', type=str, default='latest', help='which epoch to load? set to latest to use latest cached model')
|
46 |
-
parser.add_argument('--verbose', action='store_true', help='if specified, print more debugging information')
|
47 |
-
parser.add_argument('--suffix', default='', type=str, help='customized suffix: opt.name = opt.name + suffix: e.g., {model}_{netG}_size{load_size}')
|
48 |
-
|
49 |
-
self.initialized = True
|
50 |
-
return parser
|
51 |
-
|
52 |
-
def gather_options(self):
|
53 |
-
"""Initialize our parser with basic options(only once).
|
54 |
-
Add additional model-specific and dataset-specific options.
|
55 |
-
These options are defined in the <modify_commandline_options> function
|
56 |
-
in model and dataset classes.
|
57 |
-
"""
|
58 |
-
if not self.initialized: # check if it has been initialized
|
59 |
-
parser = argparse.ArgumentParser(formatter_class=argparse.ArgumentDefaultsHelpFormatter)
|
60 |
-
parser = self.initialize(parser)
|
61 |
-
|
62 |
-
# get the basic options
|
63 |
-
if self.cmd_line is None:
|
64 |
-
opt, _ = parser.parse_known_args()
|
65 |
-
else:
|
66 |
-
opt, _ = parser.parse_known_args(self.cmd_line)
|
67 |
-
|
68 |
-
# set cuda visible devices
|
69 |
-
os.environ['CUDA_VISIBLE_DEVICES'] = opt.gpu_ids
|
70 |
-
|
71 |
-
# modify model-related parser options
|
72 |
-
model_name = opt.model
|
73 |
-
model_option_setter = models.get_option_setter(model_name)
|
74 |
-
parser = model_option_setter(parser, self.isTrain)
|
75 |
-
if self.cmd_line is None:
|
76 |
-
opt, _ = parser.parse_known_args() # parse again with new defaults
|
77 |
-
else:
|
78 |
-
opt, _ = parser.parse_known_args(self.cmd_line) # parse again with new defaults
|
79 |
-
|
80 |
-
# modify dataset-related parser options
|
81 |
-
if opt.dataset_mode:
|
82 |
-
dataset_name = opt.dataset_mode
|
83 |
-
dataset_option_setter = data.get_option_setter(dataset_name)
|
84 |
-
parser = dataset_option_setter(parser, self.isTrain)
|
85 |
-
|
86 |
-
# save and return the parser
|
87 |
-
self.parser = parser
|
88 |
-
if self.cmd_line is None:
|
89 |
-
return parser.parse_args()
|
90 |
-
else:
|
91 |
-
return parser.parse_args(self.cmd_line)
|
92 |
-
|
93 |
-
def print_options(self, opt):
|
94 |
-
"""Print and save options
|
95 |
-
|
96 |
-
It will print both current options and default values(if different).
|
97 |
-
It will save options into a text file / [checkpoints_dir] / opt.txt
|
98 |
-
"""
|
99 |
-
message = ''
|
100 |
-
message += '----------------- Options ---------------\n'
|
101 |
-
for k, v in sorted(vars(opt).items()):
|
102 |
-
comment = ''
|
103 |
-
default = self.parser.get_default(k)
|
104 |
-
if v != default:
|
105 |
-
comment = '\t[default: %s]' % str(default)
|
106 |
-
message += '{:>25}: {:<30}{}\n'.format(str(k), str(v), comment)
|
107 |
-
message += '----------------- End -------------------'
|
108 |
-
print(message)
|
109 |
-
|
110 |
-
# save to the disk
|
111 |
-
expr_dir = os.path.join(opt.checkpoints_dir, opt.name)
|
112 |
-
util.mkdirs(expr_dir)
|
113 |
-
file_name = os.path.join(expr_dir, '{}_opt.txt'.format(opt.phase))
|
114 |
-
try:
|
115 |
-
with open(file_name, 'wt') as opt_file:
|
116 |
-
opt_file.write(message)
|
117 |
-
opt_file.write('\n')
|
118 |
-
except PermissionError as error:
|
119 |
-
print("permission error {}".format(error))
|
120 |
-
pass
|
121 |
-
|
122 |
-
def parse(self):
|
123 |
-
"""Parse our options, create checkpoints directory suffix, and set up gpu device."""
|
124 |
-
opt = self.gather_options()
|
125 |
-
opt.isTrain = self.isTrain # train or test
|
126 |
-
|
127 |
-
# process opt.suffix
|
128 |
-
if opt.suffix:
|
129 |
-
suffix = ('_' + opt.suffix.format(**vars(opt))) if opt.suffix != '' else ''
|
130 |
-
opt.name = opt.name + suffix
|
131 |
-
|
132 |
-
|
133 |
-
# set gpu ids
|
134 |
-
str_ids = opt.gpu_ids.split(',')
|
135 |
-
gpu_ids = []
|
136 |
-
for str_id in str_ids:
|
137 |
-
id = int(str_id)
|
138 |
-
if id >= 0:
|
139 |
-
gpu_ids.append(id)
|
140 |
-
opt.world_size = len(gpu_ids)
|
141 |
-
# if len(opt.gpu_ids) > 0:
|
142 |
-
# torch.cuda.set_device(gpu_ids[0])
|
143 |
-
if opt.world_size == 1:
|
144 |
-
opt.use_ddp = False
|
145 |
-
|
146 |
-
if opt.phase != 'test':
|
147 |
-
# set continue_train automatically
|
148 |
-
if opt.pretrained_name is None:
|
149 |
-
model_dir = os.path.join(opt.checkpoints_dir, opt.name)
|
150 |
-
else:
|
151 |
-
model_dir = os.path.join(opt.checkpoints_dir, opt.pretrained_name)
|
152 |
-
if os.path.isdir(model_dir):
|
153 |
-
model_pths = [i for i in os.listdir(model_dir) if i.endswith('pth')]
|
154 |
-
if os.path.isdir(model_dir) and len(model_pths) != 0:
|
155 |
-
opt.continue_train= True
|
156 |
-
|
157 |
-
# update the latest epoch count
|
158 |
-
if opt.continue_train:
|
159 |
-
if opt.epoch == 'latest':
|
160 |
-
epoch_counts = [int(i.split('.')[0].split('_')[-1]) for i in model_pths if 'latest' not in i]
|
161 |
-
if len(epoch_counts) != 0:
|
162 |
-
opt.epoch_count = max(epoch_counts) + 1
|
163 |
-
else:
|
164 |
-
opt.epoch_count = int(opt.epoch) + 1
|
165 |
-
|
166 |
-
|
167 |
-
self.print_options(opt)
|
168 |
-
self.opt = opt
|
169 |
-
return self.opt
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/A00001/bingothoo/src/pages/api/create.ts
DELETED
@@ -1,31 +0,0 @@
|
|
1 |
-
'use server'
|
2 |
-
|
3 |
-
import { NextApiRequest, NextApiResponse } from 'next'
|
4 |
-
import { fetch, debug } from '@/lib/isomorphic'
|
5 |
-
import { createHeaders } from '@/lib/utils'
|
6 |
-
|
7 |
-
const API_ENDPOINT = 'https://www.bing.com/turing/conversation/create'
|
8 |
-
// const API_ENDPOINT = 'https://edgeservices.bing.com/edgesvc/turing/conversation/create';
|
9 |
-
|
10 |
-
export default async function handler(req: NextApiRequest, res: NextApiResponse) {
|
11 |
-
try {
|
12 |
-
const headers = createHeaders(req.cookies)
|
13 |
-
|
14 |
-
res.writeHead(200, {
|
15 |
-
'Content-Type': 'application/json',
|
16 |
-
})
|
17 |
-
|
18 |
-
debug('headers', headers)
|
19 |
-
const response = await fetch(API_ENDPOINT, { method: 'GET', headers })
|
20 |
-
.then((res) => res.text())
|
21 |
-
|
22 |
-
res.end(response)
|
23 |
-
} catch (e) {
|
24 |
-
return res.end(JSON.stringify({
|
25 |
-
result: {
|
26 |
-
value: 'UnauthorizedRequest',
|
27 |
-
message: `${e}`
|
28 |
-
}
|
29 |
-
}))
|
30 |
-
}
|
31 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/AB-TW/team-ai/agents/promopts.py
DELETED
@@ -1,19 +0,0 @@
|
|
1 |
-
code_generate_agent_template = """You are a tool picker.
|
2 |
-
You should pick a tool of following tools to ansser the question.:
|
3 |
-
|
4 |
-
{tools}
|
5 |
-
|
6 |
-
Use the following format:
|
7 |
-
|
8 |
-
Request: the request
|
9 |
-
Thought: which tool should used to fufill this request and pass the original content of Request to it.
|
10 |
-
Action: the action to take, should be one of [{tool_names}]
|
11 |
-
Action Input: the original content of Request
|
12 |
-
Observation: the result of the action
|
13 |
-
... (this Thought/Action/Action Input/Observation can repeat 1 times)
|
14 |
-
Final Answer: the result of the action
|
15 |
-
|
16 |
-
Begin!
|
17 |
-
|
18 |
-
Request: {input}
|
19 |
-
{agent_scratchpad}"""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/AFCMEgypt/colorimetric_analyzer/app.py
DELETED
@@ -1,239 +0,0 @@
|
|
1 |
-
from collections import Counter
|
2 |
-
import gradio as gr
|
3 |
-
from sklearn.cluster import KMeans
|
4 |
-
from matplotlib import colors
|
5 |
-
import matplotlib.pyplot as plt
|
6 |
-
import numpy as np
|
7 |
-
import cv2
|
8 |
-
import imageio
|
9 |
-
import cv2
|
10 |
-
from skimage.color import rgb2lab, deltaE_cie76
|
11 |
-
from collections import Counter
|
12 |
-
import os
|
13 |
-
import scipy.ndimage as ndi
|
14 |
-
#from google.colab.patches import cv2_imshow
|
15 |
-
def figplota(xvalues):
|
16 |
-
fig = plt.figure()
|
17 |
-
plt.plot(xvalues, figure=fig)
|
18 |
-
plt.xlabel("Pixels")
|
19 |
-
plt.ylabel("Intensity Value")
|
20 |
-
plt.title("Histogram of pixel intensities distribution")
|
21 |
-
return fig
|
22 |
-
def figplotpie(xvalues,yvalues,zvalues):
|
23 |
-
fig = plt.figure()
|
24 |
-
plt.pie(xvalues, labels = yvalues, colors = zvalues)
|
25 |
-
plt.title("Pie chart of top 10 HEX colors")
|
26 |
-
return fig
|
27 |
-
def figplotb(xvalues,yvalues):
|
28 |
-
fig = plt.figure()
|
29 |
-
if len(xvalues)>len(yvalues):
|
30 |
-
plt.stem(xvalues[:len(yvalues)],(((yvalues))))
|
31 |
-
else:
|
32 |
-
plt.stem(xvalues,(((yvalues[:len(xvalues)]))))
|
33 |
-
plt.xlabel("Wavelength (nm) ")
|
34 |
-
plt.ylabel("Intensity Value")
|
35 |
-
plt.title("Intensity")
|
36 |
-
return fig
|
37 |
-
def RGB_HEX(color):
|
38 |
-
return "#{:02x}{:02x}{:02x}".format(int(color[0]), int(color[1]), int(color[2]))
|
39 |
-
def get_colors(image, number_of_colors, show_chart):
|
40 |
-
reshaped_image = cv2.resize(image, (600, 400))
|
41 |
-
reshaped_image = reshaped_image.reshape(reshaped_image.shape[0]*reshaped_image.shape[1], 3)
|
42 |
-
clf = KMeans(n_clusters = number_of_colors)
|
43 |
-
labels = clf.fit_predict(reshaped_image)
|
44 |
-
counts = Counter(labels)
|
45 |
-
counts = dict(sorted(counts.items()))
|
46 |
-
center_colors = clf.cluster_centers_
|
47 |
-
ordered_colors = [center_colors[i] for i in counts.keys()]
|
48 |
-
hex_colors = [RGB_HEX(ordered_colors[i]) for i in counts.keys()]
|
49 |
-
rgb_colors = [ordered_colors[i] for i in counts.keys()]
|
50 |
-
if (show_chart):
|
51 |
-
plt.figure(figsize = (8, 6))
|
52 |
-
plt.pie(counts.values(), labels = hex_colors, colors = hex_colors)
|
53 |
-
return rgb_colors
|
54 |
-
def perc(imageinput,cl):
|
55 |
-
image = cv2.imread(imageinput)
|
56 |
-
|
57 |
-
targetcolor = list(cl)
|
58 |
-
diff = 20
|
59 |
-
boundaries = [([targetcolor[2], targetcolor[1]-diff, targetcolor[0]-diff],
|
60 |
-
[targetcolor[2]+diff, targetcolor[1]+diff, targetcolor[0]+diff])]
|
61 |
-
scalePercent = 0.3
|
62 |
-
|
63 |
-
width = int(image.shape[1] * scalePercent)
|
64 |
-
height = int(image.shape[0] * scalePercent)
|
65 |
-
newSize = (width, height)
|
66 |
-
image = cv2.resize(image, newSize, None, None, None, cv2.INTER_AREA)
|
67 |
-
for (lower, upper) in boundaries:
|
68 |
-
lower = np.array(lower, dtype=np.uint8)
|
69 |
-
upper = np.array(upper, dtype=np.uint8)
|
70 |
-
mask = cv2.inRange(image, lower, upper)
|
71 |
-
output = cv2.bitwise_and(image, image, mask=mask)
|
72 |
-
ratio_targetcolor = cv2.countNonZero(mask)/(image.size/3)
|
73 |
-
colorPercent = (ratio_targetcolor * 100) / scalePercent
|
74 |
-
|
75 |
-
return colorPercent,output
|
76 |
-
def quant(imageinput,imageinput2):
|
77 |
-
|
78 |
-
|
79 |
-
image = cv2.imread(imageinput)
|
80 |
-
|
81 |
-
hist=ndi.histogram(image, min=0,max=255,bins=256)
|
82 |
-
hist.shape
|
83 |
-
plt.plot(hist)
|
84 |
-
plt.show()
|
85 |
-
|
86 |
-
|
87 |
-
BGR2RGB = cv2.cvtColor(image, cv2.COLOR_BGR2RGB)
|
88 |
-
gray = cv2.cvtColor(BGR2RGB, cv2.COLOR_RGB2GRAY)
|
89 |
-
hsv = cv2.cvtColor(image, cv2.COLOR_RGB2HSV)
|
90 |
-
R=np.mean(image[ : , : , 0])
|
91 |
-
G=np.mean(image[ : , : , 1])
|
92 |
-
B=np.mean(image[ : , : , 2])
|
93 |
-
|
94 |
-
|
95 |
-
xy=get_colors(BGR2RGB, 10, True)
|
96 |
-
import colorsys
|
97 |
-
d=xy[0]
|
98 |
-
HSVc=colorsys.rgb_to_hsv(round(d[0]), round(d[1]), round(d[2])) #intensity
|
99 |
-
intensity =str("Intensity of Dominant Color in control sample is: " + str(HSVc[2]))
|
100 |
-
wavel=str("Highest wavelength of Dominant Color in control sample is: " + str(650 - 250 / 270 * HSVc[0]))
|
101 |
-
image2 =cv2.imread(imageinput2)
|
102 |
-
|
103 |
-
|
104 |
-
hist2=ndi.histogram(image2, min=0,max=255,bins=256)
|
105 |
-
hist2.shape
|
106 |
-
plt.plot(hist2)
|
107 |
-
plt.show()
|
108 |
-
|
109 |
-
|
110 |
-
BGR2RGB2 = cv2.cvtColor(image2, cv2.COLOR_BGR2RGB)
|
111 |
-
gray2 = cv2.cvtColor(BGR2RGB2, cv2.COLOR_RGB2GRAY)
|
112 |
-
hsv2 = cv2.cvtColor(image2, cv2.COLOR_RGB2HSV)
|
113 |
-
R2=np.mean(image2[ : , : , 0])
|
114 |
-
G2=np.mean(image2[ : , : , 1])
|
115 |
-
B2=np.mean(image2[ : , : , 2])
|
116 |
-
xy2=get_colors(BGR2RGB2, 10, True)
|
117 |
-
reshaped_image = cv2.resize(BGR2RGB, (600, 400))
|
118 |
-
reshaped_image = reshaped_image.reshape(reshaped_image.shape[0]*reshaped_image.shape[1], 3)
|
119 |
-
clf = KMeans(n_clusters = 10)
|
120 |
-
labels = clf.fit_predict(reshaped_image)
|
121 |
-
counts = Counter(labels)
|
122 |
-
counts = dict(sorted(counts.items()))
|
123 |
-
center_colors = clf.cluster_centers_
|
124 |
-
ordered_colors = [center_colors[i] for i in counts.keys()]
|
125 |
-
hex_colors = [RGB_HEX(ordered_colors[i]) for i in counts.keys()]
|
126 |
-
rgb_colors = [ordered_colors[i] for i in counts.keys()]
|
127 |
-
plt.figure(figsize = (8, 6))
|
128 |
-
plt.pie(counts.values(), labels = hex_colors, colors = hex_colors)
|
129 |
-
reshaped_image2 = cv2.resize(BGR2RGB2, (600, 400))
|
130 |
-
reshaped_image2 = reshaped_image2.reshape(reshaped_image2.shape[0]*reshaped_image2.shape[1], 3)
|
131 |
-
clf = KMeans(n_clusters = 10)
|
132 |
-
labels2 = clf.fit_predict(reshaped_image2)
|
133 |
-
counts2 = Counter(labels2)
|
134 |
-
counts2 = dict(sorted(counts2.items()))
|
135 |
-
center_colors2 = clf.cluster_centers_
|
136 |
-
ordered_colors2 = [center_colors2[i] for i in counts2.keys()]
|
137 |
-
hex_colors2 = [RGB_HEX(ordered_colors2[i]) for i in counts2.keys()]
|
138 |
-
rgb_colors2 = [ordered_colors2[i] for i in counts2.keys()]
|
139 |
-
plt.figure(figsize = (8, 6))
|
140 |
-
plt.pie(counts2.values(), labels = hex_colors2, colors = hex_colors2)
|
141 |
-
import colorsys
|
142 |
-
d2=xy2[0]
|
143 |
-
HSVc2=colorsys.rgb_to_hsv(round(d2[0]), round(d2[1]), round(d2[2])) #intensity
|
144 |
-
intensity2 =str("Intensity of Dominant Color in test sample is:" + str(HSVc2[2]))
|
145 |
-
wavel2=str("Highest wavelength of Dominant Color in test sample is:" + str(650 - 250 / 270 * HSVc2[0]))
|
146 |
-
o=[]
|
147 |
-
for i in range(1,len(xy)+1):
|
148 |
-
o.append(perc(imageinput,xy[i-1])[0])
|
149 |
-
g=o.index((max(o)))
|
150 |
-
o2=[]
|
151 |
-
for i in range(1,len(xy2)+1):
|
152 |
-
o2.append(perc(imageinput2,xy2[i-1])[0])
|
153 |
-
g2=o2.index((max(o2)))
|
154 |
-
hsvv = cv2.cvtColor(perc(imageinput,(xy[g]))[1], cv2.COLOR_RGB2HSV)
|
155 |
-
hsvv2 = cv2.cvtColor(perc(imageinput2,(xy2[g2]))[1], cv2.COLOR_RGB2HSV)
|
156 |
-
HUE= hsvv[ : , : , 0] #hsv
|
157 |
-
value= hsvv[ : , : , 2]
|
158 |
-
valueq=[]
|
159 |
-
for i in range(0,value.shape[0]):
|
160 |
-
for j in range(1,value[i].shape[0]):
|
161 |
-
valueq.append(value[i,j])
|
162 |
-
Qt=[i for i in valueq]
|
163 |
-
valueh=[]
|
164 |
-
for i in range(0,HUE.shape[0]):
|
165 |
-
for j in range(1,HUE[i].shape[0]):
|
166 |
-
valueh.append(HUE[i,j])
|
167 |
-
hh=[i for i in valueh]
|
168 |
-
wv=[]
|
169 |
-
wv=[650 - 250 / 270 * i for i in hh]
|
170 |
-
#wv=np.reshape(wv, (2, 3))
|
171 |
-
wv=list(dict.fromkeys(wv))
|
172 |
-
Q=list(dict.fromkeys(Qt))
|
173 |
-
import matplotlib as mpl
|
174 |
-
mpl.rcParams['agg.path.chunksize'] = 10000
|
175 |
-
from scipy.signal import savgol_filter
|
176 |
-
Q = [i for i in Q if i != 0]
|
177 |
-
mn=min(Q)
|
178 |
-
mx=max(Q)
|
179 |
-
Q=[((i-mn)/(mx-mn)) for i in Q]
|
180 |
-
if len(wv)>len(Q):
|
181 |
-
plt.stem(wv[:len(Q)],(((Q))))
|
182 |
-
else:
|
183 |
-
plt.stem(wv,(((Q[:len(wv)]))))
|
184 |
-
plt.xlabel("Wavelength (nm) ")
|
185 |
-
plt.ylabel("Intensity Value")
|
186 |
-
plt.title("Intensity")
|
187 |
-
#plt.ylim([-1, 1])
|
188 |
-
#plt.xlim([-1, 600])
|
189 |
-
plt.show()
|
190 |
-
|
191 |
-
HUE2= hsvv2[ : , : , 0] #hsv
|
192 |
-
value2= hsvv2[ : , : , 2]
|
193 |
-
valueq2=[]
|
194 |
-
for i in range(0,value2.shape[0]):
|
195 |
-
for j in range(1,value2[i].shape[0]):
|
196 |
-
valueq2.append(value2[i,j])
|
197 |
-
Qt2=[i for i in valueq2]
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
valueh2=[]
|
202 |
-
for i in range(0,HUE2.shape[0]):
|
203 |
-
for j in range(1,HUE2[i].shape[0]):
|
204 |
-
valueh2.append(HUE2[i,j])
|
205 |
-
hh2=[i for i in valueh2]
|
206 |
-
|
207 |
-
wv2=[]
|
208 |
-
wv2=[650 - 250 / 270 * i for i in hh2]
|
209 |
-
#wv=np.reshape(wv, (2, 3))
|
210 |
-
wv2=list(dict.fromkeys(wv2))
|
211 |
-
Q2=list(dict.fromkeys(Qt2))
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
#from outliers import is_outlier
|
216 |
-
#filtered = wv[~is_outlier(wv)]
|
217 |
-
Q2 = [i for i in Q2 if i != 0]
|
218 |
-
#norm2 = np.linalg.norm(Q2)
|
219 |
-
#Q2 = Q2/norm2
|
220 |
-
mn=min(Q2)
|
221 |
-
mx=max(Q2)
|
222 |
-
Q2=[((i-mn)/(mx-mn)) for i in Q2]
|
223 |
-
|
224 |
-
if len(wv2)>len(Q2):
|
225 |
-
plt.stem(wv2[:len(Q2)],(((Q2))))
|
226 |
-
else:
|
227 |
-
plt.stem(wv2,(((Q2[:len(wv2)]))))
|
228 |
-
plt.xlabel("Wavelength (nm) ")
|
229 |
-
plt.ylabel("Intensity Value")
|
230 |
-
plt.title("Intensity")
|
231 |
-
plt.show()
|
232 |
-
colorperc=str("Dominant Color percentage in control sample is: " +str(perc(imageinput,xy[g])[0]))
|
233 |
-
colorperc2=str("Dominant Color percentage in test sample is: " +str(perc(imageinput2,xy2[g2])[0]))
|
234 |
-
ratio = float(cv2.meanStdDev(np.array(wv2))[0] / cv2.meanStdDev(np.array(wv))[0])
|
235 |
-
colorperc3=str("Percentage of control sample Dominant Color within test image is: " +str(perc(imageinput2,xy[g])[0])+" and test wavelength range covers "+str(ratio)+" of control's wavelength coverage")
|
236 |
-
|
237 |
-
return (colorperc),colorperc2,colorperc3,(intensity),(intensity2),wavel,wavel2,figplota(hist),figplota(hist2),figplotb(wv,Q),figplotb(wv2,Q2) , figplotpie(counts.values(), hex_colors, hex_colors), figplotpie(counts2.values(), hex_colors2, hex_colors2)
|
238 |
-
iface = gr.Interface(quant, inputs=[gr.Image(type="filepath"),gr.Image(type="filepath")], outputs=["text","text","text","text","text","text","text","plot","plot","plot","plot","plot","plot"],debug=True)
|
239 |
-
iface.launch(debug=True)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/AIConsultant/MusicGen/docs/METRICS.md
DELETED
@@ -1,127 +0,0 @@
|
|
1 |
-
# AudioCraft objective metrics
|
2 |
-
|
3 |
-
In addition to training losses, AudioCraft provides a set of objective metrics
|
4 |
-
for audio synthesis and audio generation. As these metrics may require
|
5 |
-
extra dependencies and can be costly to train, they are often disabled by default.
|
6 |
-
This section provides guidance for setting up and using these metrics in
|
7 |
-
the AudioCraft training pipelines.
|
8 |
-
|
9 |
-
## Available metrics
|
10 |
-
|
11 |
-
### Audio synthesis quality metrics
|
12 |
-
|
13 |
-
#### SI-SNR
|
14 |
-
|
15 |
-
We provide an implementation of the Scale-Invariant Signal-to-Noise Ratio in PyTorch.
|
16 |
-
No specific requirement is needed for this metric. Please activate the metric at the
|
17 |
-
evaluation stage with the appropriate flag:
|
18 |
-
|
19 |
-
```shell
|
20 |
-
dora run <...> evaluate.metrics.sisnr=true
|
21 |
-
```
|
22 |
-
|
23 |
-
#### ViSQOL
|
24 |
-
|
25 |
-
We provide a Python wrapper around the ViSQOL [official implementation](https://github.com/google/visqol)
|
26 |
-
to conveniently run ViSQOL within the training pipelines.
|
27 |
-
|
28 |
-
One must specify the path to the ViSQOL installation through the configuration in order
|
29 |
-
to enable ViSQOL computations in AudioCraft:
|
30 |
-
|
31 |
-
```shell
|
32 |
-
# the first parameter is used to activate visqol computation while the second specify
|
33 |
-
# the path to visqol's library to be used by our python wrapper
|
34 |
-
dora run <...> evaluate.metrics.visqol=true metrics.visqol.bin=<path_to_visqol>
|
35 |
-
```
|
36 |
-
|
37 |
-
See an example grid: [Compression with ViSQOL](../audiocraft/grids/compression/encodec_musicgen_32khz.py)
|
38 |
-
|
39 |
-
To learn more about ViSQOL and how to build ViSQOL binary using bazel, please refer to the
|
40 |
-
instructions available in the [open source repository](https://github.com/google/visqol).
|
41 |
-
|
42 |
-
### Audio generation metrics
|
43 |
-
|
44 |
-
#### Frechet Audio Distance
|
45 |
-
|
46 |
-
Similarly to ViSQOL, we use a Python wrapper around the Frechet Audio Distance
|
47 |
-
[official implementation](https://github.com/google-research/google-research/tree/master/frechet_audio_distance)
|
48 |
-
in TensorFlow.
|
49 |
-
|
50 |
-
Note that we had to make several changes to the actual code in order to make it work.
|
51 |
-
Please refer to the [FrechetAudioDistanceMetric](../audiocraft/metrics/fad.py) class documentation
|
52 |
-
for more details. We do not plan to provide further support in obtaining a working setup for the
|
53 |
-
Frechet Audio Distance at this stage.
|
54 |
-
|
55 |
-
```shell
|
56 |
-
# the first parameter is used to activate FAD metric computation while the second specify
|
57 |
-
# the path to FAD library to be used by our python wrapper
|
58 |
-
dora run <...> evaluate.metrics.fad=true metrics.fad.bin=<path_to_google_research_repository>
|
59 |
-
```
|
60 |
-
|
61 |
-
See an example grid: [Evaluation with FAD](../audiocraft/grids/musicgen/musicgen_pretrained_32khz_eval.py)
|
62 |
-
|
63 |
-
#### Kullback-Leibler Divergence
|
64 |
-
|
65 |
-
We provide a PyTorch implementation of the Kullback-Leibler Divergence computed over the probabilities
|
66 |
-
of the labels obtained by a state-of-the-art audio classifier. We provide our implementation of the KLD
|
67 |
-
using the [PaSST classifier](https://github.com/kkoutini/PaSST).
|
68 |
-
|
69 |
-
In order to use the KLD metric over PaSST, you must install the PaSST library as an extra dependency:
|
70 |
-
```shell
|
71 |
-
pip install 'git+https://github.com/kkoutini/[email protected]#egg=hear21passt'
|
72 |
-
```
|
73 |
-
|
74 |
-
Then similarly, you can use the metric activating the corresponding flag:
|
75 |
-
|
76 |
-
```shell
|
77 |
-
# one could extend the kld metric with additional audio classifier models that can then be picked through the configuration
|
78 |
-
dora run <...> evaluate.metrics.kld=true metrics.kld.model=passt
|
79 |
-
```
|
80 |
-
|
81 |
-
#### Text consistency
|
82 |
-
|
83 |
-
We provide a text-consistency metric, similarly to the MuLan Cycle Consistency from
|
84 |
-
[MusicLM](https://arxiv.org/pdf/2301.11325.pdf) or the CLAP score used in
|
85 |
-
[Make-An-Audio](https://arxiv.org/pdf/2301.12661v1.pdf).
|
86 |
-
More specifically, we provide a PyTorch implementation of a Text consistency metric
|
87 |
-
relying on a pre-trained [Contrastive Language-Audio Pretraining (CLAP)](https://github.com/LAION-AI/CLAP).
|
88 |
-
|
89 |
-
Please install the CLAP library as an extra dependency prior to using the metric:
|
90 |
-
```shell
|
91 |
-
pip install laion_clap
|
92 |
-
```
|
93 |
-
|
94 |
-
Then similarly, you can use the metric activating the corresponding flag:
|
95 |
-
|
96 |
-
```shell
|
97 |
-
# one could extend the text consistency metric with additional audio classifier models that can then be picked through the configuration
|
98 |
-
dora run ... evaluate.metrics.text_consistency=true metrics.text_consistency.model=clap
|
99 |
-
```
|
100 |
-
|
101 |
-
Note that the text consistency metric based on CLAP will require the CLAP checkpoint to be
|
102 |
-
provided in the configuration.
|
103 |
-
|
104 |
-
#### Chroma cosine similarity
|
105 |
-
|
106 |
-
Finally, as introduced in MusicGen, we provide a Chroma Cosine Similarity metric in PyTorch.
|
107 |
-
No specific requirement is needed for this metric. Please activate the metric at the
|
108 |
-
evaluation stage with the appropriate flag:
|
109 |
-
|
110 |
-
```shell
|
111 |
-
dora run ... evaluate.metrics.chroma_cosine=true
|
112 |
-
```
|
113 |
-
|
114 |
-
#### Comparing against reconstructed audio
|
115 |
-
|
116 |
-
For all the above audio generation metrics, we offer the option to compute the metric on the reconstructed audio
|
117 |
-
fed in EnCodec instead of the generated sample using the flag `<metric>.use_gt=true`.
|
118 |
-
|
119 |
-
## Example usage
|
120 |
-
|
121 |
-
You will find example of configuration for the different metrics introduced above in:
|
122 |
-
* The [musicgen's default solver](../config/solver/musicgen/default.yaml) for all audio generation metrics
|
123 |
-
* The [compression's default solver](../config/solver/compression/default.yaml) for all audio synthesis metrics
|
124 |
-
|
125 |
-
Similarly, we provide different examples in our grids:
|
126 |
-
* [Evaluation with ViSQOL](../audiocraft/grids/compression/encodec_musicgen_32khz.py)
|
127 |
-
* [Evaluation with FAD and others](../audiocraft/grids/musicgen/musicgen_pretrained_32khz_eval.py)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/AIGC-Audio/AudioGPT/text_to_audio/Make_An_Audio/ldm/modules/distributions/distributions.py
DELETED
@@ -1,92 +0,0 @@
|
|
1 |
-
import torch
|
2 |
-
import numpy as np
|
3 |
-
|
4 |
-
|
5 |
-
class AbstractDistribution:
|
6 |
-
def sample(self):
|
7 |
-
raise NotImplementedError()
|
8 |
-
|
9 |
-
def mode(self):
|
10 |
-
raise NotImplementedError()
|
11 |
-
|
12 |
-
|
13 |
-
class DiracDistribution(AbstractDistribution):
|
14 |
-
def __init__(self, value):
|
15 |
-
self.value = value
|
16 |
-
|
17 |
-
def sample(self):
|
18 |
-
return self.value
|
19 |
-
|
20 |
-
def mode(self):
|
21 |
-
return self.value
|
22 |
-
|
23 |
-
|
24 |
-
class DiagonalGaussianDistribution(object):
|
25 |
-
def __init__(self, parameters, deterministic=False):
|
26 |
-
self.parameters = parameters
|
27 |
-
self.mean, self.logvar = torch.chunk(parameters, 2, dim=1)
|
28 |
-
self.logvar = torch.clamp(self.logvar, -30.0, 20.0)
|
29 |
-
self.deterministic = deterministic
|
30 |
-
self.std = torch.exp(0.5 * self.logvar)
|
31 |
-
self.var = torch.exp(self.logvar)
|
32 |
-
if self.deterministic:
|
33 |
-
self.var = self.std = torch.zeros_like(self.mean).to(device=self.parameters.device)
|
34 |
-
|
35 |
-
def sample(self):
|
36 |
-
x = self.mean + self.std * torch.randn(self.mean.shape).to(device=self.parameters.device)
|
37 |
-
return x
|
38 |
-
|
39 |
-
def kl(self, other=None):
|
40 |
-
if self.deterministic:
|
41 |
-
return torch.Tensor([0.])
|
42 |
-
else:
|
43 |
-
if other is None:
|
44 |
-
return 0.5 * torch.sum(torch.pow(self.mean, 2)
|
45 |
-
+ self.var - 1.0 - self.logvar,
|
46 |
-
dim=[1, 2, 3])
|
47 |
-
else:
|
48 |
-
return 0.5 * torch.sum(
|
49 |
-
torch.pow(self.mean - other.mean, 2) / other.var
|
50 |
-
+ self.var / other.var - 1.0 - self.logvar + other.logvar,
|
51 |
-
dim=[1, 2, 3])
|
52 |
-
|
53 |
-
def nll(self, sample, dims=[1,2,3]):
|
54 |
-
if self.deterministic:
|
55 |
-
return torch.Tensor([0.])
|
56 |
-
logtwopi = np.log(2.0 * np.pi)
|
57 |
-
return 0.5 * torch.sum(
|
58 |
-
logtwopi + self.logvar + torch.pow(sample - self.mean, 2) / self.var,
|
59 |
-
dim=dims)
|
60 |
-
|
61 |
-
def mode(self):
|
62 |
-
return self.mean
|
63 |
-
|
64 |
-
|
65 |
-
def normal_kl(mean1, logvar1, mean2, logvar2):
|
66 |
-
"""
|
67 |
-
source: https://github.com/openai/guided-diffusion/blob/27c20a8fab9cb472df5d6bdd6c8d11c8f430b924/guided_diffusion/losses.py#L12
|
68 |
-
Compute the KL divergence between two gaussians.
|
69 |
-
Shapes are automatically broadcasted, so batches can be compared to
|
70 |
-
scalars, among other use cases.
|
71 |
-
"""
|
72 |
-
tensor = None
|
73 |
-
for obj in (mean1, logvar1, mean2, logvar2):
|
74 |
-
if isinstance(obj, torch.Tensor):
|
75 |
-
tensor = obj
|
76 |
-
break
|
77 |
-
assert tensor is not None, "at least one argument must be a Tensor"
|
78 |
-
|
79 |
-
# Force variances to be Tensors. Broadcasting helps convert scalars to
|
80 |
-
# Tensors, but it does not work for torch.exp().
|
81 |
-
logvar1, logvar2 = [
|
82 |
-
x if isinstance(x, torch.Tensor) else torch.tensor(x).to(tensor)
|
83 |
-
for x in (logvar1, logvar2)
|
84 |
-
]
|
85 |
-
|
86 |
-
return 0.5 * (
|
87 |
-
-1.0
|
88 |
-
+ logvar2
|
89 |
-
- logvar1
|
90 |
-
+ torch.exp(logvar1 - logvar2)
|
91 |
-
+ ((mean1 - mean2) ** 2) * torch.exp(-logvar2)
|
92 |
-
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/AIGC-Audio/AudioGPT/text_to_audio/Make_An_Audio/vocoder/bigvgan/alias_free_torch/__init__.py
DELETED
@@ -1,6 +0,0 @@
|
|
1 |
-
# Adapted from https://github.com/junjun3518/alias-free-torch under the Apache License 2.0
|
2 |
-
# LICENSE is in incl_licenses directory.
|
3 |
-
|
4 |
-
from .filter import *
|
5 |
-
from .resample import *
|
6 |
-
from .act import *
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/AIZeroToHero/03-ImageSearchSimilar/README.md
DELETED
@@ -1,13 +0,0 @@
|
|
1 |
-
---
|
2 |
-
title: 03 ImageSearchSimilar
|
3 |
-
emoji: 📚
|
4 |
-
colorFrom: yellow
|
5 |
-
colorTo: gray
|
6 |
-
sdk: streamlit
|
7 |
-
sdk_version: 1.10.0
|
8 |
-
app_file: app.py
|
9 |
-
pinned: false
|
10 |
-
license: mit
|
11 |
-
---
|
12 |
-
|
13 |
-
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/ASJMO/freegpt/client/css/stop-generating.css
DELETED
@@ -1,38 +0,0 @@
|
|
1 |
-
.stop-generating {
|
2 |
-
position: absolute;
|
3 |
-
bottom: 128px;
|
4 |
-
left: 50%;
|
5 |
-
transform: translateX(-50%);
|
6 |
-
z-index: 1000000;
|
7 |
-
}
|
8 |
-
|
9 |
-
.stop-generating button {
|
10 |
-
backdrop-filter: blur(20px);
|
11 |
-
-webkit-backdrop-filter: blur(20px);
|
12 |
-
background-color: var(--blur-bg);
|
13 |
-
color: var(--colour-3);
|
14 |
-
cursor: pointer;
|
15 |
-
animation: show_popup 0.4s;
|
16 |
-
}
|
17 |
-
|
18 |
-
@keyframes show_popup {
|
19 |
-
from {
|
20 |
-
opacity: 0;
|
21 |
-
transform: translateY(10px);
|
22 |
-
}
|
23 |
-
}
|
24 |
-
|
25 |
-
@keyframes hide_popup {
|
26 |
-
to {
|
27 |
-
opacity: 0;
|
28 |
-
transform: translateY(10px);
|
29 |
-
}
|
30 |
-
}
|
31 |
-
|
32 |
-
.stop-generating-hiding button {
|
33 |
-
animation: hide_popup 0.4s;
|
34 |
-
}
|
35 |
-
|
36 |
-
.stop-generating-hidden button {
|
37 |
-
display: none;
|
38 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/ATang0729/Forecast4Muses/Model/Model6/Model6_0_ClothesDetection/mmyolo/configs/yolov5/README.md
DELETED
@@ -1,118 +0,0 @@
|
|
1 |
-
# YOLOv5
|
2 |
-
|
3 |
-
<!-- [ALGORITHM] -->
|
4 |
-
|
5 |
-
## Abstract
|
6 |
-
|
7 |
-
YOLOv5 is a family of object detection architectures and models pretrained on the COCO dataset, and represents Ultralytics open-source research into future vision AI methods, incorporating lessons learned and best practices evolved over thousands of hours of research and development.
|
8 |
-
|
9 |
-
<div align=center>
|
10 |
-
<img src="https://user-images.githubusercontent.com/27466624/200000324-70ae078f-cea7-4189-8baa-440656797dad.jpg"/>
|
11 |
-
YOLOv5-l-P5 model structure
|
12 |
-
</div>
|
13 |
-
|
14 |
-
<div align=center>
|
15 |
-
<img src="https://user-images.githubusercontent.com/27466624/211143533-1725c1b2-6189-4c3a-a046-ad968e03cb9d.jpg"/>
|
16 |
-
YOLOv5-l-P6 model structure
|
17 |
-
</div>
|
18 |
-
|
19 |
-
## Results and models
|
20 |
-
|
21 |
-
### COCO
|
22 |
-
|
23 |
-
| Backbone | Arch | size | SyncBN | AMP | Mem (GB) | box AP | TTA box AP | Config | Download |
|
24 |
-
| :------: | :--: | :--: | :----: | :-: | :------: | :----: | :--------: | :--------------------------------------------------------------------------------------------------------------------: | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
|
25 |
-
| YOLOv5-n | P5 | 640 | Yes | Yes | 1.5 | 28.0 | 30.7 | [config](https://github.com/open-mmlab/mmyolo/tree/main/configs/yolov5/yolov5_n-v61_syncbn_fast_8xb16-300e_coco.py) | [model](https://download.openmmlab.com/mmyolo/v0/yolov5/yolov5_n-v61_syncbn_fast_8xb16-300e_coco/yolov5_n-v61_syncbn_fast_8xb16-300e_coco_20220919_090739-b804c1ad.pth) \| [log](https://download.openmmlab.com/mmyolo/v0/yolov5/yolov5_n-v61_syncbn_fast_8xb16-300e_coco/yolov5_n-v61_syncbn_fast_8xb16-300e_coco_20220919_090739.log.json) |
|
26 |
-
| YOLOv5-s | P5 | 640 | Yes | Yes | 2.7 | 37.7 | 40.2 | [config](https://github.com/open-mmlab/mmyolo/tree/main/configs/yolov5/yolov5_s-v61_syncbn_fast_8xb16-300e_coco.py) | [model](https://download.openmmlab.com/mmyolo/v0/yolov5/yolov5_s-v61_syncbn_fast_8xb16-300e_coco/yolov5_s-v61_syncbn_fast_8xb16-300e_coco_20220918_084700-86e02187.pth) \| [log](https://download.openmmlab.com/mmyolo/v0/yolov5/yolov5_s-v61_syncbn_fast_8xb16-300e_coco/yolov5_s-v61_syncbn_fast_8xb16-300e_coco_20220918_084700.log.json) |
|
27 |
-
| YOLOv5-m | P5 | 640 | Yes | Yes | 5.0 | 45.3 | 46.9 | [config](https://github.com/open-mmlab/mmyolo/tree/main/configs/yolov5/yolov5_m-v61_syncbn_fast_8xb16-300e_coco.py) | [model](https://download.openmmlab.com/mmyolo/v0/yolov5/yolov5_m-v61_syncbn_fast_8xb16-300e_coco/yolov5_m-v61_syncbn_fast_8xb16-300e_coco_20220917_204944-516a710f.pth) \| [log](https://download.openmmlab.com/mmyolo/v0/yolov5/yolov5_m-v61_syncbn_fast_8xb16-300e_coco/yolov5_m-v61_syncbn_fast_8xb16-300e_coco_20220917_204944.log.json) |
|
28 |
-
| YOLOv5-l | P5 | 640 | Yes | Yes | 8.1 | 48.8 | 49.9 | [config](https://github.com/open-mmlab/mmyolo/tree/main/configs/yolov5/yolov5_l-v61_syncbn_fast_8xb16-300e_coco.py) | [model](https://download.openmmlab.com/mmyolo/v0/yolov5/yolov5_l-v61_syncbn_fast_8xb16-300e_coco/yolov5_l-v61_syncbn_fast_8xb16-300e_coco_20220917_031007-096ef0eb.pth) \| [log](https://download.openmmlab.com/mmyolo/v0/yolov5/yolov5_l-v61_syncbn_fast_8xb16-300e_coco/yolov5_l-v61_syncbn_fast_8xb16-300e_coco_20220917_031007.log.json) |
|
29 |
-
| YOLOv5-n | P6 | 1280 | Yes | Yes | 5.8 | 35.9 | | [config](https://github.com/open-mmlab/mmyolo/tree/main/configs/yolov5/yolov5_n-p6-v62_syncbn_fast_8xb16-300e_coco.py) | [model](https://download.openmmlab.com/mmyolo/v0/yolov5/yolov5_n-p6-v62_syncbn_fast_8xb16-300e_coco/yolov5_n-p6-v62_syncbn_fast_8xb16-300e_coco_20221027_224705-d493c5f3.pth) \| [log](https://download.openmmlab.com/mmyolo/v0/yolov5/yolov5_n-p6-v62_syncbn_fast_8xb16-300e_coco/yolov5_n-p6-v62_syncbn_fast_8xb16-300e_coco_20221027_224705.log.json) |
|
30 |
-
| YOLOv5-s | P6 | 1280 | Yes | Yes | 10.5 | 44.4 | | [config](https://github.com/open-mmlab/mmyolo/tree/main/configs/yolov5/yolov5_s-p6-v62_syncbn_fast_8xb16-300e_coco.py) | [model](https://download.openmmlab.com/mmyolo/v0/yolov5/yolov5_s-p6-v62_syncbn_fast_8xb16-300e_coco/yolov5_s-p6-v62_syncbn_fast_8xb16-300e_coco_20221027_215044-58865c19.pth) \| [log](https://download.openmmlab.com/mmyolo/v0/yolov5/yolov5_s-p6-v62_syncbn_fast_8xb16-300e_coco/yolov5_s-p6-v62_syncbn_fast_8xb16-300e_coco_20221027_215044.log.json) |
|
31 |
-
| YOLOv5-m | P6 | 1280 | Yes | Yes | 19.1 | 51.3 | | [config](https://github.com/open-mmlab/mmyolo/tree/main/configs/yolov5/yolov5_m-p6-v62_syncbn_fast_8xb16-300e_coco.py) | [model](https://download.openmmlab.com/mmyolo/v0/yolov5/yolov5_m-p6-v62_syncbn_fast_8xb16-300e_coco/yolov5_m-p6-v62_syncbn_fast_8xb16-300e_coco_20221027_230453-49564d58.pth) \| [log](https://download.openmmlab.com/mmyolo/v0/yolov5/yolov5_m-p6-v62_syncbn_fast_8xb16-300e_coco/yolov5_m-p6-v62_syncbn_fast_8xb16-300e_coco_20221027_230453.log.json) |
|
32 |
-
| YOLOv5-l | P6 | 1280 | Yes | Yes | 30.5 | 53.7 | | [config](https://github.com/open-mmlab/mmyolo/tree/main/configs/yolov5/yolov5_l-p6-v62_syncbn_fast_8xb16-300e_coco.py) | [model](https://download.openmmlab.com/mmyolo/v0/yolov5/yolov5_l-p6-v62_syncbn_fast_8xb16-300e_coco/yolov5_l-p6-v62_syncbn_fast_8xb16-300e_coco_20221027_234308-7a2ba6bf.pth) \| [log](https://download.openmmlab.com/mmyolo/v0/yolov5/yolov5_l-p6-v62_syncbn_fast_8xb16-300e_coco/yolov5_l-p6-v62_syncbn_fast_8xb16-300e_coco_20221027_234308.log.json) |
|
33 |
-
|
34 |
-
**Note**:
|
35 |
-
In the official YOLOv5 code, the `random_perspective` data augmentation in COCO object detection task training uses mask annotation information, which leads to higher performance. Object detection should not use mask annotation, so only box annotation information is used in `MMYOLO`. We will use the mask annotation information in the instance segmentation task. See https://github.com/ultralytics/yolov5/issues/9917 for details.
|
36 |
-
|
37 |
-
1. `fast` means that `YOLOv5DetDataPreprocessor` and `yolov5_collate` are used for data preprocessing, which is faster for training, but less flexible for multitasking. Recommended to use fast version config if you only care about object detection.
|
38 |
-
2. `detect` means that the network input is fixed to `640x640` and the post-processing thresholds is modified.
|
39 |
-
3. `SyncBN` means use SyncBN, `AMP` indicates training with mixed precision.
|
40 |
-
4. We use 8x A100 for training, and the single-GPU batch size is 16. This is different from the official code.
|
41 |
-
5. The performance is unstable and may fluctuate by about 0.4 mAP and the highest performance weight in `COCO` training in `YOLOv5` may not be the last epoch.
|
42 |
-
6. `TTA` means that Test Time Augmentation. It's perform 3 multi-scaling transformations on the image, followed by 2 flipping transformations (flipping and not flipping). You only need to specify `--tta` when testing to enable. see [TTA](https://github.com/open-mmlab/mmyolo/blob/dev/docs/en/common_usage/tta.md) for details.
|
43 |
-
|
44 |
-
### VOC
|
45 |
-
|
46 |
-
| Backbone | size | Batchsize | AMP | Mem (GB) | box AP(COCO metric) | Config | Download |
|
47 |
-
| :------: | :--: | :-------: | :-: | :------: | :-----------------: | :------------------------------------------------------------------------------------------------------------: | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
|
48 |
-
| YOLOv5-n | 512 | 64 | Yes | 3.5 | 51.2 | [config](https://github.com/open-mmlab/mmyolo/tree/main/configs/yolov5/voc/yolov5_n-v61_fast_1xb64-50e_voc.py) | [model](https://download.openmmlab.com/mmyolo/v0/yolov5/yolov5_n-v61_fast_1xb64-50e_voc/yolov5_n-v61_fast_1xb64-50e_voc_20221017_234254-f1493430.pth) \| [log](https://download.openmmlab.com/mmyolo/v0/yolov5/yolov5_n-v61_fast_1xb64-50e_voc/yolov5_n-v61_fast_1xb64-50e_voc_20221017_234254.log.json) |
|
49 |
-
| YOLOv5-s | 512 | 64 | Yes | 6.5 | 62.7 | [config](https://github.com/open-mmlab/mmyolo/tree/main/configs/yolov5/voc/yolov5_s-v61_fast_1xb64-50e_voc.py) | [model](https://download.openmmlab.com/mmyolo/v0/yolov5/yolov5_s-v61_fast_1xb64-50e_voc/yolov5_s-v61_fast_1xb64-50e_voc_20221017_234156-0009b33e.pth) \| [log](https://download.openmmlab.com/mmyolo/v0/yolov5/yolov5_s-v61_fast_1xb64-50e_voc/yolov5_s-v61_fast_1xb64-50e_voc_20221017_234156.log.json) |
|
50 |
-
| YOLOv5-m | 512 | 64 | Yes | 12.0 | 70.1 | [config](https://github.com/open-mmlab/mmyolo/tree/main/configs/yolov5/voc/yolov5_m-v61_fast_1xb64-50e_voc.py) | [model](https://download.openmmlab.com/mmyolo/v0/yolov5/yolov5_m-v61_fast_1xb64-50e_voc/yolov5_m-v61_fast_1xb64-50e_voc_20221017_114138-815c143a.pth) \| [log](https://download.openmmlab.com/mmyolo/v0/yolov5/yolov5_m-v61_fast_1xb64-50e_voc/yolov5_m-v61_fast_1xb64-50e_voc_20221017_114138.log.json) |
|
51 |
-
| YOLOv5-l | 512 | 32 | Yes | 10.0 | 73.1 | [config](https://github.com/open-mmlab/mmyolo/tree/main/configs/yolov5/voc/yolov5_l-v61_fast_1xb32-50e_voc.py) | [model](https://download.openmmlab.com/mmyolo/v0/yolov5/yolov5_l-v61_fast_1xb32-50e_voc/yolov5_l-v61_fast_1xb32-50e_voc_20221017_045500-edc7e0d8.pth) \| [log](https://download.openmmlab.com/mmyolo/v0/yolov5/yolov5_l-v61_fast_1xb32-50e_voc/yolov5_l-v61_fast_1xb32-50e_voc_20221017_045500.log.json) |
|
52 |
-
|
53 |
-
**Note**:
|
54 |
-
|
55 |
-
1. Training on VOC dataset need pretrained model which trained on COCO.
|
56 |
-
2. The performance is unstable and may fluctuate by about 0.4 mAP.
|
57 |
-
3. Official YOLOv5 use COCO metric, while training VOC dataset.
|
58 |
-
4. We converted the VOC test dataset to COCO format offline, while reproducing mAP result as shown above. We will support to use COCO metric while training VOC dataset in later version.
|
59 |
-
5. Hyperparameter reference from `https://wandb.ai/glenn-jocher/YOLOv5_VOC_official`.
|
60 |
-
|
61 |
-
### CrowdHuman
|
62 |
-
|
63 |
-
Since the `iscrowd` annotation of the COCO dataset is not equivalent to `ignore`, we use the CrowdHuman dataset to verify that the YOLOv5 ignore logic is correct.
|
64 |
-
|
65 |
-
| Backbone | size | SyncBN | AMP | Mem (GB) | ignore_iof_thr | box AP50(CrowDHuman Metric) | MR | JI | Config | Download |
|
66 |
-
| :------: | :--: | :----: | :-: | :------: | :------------: | :-------------------------: | :--: | :---: | :-----------------------------------------------------------------------------------------------------------------------------: | :------: |
|
67 |
-
| YOLOv5-s | 640 | Yes | Yes | 2.6 | -1 | 85.79 | 48.7 | 75.33 | [config](https://github.com/open-mmlab/mmyolo/tree/main/configs/yolov5/crowdhuman/yolov5_s-v61_fast_8xb16-300e_crowdhuman.py) | |
|
68 |
-
| YOLOv5-s | 640 | Yes | Yes | 2.6 | 0.5 | 86.17 | 48.8 | 75.87 | [config](https://github.com/open-mmlab/mmyolo/tree/main/configs/yolov5/crowdhuman/yolov5_s-v61_8xb16-300e_ignore_crowdhuman.py) | |
|
69 |
-
|
70 |
-
**Note**:
|
71 |
-
|
72 |
-
1. `ignore_iof_thr` is -1 indicating that the ignore tag is not considered. We adjusted with `ignore_iof_thr` thresholds of 0.5, 0.8, 0.9, and the results show that 0.5 has the best performance.
|
73 |
-
2. The above table shows the performance of the model with the best performance on the validation set. The best performing models are around 160+ epoch which means that there is no need to train so many epochs.
|
74 |
-
3. This is a very simple implementation that simply replaces COCO's anchor with the `tools/analysis_tools/optimize_anchors.py` script. We'll adjust other parameters later to improve performance.
|
75 |
-
|
76 |
-
## Citation
|
77 |
-
|
78 |
-
```latex
|
79 |
-
@software{glenn_jocher_2022_7002879,
|
80 |
-
author = {Glenn Jocher and
|
81 |
-
Ayush Chaurasia and
|
82 |
-
Alex Stoken and
|
83 |
-
Jirka Borovec and
|
84 |
-
NanoCode012 and
|
85 |
-
Yonghye Kwon and
|
86 |
-
TaoXie and
|
87 |
-
Kalen Michael and
|
88 |
-
Jiacong Fang and
|
89 |
-
imyhxy and
|
90 |
-
Lorna and
|
91 |
-
Colin Wong and
|
92 |
-
曾逸夫(Zeng Yifu) and
|
93 |
-
Abhiram V and
|
94 |
-
Diego Montes and
|
95 |
-
Zhiqiang Wang and
|
96 |
-
Cristi Fati and
|
97 |
-
Jebastin Nadar and
|
98 |
-
Laughing and
|
99 |
-
UnglvKitDe and
|
100 |
-
tkianai and
|
101 |
-
yxNONG and
|
102 |
-
Piotr Skalski and
|
103 |
-
Adam Hogan and
|
104 |
-
Max Strobel and
|
105 |
-
Mrinal Jain and
|
106 |
-
Lorenzo Mammana and
|
107 |
-
xylieong},
|
108 |
-
title = {{ultralytics/yolov5: v6.2 - YOLOv5 Classification
|
109 |
-
Models, Apple M1, Reproducibility, ClearML and
|
110 |
-
Deci.ai integrations}},
|
111 |
-
month = aug,
|
112 |
-
year = 2022,
|
113 |
-
publisher = {Zenodo},
|
114 |
-
version = {v6.2},
|
115 |
-
doi = {10.5281/zenodo.7002879},
|
116 |
-
url = {https://doi.org/10.5281/zenodo.7002879}
|
117 |
-
}
|
118 |
-
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/ATang0729/Forecast4Muses/Model/Model6/Model6_2_ProfileRecogition/mmpretrain/configs/resnet/resnet34_8xb16_cifar10.py
DELETED
@@ -1,4 +0,0 @@
|
|
1 |
-
_base_ = [
|
2 |
-
'../_base_/models/resnet34_cifar.py', '../_base_/datasets/cifar10_bs16.py',
|
3 |
-
'../_base_/schedules/cifar10_bs128.py', '../_base_/default_runtime.py'
|
4 |
-
]
|
|
|
|
|
|
|
|
|
|
spaces/AchyuthGamer/OpenGPT/g4f/Provider/Providers/Dfehub.py
DELETED
@@ -1,49 +0,0 @@
|
|
1 |
-
import os
|
2 |
-
import requests
|
3 |
-
from ...typing import sha256, Dict, get_type_hints
|
4 |
-
|
5 |
-
url = "https://chat.dfehub.com"
|
6 |
-
model = ['gpt-3.5-turbo', 'gpt-3.5-turbo-16k', 'gpt-4']
|
7 |
-
supports_stream = True
|
8 |
-
needs_auth = False
|
9 |
-
|
10 |
-
|
11 |
-
def _create_completion(model: str, messages: list, stream: bool, **kwargs):
|
12 |
-
headers = {
|
13 |
-
'Authority': 'chat.dfehub.com',
|
14 |
-
'Content-Type': 'application/json',
|
15 |
-
'Method': 'POST',
|
16 |
-
'Path': '/api/openai/v1/chat/completions',
|
17 |
-
'Scheme': 'https',
|
18 |
-
'Accept': 'text/event-stream',
|
19 |
-
'Accept-Language': 'pt-BR,pt;q=0.9,en-US;q=0.8,en;q=0.7,zh-CN;q=0.6,zh;q=0.5',
|
20 |
-
'Content-Type': 'application/json',
|
21 |
-
'Origin': 'https://chat.dfehub.com',
|
22 |
-
'Referer': 'https://chat.dfehub.com/',
|
23 |
-
'Sec-Ch-Ua': '"Not.A/Brand";v="8", "Chromium";v="114", "Google Chrome";v="114"',
|
24 |
-
'Sec-Ch-Ua-Mobile': '?0',
|
25 |
-
'Sec-Ch-Ua-Platform': '"Windows"',
|
26 |
-
'Sec-Fetch-Dest': 'empty',
|
27 |
-
'Sec-Fetch-Mode': 'cors',
|
28 |
-
'Sec-Fetch-Site': 'same-origin',
|
29 |
-
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36',
|
30 |
-
'X-Requested-With': 'XMLHttpRequest',
|
31 |
-
}
|
32 |
-
|
33 |
-
data = {
|
34 |
-
'model': model,
|
35 |
-
'temperature': 0.7,
|
36 |
-
'max_tokens': '8000',
|
37 |
-
'presence_penalty': 0,
|
38 |
-
'messages': messages,
|
39 |
-
}
|
40 |
-
|
41 |
-
response = requests.post(url + '/api/openai/v1/chat/completions',
|
42 |
-
headers=headers, json=data, stream=stream)
|
43 |
-
|
44 |
-
yield response.json()['choices'][0]['message']['content']
|
45 |
-
|
46 |
-
|
47 |
-
params = f'g4f.Providers.{os.path.basename(__file__)[:-3]} supports: ' + \
|
48 |
-
'(%s)' % ', '.join(
|
49 |
-
[f"{name}: {get_type_hints(_create_completion)[name].__name__}" for name in _create_completion.__code__.co_varnames[:_create_completion.__code__.co_argcount]])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/AchyuthGamer/OpenGPT/g4f/Provider/Providers/deprecated/CodeLinkAva.py
DELETED
@@ -1,64 +0,0 @@
|
|
1 |
-
from __future__ import annotations
|
2 |
-
|
3 |
-
from aiohttp import ClientSession
|
4 |
-
import json
|
5 |
-
|
6 |
-
from ...typing import AsyncGenerator
|
7 |
-
from ..base_provider import AsyncGeneratorProvider
|
8 |
-
|
9 |
-
|
10 |
-
class CodeLinkAva(AsyncGeneratorProvider):
|
11 |
-
url = "https://ava-ai-ef611.web.app"
|
12 |
-
supports_gpt_35_turbo = True
|
13 |
-
working = False
|
14 |
-
|
15 |
-
@classmethod
|
16 |
-
async def create_async_generator(
|
17 |
-
cls,
|
18 |
-
model: str,
|
19 |
-
messages: list[dict[str, str]],
|
20 |
-
**kwargs
|
21 |
-
) -> AsyncGenerator:
|
22 |
-
headers = {
|
23 |
-
"User-Agent" : "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Safari/537.36",
|
24 |
-
"Accept" : "*/*",
|
25 |
-
"Accept-language" : "en,fr-FR;q=0.9,fr;q=0.8,es-ES;q=0.7,es;q=0.6,en-US;q=0.5,am;q=0.4,de;q=0.3",
|
26 |
-
"Origin" : cls.url,
|
27 |
-
"Referer" : cls.url + "/",
|
28 |
-
"Sec-Fetch-Dest" : "empty",
|
29 |
-
"Sec-Fetch-Mode" : "cors",
|
30 |
-
"Sec-Fetch-Site" : "same-origin",
|
31 |
-
}
|
32 |
-
async with ClientSession(
|
33 |
-
headers=headers
|
34 |
-
) as session:
|
35 |
-
data = {
|
36 |
-
"messages": messages,
|
37 |
-
"temperature": 0.6,
|
38 |
-
"stream": True,
|
39 |
-
**kwargs
|
40 |
-
}
|
41 |
-
async with session.post("https://ava-alpha-api.codelink.io/api/chat", json=data) as response:
|
42 |
-
response.raise_for_status()
|
43 |
-
async for line in response.content:
|
44 |
-
line = line.decode()
|
45 |
-
if line.startswith("data: "):
|
46 |
-
if line.startswith("data: [DONE]"):
|
47 |
-
break
|
48 |
-
line = json.loads(line[6:-1])
|
49 |
-
content = line["choices"][0]["delta"].get("content")
|
50 |
-
if content:
|
51 |
-
yield content
|
52 |
-
|
53 |
-
|
54 |
-
@classmethod
|
55 |
-
@property
|
56 |
-
def params(cls):
|
57 |
-
params = [
|
58 |
-
("model", "str"),
|
59 |
-
("messages", "list[dict[str, str]]"),
|
60 |
-
("stream", "bool"),
|
61 |
-
("temperature", "float"),
|
62 |
-
]
|
63 |
-
param = ", ".join([": ".join(p) for p in params])
|
64 |
-
return f"g4f.provider.{cls.__name__} supports: ({param})"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/AgentVerse/agentVerse/ui/src/phaser3-rex-plugins/templates/spinner/radio/Factory.js
DELETED
@@ -1,13 +0,0 @@
|
|
1 |
-
import Radio from './Radio.js';
|
2 |
-
import ObjectFactory from '../ObjectFactory.js';
|
3 |
-
import SetValue from '../../../plugins/utils/object/SetValue.js';
|
4 |
-
|
5 |
-
ObjectFactory.register('radio', function (config) {
|
6 |
-
var gameObject = new Radio(this.scene, config);
|
7 |
-
this.scene.add.existing(gameObject);
|
8 |
-
return gameObject;
|
9 |
-
});
|
10 |
-
|
11 |
-
SetValue(window, 'RexPlugins.Spinner.Radio', Radio);
|
12 |
-
|
13 |
-
export default Radio;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/AgentVerse/agentVerse/ui/src/phaser3-rex-plugins/templates/ui/gridtable/Factory.js
DELETED
@@ -1,13 +0,0 @@
|
|
1 |
-
import GridTable from './GridTable.js';
|
2 |
-
import ObjectFactory from '../ObjectFactory.js';
|
3 |
-
import SetValue from '../../../plugins/utils/object/SetValue.js';
|
4 |
-
|
5 |
-
ObjectFactory.register('gridTable', function (config) {
|
6 |
-
var gameObject = new GridTable(this.scene, config);
|
7 |
-
this.scene.add.existing(gameObject);
|
8 |
-
return gameObject;
|
9 |
-
});
|
10 |
-
|
11 |
-
SetValue(window, 'RexPlugins.UI.GridTable', GridTable);
|
12 |
-
|
13 |
-
export default GridTable;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Ajaxon6255/Emerald_Isle/app.py
DELETED
@@ -1,147 +0,0 @@
|
|
1 |
-
import time
|
2 |
-
|
3 |
-
from theme_dropdown import create_theme_dropdown # noqa: F401
|
4 |
-
|
5 |
-
import gradio as gr
|
6 |
-
|
7 |
-
dropdown, js = create_theme_dropdown()
|
8 |
-
|
9 |
-
with gr.Blocks(theme='Ajaxon6255/Emerald_Isle') as demo:
|
10 |
-
with gr.Row().style(equal_height=True):
|
11 |
-
with gr.Column(scale=10):
|
12 |
-
gr.Markdown(
|
13 |
-
"""
|
14 |
-
# Theme preview: `Emerald_Isle`
|
15 |
-
To use this theme, set `theme='Ajaxon6255/Emerald_Isle'` in `gr.Blocks()` or `gr.Interface()`.
|
16 |
-
You can append an `@` and a semantic version expression, e.g. @>=1.0.0,<2.0.0 to pin to a given version
|
17 |
-
of this theme.
|
18 |
-
"""
|
19 |
-
)
|
20 |
-
with gr.Column(scale=3):
|
21 |
-
with gr.Box():
|
22 |
-
dropdown.render()
|
23 |
-
toggle_dark = gr.Button(value="Toggle Dark").style(full_width=True)
|
24 |
-
|
25 |
-
dropdown.change(None, dropdown, None, _js=js)
|
26 |
-
toggle_dark.click(
|
27 |
-
None,
|
28 |
-
_js="""
|
29 |
-
() => {
|
30 |
-
document.body.classList.toggle('dark');
|
31 |
-
document.querySelector('gradio-app').style.backgroundColor = 'var(--color-background-primary)'
|
32 |
-
}
|
33 |
-
""",
|
34 |
-
)
|
35 |
-
|
36 |
-
name = gr.Textbox(
|
37 |
-
label="Name",
|
38 |
-
info="Full name, including middle name. No special characters.",
|
39 |
-
placeholder="John Doe",
|
40 |
-
value="John Doe",
|
41 |
-
interactive=True,
|
42 |
-
)
|
43 |
-
|
44 |
-
with gr.Row():
|
45 |
-
slider1 = gr.Slider(label="Slider 1")
|
46 |
-
slider2 = gr.Slider(label="Slider 2")
|
47 |
-
gr.CheckboxGroup(["A", "B", "C"], label="Checkbox Group")
|
48 |
-
|
49 |
-
with gr.Row():
|
50 |
-
with gr.Column(variant="panel", scale=1):
|
51 |
-
gr.Markdown("## Panel 1")
|
52 |
-
radio = gr.Radio(
|
53 |
-
["A", "B", "C"],
|
54 |
-
label="Radio",
|
55 |
-
info="Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.",
|
56 |
-
)
|
57 |
-
drop = gr.Dropdown(["Option 1", "Option 2", "Option 3"], show_label=False)
|
58 |
-
drop_2 = gr.Dropdown(
|
59 |
-
["Option A", "Option B", "Option C"],
|
60 |
-
multiselect=True,
|
61 |
-
value=["Option A"],
|
62 |
-
label="Dropdown",
|
63 |
-
interactive=True,
|
64 |
-
)
|
65 |
-
check = gr.Checkbox(label="Go")
|
66 |
-
with gr.Column(variant="panel", scale=2):
|
67 |
-
img = gr.Image(
|
68 |
-
"https://gradio.app/assets/img/header-image.jpg", label="Image"
|
69 |
-
).style(height=320)
|
70 |
-
with gr.Row():
|
71 |
-
go_btn = gr.Button("Go", label="Primary Button", variant="primary")
|
72 |
-
clear_btn = gr.Button(
|
73 |
-
"Clear", label="Secondary Button", variant="secondary"
|
74 |
-
)
|
75 |
-
|
76 |
-
def go(*args):
|
77 |
-
time.sleep(3)
|
78 |
-
return "https://gradio.app/assets/img/header-image.jpg"
|
79 |
-
|
80 |
-
go_btn.click(go, [radio, drop, drop_2, check, name], img, api_name="go")
|
81 |
-
|
82 |
-
def clear():
|
83 |
-
time.sleep(0.2)
|
84 |
-
return None
|
85 |
-
|
86 |
-
clear_btn.click(clear, None, img)
|
87 |
-
|
88 |
-
with gr.Row():
|
89 |
-
btn1 = gr.Button("Button 1").style(size="sm")
|
90 |
-
btn2 = gr.UploadButton().style(size="sm")
|
91 |
-
stop_btn = gr.Button("Stop", label="Stop Button", variant="stop").style(
|
92 |
-
size="sm"
|
93 |
-
)
|
94 |
-
|
95 |
-
with gr.Row():
|
96 |
-
gr.Dataframe(value=[[1, 2, 3], [4, 5, 6], [7, 8, 9]], label="Dataframe")
|
97 |
-
gr.JSON(
|
98 |
-
value={"a": 1, "b": 2, "c": {"test": "a", "test2": [1, 2, 3]}}, label="JSON"
|
99 |
-
)
|
100 |
-
gr.Label(value={"cat": 0.7, "dog": 0.2, "fish": 0.1})
|
101 |
-
gr.File()
|
102 |
-
with gr.Row():
|
103 |
-
gr.ColorPicker()
|
104 |
-
gr.Video("https://gradio-static-files.s3.us-west-2.amazonaws.com/world.mp4")
|
105 |
-
gr.Gallery(
|
106 |
-
[
|
107 |
-
(
|
108 |
-
"https://gradio-static-files.s3.us-west-2.amazonaws.com/lion.jpg",
|
109 |
-
"lion",
|
110 |
-
),
|
111 |
-
(
|
112 |
-
"https://gradio-static-files.s3.us-west-2.amazonaws.com/logo.png",
|
113 |
-
"logo",
|
114 |
-
),
|
115 |
-
(
|
116 |
-
"https://gradio-static-files.s3.us-west-2.amazonaws.com/tower.jpg",
|
117 |
-
"tower",
|
118 |
-
),
|
119 |
-
]
|
120 |
-
).style(height="200px", grid=2)
|
121 |
-
|
122 |
-
with gr.Row():
|
123 |
-
with gr.Column(scale=2):
|
124 |
-
chatbot = gr.Chatbot([("Hello", "Hi")], label="Chatbot")
|
125 |
-
chat_btn = gr.Button("Add messages")
|
126 |
-
|
127 |
-
def chat(history):
|
128 |
-
time.sleep(2)
|
129 |
-
yield [["How are you?", "I am good."]]
|
130 |
-
|
131 |
-
chat_btn.click(
|
132 |
-
lambda history: history
|
133 |
-
+ [["How are you?", "I am good."]]
|
134 |
-
+ (time.sleep(2) or []),
|
135 |
-
chatbot,
|
136 |
-
chatbot,
|
137 |
-
)
|
138 |
-
with gr.Column(scale=1):
|
139 |
-
with gr.Accordion("Advanced Settings"):
|
140 |
-
gr.Markdown("Hello")
|
141 |
-
gr.Number(label="Chatbot control 1")
|
142 |
-
gr.Number(label="Chatbot control 2")
|
143 |
-
gr.Number(label="Chatbot control 3")
|
144 |
-
|
145 |
-
|
146 |
-
if __name__ == "__main__":
|
147 |
-
demo.queue().launch()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/AlexWang/lama/models/ade20k/segm_lib/utils/data/__init__.py
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
|
2 |
-
from .dataset import Dataset, TensorDataset, ConcatDataset
|
3 |
-
from .dataloader import DataLoader
|
|
|
|
|
|
|
|
spaces/Amrrs/DragGan-Inversion/scripts/download_model.sh
DELETED
@@ -1,19 +0,0 @@
|
|
1 |
-
mkdir checkpoints
|
2 |
-
cd checkpoints
|
3 |
-
|
4 |
-
wget https://storage.googleapis.com/self-distilled-stylegan/lions_512_pytorch.pkl
|
5 |
-
mv lions_512_pytorch.pkl stylegan2_lions_512_pytorch.pkl
|
6 |
-
|
7 |
-
wget https://storage.googleapis.com/self-distilled-stylegan/dogs_1024_pytorch.pkl
|
8 |
-
mv dogs_1024_pytorch.pkl stylegan2_dogs_1024_pytorch.pkl
|
9 |
-
|
10 |
-
wget https://storage.googleapis.com/self-distilled-stylegan/horses_256_pytorch.pkl
|
11 |
-
mv horses_256_pytorch.pkl stylegan2_horses_256_pytorch.pkl
|
12 |
-
|
13 |
-
wget https://storage.googleapis.com/self-distilled-stylegan/elephants_512_pytorch.pkl
|
14 |
-
mv elephants_512_pytorch.pkl stylegan2_elephants_512_pytorch.pkl
|
15 |
-
|
16 |
-
wget https://api.ngc.nvidia.com/v2/models/nvidia/research/stylegan2/versions/1/files/stylegan2-ffhq-512x512.pkl
|
17 |
-
wget https://api.ngc.nvidia.com/v2/models/nvidia/research/stylegan2/versions/1/files/stylegan2-afhqcat-512x512.pkl
|
18 |
-
wget http://d36zk2xti64re0.cloudfront.net/stylegan2/networks/stylegan2-car-config-f.pkl
|
19 |
-
wget http://d36zk2xti64re0.cloudfront.net/stylegan2/networks/stylegan2-cat-config-f.pkl
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Androidonnxfork/CivitAi-to-Diffusers/diffusers/docs/README.md
DELETED
@@ -1,271 +0,0 @@
|
|
1 |
-
<!---
|
2 |
-
Copyright 2023- The HuggingFace Team. All rights reserved.
|
3 |
-
|
4 |
-
Licensed under the Apache License, Version 2.0 (the "License");
|
5 |
-
you may not use this file except in compliance with the License.
|
6 |
-
You may obtain a copy of the License at
|
7 |
-
|
8 |
-
http://www.apache.org/licenses/LICENSE-2.0
|
9 |
-
|
10 |
-
Unless required by applicable law or agreed to in writing, software
|
11 |
-
distributed under the License is distributed on an "AS IS" BASIS,
|
12 |
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13 |
-
See the License for the specific language governing permissions and
|
14 |
-
limitations under the License.
|
15 |
-
-->
|
16 |
-
|
17 |
-
# Generating the documentation
|
18 |
-
|
19 |
-
To generate the documentation, you first have to build it. Several packages are necessary to build the doc,
|
20 |
-
you can install them with the following command, at the root of the code repository:
|
21 |
-
|
22 |
-
```bash
|
23 |
-
pip install -e ".[docs]"
|
24 |
-
```
|
25 |
-
|
26 |
-
Then you need to install our open source documentation builder tool:
|
27 |
-
|
28 |
-
```bash
|
29 |
-
pip install git+https://github.com/huggingface/doc-builder
|
30 |
-
```
|
31 |
-
|
32 |
-
---
|
33 |
-
**NOTE**
|
34 |
-
|
35 |
-
You only need to generate the documentation to inspect it locally (if you're planning changes and want to
|
36 |
-
check how they look before committing for instance). You don't have to commit the built documentation.
|
37 |
-
|
38 |
-
---
|
39 |
-
|
40 |
-
## Previewing the documentation
|
41 |
-
|
42 |
-
To preview the docs, first install the `watchdog` module with:
|
43 |
-
|
44 |
-
```bash
|
45 |
-
pip install watchdog
|
46 |
-
```
|
47 |
-
|
48 |
-
Then run the following command:
|
49 |
-
|
50 |
-
```bash
|
51 |
-
doc-builder preview {package_name} {path_to_docs}
|
52 |
-
```
|
53 |
-
|
54 |
-
For example:
|
55 |
-
|
56 |
-
```bash
|
57 |
-
doc-builder preview diffusers docs/source/en
|
58 |
-
```
|
59 |
-
|
60 |
-
The docs will be viewable at [http://localhost:3000](http://localhost:3000). You can also preview the docs once you have opened a PR. You will see a bot add a comment to a link where the documentation with your changes lives.
|
61 |
-
|
62 |
-
---
|
63 |
-
**NOTE**
|
64 |
-
|
65 |
-
The `preview` command only works with existing doc files. When you add a completely new file, you need to update `_toctree.yml` & restart `preview` command (`ctrl-c` to stop it & call `doc-builder preview ...` again).
|
66 |
-
|
67 |
-
---
|
68 |
-
|
69 |
-
## Adding a new element to the navigation bar
|
70 |
-
|
71 |
-
Accepted files are Markdown (.md).
|
72 |
-
|
73 |
-
Create a file with its extension and put it in the source directory. You can then link it to the toc-tree by putting
|
74 |
-
the filename without the extension in the [`_toctree.yml`](https://github.com/huggingface/diffusers/blob/main/docs/source/_toctree.yml) file.
|
75 |
-
|
76 |
-
## Renaming section headers and moving sections
|
77 |
-
|
78 |
-
It helps to keep the old links working when renaming the section header and/or moving sections from one document to another. This is because the old links are likely to be used in Issues, Forums, and Social media and it'd make for a much more superior user experience if users reading those months later could still easily navigate to the originally intended information.
|
79 |
-
|
80 |
-
Therefore, we simply keep a little map of moved sections at the end of the document where the original section was. The key is to preserve the original anchor.
|
81 |
-
|
82 |
-
So if you renamed a section from: "Section A" to "Section B", then you can add at the end of the file:
|
83 |
-
|
84 |
-
```
|
85 |
-
Sections that were moved:
|
86 |
-
|
87 |
-
[ <a href="#section-b">Section A</a><a id="section-a"></a> ]
|
88 |
-
```
|
89 |
-
and of course, if you moved it to another file, then:
|
90 |
-
|
91 |
-
```
|
92 |
-
Sections that were moved:
|
93 |
-
|
94 |
-
[ <a href="../new-file#section-b">Section A</a><a id="section-a"></a> ]
|
95 |
-
```
|
96 |
-
|
97 |
-
Use the relative style to link to the new file so that the versioned docs continue to work.
|
98 |
-
|
99 |
-
For an example of a rich moved section set please see the very end of [the transformers Trainer doc](https://github.com/huggingface/transformers/blob/main/docs/source/en/main_classes/trainer.md).
|
100 |
-
|
101 |
-
|
102 |
-
## Writing Documentation - Specification
|
103 |
-
|
104 |
-
The `huggingface/diffusers` documentation follows the
|
105 |
-
[Google documentation](https://sphinxcontrib-napoleon.readthedocs.io/en/latest/example_google.html) style for docstrings,
|
106 |
-
although we can write them directly in Markdown.
|
107 |
-
|
108 |
-
### Adding a new tutorial
|
109 |
-
|
110 |
-
Adding a new tutorial or section is done in two steps:
|
111 |
-
|
112 |
-
- Add a new file under `docs/source`. This file can either be ReStructuredText (.rst) or Markdown (.md).
|
113 |
-
- Link that file in `docs/source/_toctree.yml` on the correct toc-tree.
|
114 |
-
|
115 |
-
Make sure to put your new file under the proper section. It's unlikely to go in the first section (*Get Started*), so
|
116 |
-
depending on the intended targets (beginners, more advanced users, or researchers) it should go in sections two, three, or four.
|
117 |
-
|
118 |
-
### Adding a new pipeline/scheduler
|
119 |
-
|
120 |
-
When adding a new pipeline:
|
121 |
-
|
122 |
-
- create a file `xxx.md` under `docs/source/api/pipelines` (don't hesitate to copy an existing file as template).
|
123 |
-
- Link that file in (*Diffusers Summary*) section in `docs/source/api/pipelines/overview.md`, along with the link to the paper, and a colab notebook (if available).
|
124 |
-
- Write a short overview of the diffusion model:
|
125 |
-
- Overview with paper & authors
|
126 |
-
- Paper abstract
|
127 |
-
- Tips and tricks and how to use it best
|
128 |
-
- Possible an end-to-end example of how to use it
|
129 |
-
- Add all the pipeline classes that should be linked in the diffusion model. These classes should be added using our Markdown syntax. By default as follows:
|
130 |
-
|
131 |
-
```
|
132 |
-
## XXXPipeline
|
133 |
-
|
134 |
-
[[autodoc]] XXXPipeline
|
135 |
-
- all
|
136 |
-
- __call__
|
137 |
-
```
|
138 |
-
|
139 |
-
This will include every public method of the pipeline that is documented, as well as the `__call__` method that is not documented by default. If you just want to add additional methods that are not documented, you can put the list of all methods to add in a list that contains `all`.
|
140 |
-
|
141 |
-
```
|
142 |
-
[[autodoc]] XXXPipeline
|
143 |
-
- all
|
144 |
-
- __call__
|
145 |
-
- enable_attention_slicing
|
146 |
-
- disable_attention_slicing
|
147 |
-
- enable_xformers_memory_efficient_attention
|
148 |
-
- disable_xformers_memory_efficient_attention
|
149 |
-
```
|
150 |
-
|
151 |
-
You can follow the same process to create a new scheduler under the `docs/source/api/schedulers` folder
|
152 |
-
|
153 |
-
### Writing source documentation
|
154 |
-
|
155 |
-
Values that should be put in `code` should either be surrounded by backticks: \`like so\`. Note that argument names
|
156 |
-
and objects like True, None, or any strings should usually be put in `code`.
|
157 |
-
|
158 |
-
When mentioning a class, function, or method, it is recommended to use our syntax for internal links so that our tool
|
159 |
-
adds a link to its documentation with this syntax: \[\`XXXClass\`\] or \[\`function\`\]. This requires the class or
|
160 |
-
function to be in the main package.
|
161 |
-
|
162 |
-
If you want to create a link to some internal class or function, you need to
|
163 |
-
provide its path. For instance: \[\`pipelines.ImagePipelineOutput\`\]. This will be converted into a link with
|
164 |
-
`pipelines.ImagePipelineOutput` in the description. To get rid of the path and only keep the name of the object you are
|
165 |
-
linking to in the description, add a ~: \[\`~pipelines.ImagePipelineOutput\`\] will generate a link with `ImagePipelineOutput` in the description.
|
166 |
-
|
167 |
-
The same works for methods so you can either use \[\`XXXClass.method\`\] or \[~\`XXXClass.method\`\].
|
168 |
-
|
169 |
-
#### Defining arguments in a method
|
170 |
-
|
171 |
-
Arguments should be defined with the `Args:` (or `Arguments:` or `Parameters:`) prefix, followed by a line return and
|
172 |
-
an indentation. The argument should be followed by its type, with its shape if it is a tensor, a colon, and its
|
173 |
-
description:
|
174 |
-
|
175 |
-
```
|
176 |
-
Args:
|
177 |
-
n_layers (`int`): The number of layers of the model.
|
178 |
-
```
|
179 |
-
|
180 |
-
If the description is too long to fit in one line, another indentation is necessary before writing the description
|
181 |
-
after the argument.
|
182 |
-
|
183 |
-
Here's an example showcasing everything so far:
|
184 |
-
|
185 |
-
```
|
186 |
-
Args:
|
187 |
-
input_ids (`torch.LongTensor` of shape `(batch_size, sequence_length)`):
|
188 |
-
Indices of input sequence tokens in the vocabulary.
|
189 |
-
|
190 |
-
Indices can be obtained using [`AlbertTokenizer`]. See [`~PreTrainedTokenizer.encode`] and
|
191 |
-
[`~PreTrainedTokenizer.__call__`] for details.
|
192 |
-
|
193 |
-
[What are input IDs?](../glossary#input-ids)
|
194 |
-
```
|
195 |
-
|
196 |
-
For optional arguments or arguments with defaults we follow the following syntax: imagine we have a function with the
|
197 |
-
following signature:
|
198 |
-
|
199 |
-
```
|
200 |
-
def my_function(x: str = None, a: float = 1):
|
201 |
-
```
|
202 |
-
|
203 |
-
then its documentation should look like this:
|
204 |
-
|
205 |
-
```
|
206 |
-
Args:
|
207 |
-
x (`str`, *optional*):
|
208 |
-
This argument controls ...
|
209 |
-
a (`float`, *optional*, defaults to 1):
|
210 |
-
This argument is used to ...
|
211 |
-
```
|
212 |
-
|
213 |
-
Note that we always omit the "defaults to \`None\`" when None is the default for any argument. Also note that even
|
214 |
-
if the first line describing your argument type and its default gets long, you can't break it on several lines. You can
|
215 |
-
however write as many lines as you want in the indented description (see the example above with `input_ids`).
|
216 |
-
|
217 |
-
#### Writing a multi-line code block
|
218 |
-
|
219 |
-
Multi-line code blocks can be useful for displaying examples. They are done between two lines of three backticks as usual in Markdown:
|
220 |
-
|
221 |
-
|
222 |
-
````
|
223 |
-
```
|
224 |
-
# first line of code
|
225 |
-
# second line
|
226 |
-
# etc
|
227 |
-
```
|
228 |
-
````
|
229 |
-
|
230 |
-
#### Writing a return block
|
231 |
-
|
232 |
-
The return block should be introduced with the `Returns:` prefix, followed by a line return and an indentation.
|
233 |
-
The first line should be the type of the return, followed by a line return. No need to indent further for the elements
|
234 |
-
building the return.
|
235 |
-
|
236 |
-
Here's an example of a single value return:
|
237 |
-
|
238 |
-
```
|
239 |
-
Returns:
|
240 |
-
`List[int]`: A list of integers in the range [0, 1] --- 1 for a special token, 0 for a sequence token.
|
241 |
-
```
|
242 |
-
|
243 |
-
Here's an example of a tuple return, comprising several objects:
|
244 |
-
|
245 |
-
```
|
246 |
-
Returns:
|
247 |
-
`tuple(torch.FloatTensor)` comprising various elements depending on the configuration ([`BertConfig`]) and inputs:
|
248 |
-
- ** loss** (*optional*, returned when `masked_lm_labels` is provided) `torch.FloatTensor` of shape `(1,)` --
|
249 |
-
Total loss is the sum of the masked language modeling loss and the next sequence prediction (classification) loss.
|
250 |
-
- **prediction_scores** (`torch.FloatTensor` of shape `(batch_size, sequence_length, config.vocab_size)`) --
|
251 |
-
Prediction scores of the language modeling head (scores for each vocabulary token before SoftMax).
|
252 |
-
```
|
253 |
-
|
254 |
-
#### Adding an image
|
255 |
-
|
256 |
-
Due to the rapidly growing repository, it is important to make sure that no files that would significantly weigh down the repository are added. This includes images, videos, and other non-text files. We prefer to leverage a hf.co hosted `dataset` like
|
257 |
-
the ones hosted on [`hf-internal-testing`](https://huggingface.co/hf-internal-testing) in which to place these files and reference
|
258 |
-
them by URL. We recommend putting them in the following dataset: [huggingface/documentation-images](https://huggingface.co/datasets/huggingface/documentation-images).
|
259 |
-
If an external contribution, feel free to add the images to your PR and ask a Hugging Face member to migrate your images
|
260 |
-
to this dataset.
|
261 |
-
|
262 |
-
## Styling the docstring
|
263 |
-
|
264 |
-
We have an automatic script running with the `make style` command that will make sure that:
|
265 |
-
- the docstrings fully take advantage of the line width
|
266 |
-
- all code examples are formatted using black, like the code of the Transformers library
|
267 |
-
|
268 |
-
This script may have some weird failures if you made a syntax mistake or if you uncover a bug. Therefore, it's
|
269 |
-
recommended to commit your changes before running `make style`, so you can revert the changes done by that script
|
270 |
-
easily.
|
271 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Androidonnxfork/CivitAi-to-Diffusers/diffusers/src/diffusers/models/modeling_pytorch_flax_utils.py
DELETED
@@ -1,161 +0,0 @@
|
|
1 |
-
# coding=utf-8
|
2 |
-
# Copyright 2023 The HuggingFace Inc. team.
|
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 |
-
""" PyTorch - Flax general utilities."""
|
16 |
-
|
17 |
-
from pickle import UnpicklingError
|
18 |
-
|
19 |
-
import jax
|
20 |
-
import jax.numpy as jnp
|
21 |
-
import numpy as np
|
22 |
-
from flax.serialization import from_bytes
|
23 |
-
from flax.traverse_util import flatten_dict
|
24 |
-
|
25 |
-
from ..utils import logging
|
26 |
-
|
27 |
-
|
28 |
-
logger = logging.get_logger(__name__)
|
29 |
-
|
30 |
-
|
31 |
-
#####################
|
32 |
-
# Flax => PyTorch #
|
33 |
-
#####################
|
34 |
-
|
35 |
-
|
36 |
-
# from https://github.com/huggingface/transformers/blob/main/src/transformers/modeling_flax_pytorch_utils.py#L224-L352
|
37 |
-
def load_flax_checkpoint_in_pytorch_model(pt_model, model_file):
|
38 |
-
try:
|
39 |
-
with open(model_file, "rb") as flax_state_f:
|
40 |
-
flax_state = from_bytes(None, flax_state_f.read())
|
41 |
-
except UnpicklingError as e:
|
42 |
-
try:
|
43 |
-
with open(model_file) as f:
|
44 |
-
if f.read().startswith("version"):
|
45 |
-
raise OSError(
|
46 |
-
"You seem to have cloned a repository without having git-lfs installed. Please"
|
47 |
-
" install git-lfs and run `git lfs install` followed by `git lfs pull` in the"
|
48 |
-
" folder you cloned."
|
49 |
-
)
|
50 |
-
else:
|
51 |
-
raise ValueError from e
|
52 |
-
except (UnicodeDecodeError, ValueError):
|
53 |
-
raise EnvironmentError(f"Unable to convert {model_file} to Flax deserializable object. ")
|
54 |
-
|
55 |
-
return load_flax_weights_in_pytorch_model(pt_model, flax_state)
|
56 |
-
|
57 |
-
|
58 |
-
def load_flax_weights_in_pytorch_model(pt_model, flax_state):
|
59 |
-
"""Load flax checkpoints in a PyTorch model"""
|
60 |
-
|
61 |
-
try:
|
62 |
-
import torch # noqa: F401
|
63 |
-
except ImportError:
|
64 |
-
logger.error(
|
65 |
-
"Loading Flax weights in PyTorch requires both PyTorch and Flax to be installed. Please see"
|
66 |
-
" https://pytorch.org/ and https://flax.readthedocs.io/en/latest/installation.html for installation"
|
67 |
-
" instructions."
|
68 |
-
)
|
69 |
-
raise
|
70 |
-
|
71 |
-
# check if we have bf16 weights
|
72 |
-
is_type_bf16 = flatten_dict(jax.tree_util.tree_map(lambda x: x.dtype == jnp.bfloat16, flax_state)).values()
|
73 |
-
if any(is_type_bf16):
|
74 |
-
# convert all weights to fp32 if they are bf16 since torch.from_numpy can-not handle bf16
|
75 |
-
|
76 |
-
# and bf16 is not fully supported in PT yet.
|
77 |
-
logger.warning(
|
78 |
-
"Found ``bfloat16`` weights in Flax model. Casting all ``bfloat16`` weights to ``float32`` "
|
79 |
-
"before loading those in PyTorch model."
|
80 |
-
)
|
81 |
-
flax_state = jax.tree_util.tree_map(
|
82 |
-
lambda params: params.astype(np.float32) if params.dtype == jnp.bfloat16 else params, flax_state
|
83 |
-
)
|
84 |
-
|
85 |
-
pt_model.base_model_prefix = ""
|
86 |
-
|
87 |
-
flax_state_dict = flatten_dict(flax_state, sep=".")
|
88 |
-
pt_model_dict = pt_model.state_dict()
|
89 |
-
|
90 |
-
# keep track of unexpected & missing keys
|
91 |
-
unexpected_keys = []
|
92 |
-
missing_keys = set(pt_model_dict.keys())
|
93 |
-
|
94 |
-
for flax_key_tuple, flax_tensor in flax_state_dict.items():
|
95 |
-
flax_key_tuple_array = flax_key_tuple.split(".")
|
96 |
-
|
97 |
-
if flax_key_tuple_array[-1] == "kernel" and flax_tensor.ndim == 4:
|
98 |
-
flax_key_tuple_array = flax_key_tuple_array[:-1] + ["weight"]
|
99 |
-
flax_tensor = jnp.transpose(flax_tensor, (3, 2, 0, 1))
|
100 |
-
elif flax_key_tuple_array[-1] == "kernel":
|
101 |
-
flax_key_tuple_array = flax_key_tuple_array[:-1] + ["weight"]
|
102 |
-
flax_tensor = flax_tensor.T
|
103 |
-
elif flax_key_tuple_array[-1] == "scale":
|
104 |
-
flax_key_tuple_array = flax_key_tuple_array[:-1] + ["weight"]
|
105 |
-
|
106 |
-
if "time_embedding" not in flax_key_tuple_array:
|
107 |
-
for i, flax_key_tuple_string in enumerate(flax_key_tuple_array):
|
108 |
-
flax_key_tuple_array[i] = (
|
109 |
-
flax_key_tuple_string.replace("_0", ".0")
|
110 |
-
.replace("_1", ".1")
|
111 |
-
.replace("_2", ".2")
|
112 |
-
.replace("_3", ".3")
|
113 |
-
.replace("_4", ".4")
|
114 |
-
.replace("_5", ".5")
|
115 |
-
.replace("_6", ".6")
|
116 |
-
.replace("_7", ".7")
|
117 |
-
.replace("_8", ".8")
|
118 |
-
.replace("_9", ".9")
|
119 |
-
)
|
120 |
-
|
121 |
-
flax_key = ".".join(flax_key_tuple_array)
|
122 |
-
|
123 |
-
if flax_key in pt_model_dict:
|
124 |
-
if flax_tensor.shape != pt_model_dict[flax_key].shape:
|
125 |
-
raise ValueError(
|
126 |
-
f"Flax checkpoint seems to be incorrect. Weight {flax_key_tuple} was expected "
|
127 |
-
f"to be of shape {pt_model_dict[flax_key].shape}, but is {flax_tensor.shape}."
|
128 |
-
)
|
129 |
-
else:
|
130 |
-
# add weight to pytorch dict
|
131 |
-
flax_tensor = np.asarray(flax_tensor) if not isinstance(flax_tensor, np.ndarray) else flax_tensor
|
132 |
-
pt_model_dict[flax_key] = torch.from_numpy(flax_tensor)
|
133 |
-
# remove from missing keys
|
134 |
-
missing_keys.remove(flax_key)
|
135 |
-
else:
|
136 |
-
# weight is not expected by PyTorch model
|
137 |
-
unexpected_keys.append(flax_key)
|
138 |
-
|
139 |
-
pt_model.load_state_dict(pt_model_dict)
|
140 |
-
|
141 |
-
# re-transform missing_keys to list
|
142 |
-
missing_keys = list(missing_keys)
|
143 |
-
|
144 |
-
if len(unexpected_keys) > 0:
|
145 |
-
logger.warning(
|
146 |
-
"Some weights of the Flax model were not used when initializing the PyTorch model"
|
147 |
-
f" {pt_model.__class__.__name__}: {unexpected_keys}\n- This IS expected if you are initializing"
|
148 |
-
f" {pt_model.__class__.__name__} from a Flax model trained on another task or with another architecture"
|
149 |
-
" (e.g. initializing a BertForSequenceClassification model from a FlaxBertForPreTraining model).\n- This"
|
150 |
-
f" IS NOT expected if you are initializing {pt_model.__class__.__name__} from a Flax model that you expect"
|
151 |
-
" to be exactly identical (e.g. initializing a BertForSequenceClassification model from a"
|
152 |
-
" FlaxBertForSequenceClassification model)."
|
153 |
-
)
|
154 |
-
if len(missing_keys) > 0:
|
155 |
-
logger.warning(
|
156 |
-
f"Some weights of {pt_model.__class__.__name__} were not initialized from the Flax model and are newly"
|
157 |
-
f" initialized: {missing_keys}\nYou should probably TRAIN this model on a down-stream task to be able to"
|
158 |
-
" use it for predictions and inference."
|
159 |
-
)
|
160 |
-
|
161 |
-
return pt_model
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Andy1621/uniformer_image_detection/configs/gcnet/mask_rcnn_x101_32x4d_fpn_syncbn-backbone_r4_gcb_c3-c5_1x_coco.py
DELETED
@@ -1,11 +0,0 @@
|
|
1 |
-
_base_ = '../mask_rcnn/mask_rcnn_x101_32x4d_fpn_1x_coco.py'
|
2 |
-
model = dict(
|
3 |
-
backbone=dict(
|
4 |
-
norm_cfg=dict(type='SyncBN', requires_grad=True),
|
5 |
-
norm_eval=False,
|
6 |
-
plugins=[
|
7 |
-
dict(
|
8 |
-
cfg=dict(type='ContextBlock', ratio=1. / 4),
|
9 |
-
stages=(False, True, True, True),
|
10 |
-
position='after_conv3')
|
11 |
-
]))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Andy1621/uniformer_image_detection/configs/swin/mask_rcnn_swin_tiny_patch4_window7_mstrain_480-800_adamw_3x_coco.py
DELETED
@@ -1,80 +0,0 @@
|
|
1 |
-
_base_ = [
|
2 |
-
'../_base_/models/mask_rcnn_swin_fpn.py',
|
3 |
-
'../_base_/datasets/coco_instance.py',
|
4 |
-
'../_base_/schedules/schedule_1x.py', '../_base_/default_runtime.py'
|
5 |
-
]
|
6 |
-
|
7 |
-
model = dict(
|
8 |
-
backbone=dict(
|
9 |
-
embed_dim=96,
|
10 |
-
depths=[2, 2, 6, 2],
|
11 |
-
num_heads=[3, 6, 12, 24],
|
12 |
-
window_size=7,
|
13 |
-
ape=False,
|
14 |
-
drop_path_rate=0.2,
|
15 |
-
patch_norm=True,
|
16 |
-
use_checkpoint=False
|
17 |
-
),
|
18 |
-
neck=dict(in_channels=[96, 192, 384, 768]))
|
19 |
-
|
20 |
-
img_norm_cfg = dict(
|
21 |
-
mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_rgb=True)
|
22 |
-
|
23 |
-
# augmentation strategy originates from DETR / Sparse RCNN
|
24 |
-
train_pipeline = [
|
25 |
-
dict(type='LoadImageFromFile'),
|
26 |
-
dict(type='LoadAnnotations', with_bbox=True, with_mask=True),
|
27 |
-
dict(type='RandomFlip', flip_ratio=0.5),
|
28 |
-
dict(type='AutoAugment',
|
29 |
-
policies=[
|
30 |
-
[
|
31 |
-
dict(type='Resize',
|
32 |
-
img_scale=[(480, 1333), (512, 1333), (544, 1333), (576, 1333),
|
33 |
-
(608, 1333), (640, 1333), (672, 1333), (704, 1333),
|
34 |
-
(736, 1333), (768, 1333), (800, 1333)],
|
35 |
-
multiscale_mode='value',
|
36 |
-
keep_ratio=True)
|
37 |
-
],
|
38 |
-
[
|
39 |
-
dict(type='Resize',
|
40 |
-
img_scale=[(400, 1333), (500, 1333), (600, 1333)],
|
41 |
-
multiscale_mode='value',
|
42 |
-
keep_ratio=True),
|
43 |
-
dict(type='RandomCrop',
|
44 |
-
crop_type='absolute_range',
|
45 |
-
crop_size=(384, 600),
|
46 |
-
allow_negative_crop=True),
|
47 |
-
dict(type='Resize',
|
48 |
-
img_scale=[(480, 1333), (512, 1333), (544, 1333),
|
49 |
-
(576, 1333), (608, 1333), (640, 1333),
|
50 |
-
(672, 1333), (704, 1333), (736, 1333),
|
51 |
-
(768, 1333), (800, 1333)],
|
52 |
-
multiscale_mode='value',
|
53 |
-
override=True,
|
54 |
-
keep_ratio=True)
|
55 |
-
]
|
56 |
-
]),
|
57 |
-
dict(type='Normalize', **img_norm_cfg),
|
58 |
-
dict(type='Pad', size_divisor=32),
|
59 |
-
dict(type='DefaultFormatBundle'),
|
60 |
-
dict(type='Collect', keys=['img', 'gt_bboxes', 'gt_labels', 'gt_masks']),
|
61 |
-
]
|
62 |
-
data = dict(train=dict(pipeline=train_pipeline))
|
63 |
-
|
64 |
-
optimizer = dict(_delete_=True, type='AdamW', lr=0.0001, betas=(0.9, 0.999), weight_decay=0.05,
|
65 |
-
paramwise_cfg=dict(custom_keys={'absolute_pos_embed': dict(decay_mult=0.),
|
66 |
-
'relative_position_bias_table': dict(decay_mult=0.),
|
67 |
-
'norm': dict(decay_mult=0.)}))
|
68 |
-
lr_config = dict(step=[27, 33])
|
69 |
-
runner = dict(type='EpochBasedRunnerAmp', max_epochs=36)
|
70 |
-
|
71 |
-
# do not use mmdet version fp16
|
72 |
-
fp16 = None
|
73 |
-
optimizer_config = dict(
|
74 |
-
type="DistOptimizerHook",
|
75 |
-
update_interval=1,
|
76 |
-
grad_clip=None,
|
77 |
-
coalesce=True,
|
78 |
-
bucket_size_mb=-1,
|
79 |
-
use_fp16=True,
|
80 |
-
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Anthony7906/MengHuiMXD_GPT/chatgpt - windows.bat
DELETED
@@ -1,14 +0,0 @@
|
|
1 |
-
@echo off
|
2 |
-
echo Opening ChuanhuChatGPT...
|
3 |
-
|
4 |
-
REM Open powershell via bat
|
5 |
-
start powershell.exe -NoExit -Command "python ./ChuanhuChatbot.py"
|
6 |
-
|
7 |
-
REM The web page can be accessed with delayed start http://127.0.0.1:7860/
|
8 |
-
ping -n 5 127.0.0.1>nul
|
9 |
-
|
10 |
-
REM access chargpt via your default browser
|
11 |
-
start "" "http://127.0.0.1:7860/"
|
12 |
-
|
13 |
-
|
14 |
-
echo Finished opening ChuanhuChatGPT (http://127.0.0.1:7860/).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Arthur678/vits-uma-genshin-honkai/utils.py
DELETED
@@ -1,225 +0,0 @@
|
|
1 |
-
import os
|
2 |
-
import sys
|
3 |
-
import argparse
|
4 |
-
import logging
|
5 |
-
import json
|
6 |
-
import subprocess
|
7 |
-
import numpy as np
|
8 |
-
import librosa
|
9 |
-
import torch
|
10 |
-
|
11 |
-
MATPLOTLIB_FLAG = False
|
12 |
-
|
13 |
-
logging.basicConfig(stream=sys.stdout, level=logging.DEBUG)
|
14 |
-
logger = logging
|
15 |
-
|
16 |
-
|
17 |
-
def load_checkpoint(checkpoint_path, model, optimizer=None):
|
18 |
-
assert os.path.isfile(checkpoint_path)
|
19 |
-
checkpoint_dict = torch.load(checkpoint_path, map_location='cpu')
|
20 |
-
iteration = checkpoint_dict['iteration']
|
21 |
-
learning_rate = checkpoint_dict['learning_rate']
|
22 |
-
if optimizer is not None:
|
23 |
-
optimizer.load_state_dict(checkpoint_dict['optimizer'])
|
24 |
-
saved_state_dict = checkpoint_dict['model']
|
25 |
-
if hasattr(model, 'module'):
|
26 |
-
state_dict = model.module.state_dict()
|
27 |
-
else:
|
28 |
-
state_dict = model.state_dict()
|
29 |
-
new_state_dict= {}
|
30 |
-
for k, v in state_dict.items():
|
31 |
-
try:
|
32 |
-
new_state_dict[k] = saved_state_dict[k]
|
33 |
-
except:
|
34 |
-
logger.info("%s is not in the checkpoint" % k)
|
35 |
-
new_state_dict[k] = v
|
36 |
-
if hasattr(model, 'module'):
|
37 |
-
model.module.load_state_dict(new_state_dict)
|
38 |
-
else:
|
39 |
-
model.load_state_dict(new_state_dict)
|
40 |
-
logger.info("Loaded checkpoint '{}' (iteration {})" .format(
|
41 |
-
checkpoint_path, iteration))
|
42 |
-
return model, optimizer, learning_rate, iteration
|
43 |
-
|
44 |
-
|
45 |
-
def plot_spectrogram_to_numpy(spectrogram):
|
46 |
-
global MATPLOTLIB_FLAG
|
47 |
-
if not MATPLOTLIB_FLAG:
|
48 |
-
import matplotlib
|
49 |
-
matplotlib.use("Agg")
|
50 |
-
MATPLOTLIB_FLAG = True
|
51 |
-
mpl_logger = logging.getLogger('matplotlib')
|
52 |
-
mpl_logger.setLevel(logging.WARNING)
|
53 |
-
import matplotlib.pylab as plt
|
54 |
-
import numpy as np
|
55 |
-
|
56 |
-
fig, ax = plt.subplots(figsize=(10,2))
|
57 |
-
im = ax.imshow(spectrogram, aspect="auto", origin="lower",
|
58 |
-
interpolation='none')
|
59 |
-
plt.colorbar(im, ax=ax)
|
60 |
-
plt.xlabel("Frames")
|
61 |
-
plt.ylabel("Channels")
|
62 |
-
plt.tight_layout()
|
63 |
-
|
64 |
-
fig.canvas.draw()
|
65 |
-
data = np.fromstring(fig.canvas.tostring_rgb(), dtype=np.uint8, sep='')
|
66 |
-
data = data.reshape(fig.canvas.get_width_height()[::-1] + (3,))
|
67 |
-
plt.close()
|
68 |
-
return data
|
69 |
-
|
70 |
-
|
71 |
-
def plot_alignment_to_numpy(alignment, info=None):
|
72 |
-
global MATPLOTLIB_FLAG
|
73 |
-
if not MATPLOTLIB_FLAG:
|
74 |
-
import matplotlib
|
75 |
-
matplotlib.use("Agg")
|
76 |
-
MATPLOTLIB_FLAG = True
|
77 |
-
mpl_logger = logging.getLogger('matplotlib')
|
78 |
-
mpl_logger.setLevel(logging.WARNING)
|
79 |
-
import matplotlib.pylab as plt
|
80 |
-
import numpy as np
|
81 |
-
|
82 |
-
fig, ax = plt.subplots(figsize=(6, 4))
|
83 |
-
im = ax.imshow(alignment.transpose(), aspect='auto', origin='lower',
|
84 |
-
interpolation='none')
|
85 |
-
fig.colorbar(im, ax=ax)
|
86 |
-
xlabel = 'Decoder timestep'
|
87 |
-
if info is not None:
|
88 |
-
xlabel += '\n\n' + info
|
89 |
-
plt.xlabel(xlabel)
|
90 |
-
plt.ylabel('Encoder timestep')
|
91 |
-
plt.tight_layout()
|
92 |
-
|
93 |
-
fig.canvas.draw()
|
94 |
-
data = np.fromstring(fig.canvas.tostring_rgb(), dtype=np.uint8, sep='')
|
95 |
-
data = data.reshape(fig.canvas.get_width_height()[::-1] + (3,))
|
96 |
-
plt.close()
|
97 |
-
return data
|
98 |
-
|
99 |
-
|
100 |
-
def load_audio_to_torch(full_path, target_sampling_rate):
|
101 |
-
audio, sampling_rate = librosa.load(full_path, sr=target_sampling_rate, mono=True)
|
102 |
-
return torch.FloatTensor(audio.astype(np.float32))
|
103 |
-
|
104 |
-
|
105 |
-
def load_filepaths_and_text(filename, split="|"):
|
106 |
-
with open(filename, encoding='utf-8') as f:
|
107 |
-
filepaths_and_text = [line.strip().split(split) for line in f]
|
108 |
-
return filepaths_and_text
|
109 |
-
|
110 |
-
|
111 |
-
def get_hparams(init=True):
|
112 |
-
parser = argparse.ArgumentParser()
|
113 |
-
parser.add_argument('-c', '--config', type=str, default="./configs/base.json",
|
114 |
-
help='JSON file for configuration')
|
115 |
-
parser.add_argument('-m', '--model', type=str, required=True,
|
116 |
-
help='Model name')
|
117 |
-
|
118 |
-
args = parser.parse_args()
|
119 |
-
model_dir = os.path.join("./logs", args.model)
|
120 |
-
|
121 |
-
if not os.path.exists(model_dir):
|
122 |
-
os.makedirs(model_dir)
|
123 |
-
|
124 |
-
config_path = args.config
|
125 |
-
config_save_path = os.path.join(model_dir, "config.json")
|
126 |
-
if init:
|
127 |
-
with open(config_path, "r") as f:
|
128 |
-
data = f.read()
|
129 |
-
with open(config_save_path, "w") as f:
|
130 |
-
f.write(data)
|
131 |
-
else:
|
132 |
-
with open(config_save_path, "r") as f:
|
133 |
-
data = f.read()
|
134 |
-
config = json.loads(data)
|
135 |
-
|
136 |
-
hparams = HParams(**config)
|
137 |
-
hparams.model_dir = model_dir
|
138 |
-
return hparams
|
139 |
-
|
140 |
-
|
141 |
-
def get_hparams_from_dir(model_dir):
|
142 |
-
config_save_path = os.path.join(model_dir, "config.json")
|
143 |
-
with open(config_save_path, "r") as f:
|
144 |
-
data = f.read()
|
145 |
-
config = json.loads(data)
|
146 |
-
|
147 |
-
hparams =HParams(**config)
|
148 |
-
hparams.model_dir = model_dir
|
149 |
-
return hparams
|
150 |
-
|
151 |
-
|
152 |
-
def get_hparams_from_file(config_path):
|
153 |
-
with open(config_path, "r") as f:
|
154 |
-
data = f.read()
|
155 |
-
config = json.loads(data)
|
156 |
-
|
157 |
-
hparams =HParams(**config)
|
158 |
-
return hparams
|
159 |
-
|
160 |
-
|
161 |
-
def check_git_hash(model_dir):
|
162 |
-
source_dir = os.path.dirname(os.path.realpath(__file__))
|
163 |
-
if not os.path.exists(os.path.join(source_dir, ".git")):
|
164 |
-
logger.warn("{} is not a git repository, therefore hash value comparison will be ignored.".format(
|
165 |
-
source_dir
|
166 |
-
))
|
167 |
-
return
|
168 |
-
|
169 |
-
cur_hash = subprocess.getoutput("git rev-parse HEAD")
|
170 |
-
|
171 |
-
path = os.path.join(model_dir, "githash")
|
172 |
-
if os.path.exists(path):
|
173 |
-
saved_hash = open(path).read()
|
174 |
-
if saved_hash != cur_hash:
|
175 |
-
logger.warn("git hash values are different. {}(saved) != {}(current)".format(
|
176 |
-
saved_hash[:8], cur_hash[:8]))
|
177 |
-
else:
|
178 |
-
open(path, "w").write(cur_hash)
|
179 |
-
|
180 |
-
|
181 |
-
def get_logger(model_dir, filename="train.log"):
|
182 |
-
global logger
|
183 |
-
logger = logging.getLogger(os.path.basename(model_dir))
|
184 |
-
logger.setLevel(logging.DEBUG)
|
185 |
-
|
186 |
-
formatter = logging.Formatter("%(asctime)s\t%(name)s\t%(levelname)s\t%(message)s")
|
187 |
-
if not os.path.exists(model_dir):
|
188 |
-
os.makedirs(model_dir)
|
189 |
-
h = logging.FileHandler(os.path.join(model_dir, filename))
|
190 |
-
h.setLevel(logging.DEBUG)
|
191 |
-
h.setFormatter(formatter)
|
192 |
-
logger.addHandler(h)
|
193 |
-
return logger
|
194 |
-
|
195 |
-
|
196 |
-
class HParams():
|
197 |
-
def __init__(self, **kwargs):
|
198 |
-
for k, v in kwargs.items():
|
199 |
-
if type(v) == dict:
|
200 |
-
v = HParams(**v)
|
201 |
-
self[k] = v
|
202 |
-
|
203 |
-
def keys(self):
|
204 |
-
return self.__dict__.keys()
|
205 |
-
|
206 |
-
def items(self):
|
207 |
-
return self.__dict__.items()
|
208 |
-
|
209 |
-
def values(self):
|
210 |
-
return self.__dict__.values()
|
211 |
-
|
212 |
-
def __len__(self):
|
213 |
-
return len(self.__dict__)
|
214 |
-
|
215 |
-
def __getitem__(self, key):
|
216 |
-
return getattr(self, key)
|
217 |
-
|
218 |
-
def __setitem__(self, key, value):
|
219 |
-
return setattr(self, key, value)
|
220 |
-
|
221 |
-
def __contains__(self, key):
|
222 |
-
return key in self.__dict__
|
223 |
-
|
224 |
-
def __repr__(self):
|
225 |
-
return self.__dict__.__repr__()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Avator/gradio-hugging-face/app.py
DELETED
@@ -1,14 +0,0 @@
|
|
1 |
-
import gradio as gr
|
2 |
-
from transformers import pipeline
|
3 |
-
sentiment = pipeline("sentiment-analysis")
|
4 |
-
def get_sentiment(input_text):
|
5 |
-
return sentiment(input_text)
|
6 |
-
result = get_sentiment("The movie was very bad")
|
7 |
-
result
|
8 |
-
iface = gr.Interface(fn=get_sentiment,
|
9 |
-
inputs='text',
|
10 |
-
outputs=['text'],
|
11 |
-
title='Sentiment Analysis',
|
12 |
-
description="Get Sentiment Negative/Positive for the given Input",
|
13 |
-
theme='huggingface')
|
14 |
-
iface.launch(inline=False)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Awiny/Image2Paragraph/models/grit_src/third_party/CenterNet2/detectron2/evaluation/coco_evaluation.py
DELETED
@@ -1,710 +0,0 @@
|
|
1 |
-
# Copyright (c) Facebook, Inc. and its affiliates.
|
2 |
-
import contextlib
|
3 |
-
import copy
|
4 |
-
import io
|
5 |
-
import itertools
|
6 |
-
import json
|
7 |
-
import logging
|
8 |
-
import numpy as np
|
9 |
-
import os
|
10 |
-
import pickle
|
11 |
-
from collections import OrderedDict
|
12 |
-
import pycocotools.mask as mask_util
|
13 |
-
import torch
|
14 |
-
from pycocotools.coco import COCO
|
15 |
-
from pycocotools.cocoeval import COCOeval
|
16 |
-
from tabulate import tabulate
|
17 |
-
|
18 |
-
import detectron2.utils.comm as comm
|
19 |
-
from detectron2.config import CfgNode
|
20 |
-
from detectron2.data import MetadataCatalog
|
21 |
-
from detectron2.data.datasets.coco import convert_to_coco_json
|
22 |
-
from detectron2.evaluation.fast_eval_api import COCOeval_opt
|
23 |
-
from detectron2.structures import Boxes, BoxMode, pairwise_iou
|
24 |
-
from detectron2.utils.file_io import PathManager
|
25 |
-
from detectron2.utils.logger import create_small_table
|
26 |
-
|
27 |
-
from .evaluator import DatasetEvaluator
|
28 |
-
|
29 |
-
|
30 |
-
class COCOEvaluator(DatasetEvaluator):
|
31 |
-
"""
|
32 |
-
Evaluate AR for object proposals, AP for instance detection/segmentation, AP
|
33 |
-
for keypoint detection outputs using COCO's metrics.
|
34 |
-
See http://cocodataset.org/#detection-eval and
|
35 |
-
http://cocodataset.org/#keypoints-eval to understand its metrics.
|
36 |
-
The metrics range from 0 to 100 (instead of 0 to 1), where a -1 or NaN means
|
37 |
-
the metric cannot be computed (e.g. due to no predictions made).
|
38 |
-
|
39 |
-
In addition to COCO, this evaluator is able to support any bounding box detection,
|
40 |
-
instance segmentation, or keypoint detection dataset.
|
41 |
-
"""
|
42 |
-
|
43 |
-
def __init__(
|
44 |
-
self,
|
45 |
-
dataset_name,
|
46 |
-
tasks=None,
|
47 |
-
distributed=True,
|
48 |
-
output_dir=None,
|
49 |
-
*,
|
50 |
-
max_dets_per_image=None,
|
51 |
-
use_fast_impl=True,
|
52 |
-
kpt_oks_sigmas=(),
|
53 |
-
):
|
54 |
-
"""
|
55 |
-
Args:
|
56 |
-
dataset_name (str): name of the dataset to be evaluated.
|
57 |
-
It must have either the following corresponding metadata:
|
58 |
-
|
59 |
-
"json_file": the path to the COCO format annotation
|
60 |
-
|
61 |
-
Or it must be in detectron2's standard dataset format
|
62 |
-
so it can be converted to COCO format automatically.
|
63 |
-
tasks (tuple[str]): tasks that can be evaluated under the given
|
64 |
-
configuration. A task is one of "bbox", "segm", "keypoints".
|
65 |
-
By default, will infer this automatically from predictions.
|
66 |
-
distributed (True): if True, will collect results from all ranks and run evaluation
|
67 |
-
in the main process.
|
68 |
-
Otherwise, will only evaluate the results in the current process.
|
69 |
-
output_dir (str): optional, an output directory to dump all
|
70 |
-
results predicted on the dataset. The dump contains two files:
|
71 |
-
|
72 |
-
1. "instances_predictions.pth" a file that can be loaded with `torch.load` and
|
73 |
-
contains all the results in the format they are produced by the model.
|
74 |
-
2. "coco_instances_results.json" a json file in COCO's result format.
|
75 |
-
max_dets_per_image (int): limit on the maximum number of detections per image.
|
76 |
-
By default in COCO, this limit is to 100, but this can be customized
|
77 |
-
to be greater, as is needed in evaluation metrics AP fixed and AP pool
|
78 |
-
(see https://arxiv.org/pdf/2102.01066.pdf)
|
79 |
-
This doesn't affect keypoint evaluation.
|
80 |
-
use_fast_impl (bool): use a fast but **unofficial** implementation to compute AP.
|
81 |
-
Although the results should be very close to the official implementation in COCO
|
82 |
-
API, it is still recommended to compute results with the official API for use in
|
83 |
-
papers. The faster implementation also uses more RAM.
|
84 |
-
kpt_oks_sigmas (list[float]): The sigmas used to calculate keypoint OKS.
|
85 |
-
See http://cocodataset.org/#keypoints-eval
|
86 |
-
When empty, it will use the defaults in COCO.
|
87 |
-
Otherwise it should be the same length as ROI_KEYPOINT_HEAD.NUM_KEYPOINTS.
|
88 |
-
"""
|
89 |
-
self._logger = logging.getLogger(__name__)
|
90 |
-
self._distributed = distributed
|
91 |
-
self._output_dir = output_dir
|
92 |
-
self._use_fast_impl = use_fast_impl
|
93 |
-
|
94 |
-
# COCOeval requires the limit on the number of detections per image (maxDets) to be a list
|
95 |
-
# with at least 3 elements. The default maxDets in COCOeval is [1, 10, 100], in which the
|
96 |
-
# 3rd element (100) is used as the limit on the number of detections per image when
|
97 |
-
# evaluating AP. COCOEvaluator expects an integer for max_dets_per_image, so for COCOeval,
|
98 |
-
# we reformat max_dets_per_image into [1, 10, max_dets_per_image], based on the defaults.
|
99 |
-
if max_dets_per_image is None:
|
100 |
-
max_dets_per_image = [1, 10, 100]
|
101 |
-
else:
|
102 |
-
max_dets_per_image = [1, 10, max_dets_per_image]
|
103 |
-
self._max_dets_per_image = max_dets_per_image
|
104 |
-
|
105 |
-
if tasks is not None and isinstance(tasks, CfgNode):
|
106 |
-
kpt_oks_sigmas = (
|
107 |
-
tasks.TEST.KEYPOINT_OKS_SIGMAS if not kpt_oks_sigmas else kpt_oks_sigmas
|
108 |
-
)
|
109 |
-
self._logger.warn(
|
110 |
-
"COCO Evaluator instantiated using config, this is deprecated behavior."
|
111 |
-
" Please pass in explicit arguments instead."
|
112 |
-
)
|
113 |
-
self._tasks = None # Infering it from predictions should be better
|
114 |
-
else:
|
115 |
-
self._tasks = tasks
|
116 |
-
|
117 |
-
self._cpu_device = torch.device("cpu")
|
118 |
-
|
119 |
-
self._metadata = MetadataCatalog.get(dataset_name)
|
120 |
-
if not hasattr(self._metadata, "json_file"):
|
121 |
-
if output_dir is None:
|
122 |
-
raise ValueError(
|
123 |
-
"output_dir must be provided to COCOEvaluator "
|
124 |
-
"for datasets not in COCO format."
|
125 |
-
)
|
126 |
-
self._logger.info(f"Trying to convert '{dataset_name}' to COCO format ...")
|
127 |
-
|
128 |
-
cache_path = os.path.join(output_dir, f"{dataset_name}_coco_format.json")
|
129 |
-
self._metadata.json_file = cache_path
|
130 |
-
convert_to_coco_json(dataset_name, cache_path)
|
131 |
-
|
132 |
-
json_file = PathManager.get_local_path(self._metadata.json_file)
|
133 |
-
with contextlib.redirect_stdout(io.StringIO()):
|
134 |
-
self._coco_api = COCO(json_file)
|
135 |
-
|
136 |
-
# Test set json files do not contain annotations (evaluation must be
|
137 |
-
# performed using the COCO evaluation server).
|
138 |
-
self._do_evaluation = "annotations" in self._coco_api.dataset
|
139 |
-
if self._do_evaluation:
|
140 |
-
self._kpt_oks_sigmas = kpt_oks_sigmas
|
141 |
-
|
142 |
-
def reset(self):
|
143 |
-
self._predictions = []
|
144 |
-
|
145 |
-
def process(self, inputs, outputs):
|
146 |
-
"""
|
147 |
-
Args:
|
148 |
-
inputs: the inputs to a COCO model (e.g., GeneralizedRCNN).
|
149 |
-
It is a list of dict. Each dict corresponds to an image and
|
150 |
-
contains keys like "height", "width", "file_name", "image_id".
|
151 |
-
outputs: the outputs of a COCO model. It is a list of dicts with key
|
152 |
-
"instances" that contains :class:`Instances`.
|
153 |
-
"""
|
154 |
-
for input, output in zip(inputs, outputs):
|
155 |
-
prediction = {"image_id": input["image_id"]}
|
156 |
-
|
157 |
-
if "instances" in output:
|
158 |
-
instances = output["instances"].to(self._cpu_device)
|
159 |
-
prediction["instances"] = instances_to_coco_json(instances, input["image_id"])
|
160 |
-
if "proposals" in output:
|
161 |
-
prediction["proposals"] = output["proposals"].to(self._cpu_device)
|
162 |
-
if len(prediction) > 1:
|
163 |
-
self._predictions.append(prediction)
|
164 |
-
|
165 |
-
def evaluate(self, img_ids=None):
|
166 |
-
"""
|
167 |
-
Args:
|
168 |
-
img_ids: a list of image IDs to evaluate on. Default to None for the whole dataset
|
169 |
-
"""
|
170 |
-
if self._distributed:
|
171 |
-
comm.synchronize()
|
172 |
-
predictions = comm.gather(self._predictions, dst=0)
|
173 |
-
predictions = list(itertools.chain(*predictions))
|
174 |
-
|
175 |
-
if not comm.is_main_process():
|
176 |
-
return {}
|
177 |
-
else:
|
178 |
-
predictions = self._predictions
|
179 |
-
|
180 |
-
if len(predictions) == 0:
|
181 |
-
self._logger.warning("[COCOEvaluator] Did not receive valid predictions.")
|
182 |
-
return {}
|
183 |
-
|
184 |
-
if self._output_dir:
|
185 |
-
PathManager.mkdirs(self._output_dir)
|
186 |
-
file_path = os.path.join(self._output_dir, "instances_predictions.pth")
|
187 |
-
with PathManager.open(file_path, "wb") as f:
|
188 |
-
torch.save(predictions, f)
|
189 |
-
|
190 |
-
self._results = OrderedDict()
|
191 |
-
if "proposals" in predictions[0]:
|
192 |
-
self._eval_box_proposals(predictions)
|
193 |
-
if "instances" in predictions[0]:
|
194 |
-
self._eval_predictions(predictions, img_ids=img_ids)
|
195 |
-
# Copy so the caller can do whatever with results
|
196 |
-
return copy.deepcopy(self._results)
|
197 |
-
|
198 |
-
def _tasks_from_predictions(self, predictions):
|
199 |
-
"""
|
200 |
-
Get COCO API "tasks" (i.e. iou_type) from COCO-format predictions.
|
201 |
-
"""
|
202 |
-
tasks = {"bbox"}
|
203 |
-
for pred in predictions:
|
204 |
-
if "segmentation" in pred:
|
205 |
-
tasks.add("segm")
|
206 |
-
if "keypoints" in pred:
|
207 |
-
tasks.add("keypoints")
|
208 |
-
return sorted(tasks)
|
209 |
-
|
210 |
-
def _eval_predictions(self, predictions, img_ids=None):
|
211 |
-
"""
|
212 |
-
Evaluate predictions. Fill self._results with the metrics of the tasks.
|
213 |
-
"""
|
214 |
-
self._logger.info("Preparing results for COCO format ...")
|
215 |
-
coco_results = list(itertools.chain(*[x["instances"] for x in predictions]))
|
216 |
-
tasks = self._tasks or self._tasks_from_predictions(coco_results)
|
217 |
-
|
218 |
-
# unmap the category ids for COCO
|
219 |
-
if hasattr(self._metadata, "thing_dataset_id_to_contiguous_id"):
|
220 |
-
dataset_id_to_contiguous_id = self._metadata.thing_dataset_id_to_contiguous_id
|
221 |
-
all_contiguous_ids = list(dataset_id_to_contiguous_id.values())
|
222 |
-
num_classes = len(all_contiguous_ids)
|
223 |
-
assert min(all_contiguous_ids) == 0 and max(all_contiguous_ids) == num_classes - 1
|
224 |
-
|
225 |
-
reverse_id_mapping = {v: k for k, v in dataset_id_to_contiguous_id.items()}
|
226 |
-
for result in coco_results:
|
227 |
-
category_id = result["category_id"]
|
228 |
-
assert category_id < num_classes, (
|
229 |
-
f"A prediction has class={category_id}, "
|
230 |
-
f"but the dataset only has {num_classes} classes and "
|
231 |
-
f"predicted class id should be in [0, {num_classes - 1}]."
|
232 |
-
)
|
233 |
-
result["category_id"] = reverse_id_mapping[category_id]
|
234 |
-
|
235 |
-
if self._output_dir:
|
236 |
-
file_path = os.path.join(self._output_dir, "coco_instances_results.json")
|
237 |
-
self._logger.info("Saving results to {}".format(file_path))
|
238 |
-
with PathManager.open(file_path, "w") as f:
|
239 |
-
f.write(json.dumps(coco_results))
|
240 |
-
f.flush()
|
241 |
-
|
242 |
-
if not self._do_evaluation:
|
243 |
-
self._logger.info("Annotations are not available for evaluation.")
|
244 |
-
return
|
245 |
-
|
246 |
-
self._logger.info(
|
247 |
-
"Evaluating predictions with {} COCO API...".format(
|
248 |
-
"unofficial" if self._use_fast_impl else "official"
|
249 |
-
)
|
250 |
-
)
|
251 |
-
for task in sorted(tasks):
|
252 |
-
assert task in {"bbox", "segm", "keypoints"}, f"Got unknown task: {task}!"
|
253 |
-
coco_eval = (
|
254 |
-
_evaluate_predictions_on_coco(
|
255 |
-
self._coco_api,
|
256 |
-
coco_results,
|
257 |
-
task,
|
258 |
-
kpt_oks_sigmas=self._kpt_oks_sigmas,
|
259 |
-
use_fast_impl=self._use_fast_impl,
|
260 |
-
img_ids=img_ids,
|
261 |
-
max_dets_per_image=self._max_dets_per_image,
|
262 |
-
)
|
263 |
-
if len(coco_results) > 0
|
264 |
-
else None # cocoapi does not handle empty results very well
|
265 |
-
)
|
266 |
-
|
267 |
-
res = self._derive_coco_results(
|
268 |
-
coco_eval, task, class_names=self._metadata.get("thing_classes")
|
269 |
-
)
|
270 |
-
self._results[task] = res
|
271 |
-
|
272 |
-
def _eval_box_proposals(self, predictions):
|
273 |
-
"""
|
274 |
-
Evaluate the box proposals in predictions.
|
275 |
-
Fill self._results with the metrics for "box_proposals" task.
|
276 |
-
"""
|
277 |
-
if self._output_dir:
|
278 |
-
# Saving generated box proposals to file.
|
279 |
-
# Predicted box_proposals are in XYXY_ABS mode.
|
280 |
-
bbox_mode = BoxMode.XYXY_ABS.value
|
281 |
-
ids, boxes, objectness_logits = [], [], []
|
282 |
-
for prediction in predictions:
|
283 |
-
ids.append(prediction["image_id"])
|
284 |
-
boxes.append(prediction["proposals"].proposal_boxes.tensor.numpy())
|
285 |
-
objectness_logits.append(prediction["proposals"].objectness_logits.numpy())
|
286 |
-
|
287 |
-
proposal_data = {
|
288 |
-
"boxes": boxes,
|
289 |
-
"objectness_logits": objectness_logits,
|
290 |
-
"ids": ids,
|
291 |
-
"bbox_mode": bbox_mode,
|
292 |
-
}
|
293 |
-
with PathManager.open(os.path.join(self._output_dir, "box_proposals.pkl"), "wb") as f:
|
294 |
-
pickle.dump(proposal_data, f)
|
295 |
-
|
296 |
-
if not self._do_evaluation:
|
297 |
-
self._logger.info("Annotations are not available for evaluation.")
|
298 |
-
return
|
299 |
-
|
300 |
-
self._logger.info("Evaluating bbox proposals ...")
|
301 |
-
res = {}
|
302 |
-
areas = {"all": "", "small": "s", "medium": "m", "large": "l"}
|
303 |
-
for limit in [100, 1000]:
|
304 |
-
for area, suffix in areas.items():
|
305 |
-
stats = _evaluate_box_proposals(predictions, self._coco_api, area=area, limit=limit)
|
306 |
-
key = "AR{}@{:d}".format(suffix, limit)
|
307 |
-
res[key] = float(stats["ar"].item() * 100)
|
308 |
-
self._logger.info("Proposal metrics: \n" + create_small_table(res))
|
309 |
-
self._results["box_proposals"] = res
|
310 |
-
|
311 |
-
def _derive_coco_results(self, coco_eval, iou_type, class_names=None):
|
312 |
-
"""
|
313 |
-
Derive the desired score numbers from summarized COCOeval.
|
314 |
-
|
315 |
-
Args:
|
316 |
-
coco_eval (None or COCOEval): None represents no predictions from model.
|
317 |
-
iou_type (str):
|
318 |
-
class_names (None or list[str]): if provided, will use it to predict
|
319 |
-
per-category AP.
|
320 |
-
|
321 |
-
Returns:
|
322 |
-
a dict of {metric name: score}
|
323 |
-
"""
|
324 |
-
|
325 |
-
metrics = {
|
326 |
-
"bbox": ["AP", "AP50", "AP75", "APs", "APm", "APl"],
|
327 |
-
"segm": ["AP", "AP50", "AP75", "APs", "APm", "APl"],
|
328 |
-
"keypoints": ["AP", "AP50", "AP75", "APm", "APl"],
|
329 |
-
}[iou_type]
|
330 |
-
|
331 |
-
if coco_eval is None:
|
332 |
-
self._logger.warn("No predictions from the model!")
|
333 |
-
return {metric: float("nan") for metric in metrics}
|
334 |
-
|
335 |
-
# the standard metrics
|
336 |
-
results = {
|
337 |
-
metric: float(coco_eval.stats[idx] * 100 if coco_eval.stats[idx] >= 0 else "nan")
|
338 |
-
for idx, metric in enumerate(metrics)
|
339 |
-
}
|
340 |
-
self._logger.info(
|
341 |
-
"Evaluation results for {}: \n".format(iou_type) + create_small_table(results)
|
342 |
-
)
|
343 |
-
if not np.isfinite(sum(results.values())):
|
344 |
-
self._logger.info("Some metrics cannot be computed and is shown as NaN.")
|
345 |
-
|
346 |
-
if class_names is None or len(class_names) <= 1:
|
347 |
-
return results
|
348 |
-
# Compute per-category AP
|
349 |
-
# from https://github.com/facebookresearch/Detectron/blob/a6a835f5b8208c45d0dce217ce9bbda915f44df7/detectron/datasets/json_dataset_evaluator.py#L222-L252 # noqa
|
350 |
-
precisions = coco_eval.eval["precision"]
|
351 |
-
# precision has dims (iou, recall, cls, area range, max dets)
|
352 |
-
assert len(class_names) == precisions.shape[2]
|
353 |
-
|
354 |
-
results_per_category = []
|
355 |
-
for idx, name in enumerate(class_names):
|
356 |
-
# area range index 0: all area ranges
|
357 |
-
# max dets index -1: typically 100 per image
|
358 |
-
precision = precisions[:, :, idx, 0, -1]
|
359 |
-
precision = precision[precision > -1]
|
360 |
-
ap = np.mean(precision) if precision.size else float("nan")
|
361 |
-
results_per_category.append(("{}".format(name), float(ap * 100)))
|
362 |
-
|
363 |
-
# tabulate it
|
364 |
-
N_COLS = min(6, len(results_per_category) * 2)
|
365 |
-
results_flatten = list(itertools.chain(*results_per_category))
|
366 |
-
results_2d = itertools.zip_longest(*[results_flatten[i::N_COLS] for i in range(N_COLS)])
|
367 |
-
table = tabulate(
|
368 |
-
results_2d,
|
369 |
-
tablefmt="pipe",
|
370 |
-
floatfmt=".3f",
|
371 |
-
headers=["category", "AP"] * (N_COLS // 2),
|
372 |
-
numalign="left",
|
373 |
-
)
|
374 |
-
self._logger.info("Per-category {} AP: \n".format(iou_type) + table)
|
375 |
-
|
376 |
-
results.update({"AP-" + name: ap for name, ap in results_per_category})
|
377 |
-
return results
|
378 |
-
|
379 |
-
|
380 |
-
def instances_to_coco_json(instances, img_id):
|
381 |
-
"""
|
382 |
-
Dump an "Instances" object to a COCO-format json that's used for evaluation.
|
383 |
-
|
384 |
-
Args:
|
385 |
-
instances (Instances):
|
386 |
-
img_id (int): the image id
|
387 |
-
|
388 |
-
Returns:
|
389 |
-
list[dict]: list of json annotations in COCO format.
|
390 |
-
"""
|
391 |
-
num_instance = len(instances)
|
392 |
-
if num_instance == 0:
|
393 |
-
return []
|
394 |
-
|
395 |
-
boxes = instances.pred_boxes.tensor.numpy()
|
396 |
-
boxes = BoxMode.convert(boxes, BoxMode.XYXY_ABS, BoxMode.XYWH_ABS)
|
397 |
-
boxes = boxes.tolist()
|
398 |
-
scores = instances.scores.tolist()
|
399 |
-
classes = instances.pred_classes.tolist()
|
400 |
-
|
401 |
-
has_mask = instances.has("pred_masks")
|
402 |
-
if has_mask:
|
403 |
-
# use RLE to encode the masks, because they are too large and takes memory
|
404 |
-
# since this evaluator stores outputs of the entire dataset
|
405 |
-
rles = [
|
406 |
-
mask_util.encode(np.array(mask[:, :, None], order="F", dtype="uint8"))[0]
|
407 |
-
for mask in instances.pred_masks
|
408 |
-
]
|
409 |
-
for rle in rles:
|
410 |
-
# "counts" is an array encoded by mask_util as a byte-stream. Python3's
|
411 |
-
# json writer which always produces strings cannot serialize a bytestream
|
412 |
-
# unless you decode it. Thankfully, utf-8 works out (which is also what
|
413 |
-
# the pycocotools/_mask.pyx does).
|
414 |
-
rle["counts"] = rle["counts"].decode("utf-8")
|
415 |
-
|
416 |
-
has_keypoints = instances.has("pred_keypoints")
|
417 |
-
if has_keypoints:
|
418 |
-
keypoints = instances.pred_keypoints
|
419 |
-
|
420 |
-
results = []
|
421 |
-
for k in range(num_instance):
|
422 |
-
result = {
|
423 |
-
"image_id": img_id,
|
424 |
-
"category_id": classes[k],
|
425 |
-
"bbox": boxes[k],
|
426 |
-
"score": scores[k],
|
427 |
-
}
|
428 |
-
if has_mask:
|
429 |
-
result["segmentation"] = rles[k]
|
430 |
-
if has_keypoints:
|
431 |
-
# In COCO annotations,
|
432 |
-
# keypoints coordinates are pixel indices.
|
433 |
-
# However our predictions are floating point coordinates.
|
434 |
-
# Therefore we subtract 0.5 to be consistent with the annotation format.
|
435 |
-
# This is the inverse of data loading logic in `datasets/coco.py`.
|
436 |
-
keypoints[k][:, :2] -= 0.5
|
437 |
-
result["keypoints"] = keypoints[k].flatten().tolist()
|
438 |
-
results.append(result)
|
439 |
-
return results
|
440 |
-
|
441 |
-
|
442 |
-
# inspired from Detectron:
|
443 |
-
# https://github.com/facebookresearch/Detectron/blob/a6a835f5b8208c45d0dce217ce9bbda915f44df7/detectron/datasets/json_dataset_evaluator.py#L255 # noqa
|
444 |
-
def _evaluate_box_proposals(dataset_predictions, coco_api, thresholds=None, area="all", limit=None):
|
445 |
-
"""
|
446 |
-
Evaluate detection proposal recall metrics. This function is a much
|
447 |
-
faster alternative to the official COCO API recall evaluation code. However,
|
448 |
-
it produces slightly different results.
|
449 |
-
"""
|
450 |
-
# Record max overlap value for each gt box
|
451 |
-
# Return vector of overlap values
|
452 |
-
areas = {
|
453 |
-
"all": 0,
|
454 |
-
"small": 1,
|
455 |
-
"medium": 2,
|
456 |
-
"large": 3,
|
457 |
-
"96-128": 4,
|
458 |
-
"128-256": 5,
|
459 |
-
"256-512": 6,
|
460 |
-
"512-inf": 7,
|
461 |
-
}
|
462 |
-
area_ranges = [
|
463 |
-
[0 ** 2, 1e5 ** 2], # all
|
464 |
-
[0 ** 2, 32 ** 2], # small
|
465 |
-
[32 ** 2, 96 ** 2], # medium
|
466 |
-
[96 ** 2, 1e5 ** 2], # large
|
467 |
-
[96 ** 2, 128 ** 2], # 96-128
|
468 |
-
[128 ** 2, 256 ** 2], # 128-256
|
469 |
-
[256 ** 2, 512 ** 2], # 256-512
|
470 |
-
[512 ** 2, 1e5 ** 2],
|
471 |
-
] # 512-inf
|
472 |
-
assert area in areas, "Unknown area range: {}".format(area)
|
473 |
-
area_range = area_ranges[areas[area]]
|
474 |
-
gt_overlaps = []
|
475 |
-
num_pos = 0
|
476 |
-
|
477 |
-
for prediction_dict in dataset_predictions:
|
478 |
-
predictions = prediction_dict["proposals"]
|
479 |
-
|
480 |
-
# sort predictions in descending order
|
481 |
-
# TODO maybe remove this and make it explicit in the documentation
|
482 |
-
inds = predictions.objectness_logits.sort(descending=True)[1]
|
483 |
-
predictions = predictions[inds]
|
484 |
-
|
485 |
-
ann_ids = coco_api.getAnnIds(imgIds=prediction_dict["image_id"])
|
486 |
-
anno = coco_api.loadAnns(ann_ids)
|
487 |
-
gt_boxes = [
|
488 |
-
BoxMode.convert(obj["bbox"], BoxMode.XYWH_ABS, BoxMode.XYXY_ABS)
|
489 |
-
for obj in anno
|
490 |
-
if obj["iscrowd"] == 0
|
491 |
-
]
|
492 |
-
gt_boxes = torch.as_tensor(gt_boxes).reshape(-1, 4) # guard against no boxes
|
493 |
-
gt_boxes = Boxes(gt_boxes)
|
494 |
-
gt_areas = torch.as_tensor([obj["area"] for obj in anno if obj["iscrowd"] == 0])
|
495 |
-
|
496 |
-
if len(gt_boxes) == 0 or len(predictions) == 0:
|
497 |
-
continue
|
498 |
-
|
499 |
-
valid_gt_inds = (gt_areas >= area_range[0]) & (gt_areas <= area_range[1])
|
500 |
-
gt_boxes = gt_boxes[valid_gt_inds]
|
501 |
-
|
502 |
-
num_pos += len(gt_boxes)
|
503 |
-
|
504 |
-
if len(gt_boxes) == 0:
|
505 |
-
continue
|
506 |
-
|
507 |
-
if limit is not None and len(predictions) > limit:
|
508 |
-
predictions = predictions[:limit]
|
509 |
-
|
510 |
-
overlaps = pairwise_iou(predictions.proposal_boxes, gt_boxes)
|
511 |
-
|
512 |
-
_gt_overlaps = torch.zeros(len(gt_boxes))
|
513 |
-
for j in range(min(len(predictions), len(gt_boxes))):
|
514 |
-
# find which proposal box maximally covers each gt box
|
515 |
-
# and get the iou amount of coverage for each gt box
|
516 |
-
max_overlaps, argmax_overlaps = overlaps.max(dim=0)
|
517 |
-
|
518 |
-
# find which gt box is 'best' covered (i.e. 'best' = most iou)
|
519 |
-
gt_ovr, gt_ind = max_overlaps.max(dim=0)
|
520 |
-
assert gt_ovr >= 0
|
521 |
-
# find the proposal box that covers the best covered gt box
|
522 |
-
box_ind = argmax_overlaps[gt_ind]
|
523 |
-
# record the iou coverage of this gt box
|
524 |
-
_gt_overlaps[j] = overlaps[box_ind, gt_ind]
|
525 |
-
assert _gt_overlaps[j] == gt_ovr
|
526 |
-
# mark the proposal box and the gt box as used
|
527 |
-
overlaps[box_ind, :] = -1
|
528 |
-
overlaps[:, gt_ind] = -1
|
529 |
-
|
530 |
-
# append recorded iou coverage level
|
531 |
-
gt_overlaps.append(_gt_overlaps)
|
532 |
-
gt_overlaps = (
|
533 |
-
torch.cat(gt_overlaps, dim=0) if len(gt_overlaps) else torch.zeros(0, dtype=torch.float32)
|
534 |
-
)
|
535 |
-
gt_overlaps, _ = torch.sort(gt_overlaps)
|
536 |
-
|
537 |
-
if thresholds is None:
|
538 |
-
step = 0.05
|
539 |
-
thresholds = torch.arange(0.5, 0.95 + 1e-5, step, dtype=torch.float32)
|
540 |
-
recalls = torch.zeros_like(thresholds)
|
541 |
-
# compute recall for each iou threshold
|
542 |
-
for i, t in enumerate(thresholds):
|
543 |
-
recalls[i] = (gt_overlaps >= t).float().sum() / float(num_pos)
|
544 |
-
# ar = 2 * np.trapz(recalls, thresholds)
|
545 |
-
ar = recalls.mean()
|
546 |
-
return {
|
547 |
-
"ar": ar,
|
548 |
-
"recalls": recalls,
|
549 |
-
"thresholds": thresholds,
|
550 |
-
"gt_overlaps": gt_overlaps,
|
551 |
-
"num_pos": num_pos,
|
552 |
-
}
|
553 |
-
|
554 |
-
|
555 |
-
def _evaluate_predictions_on_coco(
|
556 |
-
coco_gt,
|
557 |
-
coco_results,
|
558 |
-
iou_type,
|
559 |
-
kpt_oks_sigmas=None,
|
560 |
-
use_fast_impl=True,
|
561 |
-
img_ids=None,
|
562 |
-
max_dets_per_image=None,
|
563 |
-
):
|
564 |
-
"""
|
565 |
-
Evaluate the coco results using COCOEval API.
|
566 |
-
"""
|
567 |
-
assert len(coco_results) > 0
|
568 |
-
|
569 |
-
if iou_type == "segm":
|
570 |
-
coco_results = copy.deepcopy(coco_results)
|
571 |
-
# When evaluating mask AP, if the results contain bbox, cocoapi will
|
572 |
-
# use the box area as the area of the instance, instead of the mask area.
|
573 |
-
# This leads to a different definition of small/medium/large.
|
574 |
-
# We remove the bbox field to let mask AP use mask area.
|
575 |
-
for c in coco_results:
|
576 |
-
c.pop("bbox", None)
|
577 |
-
|
578 |
-
coco_dt = coco_gt.loadRes(coco_results)
|
579 |
-
coco_eval = (COCOeval_opt if use_fast_impl else COCOeval)(coco_gt, coco_dt, iou_type)
|
580 |
-
# For COCO, the default max_dets_per_image is [1, 10, 100].
|
581 |
-
if max_dets_per_image is None:
|
582 |
-
max_dets_per_image = [1, 10, 100] # Default from COCOEval
|
583 |
-
else:
|
584 |
-
assert (
|
585 |
-
len(max_dets_per_image) >= 3
|
586 |
-
), "COCOeval requires maxDets (and max_dets_per_image) to have length at least 3"
|
587 |
-
# In the case that user supplies a custom input for max_dets_per_image,
|
588 |
-
# apply COCOevalMaxDets to evaluate AP with the custom input.
|
589 |
-
if max_dets_per_image[2] != 100:
|
590 |
-
coco_eval = COCOevalMaxDets(coco_gt, coco_dt, iou_type)
|
591 |
-
if iou_type != "keypoints":
|
592 |
-
coco_eval.params.maxDets = max_dets_per_image
|
593 |
-
|
594 |
-
if img_ids is not None:
|
595 |
-
coco_eval.params.imgIds = img_ids
|
596 |
-
|
597 |
-
if iou_type == "keypoints":
|
598 |
-
# Use the COCO default keypoint OKS sigmas unless overrides are specified
|
599 |
-
if kpt_oks_sigmas:
|
600 |
-
assert hasattr(coco_eval.params, "kpt_oks_sigmas"), "pycocotools is too old!"
|
601 |
-
coco_eval.params.kpt_oks_sigmas = np.array(kpt_oks_sigmas)
|
602 |
-
# COCOAPI requires every detection and every gt to have keypoints, so
|
603 |
-
# we just take the first entry from both
|
604 |
-
num_keypoints_dt = len(coco_results[0]["keypoints"]) // 3
|
605 |
-
num_keypoints_gt = len(next(iter(coco_gt.anns.values()))["keypoints"]) // 3
|
606 |
-
num_keypoints_oks = len(coco_eval.params.kpt_oks_sigmas)
|
607 |
-
assert num_keypoints_oks == num_keypoints_dt == num_keypoints_gt, (
|
608 |
-
f"[COCOEvaluator] Prediction contain {num_keypoints_dt} keypoints. "
|
609 |
-
f"Ground truth contains {num_keypoints_gt} keypoints. "
|
610 |
-
f"The length of cfg.TEST.KEYPOINT_OKS_SIGMAS is {num_keypoints_oks}. "
|
611 |
-
"They have to agree with each other. For meaning of OKS, please refer to "
|
612 |
-
"http://cocodataset.org/#keypoints-eval."
|
613 |
-
)
|
614 |
-
|
615 |
-
coco_eval.evaluate()
|
616 |
-
coco_eval.accumulate()
|
617 |
-
coco_eval.summarize()
|
618 |
-
|
619 |
-
return coco_eval
|
620 |
-
|
621 |
-
|
622 |
-
class COCOevalMaxDets(COCOeval):
|
623 |
-
"""
|
624 |
-
Modified version of COCOeval for evaluating AP with a custom
|
625 |
-
maxDets (by default for COCO, maxDets is 100)
|
626 |
-
"""
|
627 |
-
|
628 |
-
def summarize(self):
|
629 |
-
"""
|
630 |
-
Compute and display summary metrics for evaluation results given
|
631 |
-
a custom value for max_dets_per_image
|
632 |
-
"""
|
633 |
-
|
634 |
-
def _summarize(ap=1, iouThr=None, areaRng="all", maxDets=100):
|
635 |
-
p = self.params
|
636 |
-
iStr = " {:<18} {} @[ IoU={:<9} | area={:>6s} | maxDets={:>3d} ] = {:0.3f}"
|
637 |
-
titleStr = "Average Precision" if ap == 1 else "Average Recall"
|
638 |
-
typeStr = "(AP)" if ap == 1 else "(AR)"
|
639 |
-
iouStr = (
|
640 |
-
"{:0.2f}:{:0.2f}".format(p.iouThrs[0], p.iouThrs[-1])
|
641 |
-
if iouThr is None
|
642 |
-
else "{:0.2f}".format(iouThr)
|
643 |
-
)
|
644 |
-
|
645 |
-
aind = [i for i, aRng in enumerate(p.areaRngLbl) if aRng == areaRng]
|
646 |
-
mind = [i for i, mDet in enumerate(p.maxDets) if mDet == maxDets]
|
647 |
-
if ap == 1:
|
648 |
-
# dimension of precision: [TxRxKxAxM]
|
649 |
-
s = self.eval["precision"]
|
650 |
-
# IoU
|
651 |
-
if iouThr is not None:
|
652 |
-
t = np.where(iouThr == p.iouThrs)[0]
|
653 |
-
s = s[t]
|
654 |
-
s = s[:, :, :, aind, mind]
|
655 |
-
else:
|
656 |
-
# dimension of recall: [TxKxAxM]
|
657 |
-
s = self.eval["recall"]
|
658 |
-
if iouThr is not None:
|
659 |
-
t = np.where(iouThr == p.iouThrs)[0]
|
660 |
-
s = s[t]
|
661 |
-
s = s[:, :, aind, mind]
|
662 |
-
if len(s[s > -1]) == 0:
|
663 |
-
mean_s = -1
|
664 |
-
else:
|
665 |
-
mean_s = np.mean(s[s > -1])
|
666 |
-
print(iStr.format(titleStr, typeStr, iouStr, areaRng, maxDets, mean_s))
|
667 |
-
return mean_s
|
668 |
-
|
669 |
-
def _summarizeDets():
|
670 |
-
stats = np.zeros((12,))
|
671 |
-
# Evaluate AP using the custom limit on maximum detections per image
|
672 |
-
stats[0] = _summarize(1, maxDets=self.params.maxDets[2])
|
673 |
-
stats[1] = _summarize(1, iouThr=0.5, maxDets=self.params.maxDets[2])
|
674 |
-
stats[2] = _summarize(1, iouThr=0.75, maxDets=self.params.maxDets[2])
|
675 |
-
stats[3] = _summarize(1, areaRng="small", maxDets=self.params.maxDets[2])
|
676 |
-
stats[4] = _summarize(1, areaRng="medium", maxDets=self.params.maxDets[2])
|
677 |
-
stats[5] = _summarize(1, areaRng="large", maxDets=self.params.maxDets[2])
|
678 |
-
stats[6] = _summarize(0, maxDets=self.params.maxDets[0])
|
679 |
-
stats[7] = _summarize(0, maxDets=self.params.maxDets[1])
|
680 |
-
stats[8] = _summarize(0, maxDets=self.params.maxDets[2])
|
681 |
-
stats[9] = _summarize(0, areaRng="small", maxDets=self.params.maxDets[2])
|
682 |
-
stats[10] = _summarize(0, areaRng="medium", maxDets=self.params.maxDets[2])
|
683 |
-
stats[11] = _summarize(0, areaRng="large", maxDets=self.params.maxDets[2])
|
684 |
-
return stats
|
685 |
-
|
686 |
-
def _summarizeKps():
|
687 |
-
stats = np.zeros((10,))
|
688 |
-
stats[0] = _summarize(1, maxDets=20)
|
689 |
-
stats[1] = _summarize(1, maxDets=20, iouThr=0.5)
|
690 |
-
stats[2] = _summarize(1, maxDets=20, iouThr=0.75)
|
691 |
-
stats[3] = _summarize(1, maxDets=20, areaRng="medium")
|
692 |
-
stats[4] = _summarize(1, maxDets=20, areaRng="large")
|
693 |
-
stats[5] = _summarize(0, maxDets=20)
|
694 |
-
stats[6] = _summarize(0, maxDets=20, iouThr=0.5)
|
695 |
-
stats[7] = _summarize(0, maxDets=20, iouThr=0.75)
|
696 |
-
stats[8] = _summarize(0, maxDets=20, areaRng="medium")
|
697 |
-
stats[9] = _summarize(0, maxDets=20, areaRng="large")
|
698 |
-
return stats
|
699 |
-
|
700 |
-
if not self.eval:
|
701 |
-
raise Exception("Please run accumulate() first")
|
702 |
-
iouType = self.params.iouType
|
703 |
-
if iouType == "segm" or iouType == "bbox":
|
704 |
-
summarize = _summarizeDets
|
705 |
-
elif iouType == "keypoints":
|
706 |
-
summarize = _summarizeKps
|
707 |
-
self.stats = summarize()
|
708 |
-
|
709 |
-
def __str__(self):
|
710 |
-
self.summarize()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Awiny/Image2Paragraph/models/grit_src/third_party/CenterNet2/detectron2/modeling/sampling.py
DELETED
@@ -1,54 +0,0 @@
|
|
1 |
-
# Copyright (c) Facebook, Inc. and its affiliates.
|
2 |
-
import torch
|
3 |
-
|
4 |
-
from detectron2.layers import nonzero_tuple
|
5 |
-
|
6 |
-
__all__ = ["subsample_labels"]
|
7 |
-
|
8 |
-
|
9 |
-
def subsample_labels(
|
10 |
-
labels: torch.Tensor, num_samples: int, positive_fraction: float, bg_label: int
|
11 |
-
):
|
12 |
-
"""
|
13 |
-
Return `num_samples` (or fewer, if not enough found)
|
14 |
-
random samples from `labels` which is a mixture of positives & negatives.
|
15 |
-
It will try to return as many positives as possible without
|
16 |
-
exceeding `positive_fraction * num_samples`, and then try to
|
17 |
-
fill the remaining slots with negatives.
|
18 |
-
|
19 |
-
Args:
|
20 |
-
labels (Tensor): (N, ) label vector with values:
|
21 |
-
* -1: ignore
|
22 |
-
* bg_label: background ("negative") class
|
23 |
-
* otherwise: one or more foreground ("positive") classes
|
24 |
-
num_samples (int): The total number of labels with value >= 0 to return.
|
25 |
-
Values that are not sampled will be filled with -1 (ignore).
|
26 |
-
positive_fraction (float): The number of subsampled labels with values > 0
|
27 |
-
is `min(num_positives, int(positive_fraction * num_samples))`. The number
|
28 |
-
of negatives sampled is `min(num_negatives, num_samples - num_positives_sampled)`.
|
29 |
-
In order words, if there are not enough positives, the sample is filled with
|
30 |
-
negatives. If there are also not enough negatives, then as many elements are
|
31 |
-
sampled as is possible.
|
32 |
-
bg_label (int): label index of background ("negative") class.
|
33 |
-
|
34 |
-
Returns:
|
35 |
-
pos_idx, neg_idx (Tensor):
|
36 |
-
1D vector of indices. The total length of both is `num_samples` or fewer.
|
37 |
-
"""
|
38 |
-
positive = nonzero_tuple((labels != -1) & (labels != bg_label))[0]
|
39 |
-
negative = nonzero_tuple(labels == bg_label)[0]
|
40 |
-
|
41 |
-
num_pos = int(num_samples * positive_fraction)
|
42 |
-
# protect against not enough positive examples
|
43 |
-
num_pos = min(positive.numel(), num_pos)
|
44 |
-
num_neg = num_samples - num_pos
|
45 |
-
# protect against not enough negative examples
|
46 |
-
num_neg = min(negative.numel(), num_neg)
|
47 |
-
|
48 |
-
# randomly select positive and negative examples
|
49 |
-
perm1 = torch.randperm(positive.numel(), device=positive.device)[:num_pos]
|
50 |
-
perm2 = torch.randperm(negative.numel(), device=negative.device)[:num_neg]
|
51 |
-
|
52 |
-
pos_idx = positive[perm1]
|
53 |
-
neg_idx = negative[perm2]
|
54 |
-
return pos_idx, neg_idx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Banbri/zcvzcv/src/components/ui/collapsible.tsx
DELETED
@@ -1,11 +0,0 @@
|
|
1 |
-
"use client"
|
2 |
-
|
3 |
-
import * as CollapsiblePrimitive from "@radix-ui/react-collapsible"
|
4 |
-
|
5 |
-
const Collapsible = CollapsiblePrimitive.Root
|
6 |
-
|
7 |
-
const CollapsibleTrigger = CollapsiblePrimitive.CollapsibleTrigger
|
8 |
-
|
9 |
-
const CollapsibleContent = CollapsiblePrimitive.CollapsibleContent
|
10 |
-
|
11 |
-
export { Collapsible, CollapsibleTrigger, CollapsibleContent }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Benson/text-generation/Examples/Bgc Apk.md
DELETED
@@ -1,119 +0,0 @@
|
|
1 |
-
|
2 |
-
<h1>¿Qué es BGC APK y cómo descargarlo? </h1>
|
3 |
-
<p>Si usted está buscando una manera divertida y emocionante para pasar su tiempo con sus amigos y familiares, es posible que desee echa un vistazo BGC APK. BGC APK es una colección de mini-juegos que pueden ser jugados por 2, 3, o 4 jugadores en el mismo dispositivo o a través de una red Wi-Fi. También puedes jugar online con otros jugadores de todo el mundo. En este artículo, le diremos qué es BGC APK, cuáles son sus características, por qué debe descargarlo, y cómo descargarlo para diferentes dispositivos. También te mostraremos cómo jugar juegos de BGC con tus amigos y familiares. </p>
|
4 |
-
<h2>Introducción</h2>
|
5 |
-
<h3>¿Qué es BGC APK? </h3>
|
6 |
-
<p>BGC APK es una aplicación para Android que contiene una variedad de minijuegos que están diseñados para la atención, reacción, pensamiento y precisión. Algunos de los minijuegos incluyen carreras, disparos, rompecabezas, árcade, deportes y más. Puedes jugar a estos juegos con 2, 3 o 4 jugadores en el mismo dispositivo o a través de una red Wi-Fi. También puedes jugar online con otros jugadores de todo el mundo. Los juegos son sencillos y claros de entender, pero desafiantes y divertidos de jugar. Puedes competir con tus amigos y familiares y ver quién es el mejor. </p>
|
7 |
-
<h2>bgc apk</h2><br /><p><b><b>Download File</b> <a href="https://bltlly.com/2v6MJP">https://bltlly.com/2v6MJP</a></b></p><br /><br />
|
8 |
-
<h3>¿Cuáles son las características de BGC APK? </h3>
|
9 |
-
<p>Algunas de las características de BGC APK son:</p>
|
10 |
-
<ul>
|
11 |
-
<li> Tiene una gran colección de mini-juegos que atienden a diferentes gustos y preferencias. </li>
|
12 |
-
<li> Soporta el modo multijugador para 2, 3 o 4 jugadores en el mismo dispositivo o a través de una red Wi-Fi. </li>
|
13 |
-
<li> También es compatible con el modo en línea donde se puede jugar con otros jugadores de todo el mundo. </li>
|
14 |
-
<li> Tiene un modo de juego con bots donde puedes practicar tus habilidades y mejorar tu rendimiento. </li>
|
15 |
-
<li> Tiene gráficos y efectos de sonido de alta calidad que mejoran su experiencia de juego. </li>
|
16 |
-
<li> Tiene una interfaz fácil de usar que es fácil de navegar y usar. </li>
|
17 |
-
<li> Es gratis para descargar y jugar, pero contiene anuncios que se pueden eliminar mediante la compra de una versión premium. </li>
|
18 |
-
</ul>
|
19 |
-
|
20 |
-
<p>Usted debe descargar BGC APK porque:</p>
|
21 |
-
<ul>
|
22 |
-
<li> Es una gran manera de divertirse y divertirse con sus amigos y familiares. </li>
|
23 |
-
<li>Es una buena manera de poner a prueba tus habilidades y habilidades en diferentes minijuegos. </li>
|
24 |
-
<li> Es una buena manera de desafiarse a sí mismo y a otros en una competencia amistosa. </li>
|
25 |
-
<li> Es una buena manera de matar el aburrimiento y pasar el tiempo cuando no tienes nada más que hacer. </li>
|
26 |
-
<li> Es una buena manera de descubrir nuevos juegos y géneros que te pueden gustar. </li>
|
27 |
-
</ul>
|
28 |
-
<h2>Cómo <h2>Cómo descargar BGC APK para dispositivos Android</h2>
|
29 |
-
<p>Si usted tiene un dispositivo Android, puede descargar BGC APK fácilmente siguiendo estos pasos:</p>
|
30 |
-
<ol>
|
31 |
-
<li>Ir a la página web oficial de BGC APK y haga clic en el botón de descarga. Verá una ventana emergente que le pide que confirme la descarga. Haz clic en Aceptar y espera a que el archivo APK se descargue en tu dispositivo. </li>
|
32 |
-
<li>Una vez completada la descarga, vaya a la configuración del dispositivo y habilite fuentes desconocidas. Esto le permitirá instalar aplicaciones desde fuentes distintas de Google Play Store. Para hacer esto, vaya a Configuración > Seguridad > Fuentes desconocidas y conéctelo. </li>
|
33 |
-
<li>Ahora, busque el archivo APK descargado en su dispositivo utilizando una aplicación de administrador de archivos. Toque en el archivo y haga clic en Instalar. Verá una pantalla que le pide que conceda permisos a la aplicación. Haga clic en Aceptar y espere a que finalice la instalación. </li>
|
34 |
-
<li>Después de la instalación se hace, puede iniciar la aplicación desde el cajón de aplicaciones o pantalla de inicio. Verás una pantalla de bienvenida con algunas instrucciones sobre cómo jugar a los juegos de BGC. También puede acceder al menú de configuración desde la esquina superior derecha de la pantalla. </li>
|
35 |
-
<li>Disfruta jugando juegos BGC con tus amigos y familiares en tu dispositivo Android. </li>
|
36 |
-
</ol>
|
37 |
-
<h2>Cómo descargar BGC APK para otros dispositivos</h2>
|
38 |
-
<p>Si usted tiene un dispositivo que no sea Android, todavía se puede descargar BGC APK mediante el uso de un emulador o un navegador. Aquí hay algunas maneras de hacer eso:</p>
|
39 |
-
<h3>Cómo descargar BGC APK para dispositivos iOS</h3>
|
40 |
-
|
41 |
-
<ol>
|
42 |
-
<li>Descargar iAndroid desde la App Store e instalarlo en su dispositivo. </li>
|
43 |
-
<li>Inicie iAndroid y toque en el icono + en la parte inferior de la pantalla. Verá una lista de opciones para agregar una aplicación. Elija Agregar URL e introduzca la URL del sitio web oficial de BGC APK. Toque en Añadir.</li>
|
44 |
-
<li>Verá BGC APK añadido a su pantalla de inicio iAndroid. Toque en él y esperar a que se cargue. Verá una ventana emergente pidiéndole que instale la aplicación. Toque en Instalar y espere a que termine. </li>
|
45 |
-
<li>Después de la instalación se hace, puede iniciar BGC APK desde iAndroid y jugar juegos BGC con sus amigos y familiares en su dispositivo iOS. </li>
|
46 |
-
</ol>
|
47 |
-
<h3>Cómo descargar BGC APK para dispositivos Windows</h3>
|
48 |
-
<p>Si usted tiene un dispositivo de Windows, puede descargar BGC APK mediante el uso de un emulador llamado BlueStacks. Este es un software que le permite ejecutar aplicaciones Android en su PC o portátil. Para descargar BGC APK para dispositivos Windows, siga estos pasos:</p>
|
49 |
-
<ol>
|
50 |
-
<li>Descargar BlueStacks desde su sitio web oficial e instalarlo en su dispositivo. </li>
|
51 |
-
<li>Inicie BlueStacks e inicie sesión con su cuenta de Google. Verá una pantalla de inicio con algunas aplicaciones preinstaladas. </li>
|
52 |
-
<li>Haga clic en el icono de Google Play Store y buscar BGC APK. Verá la aplicación en los resultados de búsqueda. Haga clic en él y luego haga clic en Instalar. Espere a que la aplicación se descargue e instale en su dispositivo. </li>
|
53 |
-
<li>Después de la instalación se hace, puede iniciar BGC APK de BlueStacks y jugar juegos BGC con tus amigos y familiares en su dispositivo Windows. </li>
|
54 |
-
</ol>
|
55 |
-
<h3>Cómo descargar BGC APK para dispositivos Mac</h3>
|
56 |
-
<p>Si usted tiene un dispositivo Mac, puede descargar BGC APK mediante el uso de un navegador llamado Puffin Browser. Este es un navegador que soporta Flash y le permite jugar juegos en línea sin descargarlos. Para descargar BGC APK para dispositivos Mac, siga estos pasos:</p>
|
57 |
-
<ol>
|
58 |
-
<li>Descargar Puffin Browser desde su sitio web oficial e instalarlo en su dispositivo. </li>
|
59 |
-
|
60 |
-
<li>Ahora puedes jugar juegos BGC con tus amigos y familiares en tu dispositivo Mac sin descargar nada. </li>
|
61 |
-
</ol>
|
62 |
-
<h2>Cómo jugar juegos de BGC con tus amigos y familiares</h2>
|
63 |
-
<p>Los juegos de BGC están diseñados para el modo multijugador, por lo que puedes jugar con tus amigos y familiares de diferentes maneras. Estos son algunos de ellos:</p>
|
64 |
-
<p></p>
|
65 |
-
<h3>Cómo jugar juegos de BGC en el mismo dispositivo</h3>
|
66 |
-
<p>Si tienes un dispositivo, puedes jugar juegos de BGC en el mismo dispositivo usando el modo de pantalla dividida. Este modo divide la pantalla en dos, tres o cuatro partes dependiendo del número de jugadores. Cada jugador puede usar su propia parte de la pantalla para controlar a su personaje e interactuar con el juego. Para jugar juegos de BGC en el mismo dispositivo, siga estos pasos:</p>
|
67 |
-
<ol>
|
68 |
-
<li>Iniciar BGC APK y elegir el juego que desea jugar desde el menú. Verá una lista de modos de juego. Elija Pantalla dividida y seleccione el número de jugadores. </li>
|
69 |
-
<li> Verá la pantalla dividida en partes iguales. Cada jugador puede elegir su nombre, color y avatar desde la parte inferior de su parte de la pantalla. </li>
|
70 |
-
<li>Cuando todo el mundo esté listo, toca Inicio y espera a que comience el juego. Verás las instrucciones y reglas del juego en la parte superior de la pantalla. </li>
|
71 |
-
<li>Usa tu parte de la pantalla para controlar a tu personaje y jugar el juego. Puede ver su puntuación y tiempo en la esquina superior derecha de su parte de la pantalla. </li>
|
72 |
-
<li>El juego terminará cuando se acabe el tiempo o cuando uno de los jugadores gane. Verás los resultados y las clasificaciones en la pantalla. Puede optar por jugar de nuevo o salir del menú. </li>
|
73 |
-
</ol>
|
74 |
-
<h3>Cómo jugar juegos de BGC a través de la red Wi-Fi</h3>
|
75 |
-
<p>Si tiene más de un dispositivo, puede jugar juegos BGC a través de una red Wi-Fi mediante el modo multijugador local. Este modo le permite conectar sus dispositivos a la misma red Wi-Fi y jugar juegos BGC entre sí. Para jugar juegos de BGC a través de una red Wi-Fi, siga estos pasos:</p>
|
76 |
-
<ol>
|
77 |
-
|
78 |
-
<li>Iniciar BGC APK y elegir el juego que desea jugar desde el menú. Verá una lista de modos de juego. Elige Multijugador local y selecciona el número de jugadores. </li>
|
79 |
-
<li>Verás una pantalla pidiéndote que crees o te unas a una habitación. Uno de los jugadores tiene que crear una habitación pulsando en Crear habitación. Verán un código de habitación en su pantalla. </li>
|
80 |
-
<li>Los otros jugadores tienen que unirse a la sala pulsando en Unirse a la sala e introduciendo el código de la sala. Verán una lista de jugadores en la sala. </li>
|
81 |
-
<li>Cuando todo el mundo esté listo, toque en Inicio y espere a que comience el juego. Verá las instrucciones y reglas del juego en su pantalla. </li>
|
82 |
-
<li>Usa tu dispositivo para controlar a tu personaje y jugar al juego. Puedes ver tu puntuación y tiempo en tu pantalla. </li>
|
83 |
-
<li>El juego terminará cuando se acabe el tiempo o cuando uno de los jugadores gane. Verás los resultados y las clasificaciones en tu pantalla. Puede optar por jugar de nuevo o salir de la habitación. </li>
|
84 |
-
</ol>
|
85 |
-
<h3>Cómo jugar juegos de BGC en línea</h3>
|
86 |
-
<p>Si quieres jugar juegos de BGC con otros jugadores de todo el mundo, puedes jugar juegos de BGC online usando el modo multijugador online. Este modo le permite conectarse a Internet y jugar juegos de BGC con jugadores al azar o con sus amigos. Para jugar juegos de BGC en línea, siga estos pasos:</p>
|
87 |
-
<ol>
|
88 |
-
<li>Asegúrese de que su dispositivo está conectado a Internet. </li>
|
89 |
-
<li>Iniciar BGC APK y elegir el juego que desea jugar desde el menú. Verá una lista de modos de juego. Elige Multijugador en línea y selecciona el número de jugadores. </li>
|
90 |
-
<li>Verá una pantalla que le pide que inicie sesión con su cuenta de Google. Esto es necesario para jugar en línea y para guardar su progreso y logros. Toque en Iniciar sesión e introduzca sus credenciales de Google. </li>
|
91 |
-
<li>Verás una pantalla pidiéndote que elijas un modo de juego. Puedes elegir Juego rápido, que te emparejará con jugadores aleatorios, o Juego personalizado, que te permitirá crear o unirte a una habitación con tus amigos. </li>
|
92 |
-
|
93 |
-
<li>Si eliges Custom Play, verás una pantalla pidiéndote que crees o te unas a una habitación. Puede crear una habitación pulsando en Crear habitación y estableciendo una contraseña para ella. Puedes compartir el código de la habitación y la contraseña con tus amigos para que puedan unirse a tu habitación. También puede unirse a una habitación pulsando en Unirse a la habitación e introduciendo el código de la habitación y la contraseña. </li>
|
94 |
-
<li>Cuando todo el mundo esté listo, toque en Inicio y espere a que comience el juego. Verá las instrucciones y reglas del juego en su pantalla. </li>
|
95 |
-
<li>Usa tu dispositivo para controlar a tu personaje y jugar al juego. Puedes ver tu puntuación y tiempo en tu pantalla. </li>
|
96 |
-
<li>El juego terminará cuando se acabe el tiempo o cuando uno de los jugadores gane. Verás los resultados y las clasificaciones en tu pantalla. Puede optar por jugar de nuevo o salir del menú. </li>
|
97 |
-
</ol>
|
98 |
-
<h2>Conclusión</h2>
|
99 |
-
<p>BGC APK es una aplicación increíble que ofrece una variedad de minijuegos que son divertidos y emocionantes para jugar con tus amigos y familiares. Puede descargar BGC APK para diferentes dispositivos y jugar juegos de BGC en el mismo dispositivo, a través de una red Wi-Fi, o en línea. Los juegos de BGC son simples y claros de entender, pero desafiantes y divertidos de jugar. Puedes competir con tus amigos y familiares y ver quién es el mejor. BGC APK es gratis para descargar y jugar, pero contiene anuncios que pueden ser eliminados mediante la compra de una versión premium. Si usted está buscando una manera divertida y entretenida para pasar su tiempo con sus amigos y familiares, definitivamente debe descargar BGC APK y probarlo. </p>
|
100 |
-
<h2>Preguntas frecuentes</h2>
|
101 |
-
<h3>¿Cuáles son algunos de los juegos populares de BGC? </h3>
|
102 |
-
<p>Algunos de los juegos populares de BGC son:</p>
|
103 |
-
<ul>
|
104 |
-
<li>carreras: un juego de ritmo rápido donde tienes que competir contra otros jugadores en diferentes pistas. </li>
|
105 |
-
<li>Disparos: Un emocionante juego donde tienes que disparar a otros jugadores o objetivos con diferentes armas. </li>
|
106 |
-
<li>rompecabezas: un juego de bromas donde tienes que resolver varios puzzles y adivinanzas. </li>
|
107 |
-
|
108 |
-
<li>Deportes: Un juego deportivo donde tienes que jugar diferentes deportes como fútbol, baloncesto, tenis, etc.</li>
|
109 |
-
</ul>
|
110 |
-
<h3>¿Es BGC APK seguro y seguro de usar? </h3>
|
111 |
-
<p>Sí, BGC APK es seguro y seguro de usar. No contiene ningún virus o malware que pueda dañar su dispositivo o datos. Tampoco requiere ningún permiso especial que pueda comprometer su privacidad o seguridad. Sin embargo, siempre debe descargar BGC APK desde su sitio web oficial o de fuentes de confianza para evitar cualquier riesgo. </p>
|
112 |
-
<h3>¿Cuánto espacio requiere BGC APK en su dispositivo? </h3>
|
113 |
-
<p>BGC APK requiere aproximadamente 50 MB de espacio en su dispositivo. Sin embargo, esto puede variar dependiendo del modelo de dispositivo y el sistema operativo. También debe asegurarse de que usted tiene suficiente espacio libre en el dispositivo antes de descargar BGC APK.</p>
|
114 |
-
<h3>¿Puedes jugar juegos de BGC sin conexión? </h3>
|
115 |
-
<p>Sí, puedes jugar juegos de BGC sin conexión usando el modo de juego con bots. Este modo le permite jugar juegos BGC con jugadores controlados por ordenador sin necesidad de una conexión a Internet. Sin embargo, no podrás guardar tu progreso o logros en este modo. Tampoco podrás acceder a algunas de las características como el modo multijugador en línea, tablas de clasificación, etc.</p>
|
116 |
-
<h3>¿Cómo puede ponerse en contacto con el desarrollador de BGC APK? </h3>
|
117 |
-
<p>Si usted tiene alguna pregunta, comentarios, sugerencias, o problemas con respecto BGC APK, puede ponerse en contacto con el desarrollador de BGC APK mediante el uso del formulario de contacto en su sitio web oficial. También puedes seguirlos en sus cuentas de redes sociales como Facebook, Twitter, Instagram, etc. para obtener las últimas actualizaciones y noticias sobre BGC APK. También puedes dejar una reseña o valoración en Google Play Store o App Store para compartir tu experiencia y comentarios con otros usuarios. </p> 64aa2da5cf<br />
|
118 |
-
<br />
|
119 |
-
<br />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Benson/text-generation/Examples/Comisin Zondo Informe Final Pdf.md
DELETED
@@ -1,78 +0,0 @@
|
|
1 |
-
|
2 |
-
<h1>Informe final de la Comisión Zondo PDF Download</h1>
|
3 |
-
<p>La Comisión de Investigación de Zondo sobre las Acusaciones de Captura del Estado, también conocida como la Comisión de Captura del Estado, fue una comisión judicial establecida en 2017 por el ex presidente Jacob Zuma, siguiendo una recomendación del ex Protector Público Thuli Madonsela en su informe de 2016 titulado <em>State of Capture</em>. La comisión fue presidida por el Presidente Adjunto del Tribunal Supremo Raymond Zondo y tenía el mandato de investigar las denuncias de corrupción, fraude e influencia indebida de particulares y entidades en el Estado y sus órganos. </p>
|
4 |
-
<p>La comisión llevó a cabo audiencias públicas entre agosto de 2018 y septiembre de 2021, durante las cuales escuchó las declaraciones de más de 330 testigos, incluidos ministros anteriores y actuales, altos funcionarios, ejecutivos de empresas, denunciantes, periodistas y activistas de la sociedad civil. La comisión también recibió miles de documentos, declaraciones juradas y presentaciones de diversas fuentes. El trabajo de la comisión fue ampliamente seguido por los medios de comunicación y el público, ya que expuso detalles impactantes de cómo la captura estatal operaba y afectaba a varios sectores de la sociedad. </p>
|
5 |
-
<h2>comisión zondo informe final pdf</h2><br /><p><b><b>Download File</b> ——— <a href="https://bltlly.com/2v6IR1">https://bltlly.com/2v6IR1</a></b></p><br /><br />
|
6 |
-
<p>La comisión presentó su informe final al presidente Cyril Ramaphosa en seis partes entre enero y junio de 2022. El informe consta de más de 900 páginas y contiene hallazgos, conclusiones y recomendaciones sobre diversos aspectos de la captura estatal. Inicialmente, la Presidencia mantuvo la confidencialidad del informe, a la espera de que el Presidente del Tribunal Supremo Zondo lo examinara para determinar las correcciones y enmiendas. Sin embargo, tras una orden judicial que autorizó la publicación de la versión modificada del informe el 12 de octubre de 2022, la Presidencia puso el informe a disposición del público en línea. </p>
|
7 |
-
<h2>¿Qué es la Comisión Zondo y por qué es importante? </h2>
|
8 |
-
|
9 |
-
<p>La Comisión Zondo fue importante por varias razones. En primer lugar, proporcionó una plataforma para exponer y documentar el alcance y el impacto de la captura estatal en diversos sectores de la sociedad. En segundo lugar, ofreció una oportunidad para aquellos que estaban implicados o afectados por la captura estatal para dar su versión de la historia y enfrentar el contrainterrogatorio. En tercer lugar, generó conciencia pública y debate sobre las causas y consecuencias de la captura estatal y cómo prevenirla en el futuro. En cuarto lugar, formuló recomendaciones para la acción legal, la reforma institucional, el cambio de políticas y la movilización social para abordar la captura estatal y su legado. </p>
|
10 |
-
<h2>Las principales conclusiones y recomendaciones del informe</h2>
|
11 |
-
<p>El informe abarca una amplia gama de temas relacionados con la captura estatal, como las empresas estatales (EPE), los departamentos y organismos gubernamentales, los partidos políticos y el Parlamento, los servicios de seguridad e inteligencia, los medios de comunicación y la sociedad civil, entre otros. El informe contiene conclusiones sobre denuncias concretas de corrupción, fraude, mala administración, nepotismo, abuso de poder, injerencia, tráfico de influencias, blanqueo de dinero, evasión fiscal, etc., en las que participan diversas personas y entidades. El informe también hace recomendaciones sobre cómo responsabilizar a los responsables, recuperar los fondos robados, fortalecer los mecanismos de supervisión, mejorar los sistemas de gobernanza, mejorar las normas éticas, proteger a los denunciantes, promover la educación cívica, etc.</p>
|
12 |
-
<p>Algunas de las principales conclusiones y recomendaciones del informe se resumen a continuación:</p>
|
13 |
-
<h3>Captura estatal en empresas estatales</h3>
|
14 |
-
|
15 |
-
<p>El informe recomienda que las empresas estatales sean reestructuradas y reformadas para asegurar su viabilidad financiera, eficiencia operativa, alineación estratégica y responsabilidad pública. En el informe también se recomienda que las empresas estatales apliquen medidas para prevenir y combatir la corrupción, como la realización de auditorías forenses, el examen de los contratos, la recuperación de fondos, la imposición de medidas disciplinarias o el enjuiciamiento de los delincuentes, el fortalecimiento de los controles internos, mejorar la transparencia y la divulgación, etc.</p>
|
16 |
-
<h3>Captura estatal en departamentos y agencias gubernamentales</h3>
|
17 |
-
<p>El informe encuentra que varios departamentos y agencias gubernamentales fueron capturados por la misma red de actores privados que capturaron a las SOEs. El informe revela cómo la familia Gupta y sus asociados utilizaron su influencia sobre el ex presidente Zuma y su gabinete para asegurar nombramientos, contratos, licitaciones, licencias, permisos, subvenciones, etc., de varios departamentos y organismos gubernamentales. El informe también expone cómo la familia Gupta y sus asociados interfirieron con el funcionamiento y la toma de decisiones de varios departamentos y organismos gubernamentales para promover sus intereses. El informe identifica varios departamentos y organismos gubernamentales que fueron afectados por la captura estatal, como el Departamento de Recursos Minerales, el Departamento de Asuntos Internos, el Departamento de Empresas Públicas, el Departamento de Agua y Saneamiento, el Tesoro Nacional, la Fiscalía Nacional, el Servicio Fiscal de Sudáfrica, etc.</p>
|
18 |
-
<p>El informe recomienda que se reformen y revitalicen los departamentos y organismos gubernamentales para garantizar su integridad, eficacia, capacidad de respuesta y responsabilidad. El informe también recomienda que los departamentos y organismos gubernamentales apliquen medidas para prevenir y combatir la corrupción, como la realización de investigaciones, la revisión de políticas, la recuperación de fondos, la imposición de medidas disciplinarias o el enjuiciamiento de delincuentes, el fortalecimiento de los mecanismos de supervisión, aumentar la participación pública, etc.</p>
|
19 |
-
<p></p>
|
20 |
-
|
21 |
-
<p>El informe concluye que varios partidos políticos y el Parlamento fueron capturados por la misma red de actores privados que capturaron a las empresas estatales y los departamentos y organismos gubernamentales. El informe muestra cómo la familia Gupta y sus asociados utilizaron sus recursos financieros y conexiones políticas para influir en la selección y elección de líderes políticos, candidatos y representantes en diversos niveles de gobierno. El informe también muestra cómo la familia Gupta y sus asociados utilizaron su acceso y su influencia para influir en las políticas, posiciones y acciones de varios partidos políticos y el Parlamento en asuntos relacionados con la captura del Estado. El informe identifica varios partidos políticos y el Parlamento que fueron afectados por la captura estatal, como el ANC, el DA, el EFF, COPE <p>, y el IFP, así como la Asamblea Nacional y el Consejo Nacional de Provincias.</p>
|
22 |
-
El informe recomienda que se reformen y renueven los partidos políticos y el Parlamento para garantizar su independencia, diversidad, representación y responsabilidad. El informe también recomienda que los partidos políticos y el Parlamento apliquen medidas para prevenir y combatir la corrupción, como la realización de auditorías internas, el examen de las donaciones, la recuperación de fondos, la imposición de medidas disciplinarias o el enjuiciamiento de los delincuentes, el fortalecimiento de los códigos de ética, mejorar el escrutinio público, etc.</p>
|
23 |
-
<h3>Captura de estado en el sector de seguridad e inteligencia</h3>
|
24 |
-
|
25 |
-
<p>El informe recomienda que se reforme y restablezca el sector de seguridad e inteligencia para garantizar su profesionalismo, imparcialidad, legalidad y rendición de cuentas. El informe también recomienda que el sector de la seguridad y la inteligencia aplique medidas para prevenir y combatir la corrupción, como la realización de investigaciones, el examen de las operaciones, la recuperación de fondos, la disciplina o el enjuiciamiento de los delincuentes, el fortalecimiento de los órganos de supervisión, mejorar la confianza pública, etc.</p>
|
26 |
-
<h2>Cómo acceder y descargar el informe en línea</h2>
|
27 |
-
<p>El informe está disponible en línea para cualquiera que quiera acceder y descargarlo. Hay varias maneras de hacerlo:</p>
|
28 |
-
<h3>El sitio web oficial de la Presidencia</h3>
|
29 |
-
<p>La Presidencia ha publicado el informe en su sitio web oficial, donde se puede acceder y descargar en formato PDF. El informe se divide en seis partes, cada una de las cuales contiene varios capítulos y anexos. El sitio web también contiene un resumen del informe y una declaración del Presidente Ramaphosa sobre la publicación del informe. </p>
|
30 |
-
<h3>El sitio web oficial de la Comisión Zondo</h3>
|
31 |
-
<p>La Comisión Zondo también ha publicado el informe en su sitio web oficial, donde se puede acceder y descargar en formato PDF. El informe se divide en seis partes, cada una de las cuales contiene varios capítulos y anexos. El sitio web también proporciona los antecedentes de la comisión, una lista de testigos, una transcripción de las audiencias, un resumen de las presentaciones y una declaración del Presidente del Tribunal Supremo Zondo sobre la presentación del informe. </p>
|
32 |
-
<h3>Otras fuentes y plataformas en línea</h3>
|
33 |
-
|
34 |
-
<h2>Los desafíos y las implicaciones del informe</h2>
|
35 |
-
<p>El informe es un documento histórico que tiene implicaciones significativas para la democracia y el desarrollo de Sudáfrica. Sin embargo, el informe también enfrenta varios desafíos que pueden afectar su implementación y su impacto. Algunos de estos desafíos e implicaciones se discuten a continuación:</p>
|
36 |
-
<h3>Situación jurídica y aplicabilidad del informe</h3>
|
37 |
-
<p>El informe no es una sentencia judicial, sino un conjunto de conclusiones y recomendaciones de una comisión judicial. Por lo tanto, el informe no tiene fuerza de ley, sino más bien el peso de la autoridad y las pruebas. El informe no da lugar automáticamente a acusaciones penales, demandas civiles, medidas disciplinarias o cambios de política, sino que más bien proporciona una base para la adopción de nuevas medidas por las autoridades y las partes interesadas pertinentes. El informe puede ser impugnado, revisado o apelado en los tribunales por aquellos que están implicados o afectados por él. El informe también puede ser ignorado, retrasado u obstruido por aquellos que no quieren o no pueden implementarlo. </p>
|
38 |
-
<p>El informe requiere voluntad política, acción legal, apoyo institucional, presión pública y movilización social para asegurar su implementación y cumplimiento. El informe también requiere coordinación, cooperación y colaboración entre diversos actores y sectores para asegurar su eficacia y eficiencia. El informe también requiere monitoreo, evaluación y supervisión para asegurar su cumplimiento y rendición de cuentas. </p>
|
39 |
-
<h3>La reacción pública y la respuesta al informe</h3>
|
40 |
-
|
41 |
-
<p>El informe también ha suscitado debate, discusión y diálogo entre diversos interesados y sectores de la sociedad, como los partidos políticos, las organizaciones de la sociedad civil, las asociaciones empresariales, las instituciones académicas, los medios de comunicación, etc. El informe también ha sensibilizado, conciencia y educación entre el público sobre los problemas y desafíos de la captura estatal y cómo abordarlos. </p>
|
42 |
-
<h3>Perspectivas y acciones futuras para la rendición de cuentas y la reforma</h3>
|
43 |
-
<p>El informe es una oportunidad histórica para que Sudáfrica enfrente y supere el legado de la captura estatal y reconstruya y renueve su democracia y desarrollo. Sin embargo, el informe no es un fin en sí mismo, sino un medio para un fin. El informe no es una fórmula mágica, sino un catalizador para el cambio. El informe no es una garantía, sino un desafío para la rendición de cuentas y la reforma. </p>
|
44 |
-
<p>El informe requiere esfuerzos sostenidos y concertados de todos los sectores de la sociedad para asegurar su implementación e impacto. El informe requiere liderazgo y compromiso por parte del gobierno y el estado para asegurar su aplicación y cumplimiento. El informe requiere la participación y el compromiso del público y la sociedad para asegurar su apoyo y supervisión. El informe requiere innovación y transformación por parte del sector privado y la economía para asegurar su alineación y contribución. </p>
|
45 |
-
<h2>Conclusión</h2>
|
46 |
-
<p>El Informe Final de la Comisión Zondo PDF Download es un recurso valioso para cualquiera que quiera aprender más sobre la captura estatal en Sudáfrica y cómo abordarla. El informe ofrece una descripción exhaustiva y creíble del alcance y el impacto de la captura estatal en diversos sectores de la sociedad. El informe también proporciona un conjunto de recomendaciones para la acción legal, la reforma institucional, el cambio de políticas y la movilización social para abordar la captura estatal y su legado. </p>
|
47 |
-
|
48 |
-
<p>El informe es un documento histórico que tiene implicaciones significativas para la democracia y el desarrollo de Sudáfrica. Sin embargo, el informe no es un fin en sí mismo, sino un medio para un fin. El informe no es una fórmula mágica, sino un catalizador para el cambio. El informe no es una garantía, sino un desafío para la rendición de cuentas y la reforma. </p>
|
49 |
-
<h2>Preguntas frecuentes</h2>
|
50 |
-
<p>Aquí hay algunas preguntas frecuentes sobre el Informe Final de la Comisión Zondo PDF Download:</p>
|
51 |
-
<tabla>
|
52 |
-
<tr>
|
53 |
-
<th>Pregunta</th>
|
54 |
-
<th>Respuesta</th>
|
55 |
-
</tr>
|
56 |
-
<tr>
|
57 |
-
<td>¿Qué es la Comisión Zondo? </td>
|
58 |
-
<td>La Comisión Zondo es una comisión judicial creada en 2017 por el expresidente Jacob Zuma para investigar denuncias de captura estatal en Sudáfrica.</td>
|
59 |
-
</tr>
|
60 |
-
<tr>
|
61 |
-
<td>¿Qué es la captura de estado? </td>
|
62 |
-
<td>La captura estatal es una forma de corrupción sistémica que involucra la cooptación de instituciones, políticas y recursos estatales por parte de actores privados para su propio beneficio. </td>
|
63 |
-
</tr>
|
64 |
-
<tr>
|
65 |
-
<td>¿Cuáles son las principales conclusiones y recomendaciones del informe? </td>
|
66 |
-
<td>El informe concluye que varios sectores de la sociedad fueron capturados por una red de actores privados liderados por la familia Gupta, quienes utilizaron su influencia sobre el ex presidente Zuma y sus aliados para asegurar contratos, nombramientos, favores, beneficios, e influencia sobre el estado y sus órganos. El informe recomienda la acción legal, la reforma institucional, el cambio de políticas y la movilización social para abordar la captura estatal y su legado. </td>
|
67 |
-
</tr>
|
68 |
-
<tr>
|
69 |
-
<td>¿Cómo puedo acceder y descargar el informe en línea? </td>
|
70 |
-
<td>Puede acceder y descargar el informe en línea desde diversas fuentes y plataformas, como el sitio web oficial de la Presidencia, el sitio web oficial de la Comisión Zondo u otras fuentes y plataformas en línea. </td>
|
71 |
-
</tr>
|
72 |
-
<tr>
|
73 |
-
<td>¿Cuáles son los desafíos y las implicaciones del informe? </td>
|
74 |
-
|
75 |
-
</tr>
|
76 |
-
</table></p> 64aa2da5cf<br />
|
77 |
-
<br />
|
78 |
-
<br />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Benson/text-generation/Examples/Cuerda Hroe Apk Mod 3.md
DELETED
@@ -1,68 +0,0 @@
|
|
1 |
-
|
2 |
-
<h1>héroe de cuerda APK Mod 3: Un juego de superhéroes con diversión ilimitada</h1>
|
3 |
-
<p>¿Te gustan los juegos de superhéroes? ¿Quieres balancearte como Spider-Man, luchar como Batman y volar como Superman? Si es así, entonces usted debe probar <strong>Héroe de cuerda APK Mod 3</strong>, un juego de acción en tercera persona con elementos RPG que le permite convertirse en un héroe de la súper cuerda en una ciudad llena de crimen y aventura. </p>
|
4 |
-
<p>En este artículo, te diremos todo lo que necesitas saber sobre este increíble juego y su versión modificada. Te mostraremos cómo descargarlo e instalarlo en tu dispositivo, cuáles son sus características y cómo jugarlo como un profesional. También te daremos algunos consejos y trucos para que tu experiencia de juego sea más agradable. ¡Empecemos! </p>
|
5 |
-
<h2>cuerda héroe apk mod 3</h2><br /><p><b><b>Download Zip</b> 🗸 <a href="https://bltlly.com/2v6Lte">https://bltlly.com/2v6Lte</a></b></p><br /><br />
|
6 |
-
<h2>¿Qué es el héroe de cuerda APK Mod 3?</h2>
|
7 |
-
<p>Rope Hero es un popular juego desarrollado por Naxeex Action & RPG Games, un estudio especializado en crear juegos de mundo abierto con temas de superhéroes. El juego tiene más de 100 millones de descargas en Google Play Store y ha recibido críticas positivas de jugadores y críticos por igual. </p>
|
8 |
-
<p>El juego sigue la historia de un súper héroe azul que se despierta en una ciudad viciosa sin memoria de su pasado. Tiene una súper cuerda que le permite balancearse de un edificio a otro, saltar como una araña y realizar aterrizajes de potencia. También tiene superpoderes y armas que puede usar para luchar contra gángsters, policías y otros enemigos. También puede secuestrar coches, bicicletas, helicópteros, aviones e incluso robots. </p>
|
9 |
-
<p>El juego tiene una línea de búsqueda principal que implica descubrir la verdad sobre su identidad y su papel en un experimento secreto. También tiene que enfrentar varios desafíos, como capturar distritos, derrotar jefes, completar misiones, participar en desafíos de armas, carreras de autos, batallas en arenas y mucho más. </p>
|
10 |
-
|
11 |
-
<h2>Cómo descargar e instalar el héroe de cuerda APK Mod 3?</h2>
|
12 |
-
<p>Si desea jugar Rope Hero APK Mod 3 en su dispositivo, es necesario seguir estos sencillos pasos:</p>
|
13 |
-
<ol>
|
14 |
-
<li>Ir a <a href="( 1 )">este enlace</a> y descargar el archivo APK de Rope Hero APK Mod 3.</li>
|
15 |
-
<li>Ir a la configuración del dispositivo y permitir la instalación de aplicaciones de fuentes desconocidas. </li>
|
16 |
-
<li>Busque el archivo descargado en su administrador de archivos y toque en él para instalarlo. </li>
|
17 |
-
<li>Espere a que el proceso de instalación termine y luego inicie el juego. </li>
|
18 |
-
<li> ¡Disfruta jugando Rope Hero APK Mod 3 con dinero y gemas ilimitadas! </li>
|
19 |
-
</ol>
|
20 |
-
<p>Nota: Es posible que tenga que desinstalar la versión original de Rope Hero antes de instalar la versión modificada. </p>
|
21 |
-
<h <h2>¿Cuáles son las características de la cuerda héroe APK Mod 3?</h2>
|
22 |
-
<p>Héroe de cuerda APK Mod 3 no es solo un simple juego de superhéroes. Tiene muchas características que lo hacen destacar de otros juegos en el género. Estas son algunas de las características que puedes disfrutar en este juego:</p>
|
23 |
-
<p></p>
|
24 |
-
<h3>Dinero ilimitado y gemas</h3>
|
25 |
-
<p>Como hemos mencionado antes, Héroe de cuerda APK Mod 3 le da dinero ilimitado y gemas, que son las principales monedas en el juego. Puedes usarlos para comprar armas, pieles, mejoras y otros artículos que harán a tu héroe más fuerte y más fresco. También puedes desbloquear todas las características del juego sin tener que gastar dinero real o ver anuncios. </p>
|
26 |
-
<p>Por ejemplo, puedes comprar diferentes tipos de armas, como pistolas, escopetas, rifles, francotiradores, lanzacohetes y más. También puedes comprar armas cuerpo a cuerpo, como espadas, hachas, martillos y más. También puedes comprar súper armas, como láseres, lanzallamas, pistolas de plasma y más. </p>
|
27 |
-
<p>También puedes comprar diferentes pieles para tu héroe, como Iron Man, Spider Man, Batman, Capitán América, Hulk y más. También puedes comprar mejoras para tu súper cuerda, como longitud, velocidad, daños y más. También puedes comprar mejoras para tus superpoderes, como velocidad de vuelo, altura de salto, daño de aterrizaje y más. </p>
|
28 |
-
|
29 |
-
<p>Héroe de cuerda APK Mod 3 no se trata solo de balanceo de un edificio a otro. También se trata de usar tus superpoderes y armas para luchar contra el crimen y los enemigos. Tienes una variedad de superpoderes y armas que puedes usar a tu favor. </p>
|
30 |
-
<p>Tu superpoder principal es tu súper cuerda, que te permite balancearte como una araña, saltar como una rana y realizar aterrizajes de potencia. Puedes usarlo para moverte por la ciudad rápida y fácilmente. También puedes usarlo para agarrar enemigos y objetos y tirarlos. También se puede utilizar para subir paredes y techos. </p>
|
31 |
-
<p>Tus otros superpoderes incluyen volar como un pájaro, correr como un guepardo, golpear como un boxeador, patear como un ninja, y más. Puedes usarlas para luchar contra gángsters, policías y otros enemigos. También puedes usarlas para realizar acrobacias y trucos. </p>
|
32 |
-
<p>Tus armas incluyen armas, armas cuerpo a cuerpo y súper armas. Puedes usarlas para disparar a los enemigos a distancia o a corta distancia. También puedes usarlas para destruir coches, bicicletas, helicópteros, aviones, robots y más. También puedes usarlas para crear explosiones y caos. </p>
|
33 |
-
<h3>Mundo abierto y misiones</h3>
|
34 |
-
<p>Héroe de cuerda APK Mod 3 no se trata solo de luchar contra los enemigos. También se trata de explorar la ciudad y completar misiones. Tienes un enorme mundo abierto que puedes recorrer libremente y descubrir nuevos lugares y secretos. </p>
|
35 |
-
<p>La ciudad está dividida en diferentes distritos que tienen diferentes niveles de dificultad y recompensas. Puedes capturar distritos derrotando a los jefes y limpiando a los enemigos. También puedes completar misiones que involucran salvar civiles, detener crímenes, perseguir criminales, entregar paquetes, autos de carreras, pelear en arenas y más. </p>
|
36 |
-
|
37 |
-
<p>Héroe de cuerda APK Mod 3 no se trata solo de juego y contenido. También se trata de gráficos y optimización. El juego ha mejorado los gráficos y el rendimiento que lo hacen más realista y suave. </p>
|
38 |
-
<p>El juego tiene gráficos en 3D que son coloridos y detallados. Puedes ver los edificios, coches, personas y objetos en la ciudad clara y vívidamente. También puedes ver los efectos de tus superpoderes y armas, como fuego, humo, chispas y sangre. También puede personalizar la configuración de gráficos según su dispositivo y preferencia. </p>
|
39 |
-
<p>El juego también tiene optimización que lo hace correr más rápido y más suave en su dispositivo. Puede jugar el juego sin retraso o estrellarse. También puede guardar su progreso y datos en línea o fuera de línea. También puede jugar el juego con o sin conexión a Internet. </p>
|
40 |
-
<h2> Consejos y trucos para jugar héroe de la cuerda APK Mod 3</h2>
|
41 |
-
<p>Héroe de cuerda APK Mod 3 es un juego divertido y fácil de jugar, pero también puede ser difícil y difícil a veces. Aquí hay algunos consejos y trucos que pueden ayudarte a dominar el juego y divertirte más:</p>
|
42 |
-
<ul>
|
43 |
-
<li>Utilice su súper cuerda sabiamente. Es su herramienta principal para moverse por la ciudad y luchar contra los enemigos. Puedes usarlo para hacer swing, saltar, agarrar, lanzar, subir y más. También puedes actualizarlo para que sea más largo, más rápido, más fuerte y más. </li>
|
44 |
-
<li>Usa tus superpoderes y armas inteligentemente. Son tus armas principales para luchar contra los enemigos y destruir objetos. Puedes usarlos para volar, correr, golpear, patear, disparar, detonar y más. También puedes actualizarlos para hacerlos más potentes, precisos y diversos. </li>
|
45 |
-
<li>Usa tu dinero y gemas con moderación. Son tus principales recursos para comprar artículos y desbloquear funciones. Puedes usarlos para comprar armas, armas cuerpo a cuerpo, súper armas, pieles, mejoras y más. También puedes ganarlos completando misiones, capturando distritos, derrotando jefes y más. </li>
|
46 |
-
|
47 |
-
<li>Completa las misiones diligentemente. Son tu principal fuente de información y recompensas. Puedes seguir la línea de búsqueda principal para descubrir la verdad sobre tu pasado y presente. También puedes hacer misiones secundarias para ayudar a la gente, detener crímenes, perseguir criminales, entregar paquetes, coches de carreras, luchar en arenas y más. </li>
|
48 |
-
</ul>
|
49 |
-
<h2>Conclusión</h2>
|
50 |
-
<p>Héroe de cuerda APK Mod 3 es un juego de superhéroes con diversión ilimitada. Usted puede convertirse en un héroe de súper cuerda en una ciudad llena de crimen y aventura. Puede utilizar sus superpoderes y armas para luchar contra los enemigos y destruir objetos. También puedes explorar la ciudad y completar misiones para descubrir la verdad sobre ti mismo. </p>
|
51 |
-
<p>Si quieres jugar a este juego en tu dispositivo, puedes descargarlo desde <a href="( 1 )">este enlace</a>. Obtendrá dinero y gemas ilimitadas que puede usar para comprar artículos y desbloquear funciones. También obtendrá gráficos mejorados y la optimización que hará que su experiencia de juego más realista y suave. </p>
|
52 |
-
<p>Entonces, ¿qué estás esperando? Descargar Rope Hero APK Mod 3 ahora y disfrutar de ser un héroe súper cuerda! </p>
|
53 |
-
<h2>Preguntas frecuentes</h2>
|
54 |
-
<p>Aquí hay algunas preguntas y respuestas frecuentes sobre Rope Hero APK Mod 3:</p>
|
55 |
-
<ol>
|
56 |
-
<li><strong>¿Es seguro descargar Rope Hero APK Mod 3? </strong></li>
|
57 |
-
<p>Sí, Héroe de cuerda APK Mod 3 es seguro para descargar desde <a href="( 1 )">este enlace</a>. No contiene ningún virus o malware que pueda dañar su dispositivo o datos. </p>
|
58 |
-
<li><strong>¿Es Rope Hero APK Mod 3 compatible con mi dispositivo? </strong></li>
|
59 |
-
<p>Héroe de cuerda APK Mod 3 es compatible con la mayoría de los dispositivos Android que tienen Android 4.4 o versiones superiores. Sin embargo, algunos dispositivos pueden tener diferentes especificaciones que pueden afectar el rendimiento del juego. </p>
|
60 |
-
<li><strong>¿Cómo actualizo Rope Hero APK Mod 3?</strong></li>
|
61 |
-
|
62 |
-
<li><strong>¿Cómo me pongo en contacto con el desarrollador de Rope Hero APK Mod 3?</strong></li>
|
63 |
-
<p>Para ponerse en contacto con el desarrollador de Rope Hero APK Mod 3, puede visitar su sitio web oficial <a href=">here</a <p>or correo electrónico a <a href="mailto:[email protected]">[email protected]</a>. También puedes seguirlos en Facebook, Twitter, Instagram y YouTube.</p>
|
64 |
-
<li><strong>¿Cómo califico y reviso Rope Hero APK Mod 3?</strong></li>
|
65 |
-
<p>Para calificar y revisar Rope Hero APK Mod 3, puede ir a Google Play Store y buscar el juego. Luego puedes tocar las estrellas para dar tu calificación y escribir tus comentarios en la sección de comentarios. También puedes compartir tu opinión con otros jugadores y leer sus reseñas. </p>
|
66 |
-
</ol></p> 64aa2da5cf<br />
|
67 |
-
<br />
|
68 |
-
<br />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Benson/text-generation/Examples/Descarga Gratuita De Picas Para Ventanas 7.md
DELETED
@@ -1,125 +0,0 @@
|
|
1 |
-
<br />
|
2 |
-
<h1>Descargar Oluwa E Tobi Loba: Una poderosa canción de alabanza de Sammie Okposo</h1>
|
3 |
-
<p>Si usted está buscando una canción de alabanza que levantará su espíritu y glorificar a Dios, usted debe descargar Oluwa E Tobi Loba por Sammie Okposo. Esta canción es un remake de la canción popular de Tope Alabi con el mismo título, que significa "Dios, Eres Grande" en idioma yoruba. En este artículo, aprenderás más sobre esta canción, por qué deberías descargarla y cómo descargarla. </p>
|
4 |
-
<h2>¿Qué es Oluwa E Tobi Loba? </h2>
|
5 |
-
<p>Oluwa E Tobi Loba es una canción de alabanza de hip-hop que expresa la grandeza y majestad de Dios. Se canta en una mezcla de dialecto yoruba e inglés, con un coro pegadizo y un ritmo animado. La canción tiene las siguientes características:</p>
|
6 |
-
<h2>descarga gratuita de picas para ventanas 7</h2><br /><p><b><b>Download</b> › <a href="https://bltlly.com/2v6LY5">https://bltlly.com/2v6LY5</a></b></p><br /><br />
|
7 |
-
<h3>El significado del título de la canción</h3>
|
8 |
-
<p>El título de la canción, Oluwa E Tobi Loba, es una frase yoruba que significa "Dios, eres grande". Es una declaración de la supremacía y soberanía de Dios sobre todas las cosas. También reconoce el poder y la fuerza de Dios, que son incomparables a cualquier persona o cualquier otra cosa. </p>
|
9 |
-
<h3>La letra y traducción de la canción</h3>
|
10 |
-
<p>La letra de la canción es la siguiente:</p>
|
11 |
-
<pre>
|
12 |
-
|
13 |
-
<p>La traducción de las partes yorubas es la siguiente:</p> <h3>El compositor y cantante de la canción</h3>
|
14 |
-
<p>La canción Oluwa E Tobi Loba es un remake de una canción popular de Tope Alabi, un cantante de gospel nigeriano, compositor de música de cine y actriz. Tope Alabi es conocida por sus canciones gospel yorubas que mezclan ritmos tradicionales y modernos. Ha lanzado más de 20 álbumes y ha ganado muchos premios por su música. </p>
|
15 |
-
<p>El remake fue hecho por Sammie Okposo, otro artista gospel nigeriano, que también es productor musical, salmista y CEO de Zamar Entertainment. Sammie Okposo comenzó su carrera como productor de bandas sonoras en la industria cinematográfica nigeriana antes de cambiar a la producción musical. Lanzó su álbum debut, Amor incondicional, en 2000 y su segundo álbum, Addicted, en 2004. Ha colaborado con muchos otros artistas en los campos de la música gospel y soul, como Marvellous Odiete, Jonathan Nelson y Shaggy. También ha actuado en África, Europa y América del Norte, y comisariado una serie de conciertos llamados SOPP (Sammie Okposo Praise Party). Su álbum más reciente, The Statement, fue producido por el ganador del Grammy Kevin Bond. </p>
|
16 |
-
<p></p>
|
17 |
-
<h2>¿Por qué descargar Oluwa E Tobi Loba? </h2>
|
18 |
-
<p>Oluwa E Tobi Loba es una canción que te inspirará a alabar a Dios con todo tu corazón y alma. Es una canción que les recordará la grandeza y majestad de Dios, y cómo Él merece toda la gloria y el honor. Aquí hay algunas razones por las que deberías descargar esta canción:</p>
|
19 |
-
<h3>Los beneficios de alabar a Dios con esta canción</h3>
|
20 |
-
<p>Alabar a Dios con esta canción te traerá muchos beneficios, como:</p>
|
21 |
-
<ul>
|
22 |
-
<li>Aumentará tu fe y confianza en Dios, que es capaz de hacer abundantemente sobre todo lo que puedes pedir o pensar. </li>
|
23 |
-
<li>Te llenará de alegría y paz, al expresar tu gratitud y amor a Dios, que es la fuente de tu vida y felicidad. </li>
|
24 |
-
|
25 |
-
<li>Te acercará a Dios y profundizará tu relación con Él, mientras lo adoras en espíritu y en verdad. </li>
|
26 |
-
<li>Bendecirá a otros que lo escuchen y los animará a unirse a ustedes en la alabanza a Dios, que es digno de toda alabanza. </li>
|
27 |
-
</ul> <h3>Los testimonios de las personas que han sido bendecidas por esta canción</h3>
|
28 |
-
<p>Muchas personas han compartido sus testimonios de cómo esta canción los ha bendecido y cambiado sus vidas. Aquí están algunos de ellos:</p>
|
29 |
-
<blockquote>
|
30 |
-
<p>"Esta canción es una bendición para mí. Siempre me levanta el ánimo y me hace sentir la presencia de Dios. Lo toco cada mañana y cada noche, y me da fuerza y esperanza. Gracias, Sammie Okposo, por esta maravillosa canción." - Oluwaseun desde Lagos, Nigeria.</p>
|
31 |
-
</blockquote>
|
32 |
-
<blockquote>
|
33 |
-
<p>"Me encanta esta canción tanto. Me recuerda lo grande y asombroso que es Dios. Ha hecho tantos milagros en mi vida, y no puedo agradecerle lo suficiente. Esta canción me ayuda a alabarlo con todo mi corazón y alma. Dios te bendiga, Sammie Okposo, por esta poderosa canción." - Esther de Accra, Ghana.</p>
|
34 |
-
</blockquote>
|
35 |
-
<blockquote>
|
36 |
-
<p>"Esta canción es un milagro para mí. Estaba pasando por un momento muy difícil en mi vida, y me sentí como renunciar. Pero un día, escuché esta canción en la radio, y me conmovió profundamente. Me hizo darme cuenta de que Dios es más grande que mis problemas, y Él puede hacer cualquier cosa. Decidí confiar en Él y alabarlo, y Él cambió mi situación. Gracias, Sammie Okposo, por esta increíble canción." - John de Nairobi, Kenia.</p>
|
37 |
-
</blockquote>
|
38 |
-
<h3>Las mejores plataformas para descargar esta canción</h3>
|
39 |
-
<p>Si quieres descargar esta canción, tienes muchas opciones para elegir. Puedes descargarla desde varias plataformas, como:</p>
|
40 |
-
<tabla>
|
41 |
-
<tr>
|
42 |
-
<th>Plataforma</th>
|
43 |
-
<th>Enlace</th>
|
44 |
-
<th>Precio</th>
|
45 |
-
</tr>
|
46 |
-
<tr>
|
47 |
-
<td>Música de Apple</td>
|
48 |
-
<td><a href=">Descargar Oluwa E Tobi Loba en Apple Music</a></td>
|
49 |
-
<td>$0.99</td>
|
50 |
-
</tr>
|
51 |
-
<tr>
|
52 |
-
<td>Spotify</td>
|
53 |
-
<td><a href=">Descargar Oluwa E Tobi Loba en Spotify</a></td>
|
54 |
-
|
55 |
-
</tr>
|
56 |
-
<tr>
|
57 |
-
<td>Música de YouTube</td>
|
58 |
-
<td><a href=">Descargar Oluwa E Tobi Loba en YouTube Música</a></td>
|
59 |
-
<td>Gratis con anuncios o $11.99/mes para premium</td>
|
60 |
-
</tr>
|
61 |
-
<tr>
|
62 |
-
<td>Música de Amazon</td>
|
63 |
-
<td><a href=">Descargar Oluwa E Tobi Loba en Amazon Music</a></td>
|
64 |
-
<td>$0.99 o gratis con membresía Prime</td>
|
65 |
-
</tr>
|
66 |
-
<tr>
|
67 |
-
<td>Audiomack</td>
|
68 |
-
<td><a href=">Descargar Oluwa E Tobi Loba en Audiomack</a></td>
|
69 |
-
<td>Gratis o $4.99/mes para premium</td>
|
70 |
-
</tr>
|
71 |
-
<tr>
|
72 |
-
<td>Boomplay</td>
|
73 |
-
<td><a href=">Descargar Oluwa E Tobi Loba en Boomplay</a></td>
|
74 |
-
<td>Gratis o $1.99/mes para premium</td>
|
75 |
-
</tr> <h2>Cómo descargar Oluwa E Tobi Loba? </h2>
|
76 |
-
<p>Ahora que sabes lo que es Oluwa E Tobi Loba y por qué deberías descargarlo, te estarás preguntando cómo descargarlo. Bueno, no es difícil en absoluto. Solo tienes que seguir estos sencillos pasos:</p>
|
77 |
-
<h3>Los pasos a seguir para descargar esta canción</h3>
|
78 |
-
<ol>
|
79 |
-
<li>Elija la plataforma desde la que desea descargar la canción. Puede utilizar cualquiera de las plataformas enumeradas en la sección anterior, o cualquier otra plataforma que prefiera. </li>
|
80 |
-
<li>Haga clic en el enlace que lo llevará al sitio web o aplicación de la plataforma. Es posible que necesite registrarse o iniciar sesión para acceder a la plataforma. </li>
|
81 |
-
<li>Busque la canción escribiendo "Oluwa E Tobi Loba" o "Sammie Okposo" en la barra de búsqueda. Debería ver la canción entre los resultados. </li>
|
82 |
-
<li>Haga clic en el botón de descarga o icono que le permitirá descargar la canción. Es posible que tenga que pagar una cuota o suscribirse a un plan para descargar la canción, dependiendo de la plataforma. </li>
|
83 |
-
<li>Espere a que se complete la descarga. Debería ver una notificación o un mensaje que confirme que la descarga se ha realizado correctamente. </li>
|
84 |
-
<li>Disfruta escuchando la canción en tu dispositivo. Puedes reproducirla offline o online, tantas veces como quieras. </li>
|
85 |
-
</ol>
|
86 |
-
<h3>Los consejos para asegurar una descarga suave y segura</h3>
|
87 |
-
<p>Para asegurarte de que tu descarga sea fluida y segura, debes seguir estos consejos:</p>
|
88 |
-
<ul>
|
89 |
-
|
90 |
-
<li>Utilice una plataforma confiable y legal. Esto asegurará que obtengas una versión original y de alta calidad de la canción, y que no violes ninguna ley de derechos de autor. </li>
|
91 |
-
<li>Utilice un dispositivo compatible y actualizado. Esto asegurará que puede reproducir la canción sin problemas o problemas técnicos. </li>
|
92 |
-
<li>Utilice software antivirus y protección contra cortafuegos. Esto protegerá su dispositivo de cualquier virus o malware que pueda venir con la descarga. </li>
|
93 |
-
</ul>
|
94 |
-
<h3>Las alternativas para descargar esta canción</h3>
|
95 |
-
<p>Si no quieres descargar esta canción, o si no puedes descargarla por alguna razón, tienes algunas alternativas. Puedes:</p>
|
96 |
-
<ul>
|
97 |
-
<li>Transmitir la canción en línea. Puede utilizar cualquiera de las plataformas enumeradas en la sección anterior, o cualquier otra plataforma que ofrece servicios de transmisión. Necesitará una conexión a Internet y un plan de suscripción para transmitir la canción. </li>
|
98 |
-
<li>Ver el video de la canción en línea. Puede utilizar plataformas como YouTube o Vimeo para ver el video de la canción. Necesitará una conexión a Internet y un navegador o aplicación para ver el video. </li>
|
99 |
-
<li>Compra el CD o DVD de la canción. Puedes usar plataformas como Amazon o eBay para comprar la copia física de la canción. Necesitará un reproductor de CD o DVD y un altavoz para reproducir la canción. </li>
|
100 |
-
</ul>
|
101 |
-
<h2>Conclusión</h2>
|
102 |
-
<p>Oluwa E Tobi Loba es una poderosa canción de alabanza de Sammie Okposo que te inspirará a adorar a Dios con todo tu corazón y alma. Es un remake de la canción popular de Tope Alabi con el mismo título, que significa "Dios, Eres Grande" en idioma yoruba. Se canta en una mezcla de dialecto yoruba e inglés, con un estribillo pegadizo y un ritmo animado. </p>
|
103 |
-
|
104 |
-
<p>Puedes descargar esta canción desde varias plataformas, como Apple Music, Spotify, YouTube Music, Amazon Music, Audiomack y Boomplay. Solo tiene que seguir algunos pasos simples y consejos para garantizar una descarga suave y segura. Alternativamente, puede transmitir la canción en línea, ver el video de la canción en línea, o comprar el CD o DVD de la canción. </p>
|
105 |
-
<p>Si usted está buscando una canción de alabanza que levantará su espíritu y glorificar a Dios, usted debe descargar Oluwa E Tobi Loba por Sammie Okposo hoy. ¡No te arrepentirás! </p>
|
106 |
-
<h3>Un llamado a la acción para los lectores</h3>
|
107 |
-
<p>Si has disfrutado leyendo este artículo, por favor compártelo con tus amigos y familiares que también pueden estar interesados en este tema. También, por favor deje un comentario a continuación y háganos saber lo que piensa acerca de esta canción y este artículo. Nos encantaría saber de usted! </p>
|
108 |
-
<h2>Preguntas frecuentes</h2>
|
109 |
-
<p>Aquí hay algunas preguntas frecuentes sobre Oluwa E Tobi Loba y sus respuestas:</p>
|
110 |
-
<h3>¿Cuál es el género de Oluwa E Tobi Loba? </h3>
|
111 |
-
<p>Oluwa E Tobi Loba es una canción de alabanza de hip-hop que combina ritmos tradicionales y modernos. Es un subgénero de música gospel que usa rap, ritmo y rima para expresar fe y adoración. </p>
|
112 |
-
<h3>¿Quién es el cantante original de Oluwa E Tobi Loba? </h3>
|
113 |
-
<p>El cantante original de Oluwa E Tobi Loba es Tope Alabi, una cantante de gospel nigeriana, compositora de música de cine y actriz. Lanzó la canción en 2018 como parte de su álbum titulado Yes and Amen.</p>
|
114 |
-
<h3>¿Cuál es la diferencia entre la versión de Sammie Okposo y la versión de Tope Alabi? </h3>
|
115 |
-
<p>La versión de Sammie Okposo es un remake de la versión de Tope Alabi, con algunos cambios y adiciones. Sammie Okposo agregó algunas letras en inglés, algunos sonidos de cuerno y algunas voces de fondo a la canción. También hizo la canción más optimista y enérgica, manteniendo el mensaje original y la melodía. </p>
|
116 |
-
<h3>¿Dónde puedo ver el video de Oluwa E Tobi Loba por Sammie Okposo? </h3>
|
117 |
-
|
118 |
-
<h3>¿Cómo puedo contactar con Sammie Okposo o Tope Alabi? </h3>
|
119 |
-
<p>Puede ponerse en contacto con Sammie Okposo o Tope Alabi a través de sus cuentas de redes sociales o sus sitios web. Aquí están sus datos:</p>
|
120 |
-
<ul>
|
121 |
-
<li>Sammie Okposo: <a href="">Instagram</a>, <a href=">Twitter</a>, <a href="">Facebook</a>, <a href=">Sitio web</a>. </li>
|
122 |
-
<li>Tope Alabi: <a href="">Instagram</a>, <a href=">Twitter</a>, <a href=">Facebook</a>, <a href=">Sitio web</a>. </li>
|
123 |
-
</ul></p> 64aa2da5cf<br />
|
124 |
-
<br />
|
125 |
-
<br />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Big-Web/MMSD/env/Lib/site-packages/boto3/session.py
DELETED
@@ -1,532 +0,0 @@
|
|
1 |
-
# Copyright 2014 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 |
-
# https://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 |
-
|
14 |
-
import copy
|
15 |
-
import os
|
16 |
-
|
17 |
-
import botocore.session
|
18 |
-
from botocore.client import Config
|
19 |
-
from botocore.exceptions import DataNotFoundError, UnknownServiceError
|
20 |
-
|
21 |
-
import boto3
|
22 |
-
import boto3.utils
|
23 |
-
from boto3.exceptions import ResourceNotExistsError, UnknownAPIVersionError
|
24 |
-
|
25 |
-
from .resources.factory import ResourceFactory
|
26 |
-
|
27 |
-
|
28 |
-
class Session:
|
29 |
-
"""
|
30 |
-
A session stores configuration state and allows you to create service
|
31 |
-
clients and resources.
|
32 |
-
|
33 |
-
:type aws_access_key_id: string
|
34 |
-
:param aws_access_key_id: AWS access key ID
|
35 |
-
:type aws_secret_access_key: string
|
36 |
-
:param aws_secret_access_key: AWS secret access key
|
37 |
-
:type aws_session_token: string
|
38 |
-
:param aws_session_token: AWS temporary session token
|
39 |
-
:type region_name: string
|
40 |
-
:param region_name: Default region when creating new connections
|
41 |
-
:type botocore_session: botocore.session.Session
|
42 |
-
:param botocore_session: Use this Botocore session instead of creating
|
43 |
-
a new default one.
|
44 |
-
:type profile_name: string
|
45 |
-
:param profile_name: The name of a profile to use. If not given, then
|
46 |
-
the default profile is used.
|
47 |
-
"""
|
48 |
-
|
49 |
-
def __init__(
|
50 |
-
self,
|
51 |
-
aws_access_key_id=None,
|
52 |
-
aws_secret_access_key=None,
|
53 |
-
aws_session_token=None,
|
54 |
-
region_name=None,
|
55 |
-
botocore_session=None,
|
56 |
-
profile_name=None,
|
57 |
-
):
|
58 |
-
if botocore_session is not None:
|
59 |
-
self._session = botocore_session
|
60 |
-
else:
|
61 |
-
# Create a new default session
|
62 |
-
self._session = botocore.session.get_session()
|
63 |
-
|
64 |
-
# Setup custom user-agent string if it isn't already customized
|
65 |
-
if self._session.user_agent_name == 'Botocore':
|
66 |
-
botocore_info = 'Botocore/{}'.format(
|
67 |
-
self._session.user_agent_version
|
68 |
-
)
|
69 |
-
if self._session.user_agent_extra:
|
70 |
-
self._session.user_agent_extra += ' ' + botocore_info
|
71 |
-
else:
|
72 |
-
self._session.user_agent_extra = botocore_info
|
73 |
-
self._session.user_agent_name = 'Boto3'
|
74 |
-
self._session.user_agent_version = boto3.__version__
|
75 |
-
|
76 |
-
if profile_name is not None:
|
77 |
-
self._session.set_config_variable('profile', profile_name)
|
78 |
-
|
79 |
-
if aws_access_key_id or aws_secret_access_key or aws_session_token:
|
80 |
-
self._session.set_credentials(
|
81 |
-
aws_access_key_id, aws_secret_access_key, aws_session_token
|
82 |
-
)
|
83 |
-
|
84 |
-
if region_name is not None:
|
85 |
-
self._session.set_config_variable('region', region_name)
|
86 |
-
|
87 |
-
self.resource_factory = ResourceFactory(
|
88 |
-
self._session.get_component('event_emitter')
|
89 |
-
)
|
90 |
-
self._setup_loader()
|
91 |
-
self._register_default_handlers()
|
92 |
-
|
93 |
-
def __repr__(self):
|
94 |
-
return '{}(region_name={})'.format(
|
95 |
-
self.__class__.__name__,
|
96 |
-
repr(self._session.get_config_variable('region')),
|
97 |
-
)
|
98 |
-
|
99 |
-
@property
|
100 |
-
def profile_name(self):
|
101 |
-
"""
|
102 |
-
The **read-only** profile name.
|
103 |
-
"""
|
104 |
-
return self._session.profile or 'default'
|
105 |
-
|
106 |
-
@property
|
107 |
-
def region_name(self):
|
108 |
-
"""
|
109 |
-
The **read-only** region name.
|
110 |
-
"""
|
111 |
-
return self._session.get_config_variable('region')
|
112 |
-
|
113 |
-
@property
|
114 |
-
def events(self):
|
115 |
-
"""
|
116 |
-
The event emitter for a session
|
117 |
-
"""
|
118 |
-
return self._session.get_component('event_emitter')
|
119 |
-
|
120 |
-
@property
|
121 |
-
def available_profiles(self):
|
122 |
-
"""
|
123 |
-
The profiles available to the session credentials
|
124 |
-
"""
|
125 |
-
return self._session.available_profiles
|
126 |
-
|
127 |
-
def _setup_loader(self):
|
128 |
-
"""
|
129 |
-
Setup loader paths so that we can load resources.
|
130 |
-
"""
|
131 |
-
self._loader = self._session.get_component('data_loader')
|
132 |
-
self._loader.search_paths.append(
|
133 |
-
os.path.join(os.path.dirname(__file__), 'data')
|
134 |
-
)
|
135 |
-
|
136 |
-
def get_available_services(self):
|
137 |
-
"""
|
138 |
-
Get a list of available services that can be loaded as low-level
|
139 |
-
clients via :py:meth:`Session.client`.
|
140 |
-
|
141 |
-
:rtype: list
|
142 |
-
:return: List of service names
|
143 |
-
"""
|
144 |
-
return self._session.get_available_services()
|
145 |
-
|
146 |
-
def get_available_resources(self):
|
147 |
-
"""
|
148 |
-
Get a list of available services that can be loaded as resource
|
149 |
-
clients via :py:meth:`Session.resource`.
|
150 |
-
|
151 |
-
:rtype: list
|
152 |
-
:return: List of service names
|
153 |
-
"""
|
154 |
-
return self._loader.list_available_services(type_name='resources-1')
|
155 |
-
|
156 |
-
def get_available_partitions(self):
|
157 |
-
"""Lists the available partitions
|
158 |
-
|
159 |
-
:rtype: list
|
160 |
-
:return: Returns a list of partition names (e.g., ["aws", "aws-cn"])
|
161 |
-
"""
|
162 |
-
return self._session.get_available_partitions()
|
163 |
-
|
164 |
-
def get_available_regions(
|
165 |
-
self, service_name, partition_name='aws', allow_non_regional=False
|
166 |
-
):
|
167 |
-
"""Lists the region and endpoint names of a particular partition.
|
168 |
-
|
169 |
-
The list of regions returned by this method are regions that are
|
170 |
-
explicitly known by the client to exist and is not comprehensive. A
|
171 |
-
region not returned in this list may still be available for the
|
172 |
-
provided service.
|
173 |
-
|
174 |
-
:type service_name: string
|
175 |
-
:param service_name: Name of a service to list endpoint for (e.g., s3).
|
176 |
-
|
177 |
-
:type partition_name: string
|
178 |
-
:param partition_name: Name of the partition to limit endpoints to.
|
179 |
-
(e.g., aws for the public AWS endpoints, aws-cn for AWS China
|
180 |
-
endpoints, aws-us-gov for AWS GovCloud (US) Endpoints, etc.)
|
181 |
-
|
182 |
-
:type allow_non_regional: bool
|
183 |
-
:param allow_non_regional: Set to True to include endpoints that are
|
184 |
-
not regional endpoints (e.g., s3-external-1,
|
185 |
-
fips-us-gov-west-1, etc).
|
186 |
-
|
187 |
-
:return: Returns a list of endpoint names (e.g., ["us-east-1"]).
|
188 |
-
"""
|
189 |
-
return self._session.get_available_regions(
|
190 |
-
service_name=service_name,
|
191 |
-
partition_name=partition_name,
|
192 |
-
allow_non_regional=allow_non_regional,
|
193 |
-
)
|
194 |
-
|
195 |
-
def get_credentials(self):
|
196 |
-
"""
|
197 |
-
Return the :class:`botocore.credentials.Credentials` object
|
198 |
-
associated with this session. If the credentials have not
|
199 |
-
yet been loaded, this will attempt to load them. If they
|
200 |
-
have already been loaded, this will return the cached
|
201 |
-
credentials.
|
202 |
-
"""
|
203 |
-
return self._session.get_credentials()
|
204 |
-
|
205 |
-
def get_partition_for_region(self, region_name):
|
206 |
-
"""Lists the partition name of a particular region.
|
207 |
-
|
208 |
-
:type region_name: string
|
209 |
-
:param region_name: Name of the region to list partition for (e.g.,
|
210 |
-
us-east-1).
|
211 |
-
|
212 |
-
:rtype: string
|
213 |
-
:return: Returns the respective partition name (e.g., aws).
|
214 |
-
"""
|
215 |
-
return self._session.get_partition_for_region(region_name)
|
216 |
-
|
217 |
-
def client(
|
218 |
-
self,
|
219 |
-
service_name,
|
220 |
-
region_name=None,
|
221 |
-
api_version=None,
|
222 |
-
use_ssl=True,
|
223 |
-
verify=None,
|
224 |
-
endpoint_url=None,
|
225 |
-
aws_access_key_id=None,
|
226 |
-
aws_secret_access_key=None,
|
227 |
-
aws_session_token=None,
|
228 |
-
config=None,
|
229 |
-
):
|
230 |
-
"""
|
231 |
-
Create a low-level service client by name.
|
232 |
-
|
233 |
-
:type service_name: string
|
234 |
-
:param service_name: The name of a service, e.g. 's3' or 'ec2'. You
|
235 |
-
can get a list of available services via
|
236 |
-
:py:meth:`get_available_services`.
|
237 |
-
|
238 |
-
:type region_name: string
|
239 |
-
:param region_name: The name of the region associated with the client.
|
240 |
-
A client is associated with a single region.
|
241 |
-
|
242 |
-
:type api_version: string
|
243 |
-
:param api_version: The API version to use. By default, botocore will
|
244 |
-
use the latest API version when creating a client. You only need
|
245 |
-
to specify this parameter if you want to use a previous API version
|
246 |
-
of the client.
|
247 |
-
|
248 |
-
:type use_ssl: boolean
|
249 |
-
:param use_ssl: Whether or not to use SSL. By default, SSL is used.
|
250 |
-
Note that not all services support non-ssl connections.
|
251 |
-
|
252 |
-
:type verify: boolean/string
|
253 |
-
:param verify: Whether or not to verify SSL certificates. By default
|
254 |
-
SSL certificates are verified. You can provide the following
|
255 |
-
values:
|
256 |
-
|
257 |
-
* False - do not validate SSL certificates. SSL will still be
|
258 |
-
used (unless use_ssl is False), but SSL certificates
|
259 |
-
will not be verified.
|
260 |
-
* path/to/cert/bundle.pem - A filename of the CA cert bundle to
|
261 |
-
uses. You can specify this argument if you want to use a
|
262 |
-
different CA cert bundle than the one used by botocore.
|
263 |
-
|
264 |
-
:type endpoint_url: string
|
265 |
-
:param endpoint_url: The complete URL to use for the constructed
|
266 |
-
client. Normally, botocore will automatically construct the
|
267 |
-
appropriate URL to use when communicating with a service. You
|
268 |
-
can specify a complete URL (including the "http/https" scheme)
|
269 |
-
to override this behavior. If this value is provided,
|
270 |
-
then ``use_ssl`` is ignored.
|
271 |
-
|
272 |
-
:type aws_access_key_id: string
|
273 |
-
:param aws_access_key_id: The access key to use when creating
|
274 |
-
the client. This is entirely optional, and if not provided,
|
275 |
-
the credentials configured for the session will automatically
|
276 |
-
be used. You only need to provide this argument if you want
|
277 |
-
to override the credentials used for this specific client.
|
278 |
-
|
279 |
-
:type aws_secret_access_key: string
|
280 |
-
:param aws_secret_access_key: The secret key to use when creating
|
281 |
-
the client. Same semantics as aws_access_key_id above.
|
282 |
-
|
283 |
-
:type aws_session_token: string
|
284 |
-
:param aws_session_token: The session token to use when creating
|
285 |
-
the client. Same semantics as aws_access_key_id above.
|
286 |
-
|
287 |
-
:type config: botocore.client.Config
|
288 |
-
:param config: Advanced client configuration options. If region_name
|
289 |
-
is specified in the client config, its value will take precedence
|
290 |
-
over environment variables and configuration values, but not over
|
291 |
-
a region_name value passed explicitly to the method. See
|
292 |
-
`botocore config documentation
|
293 |
-
<https://botocore.amazonaws.com/v1/documentation/api/latest/reference/config.html>`_
|
294 |
-
for more details.
|
295 |
-
|
296 |
-
:return: Service client instance
|
297 |
-
|
298 |
-
"""
|
299 |
-
return self._session.create_client(
|
300 |
-
service_name,
|
301 |
-
region_name=region_name,
|
302 |
-
api_version=api_version,
|
303 |
-
use_ssl=use_ssl,
|
304 |
-
verify=verify,
|
305 |
-
endpoint_url=endpoint_url,
|
306 |
-
aws_access_key_id=aws_access_key_id,
|
307 |
-
aws_secret_access_key=aws_secret_access_key,
|
308 |
-
aws_session_token=aws_session_token,
|
309 |
-
config=config,
|
310 |
-
)
|
311 |
-
|
312 |
-
def resource(
|
313 |
-
self,
|
314 |
-
service_name,
|
315 |
-
region_name=None,
|
316 |
-
api_version=None,
|
317 |
-
use_ssl=True,
|
318 |
-
verify=None,
|
319 |
-
endpoint_url=None,
|
320 |
-
aws_access_key_id=None,
|
321 |
-
aws_secret_access_key=None,
|
322 |
-
aws_session_token=None,
|
323 |
-
config=None,
|
324 |
-
):
|
325 |
-
"""
|
326 |
-
Create a resource service client by name.
|
327 |
-
|
328 |
-
:type service_name: string
|
329 |
-
:param service_name: The name of a service, e.g. 's3' or 'ec2'. You
|
330 |
-
can get a list of available services via
|
331 |
-
:py:meth:`get_available_resources`.
|
332 |
-
|
333 |
-
:type region_name: string
|
334 |
-
:param region_name: The name of the region associated with the client.
|
335 |
-
A client is associated with a single region.
|
336 |
-
|
337 |
-
:type api_version: string
|
338 |
-
:param api_version: The API version to use. By default, botocore will
|
339 |
-
use the latest API version when creating a client. You only need
|
340 |
-
to specify this parameter if you want to use a previous API version
|
341 |
-
of the client.
|
342 |
-
|
343 |
-
:type use_ssl: boolean
|
344 |
-
:param use_ssl: Whether or not to use SSL. By default, SSL is used.
|
345 |
-
Note that not all services support non-ssl connections.
|
346 |
-
|
347 |
-
:type verify: boolean/string
|
348 |
-
:param verify: Whether or not to verify SSL certificates. By default
|
349 |
-
SSL certificates are verified. You can provide the following
|
350 |
-
values:
|
351 |
-
|
352 |
-
* False - do not validate SSL certificates. SSL will still be
|
353 |
-
used (unless use_ssl is False), but SSL certificates
|
354 |
-
will not be verified.
|
355 |
-
* path/to/cert/bundle.pem - A filename of the CA cert bundle to
|
356 |
-
uses. You can specify this argument if you want to use a
|
357 |
-
different CA cert bundle than the one used by botocore.
|
358 |
-
|
359 |
-
:type endpoint_url: string
|
360 |
-
:param endpoint_url: The complete URL to use for the constructed
|
361 |
-
client. Normally, botocore will automatically construct the
|
362 |
-
appropriate URL to use when communicating with a service. You
|
363 |
-
can specify a complete URL (including the "http/https" scheme)
|
364 |
-
to override this behavior. If this value is provided,
|
365 |
-
then ``use_ssl`` is ignored.
|
366 |
-
|
367 |
-
:type aws_access_key_id: string
|
368 |
-
:param aws_access_key_id: The access key to use when creating
|
369 |
-
the client. This is entirely optional, and if not provided,
|
370 |
-
the credentials configured for the session will automatically
|
371 |
-
be used. You only need to provide this argument if you want
|
372 |
-
to override the credentials used for this specific client.
|
373 |
-
|
374 |
-
:type aws_secret_access_key: string
|
375 |
-
:param aws_secret_access_key: The secret key to use when creating
|
376 |
-
the client. Same semantics as aws_access_key_id above.
|
377 |
-
|
378 |
-
:type aws_session_token: string
|
379 |
-
:param aws_session_token: The session token to use when creating
|
380 |
-
the client. Same semantics as aws_access_key_id above.
|
381 |
-
|
382 |
-
:type config: botocore.client.Config
|
383 |
-
:param config: Advanced client configuration options. If region_name
|
384 |
-
is specified in the client config, its value will take precedence
|
385 |
-
over environment variables and configuration values, but not over
|
386 |
-
a region_name value passed explicitly to the method. If
|
387 |
-
user_agent_extra is specified in the client config, it overrides
|
388 |
-
the default user_agent_extra provided by the resource API. See
|
389 |
-
`botocore config documentation
|
390 |
-
<https://botocore.amazonaws.com/v1/documentation/api/latest/reference/config.html>`_
|
391 |
-
for more details.
|
392 |
-
|
393 |
-
:return: Subclass of :py:class:`~boto3.resources.base.ServiceResource`
|
394 |
-
"""
|
395 |
-
try:
|
396 |
-
resource_model = self._loader.load_service_model(
|
397 |
-
service_name, 'resources-1', api_version
|
398 |
-
)
|
399 |
-
except UnknownServiceError:
|
400 |
-
available = self.get_available_resources()
|
401 |
-
has_low_level_client = (
|
402 |
-
service_name in self.get_available_services()
|
403 |
-
)
|
404 |
-
raise ResourceNotExistsError(
|
405 |
-
service_name, available, has_low_level_client
|
406 |
-
)
|
407 |
-
except DataNotFoundError:
|
408 |
-
# This is because we've provided an invalid API version.
|
409 |
-
available_api_versions = self._loader.list_api_versions(
|
410 |
-
service_name, 'resources-1'
|
411 |
-
)
|
412 |
-
raise UnknownAPIVersionError(
|
413 |
-
service_name, api_version, ', '.join(available_api_versions)
|
414 |
-
)
|
415 |
-
|
416 |
-
if api_version is None:
|
417 |
-
# Even though botocore's load_service_model() can handle
|
418 |
-
# using the latest api_version if not provided, we need
|
419 |
-
# to track this api_version in boto3 in order to ensure
|
420 |
-
# we're pairing a resource model with a client model
|
421 |
-
# of the same API version. It's possible for the latest
|
422 |
-
# API version of a resource model in boto3 to not be
|
423 |
-
# the same API version as a service model in botocore.
|
424 |
-
# So we need to look up the api_version if one is not
|
425 |
-
# provided to ensure we load the same API version of the
|
426 |
-
# client.
|
427 |
-
#
|
428 |
-
# Note: This is relying on the fact that
|
429 |
-
# loader.load_service_model(..., api_version=None)
|
430 |
-
# and loader.determine_latest_version(..., 'resources-1')
|
431 |
-
# both load the same api version of the file.
|
432 |
-
api_version = self._loader.determine_latest_version(
|
433 |
-
service_name, 'resources-1'
|
434 |
-
)
|
435 |
-
|
436 |
-
# Creating a new resource instance requires the low-level client
|
437 |
-
# and service model, the resource version and resource JSON data.
|
438 |
-
# We pass these to the factory and get back a class, which is
|
439 |
-
# instantiated on top of the low-level client.
|
440 |
-
if config is not None:
|
441 |
-
if config.user_agent_extra is None:
|
442 |
-
config = copy.deepcopy(config)
|
443 |
-
config.user_agent_extra = 'Resource'
|
444 |
-
else:
|
445 |
-
config = Config(user_agent_extra='Resource')
|
446 |
-
client = self.client(
|
447 |
-
service_name,
|
448 |
-
region_name=region_name,
|
449 |
-
api_version=api_version,
|
450 |
-
use_ssl=use_ssl,
|
451 |
-
verify=verify,
|
452 |
-
endpoint_url=endpoint_url,
|
453 |
-
aws_access_key_id=aws_access_key_id,
|
454 |
-
aws_secret_access_key=aws_secret_access_key,
|
455 |
-
aws_session_token=aws_session_token,
|
456 |
-
config=config,
|
457 |
-
)
|
458 |
-
service_model = client.meta.service_model
|
459 |
-
|
460 |
-
# Create a ServiceContext object to serve as a reference to
|
461 |
-
# important read-only information about the general service.
|
462 |
-
service_context = boto3.utils.ServiceContext(
|
463 |
-
service_name=service_name,
|
464 |
-
service_model=service_model,
|
465 |
-
resource_json_definitions=resource_model['resources'],
|
466 |
-
service_waiter_model=boto3.utils.LazyLoadedWaiterModel(
|
467 |
-
self._session, service_name, api_version
|
468 |
-
),
|
469 |
-
)
|
470 |
-
|
471 |
-
# Create the service resource class.
|
472 |
-
cls = self.resource_factory.load_from_definition(
|
473 |
-
resource_name=service_name,
|
474 |
-
single_resource_json_definition=resource_model['service'],
|
475 |
-
service_context=service_context,
|
476 |
-
)
|
477 |
-
|
478 |
-
return cls(client=client)
|
479 |
-
|
480 |
-
def _register_default_handlers(self):
|
481 |
-
|
482 |
-
# S3 customizations
|
483 |
-
self._session.register(
|
484 |
-
'creating-client-class.s3',
|
485 |
-
boto3.utils.lazy_call(
|
486 |
-
'boto3.s3.inject.inject_s3_transfer_methods'
|
487 |
-
),
|
488 |
-
)
|
489 |
-
self._session.register(
|
490 |
-
'creating-resource-class.s3.Bucket',
|
491 |
-
boto3.utils.lazy_call('boto3.s3.inject.inject_bucket_methods'),
|
492 |
-
)
|
493 |
-
self._session.register(
|
494 |
-
'creating-resource-class.s3.Object',
|
495 |
-
boto3.utils.lazy_call('boto3.s3.inject.inject_object_methods'),
|
496 |
-
)
|
497 |
-
self._session.register(
|
498 |
-
'creating-resource-class.s3.ObjectSummary',
|
499 |
-
boto3.utils.lazy_call(
|
500 |
-
'boto3.s3.inject.inject_object_summary_methods'
|
501 |
-
),
|
502 |
-
)
|
503 |
-
|
504 |
-
# DynamoDb customizations
|
505 |
-
self._session.register(
|
506 |
-
'creating-resource-class.dynamodb',
|
507 |
-
boto3.utils.lazy_call(
|
508 |
-
'boto3.dynamodb.transform.register_high_level_interface'
|
509 |
-
),
|
510 |
-
unique_id='high-level-dynamodb',
|
511 |
-
)
|
512 |
-
self._session.register(
|
513 |
-
'creating-resource-class.dynamodb.Table',
|
514 |
-
boto3.utils.lazy_call(
|
515 |
-
'boto3.dynamodb.table.register_table_methods'
|
516 |
-
),
|
517 |
-
unique_id='high-level-dynamodb-table',
|
518 |
-
)
|
519 |
-
|
520 |
-
# EC2 Customizations
|
521 |
-
self._session.register(
|
522 |
-
'creating-resource-class.ec2.ServiceResource',
|
523 |
-
boto3.utils.lazy_call('boto3.ec2.createtags.inject_create_tags'),
|
524 |
-
)
|
525 |
-
|
526 |
-
self._session.register(
|
527 |
-
'creating-resource-class.ec2.Instance',
|
528 |
-
boto3.utils.lazy_call(
|
529 |
-
'boto3.ec2.deletetags.inject_delete_tags',
|
530 |
-
event_emitter=self.events,
|
531 |
-
),
|
532 |
-
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Big-Web/MMSD/env/Lib/site-packages/pkg_resources/_vendor/pyparsing/results.py
DELETED
@@ -1,760 +0,0 @@
|
|
1 |
-
# results.py
|
2 |
-
from collections.abc import MutableMapping, Mapping, MutableSequence, Iterator
|
3 |
-
import pprint
|
4 |
-
from weakref import ref as wkref
|
5 |
-
from typing import Tuple, Any
|
6 |
-
|
7 |
-
str_type: Tuple[type, ...] = (str, bytes)
|
8 |
-
_generator_type = type((_ for _ in ()))
|
9 |
-
|
10 |
-
|
11 |
-
class _ParseResultsWithOffset:
|
12 |
-
__slots__ = ["tup"]
|
13 |
-
|
14 |
-
def __init__(self, p1, p2):
|
15 |
-
self.tup = (p1, p2)
|
16 |
-
|
17 |
-
def __getitem__(self, i):
|
18 |
-
return self.tup[i]
|
19 |
-
|
20 |
-
def __getstate__(self):
|
21 |
-
return self.tup
|
22 |
-
|
23 |
-
def __setstate__(self, *args):
|
24 |
-
self.tup = args[0]
|
25 |
-
|
26 |
-
|
27 |
-
class ParseResults:
|
28 |
-
"""Structured parse results, to provide multiple means of access to
|
29 |
-
the parsed data:
|
30 |
-
|
31 |
-
- as a list (``len(results)``)
|
32 |
-
- by list index (``results[0], results[1]``, etc.)
|
33 |
-
- by attribute (``results.<results_name>`` - see :class:`ParserElement.set_results_name`)
|
34 |
-
|
35 |
-
Example::
|
36 |
-
|
37 |
-
integer = Word(nums)
|
38 |
-
date_str = (integer.set_results_name("year") + '/'
|
39 |
-
+ integer.set_results_name("month") + '/'
|
40 |
-
+ integer.set_results_name("day"))
|
41 |
-
# equivalent form:
|
42 |
-
# date_str = (integer("year") + '/'
|
43 |
-
# + integer("month") + '/'
|
44 |
-
# + integer("day"))
|
45 |
-
|
46 |
-
# parse_string returns a ParseResults object
|
47 |
-
result = date_str.parse_string("1999/12/31")
|
48 |
-
|
49 |
-
def test(s, fn=repr):
|
50 |
-
print("{} -> {}".format(s, fn(eval(s))))
|
51 |
-
test("list(result)")
|
52 |
-
test("result[0]")
|
53 |
-
test("result['month']")
|
54 |
-
test("result.day")
|
55 |
-
test("'month' in result")
|
56 |
-
test("'minutes' in result")
|
57 |
-
test("result.dump()", str)
|
58 |
-
|
59 |
-
prints::
|
60 |
-
|
61 |
-
list(result) -> ['1999', '/', '12', '/', '31']
|
62 |
-
result[0] -> '1999'
|
63 |
-
result['month'] -> '12'
|
64 |
-
result.day -> '31'
|
65 |
-
'month' in result -> True
|
66 |
-
'minutes' in result -> False
|
67 |
-
result.dump() -> ['1999', '/', '12', '/', '31']
|
68 |
-
- day: '31'
|
69 |
-
- month: '12'
|
70 |
-
- year: '1999'
|
71 |
-
"""
|
72 |
-
|
73 |
-
_null_values: Tuple[Any, ...] = (None, [], "", ())
|
74 |
-
|
75 |
-
__slots__ = [
|
76 |
-
"_name",
|
77 |
-
"_parent",
|
78 |
-
"_all_names",
|
79 |
-
"_modal",
|
80 |
-
"_toklist",
|
81 |
-
"_tokdict",
|
82 |
-
"__weakref__",
|
83 |
-
]
|
84 |
-
|
85 |
-
class List(list):
|
86 |
-
"""
|
87 |
-
Simple wrapper class to distinguish parsed list results that should be preserved
|
88 |
-
as actual Python lists, instead of being converted to :class:`ParseResults`:
|
89 |
-
|
90 |
-
LBRACK, RBRACK = map(pp.Suppress, "[]")
|
91 |
-
element = pp.Forward()
|
92 |
-
item = ppc.integer
|
93 |
-
element_list = LBRACK + pp.delimited_list(element) + RBRACK
|
94 |
-
|
95 |
-
# add parse actions to convert from ParseResults to actual Python collection types
|
96 |
-
def as_python_list(t):
|
97 |
-
return pp.ParseResults.List(t.as_list())
|
98 |
-
element_list.add_parse_action(as_python_list)
|
99 |
-
|
100 |
-
element <<= item | element_list
|
101 |
-
|
102 |
-
element.run_tests('''
|
103 |
-
100
|
104 |
-
[2,3,4]
|
105 |
-
[[2, 1],3,4]
|
106 |
-
[(2, 1),3,4]
|
107 |
-
(2,3,4)
|
108 |
-
''', post_parse=lambda s, r: (r[0], type(r[0])))
|
109 |
-
|
110 |
-
prints:
|
111 |
-
|
112 |
-
100
|
113 |
-
(100, <class 'int'>)
|
114 |
-
|
115 |
-
[2,3,4]
|
116 |
-
([2, 3, 4], <class 'list'>)
|
117 |
-
|
118 |
-
[[2, 1],3,4]
|
119 |
-
([[2, 1], 3, 4], <class 'list'>)
|
120 |
-
|
121 |
-
(Used internally by :class:`Group` when `aslist=True`.)
|
122 |
-
"""
|
123 |
-
|
124 |
-
def __new__(cls, contained=None):
|
125 |
-
if contained is None:
|
126 |
-
contained = []
|
127 |
-
|
128 |
-
if not isinstance(contained, list):
|
129 |
-
raise TypeError(
|
130 |
-
"{} may only be constructed with a list,"
|
131 |
-
" not {}".format(cls.__name__, type(contained).__name__)
|
132 |
-
)
|
133 |
-
|
134 |
-
return list.__new__(cls)
|
135 |
-
|
136 |
-
def __new__(cls, toklist=None, name=None, **kwargs):
|
137 |
-
if isinstance(toklist, ParseResults):
|
138 |
-
return toklist
|
139 |
-
self = object.__new__(cls)
|
140 |
-
self._name = None
|
141 |
-
self._parent = None
|
142 |
-
self._all_names = set()
|
143 |
-
|
144 |
-
if toklist is None:
|
145 |
-
self._toklist = []
|
146 |
-
elif isinstance(toklist, (list, _generator_type)):
|
147 |
-
self._toklist = (
|
148 |
-
[toklist[:]]
|
149 |
-
if isinstance(toklist, ParseResults.List)
|
150 |
-
else list(toklist)
|
151 |
-
)
|
152 |
-
else:
|
153 |
-
self._toklist = [toklist]
|
154 |
-
self._tokdict = dict()
|
155 |
-
return self
|
156 |
-
|
157 |
-
# Performance tuning: we construct a *lot* of these, so keep this
|
158 |
-
# constructor as small and fast as possible
|
159 |
-
def __init__(
|
160 |
-
self, toklist=None, name=None, asList=True, modal=True, isinstance=isinstance
|
161 |
-
):
|
162 |
-
self._modal = modal
|
163 |
-
if name is not None and name != "":
|
164 |
-
if isinstance(name, int):
|
165 |
-
name = str(name)
|
166 |
-
if not modal:
|
167 |
-
self._all_names = {name}
|
168 |
-
self._name = name
|
169 |
-
if toklist not in self._null_values:
|
170 |
-
if isinstance(toklist, (str_type, type)):
|
171 |
-
toklist = [toklist]
|
172 |
-
if asList:
|
173 |
-
if isinstance(toklist, ParseResults):
|
174 |
-
self[name] = _ParseResultsWithOffset(
|
175 |
-
ParseResults(toklist._toklist), 0
|
176 |
-
)
|
177 |
-
else:
|
178 |
-
self[name] = _ParseResultsWithOffset(
|
179 |
-
ParseResults(toklist[0]), 0
|
180 |
-
)
|
181 |
-
self[name]._name = name
|
182 |
-
else:
|
183 |
-
try:
|
184 |
-
self[name] = toklist[0]
|
185 |
-
except (KeyError, TypeError, IndexError):
|
186 |
-
if toklist is not self:
|
187 |
-
self[name] = toklist
|
188 |
-
else:
|
189 |
-
self._name = name
|
190 |
-
|
191 |
-
def __getitem__(self, i):
|
192 |
-
if isinstance(i, (int, slice)):
|
193 |
-
return self._toklist[i]
|
194 |
-
else:
|
195 |
-
if i not in self._all_names:
|
196 |
-
return self._tokdict[i][-1][0]
|
197 |
-
else:
|
198 |
-
return ParseResults([v[0] for v in self._tokdict[i]])
|
199 |
-
|
200 |
-
def __setitem__(self, k, v, isinstance=isinstance):
|
201 |
-
if isinstance(v, _ParseResultsWithOffset):
|
202 |
-
self._tokdict[k] = self._tokdict.get(k, list()) + [v]
|
203 |
-
sub = v[0]
|
204 |
-
elif isinstance(k, (int, slice)):
|
205 |
-
self._toklist[k] = v
|
206 |
-
sub = v
|
207 |
-
else:
|
208 |
-
self._tokdict[k] = self._tokdict.get(k, list()) + [
|
209 |
-
_ParseResultsWithOffset(v, 0)
|
210 |
-
]
|
211 |
-
sub = v
|
212 |
-
if isinstance(sub, ParseResults):
|
213 |
-
sub._parent = wkref(self)
|
214 |
-
|
215 |
-
def __delitem__(self, i):
|
216 |
-
if isinstance(i, (int, slice)):
|
217 |
-
mylen = len(self._toklist)
|
218 |
-
del self._toklist[i]
|
219 |
-
|
220 |
-
# convert int to slice
|
221 |
-
if isinstance(i, int):
|
222 |
-
if i < 0:
|
223 |
-
i += mylen
|
224 |
-
i = slice(i, i + 1)
|
225 |
-
# get removed indices
|
226 |
-
removed = list(range(*i.indices(mylen)))
|
227 |
-
removed.reverse()
|
228 |
-
# fixup indices in token dictionary
|
229 |
-
for name, occurrences in self._tokdict.items():
|
230 |
-
for j in removed:
|
231 |
-
for k, (value, position) in enumerate(occurrences):
|
232 |
-
occurrences[k] = _ParseResultsWithOffset(
|
233 |
-
value, position - (position > j)
|
234 |
-
)
|
235 |
-
else:
|
236 |
-
del self._tokdict[i]
|
237 |
-
|
238 |
-
def __contains__(self, k) -> bool:
|
239 |
-
return k in self._tokdict
|
240 |
-
|
241 |
-
def __len__(self) -> int:
|
242 |
-
return len(self._toklist)
|
243 |
-
|
244 |
-
def __bool__(self) -> bool:
|
245 |
-
return not not (self._toklist or self._tokdict)
|
246 |
-
|
247 |
-
def __iter__(self) -> Iterator:
|
248 |
-
return iter(self._toklist)
|
249 |
-
|
250 |
-
def __reversed__(self) -> Iterator:
|
251 |
-
return iter(self._toklist[::-1])
|
252 |
-
|
253 |
-
def keys(self):
|
254 |
-
return iter(self._tokdict)
|
255 |
-
|
256 |
-
def values(self):
|
257 |
-
return (self[k] for k in self.keys())
|
258 |
-
|
259 |
-
def items(self):
|
260 |
-
return ((k, self[k]) for k in self.keys())
|
261 |
-
|
262 |
-
def haskeys(self) -> bool:
|
263 |
-
"""
|
264 |
-
Since ``keys()`` returns an iterator, this method is helpful in bypassing
|
265 |
-
code that looks for the existence of any defined results names."""
|
266 |
-
return bool(self._tokdict)
|
267 |
-
|
268 |
-
def pop(self, *args, **kwargs):
|
269 |
-
"""
|
270 |
-
Removes and returns item at specified index (default= ``last``).
|
271 |
-
Supports both ``list`` and ``dict`` semantics for ``pop()``. If
|
272 |
-
passed no argument or an integer argument, it will use ``list``
|
273 |
-
semantics and pop tokens from the list of parsed tokens. If passed
|
274 |
-
a non-integer argument (most likely a string), it will use ``dict``
|
275 |
-
semantics and pop the corresponding value from any defined results
|
276 |
-
names. A second default return value argument is supported, just as in
|
277 |
-
``dict.pop()``.
|
278 |
-
|
279 |
-
Example::
|
280 |
-
|
281 |
-
numlist = Word(nums)[...]
|
282 |
-
print(numlist.parse_string("0 123 321")) # -> ['0', '123', '321']
|
283 |
-
|
284 |
-
def remove_first(tokens):
|
285 |
-
tokens.pop(0)
|
286 |
-
numlist.add_parse_action(remove_first)
|
287 |
-
print(numlist.parse_string("0 123 321")) # -> ['123', '321']
|
288 |
-
|
289 |
-
label = Word(alphas)
|
290 |
-
patt = label("LABEL") + Word(nums)[1, ...]
|
291 |
-
print(patt.parse_string("AAB 123 321").dump())
|
292 |
-
|
293 |
-
# Use pop() in a parse action to remove named result (note that corresponding value is not
|
294 |
-
# removed from list form of results)
|
295 |
-
def remove_LABEL(tokens):
|
296 |
-
tokens.pop("LABEL")
|
297 |
-
return tokens
|
298 |
-
patt.add_parse_action(remove_LABEL)
|
299 |
-
print(patt.parse_string("AAB 123 321").dump())
|
300 |
-
|
301 |
-
prints::
|
302 |
-
|
303 |
-
['AAB', '123', '321']
|
304 |
-
- LABEL: 'AAB'
|
305 |
-
|
306 |
-
['AAB', '123', '321']
|
307 |
-
"""
|
308 |
-
if not args:
|
309 |
-
args = [-1]
|
310 |
-
for k, v in kwargs.items():
|
311 |
-
if k == "default":
|
312 |
-
args = (args[0], v)
|
313 |
-
else:
|
314 |
-
raise TypeError(
|
315 |
-
"pop() got an unexpected keyword argument {!r}".format(k)
|
316 |
-
)
|
317 |
-
if isinstance(args[0], int) or len(args) == 1 or args[0] in self:
|
318 |
-
index = args[0]
|
319 |
-
ret = self[index]
|
320 |
-
del self[index]
|
321 |
-
return ret
|
322 |
-
else:
|
323 |
-
defaultvalue = args[1]
|
324 |
-
return defaultvalue
|
325 |
-
|
326 |
-
def get(self, key, default_value=None):
|
327 |
-
"""
|
328 |
-
Returns named result matching the given key, or if there is no
|
329 |
-
such name, then returns the given ``default_value`` or ``None`` if no
|
330 |
-
``default_value`` is specified.
|
331 |
-
|
332 |
-
Similar to ``dict.get()``.
|
333 |
-
|
334 |
-
Example::
|
335 |
-
|
336 |
-
integer = Word(nums)
|
337 |
-
date_str = integer("year") + '/' + integer("month") + '/' + integer("day")
|
338 |
-
|
339 |
-
result = date_str.parse_string("1999/12/31")
|
340 |
-
print(result.get("year")) # -> '1999'
|
341 |
-
print(result.get("hour", "not specified")) # -> 'not specified'
|
342 |
-
print(result.get("hour")) # -> None
|
343 |
-
"""
|
344 |
-
if key in self:
|
345 |
-
return self[key]
|
346 |
-
else:
|
347 |
-
return default_value
|
348 |
-
|
349 |
-
def insert(self, index, ins_string):
|
350 |
-
"""
|
351 |
-
Inserts new element at location index in the list of parsed tokens.
|
352 |
-
|
353 |
-
Similar to ``list.insert()``.
|
354 |
-
|
355 |
-
Example::
|
356 |
-
|
357 |
-
numlist = Word(nums)[...]
|
358 |
-
print(numlist.parse_string("0 123 321")) # -> ['0', '123', '321']
|
359 |
-
|
360 |
-
# use a parse action to insert the parse location in the front of the parsed results
|
361 |
-
def insert_locn(locn, tokens):
|
362 |
-
tokens.insert(0, locn)
|
363 |
-
numlist.add_parse_action(insert_locn)
|
364 |
-
print(numlist.parse_string("0 123 321")) # -> [0, '0', '123', '321']
|
365 |
-
"""
|
366 |
-
self._toklist.insert(index, ins_string)
|
367 |
-
# fixup indices in token dictionary
|
368 |
-
for name, occurrences in self._tokdict.items():
|
369 |
-
for k, (value, position) in enumerate(occurrences):
|
370 |
-
occurrences[k] = _ParseResultsWithOffset(
|
371 |
-
value, position + (position > index)
|
372 |
-
)
|
373 |
-
|
374 |
-
def append(self, item):
|
375 |
-
"""
|
376 |
-
Add single element to end of ``ParseResults`` list of elements.
|
377 |
-
|
378 |
-
Example::
|
379 |
-
|
380 |
-
numlist = Word(nums)[...]
|
381 |
-
print(numlist.parse_string("0 123 321")) # -> ['0', '123', '321']
|
382 |
-
|
383 |
-
# use a parse action to compute the sum of the parsed integers, and add it to the end
|
384 |
-
def append_sum(tokens):
|
385 |
-
tokens.append(sum(map(int, tokens)))
|
386 |
-
numlist.add_parse_action(append_sum)
|
387 |
-
print(numlist.parse_string("0 123 321")) # -> ['0', '123', '321', 444]
|
388 |
-
"""
|
389 |
-
self._toklist.append(item)
|
390 |
-
|
391 |
-
def extend(self, itemseq):
|
392 |
-
"""
|
393 |
-
Add sequence of elements to end of ``ParseResults`` list of elements.
|
394 |
-
|
395 |
-
Example::
|
396 |
-
|
397 |
-
patt = Word(alphas)[1, ...]
|
398 |
-
|
399 |
-
# use a parse action to append the reverse of the matched strings, to make a palindrome
|
400 |
-
def make_palindrome(tokens):
|
401 |
-
tokens.extend(reversed([t[::-1] for t in tokens]))
|
402 |
-
return ''.join(tokens)
|
403 |
-
patt.add_parse_action(make_palindrome)
|
404 |
-
print(patt.parse_string("lskdj sdlkjf lksd")) # -> 'lskdjsdlkjflksddsklfjkldsjdksl'
|
405 |
-
"""
|
406 |
-
if isinstance(itemseq, ParseResults):
|
407 |
-
self.__iadd__(itemseq)
|
408 |
-
else:
|
409 |
-
self._toklist.extend(itemseq)
|
410 |
-
|
411 |
-
def clear(self):
|
412 |
-
"""
|
413 |
-
Clear all elements and results names.
|
414 |
-
"""
|
415 |
-
del self._toklist[:]
|
416 |
-
self._tokdict.clear()
|
417 |
-
|
418 |
-
def __getattr__(self, name):
|
419 |
-
try:
|
420 |
-
return self[name]
|
421 |
-
except KeyError:
|
422 |
-
if name.startswith("__"):
|
423 |
-
raise AttributeError(name)
|
424 |
-
return ""
|
425 |
-
|
426 |
-
def __add__(self, other) -> "ParseResults":
|
427 |
-
ret = self.copy()
|
428 |
-
ret += other
|
429 |
-
return ret
|
430 |
-
|
431 |
-
def __iadd__(self, other) -> "ParseResults":
|
432 |
-
if other._tokdict:
|
433 |
-
offset = len(self._toklist)
|
434 |
-
addoffset = lambda a: offset if a < 0 else a + offset
|
435 |
-
otheritems = other._tokdict.items()
|
436 |
-
otherdictitems = [
|
437 |
-
(k, _ParseResultsWithOffset(v[0], addoffset(v[1])))
|
438 |
-
for k, vlist in otheritems
|
439 |
-
for v in vlist
|
440 |
-
]
|
441 |
-
for k, v in otherdictitems:
|
442 |
-
self[k] = v
|
443 |
-
if isinstance(v[0], ParseResults):
|
444 |
-
v[0]._parent = wkref(self)
|
445 |
-
|
446 |
-
self._toklist += other._toklist
|
447 |
-
self._all_names |= other._all_names
|
448 |
-
return self
|
449 |
-
|
450 |
-
def __radd__(self, other) -> "ParseResults":
|
451 |
-
if isinstance(other, int) and other == 0:
|
452 |
-
# useful for merging many ParseResults using sum() builtin
|
453 |
-
return self.copy()
|
454 |
-
else:
|
455 |
-
# this may raise a TypeError - so be it
|
456 |
-
return other + self
|
457 |
-
|
458 |
-
def __repr__(self) -> str:
|
459 |
-
return "{}({!r}, {})".format(type(self).__name__, self._toklist, self.as_dict())
|
460 |
-
|
461 |
-
def __str__(self) -> str:
|
462 |
-
return (
|
463 |
-
"["
|
464 |
-
+ ", ".join(
|
465 |
-
[
|
466 |
-
str(i) if isinstance(i, ParseResults) else repr(i)
|
467 |
-
for i in self._toklist
|
468 |
-
]
|
469 |
-
)
|
470 |
-
+ "]"
|
471 |
-
)
|
472 |
-
|
473 |
-
def _asStringList(self, sep=""):
|
474 |
-
out = []
|
475 |
-
for item in self._toklist:
|
476 |
-
if out and sep:
|
477 |
-
out.append(sep)
|
478 |
-
if isinstance(item, ParseResults):
|
479 |
-
out += item._asStringList()
|
480 |
-
else:
|
481 |
-
out.append(str(item))
|
482 |
-
return out
|
483 |
-
|
484 |
-
def as_list(self) -> list:
|
485 |
-
"""
|
486 |
-
Returns the parse results as a nested list of matching tokens, all converted to strings.
|
487 |
-
|
488 |
-
Example::
|
489 |
-
|
490 |
-
patt = Word(alphas)[1, ...]
|
491 |
-
result = patt.parse_string("sldkj lsdkj sldkj")
|
492 |
-
# even though the result prints in string-like form, it is actually a pyparsing ParseResults
|
493 |
-
print(type(result), result) # -> <class 'pyparsing.ParseResults'> ['sldkj', 'lsdkj', 'sldkj']
|
494 |
-
|
495 |
-
# Use as_list() to create an actual list
|
496 |
-
result_list = result.as_list()
|
497 |
-
print(type(result_list), result_list) # -> <class 'list'> ['sldkj', 'lsdkj', 'sldkj']
|
498 |
-
"""
|
499 |
-
return [
|
500 |
-
res.as_list() if isinstance(res, ParseResults) else res
|
501 |
-
for res in self._toklist
|
502 |
-
]
|
503 |
-
|
504 |
-
def as_dict(self) -> dict:
|
505 |
-
"""
|
506 |
-
Returns the named parse results as a nested dictionary.
|
507 |
-
|
508 |
-
Example::
|
509 |
-
|
510 |
-
integer = Word(nums)
|
511 |
-
date_str = integer("year") + '/' + integer("month") + '/' + integer("day")
|
512 |
-
|
513 |
-
result = date_str.parse_string('12/31/1999')
|
514 |
-
print(type(result), repr(result)) # -> <class 'pyparsing.ParseResults'> (['12', '/', '31', '/', '1999'], {'day': [('1999', 4)], 'year': [('12', 0)], 'month': [('31', 2)]})
|
515 |
-
|
516 |
-
result_dict = result.as_dict()
|
517 |
-
print(type(result_dict), repr(result_dict)) # -> <class 'dict'> {'day': '1999', 'year': '12', 'month': '31'}
|
518 |
-
|
519 |
-
# even though a ParseResults supports dict-like access, sometime you just need to have a dict
|
520 |
-
import json
|
521 |
-
print(json.dumps(result)) # -> Exception: TypeError: ... is not JSON serializable
|
522 |
-
print(json.dumps(result.as_dict())) # -> {"month": "31", "day": "1999", "year": "12"}
|
523 |
-
"""
|
524 |
-
|
525 |
-
def to_item(obj):
|
526 |
-
if isinstance(obj, ParseResults):
|
527 |
-
return obj.as_dict() if obj.haskeys() else [to_item(v) for v in obj]
|
528 |
-
else:
|
529 |
-
return obj
|
530 |
-
|
531 |
-
return dict((k, to_item(v)) for k, v in self.items())
|
532 |
-
|
533 |
-
def copy(self) -> "ParseResults":
|
534 |
-
"""
|
535 |
-
Returns a new copy of a :class:`ParseResults` object.
|
536 |
-
"""
|
537 |
-
ret = ParseResults(self._toklist)
|
538 |
-
ret._tokdict = self._tokdict.copy()
|
539 |
-
ret._parent = self._parent
|
540 |
-
ret._all_names |= self._all_names
|
541 |
-
ret._name = self._name
|
542 |
-
return ret
|
543 |
-
|
544 |
-
def get_name(self):
|
545 |
-
r"""
|
546 |
-
Returns the results name for this token expression. Useful when several
|
547 |
-
different expressions might match at a particular location.
|
548 |
-
|
549 |
-
Example::
|
550 |
-
|
551 |
-
integer = Word(nums)
|
552 |
-
ssn_expr = Regex(r"\d\d\d-\d\d-\d\d\d\d")
|
553 |
-
house_number_expr = Suppress('#') + Word(nums, alphanums)
|
554 |
-
user_data = (Group(house_number_expr)("house_number")
|
555 |
-
| Group(ssn_expr)("ssn")
|
556 |
-
| Group(integer)("age"))
|
557 |
-
user_info = user_data[1, ...]
|
558 |
-
|
559 |
-
result = user_info.parse_string("22 111-22-3333 #221B")
|
560 |
-
for item in result:
|
561 |
-
print(item.get_name(), ':', item[0])
|
562 |
-
|
563 |
-
prints::
|
564 |
-
|
565 |
-
age : 22
|
566 |
-
ssn : 111-22-3333
|
567 |
-
house_number : 221B
|
568 |
-
"""
|
569 |
-
if self._name:
|
570 |
-
return self._name
|
571 |
-
elif self._parent:
|
572 |
-
par = self._parent()
|
573 |
-
|
574 |
-
def find_in_parent(sub):
|
575 |
-
return next(
|
576 |
-
(
|
577 |
-
k
|
578 |
-
for k, vlist in par._tokdict.items()
|
579 |
-
for v, loc in vlist
|
580 |
-
if sub is v
|
581 |
-
),
|
582 |
-
None,
|
583 |
-
)
|
584 |
-
|
585 |
-
return find_in_parent(self) if par else None
|
586 |
-
elif (
|
587 |
-
len(self) == 1
|
588 |
-
and len(self._tokdict) == 1
|
589 |
-
and next(iter(self._tokdict.values()))[0][1] in (0, -1)
|
590 |
-
):
|
591 |
-
return next(iter(self._tokdict.keys()))
|
592 |
-
else:
|
593 |
-
return None
|
594 |
-
|
595 |
-
def dump(self, indent="", full=True, include_list=True, _depth=0) -> str:
|
596 |
-
"""
|
597 |
-
Diagnostic method for listing out the contents of
|
598 |
-
a :class:`ParseResults`. Accepts an optional ``indent`` argument so
|
599 |
-
that this string can be embedded in a nested display of other data.
|
600 |
-
|
601 |
-
Example::
|
602 |
-
|
603 |
-
integer = Word(nums)
|
604 |
-
date_str = integer("year") + '/' + integer("month") + '/' + integer("day")
|
605 |
-
|
606 |
-
result = date_str.parse_string('1999/12/31')
|
607 |
-
print(result.dump())
|
608 |
-
|
609 |
-
prints::
|
610 |
-
|
611 |
-
['1999', '/', '12', '/', '31']
|
612 |
-
- day: '31'
|
613 |
-
- month: '12'
|
614 |
-
- year: '1999'
|
615 |
-
"""
|
616 |
-
out = []
|
617 |
-
NL = "\n"
|
618 |
-
out.append(indent + str(self.as_list()) if include_list else "")
|
619 |
-
|
620 |
-
if full:
|
621 |
-
if self.haskeys():
|
622 |
-
items = sorted((str(k), v) for k, v in self.items())
|
623 |
-
for k, v in items:
|
624 |
-
if out:
|
625 |
-
out.append(NL)
|
626 |
-
out.append("{}{}- {}: ".format(indent, (" " * _depth), k))
|
627 |
-
if isinstance(v, ParseResults):
|
628 |
-
if v:
|
629 |
-
out.append(
|
630 |
-
v.dump(
|
631 |
-
indent=indent,
|
632 |
-
full=full,
|
633 |
-
include_list=include_list,
|
634 |
-
_depth=_depth + 1,
|
635 |
-
)
|
636 |
-
)
|
637 |
-
else:
|
638 |
-
out.append(str(v))
|
639 |
-
else:
|
640 |
-
out.append(repr(v))
|
641 |
-
if any(isinstance(vv, ParseResults) for vv in self):
|
642 |
-
v = self
|
643 |
-
for i, vv in enumerate(v):
|
644 |
-
if isinstance(vv, ParseResults):
|
645 |
-
out.append(
|
646 |
-
"\n{}{}[{}]:\n{}{}{}".format(
|
647 |
-
indent,
|
648 |
-
(" " * (_depth)),
|
649 |
-
i,
|
650 |
-
indent,
|
651 |
-
(" " * (_depth + 1)),
|
652 |
-
vv.dump(
|
653 |
-
indent=indent,
|
654 |
-
full=full,
|
655 |
-
include_list=include_list,
|
656 |
-
_depth=_depth + 1,
|
657 |
-
),
|
658 |
-
)
|
659 |
-
)
|
660 |
-
else:
|
661 |
-
out.append(
|
662 |
-
"\n%s%s[%d]:\n%s%s%s"
|
663 |
-
% (
|
664 |
-
indent,
|
665 |
-
(" " * (_depth)),
|
666 |
-
i,
|
667 |
-
indent,
|
668 |
-
(" " * (_depth + 1)),
|
669 |
-
str(vv),
|
670 |
-
)
|
671 |
-
)
|
672 |
-
|
673 |
-
return "".join(out)
|
674 |
-
|
675 |
-
def pprint(self, *args, **kwargs):
|
676 |
-
"""
|
677 |
-
Pretty-printer for parsed results as a list, using the
|
678 |
-
`pprint <https://docs.python.org/3/library/pprint.html>`_ module.
|
679 |
-
Accepts additional positional or keyword args as defined for
|
680 |
-
`pprint.pprint <https://docs.python.org/3/library/pprint.html#pprint.pprint>`_ .
|
681 |
-
|
682 |
-
Example::
|
683 |
-
|
684 |
-
ident = Word(alphas, alphanums)
|
685 |
-
num = Word(nums)
|
686 |
-
func = Forward()
|
687 |
-
term = ident | num | Group('(' + func + ')')
|
688 |
-
func <<= ident + Group(Optional(delimited_list(term)))
|
689 |
-
result = func.parse_string("fna a,b,(fnb c,d,200),100")
|
690 |
-
result.pprint(width=40)
|
691 |
-
|
692 |
-
prints::
|
693 |
-
|
694 |
-
['fna',
|
695 |
-
['a',
|
696 |
-
'b',
|
697 |
-
['(', 'fnb', ['c', 'd', '200'], ')'],
|
698 |
-
'100']]
|
699 |
-
"""
|
700 |
-
pprint.pprint(self.as_list(), *args, **kwargs)
|
701 |
-
|
702 |
-
# add support for pickle protocol
|
703 |
-
def __getstate__(self):
|
704 |
-
return (
|
705 |
-
self._toklist,
|
706 |
-
(
|
707 |
-
self._tokdict.copy(),
|
708 |
-
self._parent is not None and self._parent() or None,
|
709 |
-
self._all_names,
|
710 |
-
self._name,
|
711 |
-
),
|
712 |
-
)
|
713 |
-
|
714 |
-
def __setstate__(self, state):
|
715 |
-
self._toklist, (self._tokdict, par, inAccumNames, self._name) = state
|
716 |
-
self._all_names = set(inAccumNames)
|
717 |
-
if par is not None:
|
718 |
-
self._parent = wkref(par)
|
719 |
-
else:
|
720 |
-
self._parent = None
|
721 |
-
|
722 |
-
def __getnewargs__(self):
|
723 |
-
return self._toklist, self._name
|
724 |
-
|
725 |
-
def __dir__(self):
|
726 |
-
return dir(type(self)) + list(self.keys())
|
727 |
-
|
728 |
-
@classmethod
|
729 |
-
def from_dict(cls, other, name=None) -> "ParseResults":
|
730 |
-
"""
|
731 |
-
Helper classmethod to construct a ``ParseResults`` from a ``dict``, preserving the
|
732 |
-
name-value relations as results names. If an optional ``name`` argument is
|
733 |
-
given, a nested ``ParseResults`` will be returned.
|
734 |
-
"""
|
735 |
-
|
736 |
-
def is_iterable(obj):
|
737 |
-
try:
|
738 |
-
iter(obj)
|
739 |
-
except Exception:
|
740 |
-
return False
|
741 |
-
else:
|
742 |
-
return not isinstance(obj, str_type)
|
743 |
-
|
744 |
-
ret = cls([])
|
745 |
-
for k, v in other.items():
|
746 |
-
if isinstance(v, Mapping):
|
747 |
-
ret += cls.from_dict(v, name=k)
|
748 |
-
else:
|
749 |
-
ret += cls([v], name=k, asList=is_iterable(v))
|
750 |
-
if name is not None:
|
751 |
-
ret = cls([ret], name=name)
|
752 |
-
return ret
|
753 |
-
|
754 |
-
asList = as_list
|
755 |
-
asDict = as_dict
|
756 |
-
getName = get_name
|
757 |
-
|
758 |
-
|
759 |
-
MutableMapping.register(ParseResults)
|
760 |
-
MutableSequence.register(ParseResults)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Big-Web/MMSD/env/Lib/site-packages/setuptools/_imp.py
DELETED
@@ -1,82 +0,0 @@
|
|
1 |
-
"""
|
2 |
-
Re-implementation of find_module and get_frozen_object
|
3 |
-
from the deprecated imp module.
|
4 |
-
"""
|
5 |
-
|
6 |
-
import os
|
7 |
-
import importlib.util
|
8 |
-
import importlib.machinery
|
9 |
-
|
10 |
-
from .py34compat import module_from_spec
|
11 |
-
|
12 |
-
|
13 |
-
PY_SOURCE = 1
|
14 |
-
PY_COMPILED = 2
|
15 |
-
C_EXTENSION = 3
|
16 |
-
C_BUILTIN = 6
|
17 |
-
PY_FROZEN = 7
|
18 |
-
|
19 |
-
|
20 |
-
def find_spec(module, paths):
|
21 |
-
finder = (
|
22 |
-
importlib.machinery.PathFinder().find_spec
|
23 |
-
if isinstance(paths, list) else
|
24 |
-
importlib.util.find_spec
|
25 |
-
)
|
26 |
-
return finder(module, paths)
|
27 |
-
|
28 |
-
|
29 |
-
def find_module(module, paths=None):
|
30 |
-
"""Just like 'imp.find_module()', but with package support"""
|
31 |
-
spec = find_spec(module, paths)
|
32 |
-
if spec is None:
|
33 |
-
raise ImportError("Can't find %s" % module)
|
34 |
-
if not spec.has_location and hasattr(spec, 'submodule_search_locations'):
|
35 |
-
spec = importlib.util.spec_from_loader('__init__.py', spec.loader)
|
36 |
-
|
37 |
-
kind = -1
|
38 |
-
file = None
|
39 |
-
static = isinstance(spec.loader, type)
|
40 |
-
if spec.origin == 'frozen' or static and issubclass(
|
41 |
-
spec.loader, importlib.machinery.FrozenImporter):
|
42 |
-
kind = PY_FROZEN
|
43 |
-
path = None # imp compabilty
|
44 |
-
suffix = mode = '' # imp compatibility
|
45 |
-
elif spec.origin == 'built-in' or static and issubclass(
|
46 |
-
spec.loader, importlib.machinery.BuiltinImporter):
|
47 |
-
kind = C_BUILTIN
|
48 |
-
path = None # imp compabilty
|
49 |
-
suffix = mode = '' # imp compatibility
|
50 |
-
elif spec.has_location:
|
51 |
-
path = spec.origin
|
52 |
-
suffix = os.path.splitext(path)[1]
|
53 |
-
mode = 'r' if suffix in importlib.machinery.SOURCE_SUFFIXES else 'rb'
|
54 |
-
|
55 |
-
if suffix in importlib.machinery.SOURCE_SUFFIXES:
|
56 |
-
kind = PY_SOURCE
|
57 |
-
elif suffix in importlib.machinery.BYTECODE_SUFFIXES:
|
58 |
-
kind = PY_COMPILED
|
59 |
-
elif suffix in importlib.machinery.EXTENSION_SUFFIXES:
|
60 |
-
kind = C_EXTENSION
|
61 |
-
|
62 |
-
if kind in {PY_SOURCE, PY_COMPILED}:
|
63 |
-
file = open(path, mode)
|
64 |
-
else:
|
65 |
-
path = None
|
66 |
-
suffix = mode = ''
|
67 |
-
|
68 |
-
return file, path, (suffix, mode, kind)
|
69 |
-
|
70 |
-
|
71 |
-
def get_frozen_object(module, paths=None):
|
72 |
-
spec = find_spec(module, paths)
|
73 |
-
if not spec:
|
74 |
-
raise ImportError("Can't find %s" % module)
|
75 |
-
return spec.loader.get_code(module)
|
76 |
-
|
77 |
-
|
78 |
-
def get_module(module, paths, info):
|
79 |
-
spec = find_spec(module, paths)
|
80 |
-
if not spec:
|
81 |
-
raise ImportError("Can't find %s" % module)
|
82 |
-
return module_from_spec(spec)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/CVPR/LIVE/pybind11/tests/test_numpy_vectorize.py
DELETED
@@ -1,194 +0,0 @@
|
|
1 |
-
# -*- coding: utf-8 -*-
|
2 |
-
import pytest
|
3 |
-
from pybind11_tests import numpy_vectorize as m
|
4 |
-
|
5 |
-
np = pytest.importorskip("numpy")
|
6 |
-
|
7 |
-
|
8 |
-
def test_vectorize(capture):
|
9 |
-
assert np.isclose(m.vectorized_func3(np.array(3 + 7j)), [6 + 14j])
|
10 |
-
|
11 |
-
for f in [m.vectorized_func, m.vectorized_func2]:
|
12 |
-
with capture:
|
13 |
-
assert np.isclose(f(1, 2, 3), 6)
|
14 |
-
assert capture == "my_func(x:int=1, y:float=2, z:float=3)"
|
15 |
-
with capture:
|
16 |
-
assert np.isclose(f(np.array(1), np.array(2), 3), 6)
|
17 |
-
assert capture == "my_func(x:int=1, y:float=2, z:float=3)"
|
18 |
-
with capture:
|
19 |
-
assert np.allclose(f(np.array([1, 3]), np.array([2, 4]), 3), [6, 36])
|
20 |
-
assert capture == """
|
21 |
-
my_func(x:int=1, y:float=2, z:float=3)
|
22 |
-
my_func(x:int=3, y:float=4, z:float=3)
|
23 |
-
"""
|
24 |
-
with capture:
|
25 |
-
a = np.array([[1, 2], [3, 4]], order='F')
|
26 |
-
b = np.array([[10, 20], [30, 40]], order='F')
|
27 |
-
c = 3
|
28 |
-
result = f(a, b, c)
|
29 |
-
assert np.allclose(result, a * b * c)
|
30 |
-
assert result.flags.f_contiguous
|
31 |
-
# All inputs are F order and full or singletons, so we the result is in col-major order:
|
32 |
-
assert capture == """
|
33 |
-
my_func(x:int=1, y:float=10, z:float=3)
|
34 |
-
my_func(x:int=3, y:float=30, z:float=3)
|
35 |
-
my_func(x:int=2, y:float=20, z:float=3)
|
36 |
-
my_func(x:int=4, y:float=40, z:float=3)
|
37 |
-
"""
|
38 |
-
with capture:
|
39 |
-
a, b, c = np.array([[1, 3, 5], [7, 9, 11]]), np.array([[2, 4, 6], [8, 10, 12]]), 3
|
40 |
-
assert np.allclose(f(a, b, c), a * b * c)
|
41 |
-
assert capture == """
|
42 |
-
my_func(x:int=1, y:float=2, z:float=3)
|
43 |
-
my_func(x:int=3, y:float=4, z:float=3)
|
44 |
-
my_func(x:int=5, y:float=6, z:float=3)
|
45 |
-
my_func(x:int=7, y:float=8, z:float=3)
|
46 |
-
my_func(x:int=9, y:float=10, z:float=3)
|
47 |
-
my_func(x:int=11, y:float=12, z:float=3)
|
48 |
-
"""
|
49 |
-
with capture:
|
50 |
-
a, b, c = np.array([[1, 2, 3], [4, 5, 6]]), np.array([2, 3, 4]), 2
|
51 |
-
assert np.allclose(f(a, b, c), a * b * c)
|
52 |
-
assert capture == """
|
53 |
-
my_func(x:int=1, y:float=2, z:float=2)
|
54 |
-
my_func(x:int=2, y:float=3, z:float=2)
|
55 |
-
my_func(x:int=3, y:float=4, z:float=2)
|
56 |
-
my_func(x:int=4, y:float=2, z:float=2)
|
57 |
-
my_func(x:int=5, y:float=3, z:float=2)
|
58 |
-
my_func(x:int=6, y:float=4, z:float=2)
|
59 |
-
"""
|
60 |
-
with capture:
|
61 |
-
a, b, c = np.array([[1, 2, 3], [4, 5, 6]]), np.array([[2], [3]]), 2
|
62 |
-
assert np.allclose(f(a, b, c), a * b * c)
|
63 |
-
assert capture == """
|
64 |
-
my_func(x:int=1, y:float=2, z:float=2)
|
65 |
-
my_func(x:int=2, y:float=2, z:float=2)
|
66 |
-
my_func(x:int=3, y:float=2, z:float=2)
|
67 |
-
my_func(x:int=4, y:float=3, z:float=2)
|
68 |
-
my_func(x:int=5, y:float=3, z:float=2)
|
69 |
-
my_func(x:int=6, y:float=3, z:float=2)
|
70 |
-
"""
|
71 |
-
with capture:
|
72 |
-
a, b, c = np.array([[1, 2, 3], [4, 5, 6]], order='F'), np.array([[2], [3]]), 2
|
73 |
-
assert np.allclose(f(a, b, c), a * b * c)
|
74 |
-
assert capture == """
|
75 |
-
my_func(x:int=1, y:float=2, z:float=2)
|
76 |
-
my_func(x:int=2, y:float=2, z:float=2)
|
77 |
-
my_func(x:int=3, y:float=2, z:float=2)
|
78 |
-
my_func(x:int=4, y:float=3, z:float=2)
|
79 |
-
my_func(x:int=5, y:float=3, z:float=2)
|
80 |
-
my_func(x:int=6, y:float=3, z:float=2)
|
81 |
-
"""
|
82 |
-
with capture:
|
83 |
-
a, b, c = np.array([[1, 2, 3], [4, 5, 6]])[::, ::2], np.array([[2], [3]]), 2
|
84 |
-
assert np.allclose(f(a, b, c), a * b * c)
|
85 |
-
assert capture == """
|
86 |
-
my_func(x:int=1, y:float=2, z:float=2)
|
87 |
-
my_func(x:int=3, y:float=2, z:float=2)
|
88 |
-
my_func(x:int=4, y:float=3, z:float=2)
|
89 |
-
my_func(x:int=6, y:float=3, z:float=2)
|
90 |
-
"""
|
91 |
-
with capture:
|
92 |
-
a, b, c = np.array([[1, 2, 3], [4, 5, 6]], order='F')[::, ::2], np.array([[2], [3]]), 2
|
93 |
-
assert np.allclose(f(a, b, c), a * b * c)
|
94 |
-
assert capture == """
|
95 |
-
my_func(x:int=1, y:float=2, z:float=2)
|
96 |
-
my_func(x:int=3, y:float=2, z:float=2)
|
97 |
-
my_func(x:int=4, y:float=3, z:float=2)
|
98 |
-
my_func(x:int=6, y:float=3, z:float=2)
|
99 |
-
"""
|
100 |
-
|
101 |
-
|
102 |
-
def test_type_selection():
|
103 |
-
assert m.selective_func(np.array([1], dtype=np.int32)) == "Int branch taken."
|
104 |
-
assert m.selective_func(np.array([1.0], dtype=np.float32)) == "Float branch taken."
|
105 |
-
assert m.selective_func(np.array([1.0j], dtype=np.complex64)) == "Complex float branch taken."
|
106 |
-
|
107 |
-
|
108 |
-
def test_docs(doc):
|
109 |
-
assert doc(m.vectorized_func) == """
|
110 |
-
vectorized_func(arg0: numpy.ndarray[numpy.int32], arg1: numpy.ndarray[numpy.float32], arg2: numpy.ndarray[numpy.float64]) -> object
|
111 |
-
""" # noqa: E501 line too long
|
112 |
-
|
113 |
-
|
114 |
-
def test_trivial_broadcasting():
|
115 |
-
trivial, vectorized_is_trivial = m.trivial, m.vectorized_is_trivial
|
116 |
-
|
117 |
-
assert vectorized_is_trivial(1, 2, 3) == trivial.c_trivial
|
118 |
-
assert vectorized_is_trivial(np.array(1), np.array(2), 3) == trivial.c_trivial
|
119 |
-
assert vectorized_is_trivial(np.array([1, 3]), np.array([2, 4]), 3) == trivial.c_trivial
|
120 |
-
assert trivial.c_trivial == vectorized_is_trivial(
|
121 |
-
np.array([[1, 3, 5], [7, 9, 11]]), np.array([[2, 4, 6], [8, 10, 12]]), 3)
|
122 |
-
assert vectorized_is_trivial(
|
123 |
-
np.array([[1, 2, 3], [4, 5, 6]]), np.array([2, 3, 4]), 2) == trivial.non_trivial
|
124 |
-
assert vectorized_is_trivial(
|
125 |
-
np.array([[1, 2, 3], [4, 5, 6]]), np.array([[2], [3]]), 2) == trivial.non_trivial
|
126 |
-
z1 = np.array([[1, 2, 3, 4], [5, 6, 7, 8]], dtype='int32')
|
127 |
-
z2 = np.array(z1, dtype='float32')
|
128 |
-
z3 = np.array(z1, dtype='float64')
|
129 |
-
assert vectorized_is_trivial(z1, z2, z3) == trivial.c_trivial
|
130 |
-
assert vectorized_is_trivial(1, z2, z3) == trivial.c_trivial
|
131 |
-
assert vectorized_is_trivial(z1, 1, z3) == trivial.c_trivial
|
132 |
-
assert vectorized_is_trivial(z1, z2, 1) == trivial.c_trivial
|
133 |
-
assert vectorized_is_trivial(z1[::2, ::2], 1, 1) == trivial.non_trivial
|
134 |
-
assert vectorized_is_trivial(1, 1, z1[::2, ::2]) == trivial.c_trivial
|
135 |
-
assert vectorized_is_trivial(1, 1, z3[::2, ::2]) == trivial.non_trivial
|
136 |
-
assert vectorized_is_trivial(z1, 1, z3[1::4, 1::4]) == trivial.c_trivial
|
137 |
-
|
138 |
-
y1 = np.array(z1, order='F')
|
139 |
-
y2 = np.array(y1)
|
140 |
-
y3 = np.array(y1)
|
141 |
-
assert vectorized_is_trivial(y1, y2, y3) == trivial.f_trivial
|
142 |
-
assert vectorized_is_trivial(y1, 1, 1) == trivial.f_trivial
|
143 |
-
assert vectorized_is_trivial(1, y2, 1) == trivial.f_trivial
|
144 |
-
assert vectorized_is_trivial(1, 1, y3) == trivial.f_trivial
|
145 |
-
assert vectorized_is_trivial(y1, z2, 1) == trivial.non_trivial
|
146 |
-
assert vectorized_is_trivial(z1[1::4, 1::4], y2, 1) == trivial.f_trivial
|
147 |
-
assert vectorized_is_trivial(y1[1::4, 1::4], z2, 1) == trivial.c_trivial
|
148 |
-
|
149 |
-
assert m.vectorized_func(z1, z2, z3).flags.c_contiguous
|
150 |
-
assert m.vectorized_func(y1, y2, y3).flags.f_contiguous
|
151 |
-
assert m.vectorized_func(z1, 1, 1).flags.c_contiguous
|
152 |
-
assert m.vectorized_func(1, y2, 1).flags.f_contiguous
|
153 |
-
assert m.vectorized_func(z1[1::4, 1::4], y2, 1).flags.f_contiguous
|
154 |
-
assert m.vectorized_func(y1[1::4, 1::4], z2, 1).flags.c_contiguous
|
155 |
-
|
156 |
-
|
157 |
-
def test_passthrough_arguments(doc):
|
158 |
-
assert doc(m.vec_passthrough) == (
|
159 |
-
"vec_passthrough(" + ", ".join([
|
160 |
-
"arg0: float",
|
161 |
-
"arg1: numpy.ndarray[numpy.float64]",
|
162 |
-
"arg2: numpy.ndarray[numpy.float64]",
|
163 |
-
"arg3: numpy.ndarray[numpy.int32]",
|
164 |
-
"arg4: int",
|
165 |
-
"arg5: m.numpy_vectorize.NonPODClass",
|
166 |
-
"arg6: numpy.ndarray[numpy.float64]"]) + ") -> object")
|
167 |
-
|
168 |
-
b = np.array([[10, 20, 30]], dtype='float64')
|
169 |
-
c = np.array([100, 200]) # NOT a vectorized argument
|
170 |
-
d = np.array([[1000], [2000], [3000]], dtype='int')
|
171 |
-
g = np.array([[1000000, 2000000, 3000000]], dtype='int') # requires casting
|
172 |
-
assert np.all(
|
173 |
-
m.vec_passthrough(1, b, c, d, 10000, m.NonPODClass(100000), g) ==
|
174 |
-
np.array([[1111111, 2111121, 3111131],
|
175 |
-
[1112111, 2112121, 3112131],
|
176 |
-
[1113111, 2113121, 3113131]]))
|
177 |
-
|
178 |
-
|
179 |
-
def test_method_vectorization():
|
180 |
-
o = m.VectorizeTestClass(3)
|
181 |
-
x = np.array([1, 2], dtype='int')
|
182 |
-
y = np.array([[10], [20]], dtype='float32')
|
183 |
-
assert np.all(o.method(x, y) == [[14, 15], [24, 25]])
|
184 |
-
|
185 |
-
|
186 |
-
def test_array_collapse():
|
187 |
-
assert not isinstance(m.vectorized_func(1, 2, 3), np.ndarray)
|
188 |
-
assert not isinstance(m.vectorized_func(np.array(1), 2, 3), np.ndarray)
|
189 |
-
z = m.vectorized_func([1], 2, 3)
|
190 |
-
assert isinstance(z, np.ndarray)
|
191 |
-
assert z.shape == (1, )
|
192 |
-
z = m.vectorized_func(1, [[[2]]], 3)
|
193 |
-
assert isinstance(z, np.ndarray)
|
194 |
-
assert z.shape == (1, 1, 1)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/CVPR/LIVE/thrust/thrust/detail/vector_base.h
DELETED
@@ -1,588 +0,0 @@
|
|
1 |
-
/*
|
2 |
-
* Copyright 2008-2018 NVIDIA Corporation
|
3 |
-
*
|
4 |
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
5 |
-
* you may not use this file except in compliance with the License.
|
6 |
-
* You may obtain a copy of the License at
|
7 |
-
*
|
8 |
-
* http://www.apache.org/licenses/LICENSE-2.0
|
9 |
-
*
|
10 |
-
* Unless required by applicable law or agreed to in writing, software
|
11 |
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
12 |
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13 |
-
* See the License for the specific language governing permissions and
|
14 |
-
* limitations under the License.
|
15 |
-
*/
|
16 |
-
|
17 |
-
|
18 |
-
/*! \file vector_base.h
|
19 |
-
* \brief Defines the interface to a base class for
|
20 |
-
* host_vector & device_vector.
|
21 |
-
*/
|
22 |
-
|
23 |
-
#pragma once
|
24 |
-
|
25 |
-
#include <thrust/iterator/detail/normal_iterator.h>
|
26 |
-
#include <thrust/iterator/reverse_iterator.h>
|
27 |
-
#include <thrust/iterator/iterator_traits.h>
|
28 |
-
#include <thrust/detail/type_traits.h>
|
29 |
-
#include <thrust/detail/config.h>
|
30 |
-
#include <thrust/detail/contiguous_storage.h>
|
31 |
-
#include <vector>
|
32 |
-
|
33 |
-
namespace thrust
|
34 |
-
{
|
35 |
-
|
36 |
-
namespace detail
|
37 |
-
{
|
38 |
-
|
39 |
-
template<typename T, typename Alloc>
|
40 |
-
class vector_base
|
41 |
-
{
|
42 |
-
private:
|
43 |
-
typedef thrust::detail::contiguous_storage<T,Alloc> storage_type;
|
44 |
-
|
45 |
-
public:
|
46 |
-
// typedefs
|
47 |
-
typedef typename storage_type::value_type value_type;
|
48 |
-
typedef typename storage_type::pointer pointer;
|
49 |
-
typedef typename storage_type::const_pointer const_pointer;
|
50 |
-
typedef typename storage_type::reference reference;
|
51 |
-
typedef typename storage_type::const_reference const_reference;
|
52 |
-
typedef typename storage_type::size_type size_type;
|
53 |
-
typedef typename storage_type::difference_type difference_type;
|
54 |
-
typedef typename storage_type::allocator_type allocator_type;
|
55 |
-
|
56 |
-
typedef typename storage_type::iterator iterator;
|
57 |
-
typedef typename storage_type::const_iterator const_iterator;
|
58 |
-
|
59 |
-
typedef thrust::reverse_iterator<iterator> reverse_iterator;
|
60 |
-
typedef thrust::reverse_iterator<const_iterator> const_reverse_iterator;
|
61 |
-
|
62 |
-
/*! This constructor creates an empty vector_base.
|
63 |
-
*/
|
64 |
-
vector_base(void);
|
65 |
-
|
66 |
-
/*! This constructor creates an empty vector_base.
|
67 |
-
* \param alloc The allocator to use by this vector_base.
|
68 |
-
*/
|
69 |
-
explicit vector_base(const Alloc &alloc);
|
70 |
-
|
71 |
-
/*! This constructor creates a vector_base with default-constructed
|
72 |
-
* elements.
|
73 |
-
* \param n The number of elements to create.
|
74 |
-
*/
|
75 |
-
explicit vector_base(size_type n);
|
76 |
-
|
77 |
-
/*! This constructor creates a vector_base with default-constructed
|
78 |
-
* elements.
|
79 |
-
* \param n The number of elements to create.
|
80 |
-
* \param alloc The allocator to use by this vector_base.
|
81 |
-
*/
|
82 |
-
explicit vector_base(size_type n, const Alloc &alloc);
|
83 |
-
|
84 |
-
/*! This constructor creates a vector_base with copies
|
85 |
-
* of an exemplar element.
|
86 |
-
* \param n The number of elements to initially create.
|
87 |
-
* \param value An element to copy.
|
88 |
-
*/
|
89 |
-
explicit vector_base(size_type n, const value_type &value);
|
90 |
-
|
91 |
-
/*! This constructor creates a vector_base with copies
|
92 |
-
* of an exemplar element.
|
93 |
-
* \param n The number of elements to initially create.
|
94 |
-
* \param value An element to copy.
|
95 |
-
* \param alloc The allocator to use by this vector_base.
|
96 |
-
*/
|
97 |
-
explicit vector_base(size_type n, const value_type &value, const Alloc &alloc);
|
98 |
-
|
99 |
-
/*! Copy constructor copies from an exemplar vector_base.
|
100 |
-
* \param v The vector_base to copy.
|
101 |
-
*/
|
102 |
-
vector_base(const vector_base &v);
|
103 |
-
|
104 |
-
/*! Copy constructor copies from an exemplar vector_base.
|
105 |
-
* \param v The vector_base to copy.
|
106 |
-
* \param alloc The allocator to use by this vector_base.
|
107 |
-
*/
|
108 |
-
vector_base(const vector_base &v, const Alloc &alloc);
|
109 |
-
|
110 |
-
#if THRUST_CPP_DIALECT >= 2011
|
111 |
-
/*! Move constructor moves from another vector_base.
|
112 |
-
* \param v The vector_base to move.
|
113 |
-
*/
|
114 |
-
vector_base(vector_base &&v);
|
115 |
-
|
116 |
-
// FIXME: the internal Thrust machinery in range_init doesn't work with move
|
117 |
-
// iterators, which is necessary for the following constructor to be implemented
|
118 |
-
// correctly
|
119 |
-
// vector_base(vector_base &&v, const Alloc &alloc);
|
120 |
-
#endif
|
121 |
-
|
122 |
-
/*! Copy assign operator copies from another vector_base.
|
123 |
-
* \param v The vector_base to copy.
|
124 |
-
*/
|
125 |
-
vector_base &operator=(const vector_base &v);
|
126 |
-
|
127 |
-
#if THRUST_CPP_DIALECT >= 2011
|
128 |
-
/*! Move assign operator moves from another vector_base.
|
129 |
-
* \param v The vector_base to move.
|
130 |
-
*/
|
131 |
-
vector_base &operator=(vector_base &&v);
|
132 |
-
#endif
|
133 |
-
|
134 |
-
/*! Copy constructor copies from an exemplar vector_base with different
|
135 |
-
* type.
|
136 |
-
* \param v The vector_base to copy.
|
137 |
-
*/
|
138 |
-
template<typename OtherT, typename OtherAlloc>
|
139 |
-
vector_base(const vector_base<OtherT, OtherAlloc> &v);
|
140 |
-
|
141 |
-
/*! assign operator makes a copy of an exemplar vector_base with different
|
142 |
-
* type.
|
143 |
-
* \param v The vector_base to copy.
|
144 |
-
*/
|
145 |
-
template<typename OtherT, typename OtherAlloc>
|
146 |
-
vector_base &operator=(const vector_base<OtherT,OtherAlloc> &v);
|
147 |
-
|
148 |
-
/*! Copy constructor copies from an exemplar std::vector.
|
149 |
-
* \param v The std::vector to copy.
|
150 |
-
* XXX TODO: Make this method redundant with a properly templatized constructor.
|
151 |
-
* We would like to copy from a vector whose element type is anything
|
152 |
-
* assignable to value_type.
|
153 |
-
*/
|
154 |
-
template<typename OtherT, typename OtherAlloc>
|
155 |
-
vector_base(const std::vector<OtherT, OtherAlloc> &v);
|
156 |
-
|
157 |
-
/*! assign operator makes a copy of an exemplar std::vector.
|
158 |
-
* \param v The vector to copy.
|
159 |
-
* XXX TODO: Templatize this assign on the type of the vector to copy from.
|
160 |
-
* We would like to copy from a vector whose element type is anything
|
161 |
-
* assignable to value_type.
|
162 |
-
*/
|
163 |
-
template<typename OtherT, typename OtherAlloc>
|
164 |
-
vector_base &operator=(const std::vector<OtherT,OtherAlloc> &v);
|
165 |
-
|
166 |
-
/*! This constructor builds a vector_base from a range.
|
167 |
-
* \param first The beginning of the range.
|
168 |
-
* \param last The end of the range.
|
169 |
-
*/
|
170 |
-
template<typename InputIterator>
|
171 |
-
vector_base(InputIterator first, InputIterator last);
|
172 |
-
|
173 |
-
/*! This constructor builds a vector_base from a range.
|
174 |
-
* \param first The beginning of the range.
|
175 |
-
* \param last The end of the range.
|
176 |
-
* \param alloc The allocator to use by this vector_base.
|
177 |
-
*/
|
178 |
-
template<typename InputIterator>
|
179 |
-
vector_base(InputIterator first, InputIterator last, const Alloc &alloc);
|
180 |
-
|
181 |
-
/*! The destructor erases the elements.
|
182 |
-
*/
|
183 |
-
~vector_base(void);
|
184 |
-
|
185 |
-
/*! \brief Resizes this vector_base to the specified number of elements.
|
186 |
-
* \param new_size Number of elements this vector_base should contain.
|
187 |
-
* \throw std::length_error If n exceeds max_size9).
|
188 |
-
*
|
189 |
-
* This method will resize this vector_base to the specified number of
|
190 |
-
* elements. If the number is smaller than this vector_base's current
|
191 |
-
* size this vector_base is truncated, otherwise this vector_base is
|
192 |
-
* extended and new elements are default constructed.
|
193 |
-
*/
|
194 |
-
void resize(size_type new_size);
|
195 |
-
|
196 |
-
/*! \brief Resizes this vector_base to the specified number of elements.
|
197 |
-
* \param new_size Number of elements this vector_base should contain.
|
198 |
-
* \param x Data with which new elements should be populated.
|
199 |
-
* \throw std::length_error If n exceeds max_size().
|
200 |
-
*
|
201 |
-
* This method will resize this vector_base to the specified number of
|
202 |
-
* elements. If the number is smaller than this vector_base's current
|
203 |
-
* size this vector_base is truncated, otherwise this vector_base is
|
204 |
-
* extended and new elements are populated with given data.
|
205 |
-
*/
|
206 |
-
void resize(size_type new_size, const value_type &x);
|
207 |
-
|
208 |
-
/*! Returns the number of elements in this vector_base.
|
209 |
-
*/
|
210 |
-
size_type size(void) const;
|
211 |
-
|
212 |
-
/*! Returns the size() of the largest possible vector_base.
|
213 |
-
* \return The largest possible return value of size().
|
214 |
-
*/
|
215 |
-
size_type max_size(void) const;
|
216 |
-
|
217 |
-
/*! \brief If n is less than or equal to capacity(), this call has no effect.
|
218 |
-
* Otherwise, this method is a request for allocation of additional memory. If
|
219 |
-
* the request is successful, then capacity() is greater than or equal to
|
220 |
-
* n; otherwise, capacity() is unchanged. In either case, size() is unchanged.
|
221 |
-
* \throw std::length_error If n exceeds max_size().
|
222 |
-
*/
|
223 |
-
void reserve(size_type n);
|
224 |
-
|
225 |
-
/*! Returns the number of elements which have been reserved in this
|
226 |
-
* vector_base.
|
227 |
-
*/
|
228 |
-
size_type capacity(void) const;
|
229 |
-
|
230 |
-
/*! This method shrinks the capacity of this vector_base to exactly
|
231 |
-
* fit its elements.
|
232 |
-
*/
|
233 |
-
void shrink_to_fit(void);
|
234 |
-
|
235 |
-
/*! \brief Subscript access to the data contained in this vector_dev.
|
236 |
-
* \param n The index of the element for which data should be accessed.
|
237 |
-
* \return Read/write reference to data.
|
238 |
-
*
|
239 |
-
* This operator allows for easy, array-style, data access.
|
240 |
-
* Note that data access with this operator is unchecked and
|
241 |
-
* out_of_range lookups are not defined.
|
242 |
-
*/
|
243 |
-
reference operator[](size_type n);
|
244 |
-
|
245 |
-
/*! \brief Subscript read access to the data contained in this vector_dev.
|
246 |
-
* \param n The index of the element for which data should be accessed.
|
247 |
-
* \return Read reference to data.
|
248 |
-
*
|
249 |
-
* This operator allows for easy, array-style, data access.
|
250 |
-
* Note that data access with this operator is unchecked and
|
251 |
-
* out_of_range lookups are not defined.
|
252 |
-
*/
|
253 |
-
const_reference operator[](size_type n) const;
|
254 |
-
|
255 |
-
/*! This method returns an iterator pointing to the beginning of
|
256 |
-
* this vector_base.
|
257 |
-
* \return mStart
|
258 |
-
*/
|
259 |
-
iterator begin(void);
|
260 |
-
|
261 |
-
/*! This method returns a const_iterator pointing to the beginning
|
262 |
-
* of this vector_base.
|
263 |
-
* \return mStart
|
264 |
-
*/
|
265 |
-
const_iterator begin(void) const;
|
266 |
-
|
267 |
-
/*! This method returns a const_iterator pointing to the beginning
|
268 |
-
* of this vector_base.
|
269 |
-
* \return mStart
|
270 |
-
*/
|
271 |
-
const_iterator cbegin(void) const;
|
272 |
-
|
273 |
-
/*! This method returns a reverse_iterator pointing to the beginning of
|
274 |
-
* this vector_base's reversed sequence.
|
275 |
-
* \return A reverse_iterator pointing to the beginning of this
|
276 |
-
* vector_base's reversed sequence.
|
277 |
-
*/
|
278 |
-
reverse_iterator rbegin(void);
|
279 |
-
|
280 |
-
/*! This method returns a const_reverse_iterator pointing to the beginning of
|
281 |
-
* this vector_base's reversed sequence.
|
282 |
-
* \return A const_reverse_iterator pointing to the beginning of this
|
283 |
-
* vector_base's reversed sequence.
|
284 |
-
*/
|
285 |
-
const_reverse_iterator rbegin(void) const;
|
286 |
-
|
287 |
-
/*! This method returns a const_reverse_iterator pointing to the beginning of
|
288 |
-
* this vector_base's reversed sequence.
|
289 |
-
* \return A const_reverse_iterator pointing to the beginning of this
|
290 |
-
* vector_base's reversed sequence.
|
291 |
-
*/
|
292 |
-
const_reverse_iterator crbegin(void) const;
|
293 |
-
|
294 |
-
/*! This method returns an iterator pointing to one element past the
|
295 |
-
* last of this vector_base.
|
296 |
-
* \return begin() + size().
|
297 |
-
*/
|
298 |
-
iterator end(void);
|
299 |
-
|
300 |
-
/*! This method returns a const_iterator pointing to one element past the
|
301 |
-
* last of this vector_base.
|
302 |
-
* \return begin() + size().
|
303 |
-
*/
|
304 |
-
const_iterator end(void) const;
|
305 |
-
|
306 |
-
/*! This method returns a const_iterator pointing to one element past the
|
307 |
-
* last of this vector_base.
|
308 |
-
* \return begin() + size().
|
309 |
-
*/
|
310 |
-
const_iterator cend(void) const;
|
311 |
-
|
312 |
-
/*! This method returns a reverse_iterator pointing to one element past the
|
313 |
-
* last of this vector_base's reversed sequence.
|
314 |
-
* \return rbegin() + size().
|
315 |
-
*/
|
316 |
-
reverse_iterator rend(void);
|
317 |
-
|
318 |
-
/*! This method returns a const_reverse_iterator pointing to one element past the
|
319 |
-
* last of this vector_base's reversed sequence.
|
320 |
-
* \return rbegin() + size().
|
321 |
-
*/
|
322 |
-
const_reverse_iterator rend(void) const;
|
323 |
-
|
324 |
-
/*! This method returns a const_reverse_iterator pointing to one element past the
|
325 |
-
* last of this vector_base's reversed sequence.
|
326 |
-
* \return rbegin() + size().
|
327 |
-
*/
|
328 |
-
const_reverse_iterator crend(void) const;
|
329 |
-
|
330 |
-
/*! This method returns a const_reference referring to the first element of this
|
331 |
-
* vector_base.
|
332 |
-
* \return The first element of this vector_base.
|
333 |
-
*/
|
334 |
-
const_reference front(void) const;
|
335 |
-
|
336 |
-
/*! This method returns a reference pointing to the first element of this
|
337 |
-
* vector_base.
|
338 |
-
* \return The first element of this vector_base.
|
339 |
-
*/
|
340 |
-
reference front(void);
|
341 |
-
|
342 |
-
/*! This method returns a const reference pointing to the last element of
|
343 |
-
* this vector_base.
|
344 |
-
* \return The last element of this vector_base.
|
345 |
-
*/
|
346 |
-
const_reference back(void) const;
|
347 |
-
|
348 |
-
/*! This method returns a reference referring to the last element of
|
349 |
-
* this vector_dev.
|
350 |
-
* \return The last element of this vector_base.
|
351 |
-
*/
|
352 |
-
reference back(void);
|
353 |
-
|
354 |
-
/*! This method returns a pointer to this vector_base's first element.
|
355 |
-
* \return A pointer to the first element of this vector_base.
|
356 |
-
*/
|
357 |
-
pointer data(void);
|
358 |
-
|
359 |
-
/*! This method returns a const_pointer to this vector_base's first element.
|
360 |
-
* \return a const_pointer to the first element of this vector_base.
|
361 |
-
*/
|
362 |
-
const_pointer data(void) const;
|
363 |
-
|
364 |
-
/*! This method resizes this vector_base to 0.
|
365 |
-
*/
|
366 |
-
void clear(void);
|
367 |
-
|
368 |
-
/*! This method returns true iff size() == 0.
|
369 |
-
* \return true if size() == 0; false, otherwise.
|
370 |
-
*/
|
371 |
-
bool empty(void) const;
|
372 |
-
|
373 |
-
/*! This method appends the given element to the end of this vector_base.
|
374 |
-
* \param x The element to append.
|
375 |
-
*/
|
376 |
-
void push_back(const value_type &x);
|
377 |
-
|
378 |
-
/*! This method erases the last element of this vector_base, invalidating
|
379 |
-
* all iterators and references to it.
|
380 |
-
*/
|
381 |
-
void pop_back(void);
|
382 |
-
|
383 |
-
/*! This method swaps the contents of this vector_base with another vector_base.
|
384 |
-
* \param v The vector_base with which to swap.
|
385 |
-
*/
|
386 |
-
void swap(vector_base &v);
|
387 |
-
|
388 |
-
/*! This method removes the element at position pos.
|
389 |
-
* \param pos The position of the element of interest.
|
390 |
-
* \return An iterator pointing to the new location of the element that followed the element
|
391 |
-
* at position pos.
|
392 |
-
*/
|
393 |
-
iterator erase(iterator pos);
|
394 |
-
|
395 |
-
/*! This method removes the range of elements [first,last) from this vector_base.
|
396 |
-
* \param first The beginning of the range of elements to remove.
|
397 |
-
* \param last The end of the range of elements to remove.
|
398 |
-
* \return An iterator pointing to the new location of the element that followed the last
|
399 |
-
* element in the sequence [first,last).
|
400 |
-
*/
|
401 |
-
iterator erase(iterator first, iterator last);
|
402 |
-
|
403 |
-
/*! This method inserts a single copy of a given exemplar value at the
|
404 |
-
* specified position in this vector_base.
|
405 |
-
* \param position The insertion position.
|
406 |
-
* \param x The exemplar element to copy & insert.
|
407 |
-
* \return An iterator pointing to the newly inserted element.
|
408 |
-
*/
|
409 |
-
iterator insert(iterator position, const T &x);
|
410 |
-
|
411 |
-
/*! This method inserts a copy of an exemplar value to a range at the
|
412 |
-
* specified position in this vector_base.
|
413 |
-
* \param position The insertion position
|
414 |
-
* \param n The number of insertions to perform.
|
415 |
-
* \param x The value to replicate and insert.
|
416 |
-
*/
|
417 |
-
void insert(iterator position, size_type n, const T &x);
|
418 |
-
|
419 |
-
/*! This method inserts a copy of an input range at the specified position
|
420 |
-
* in this vector_base.
|
421 |
-
* \param position The insertion position.
|
422 |
-
* \param first The beginning of the range to copy.
|
423 |
-
* \param last The end of the range to copy.
|
424 |
-
*
|
425 |
-
* \tparam InputIterator is a model of <a href="http://www.sgi.com/tech/stl/InputIterator.html>Input Iterator</a>,
|
426 |
-
* and \p InputIterator's \c value_type is a model of <a href="http://www.sgi.com/tech/stl/Assignable.html">Assignable</a>.
|
427 |
-
*/
|
428 |
-
template<typename InputIterator>
|
429 |
-
void insert(iterator position, InputIterator first, InputIterator last);
|
430 |
-
|
431 |
-
/*! This version of \p assign replicates a given exemplar
|
432 |
-
* \p n times into this vector_base.
|
433 |
-
* \param n The number of times to copy \p x.
|
434 |
-
* \param x The exemplar element to replicate.
|
435 |
-
*/
|
436 |
-
void assign(size_type n, const T &x);
|
437 |
-
|
438 |
-
/*! This version of \p assign makes this vector_base a copy of a given input range.
|
439 |
-
* \param first The beginning of the range to copy.
|
440 |
-
* \param last The end of the range to copy.
|
441 |
-
*
|
442 |
-
* \tparam InputIterator is a model of <a href="http://www.sgi.com/tech/stl/InputIterator">Input Iterator</a>.
|
443 |
-
*/
|
444 |
-
template<typename InputIterator>
|
445 |
-
void assign(InputIterator first, InputIterator last);
|
446 |
-
|
447 |
-
/*! This method returns a copy of this vector's allocator.
|
448 |
-
* \return A copy of the alloctor used by this vector.
|
449 |
-
*/
|
450 |
-
allocator_type get_allocator(void) const;
|
451 |
-
|
452 |
-
protected:
|
453 |
-
// Our storage
|
454 |
-
storage_type m_storage;
|
455 |
-
|
456 |
-
// The size of this vector_base, in number of elements.
|
457 |
-
size_type m_size;
|
458 |
-
|
459 |
-
private:
|
460 |
-
// these methods resolve the ambiguity of the constructor template of form (Iterator, Iterator)
|
461 |
-
template<typename IteratorOrIntegralType>
|
462 |
-
void init_dispatch(IteratorOrIntegralType begin, IteratorOrIntegralType end, false_type);
|
463 |
-
|
464 |
-
template<typename IteratorOrIntegralType>
|
465 |
-
void init_dispatch(IteratorOrIntegralType n, IteratorOrIntegralType value, true_type);
|
466 |
-
|
467 |
-
template<typename InputIterator>
|
468 |
-
void range_init(InputIterator first, InputIterator last);
|
469 |
-
|
470 |
-
template<typename InputIterator>
|
471 |
-
void range_init(InputIterator first, InputIterator last, thrust::incrementable_traversal_tag);
|
472 |
-
|
473 |
-
template<typename ForwardIterator>
|
474 |
-
void range_init(ForwardIterator first, ForwardIterator last, thrust::random_access_traversal_tag);
|
475 |
-
|
476 |
-
void default_init(size_type n);
|
477 |
-
|
478 |
-
void fill_init(size_type n, const T &x);
|
479 |
-
|
480 |
-
// these methods resolve the ambiguity of the insert() template of form (iterator, InputIterator, InputIterator)
|
481 |
-
template<typename InputIteratorOrIntegralType>
|
482 |
-
void insert_dispatch(iterator position, InputIteratorOrIntegralType first, InputIteratorOrIntegralType last, false_type);
|
483 |
-
|
484 |
-
// these methods resolve the ambiguity of the insert() template of form (iterator, InputIterator, InputIterator)
|
485 |
-
template<typename InputIteratorOrIntegralType>
|
486 |
-
void insert_dispatch(iterator position, InputIteratorOrIntegralType n, InputIteratorOrIntegralType x, true_type);
|
487 |
-
|
488 |
-
// this method appends n default-constructed elements at the end
|
489 |
-
void append(size_type n);
|
490 |
-
|
491 |
-
// this method performs insertion from a fill value
|
492 |
-
void fill_insert(iterator position, size_type n, const T &x);
|
493 |
-
|
494 |
-
// this method performs insertion from a range
|
495 |
-
template<typename InputIterator>
|
496 |
-
void copy_insert(iterator position, InputIterator first, InputIterator last);
|
497 |
-
|
498 |
-
// these methods resolve the ambiguity of the assign() template of form (InputIterator, InputIterator)
|
499 |
-
template<typename InputIterator>
|
500 |
-
void assign_dispatch(InputIterator first, InputIterator last, false_type);
|
501 |
-
|
502 |
-
// these methods resolve the ambiguity of the assign() template of form (InputIterator, InputIterator)
|
503 |
-
template<typename Integral>
|
504 |
-
void assign_dispatch(Integral n, Integral x, true_type);
|
505 |
-
|
506 |
-
// this method performs assignment from a range
|
507 |
-
template<typename InputIterator>
|
508 |
-
void range_assign(InputIterator first, InputIterator last);
|
509 |
-
|
510 |
-
// this method performs assignment from a range of RandomAccessIterators
|
511 |
-
template<typename RandomAccessIterator>
|
512 |
-
void range_assign(RandomAccessIterator first, RandomAccessIterator last, thrust::random_access_traversal_tag);
|
513 |
-
|
514 |
-
// this method performs assignment from a range of InputIterators
|
515 |
-
template<typename InputIterator>
|
516 |
-
void range_assign(InputIterator first, InputIterator last, thrust::incrementable_traversal_tag);
|
517 |
-
|
518 |
-
// this method performs assignment from a fill value
|
519 |
-
void fill_assign(size_type n, const T &x);
|
520 |
-
|
521 |
-
// this method allocates new storage and construct copies the given range
|
522 |
-
template<typename ForwardIterator>
|
523 |
-
void allocate_and_copy(size_type requested_size,
|
524 |
-
ForwardIterator first, ForwardIterator last,
|
525 |
-
storage_type &new_storage);
|
526 |
-
}; // end vector_base
|
527 |
-
|
528 |
-
} // end detail
|
529 |
-
|
530 |
-
/*! This function assigns the contents of vector a to vector b and the
|
531 |
-
* contents of vector b to vector a.
|
532 |
-
*
|
533 |
-
* \param a The first vector of interest. After completion, the contents
|
534 |
-
* of b will be returned here.
|
535 |
-
* \param b The second vector of interest. After completion, the contents
|
536 |
-
* of a will be returned here.
|
537 |
-
*/
|
538 |
-
template<typename T, typename Alloc>
|
539 |
-
void swap(detail::vector_base<T,Alloc> &a,
|
540 |
-
detail::vector_base<T,Alloc> &b);
|
541 |
-
|
542 |
-
|
543 |
-
/*! This operator allows comparison between two vectors.
|
544 |
-
* \param lhs The first \p vector to compare.
|
545 |
-
* \param rhs The second \p vector to compare.
|
546 |
-
* \return \c true if and only if each corresponding element in either
|
547 |
-
* \p vector equals the other; \c false, otherwise.
|
548 |
-
*/
|
549 |
-
template<typename T1, typename Alloc1,
|
550 |
-
typename T2, typename Alloc2>
|
551 |
-
bool operator==(const detail::vector_base<T1,Alloc1>& lhs,
|
552 |
-
const detail::vector_base<T2,Alloc2>& rhs);
|
553 |
-
|
554 |
-
template<typename T1, typename Alloc1,
|
555 |
-
typename T2, typename Alloc2>
|
556 |
-
bool operator==(const detail::vector_base<T1,Alloc1>& lhs,
|
557 |
-
const std::vector<T2,Alloc2>& rhs);
|
558 |
-
|
559 |
-
template<typename T1, typename Alloc1,
|
560 |
-
typename T2, typename Alloc2>
|
561 |
-
bool operator==(const std::vector<T1,Alloc1>& lhs,
|
562 |
-
const detail::vector_base<T2,Alloc2>& rhs);
|
563 |
-
|
564 |
-
/*! This operator allows comparison between two vectors.
|
565 |
-
* \param lhs The first \p vector to compare.
|
566 |
-
* \param rhs The second \p vector to compare.
|
567 |
-
* \return \c false if and only if each corresponding element in either
|
568 |
-
* \p vector equals the other; \c true, otherwise.
|
569 |
-
*/
|
570 |
-
template<typename T1, typename Alloc1,
|
571 |
-
typename T2, typename Alloc2>
|
572 |
-
bool operator!=(const detail::vector_base<T1,Alloc1>& lhs,
|
573 |
-
const detail::vector_base<T2,Alloc2>& rhs);
|
574 |
-
|
575 |
-
template<typename T1, typename Alloc1,
|
576 |
-
typename T2, typename Alloc2>
|
577 |
-
bool operator!=(const detail::vector_base<T1,Alloc1>& lhs,
|
578 |
-
const std::vector<T2,Alloc2>& rhs);
|
579 |
-
|
580 |
-
template<typename T1, typename Alloc1,
|
581 |
-
typename T2, typename Alloc2>
|
582 |
-
bool operator!=(const std::vector<T1,Alloc1>& lhs,
|
583 |
-
const detail::vector_base<T2,Alloc2>& rhs);
|
584 |
-
|
585 |
-
} // end thrust
|
586 |
-
|
587 |
-
#include <thrust/detail/vector_base.inl>
|
588 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/CVPR/LIVE/thrust/thrust/system/cuda/memory.h
DELETED
@@ -1,93 +0,0 @@
|
|
1 |
-
/*
|
2 |
-
* Copyright 2008-2018 NVIDIA Corporation
|
3 |
-
*
|
4 |
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
5 |
-
* you may not use this file except in ccudaliance with the License.
|
6 |
-
* You may obtain a copy of the License at
|
7 |
-
*
|
8 |
-
* http://www.apache.org/licenses/LICENSE-2.0
|
9 |
-
*
|
10 |
-
* Unless required by applicable law or agreed to in writing, software
|
11 |
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
12 |
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13 |
-
* See the License for the specific language governing permissions and
|
14 |
-
* limitations under the License.
|
15 |
-
*/
|
16 |
-
|
17 |
-
/*! \file thrust/system/cuda/memory.h
|
18 |
-
* \brief Managing memory associated with Thrust's CUDA system.
|
19 |
-
*/
|
20 |
-
|
21 |
-
#pragma once
|
22 |
-
|
23 |
-
#include <thrust/detail/config.h>
|
24 |
-
#include <thrust/system/cuda/memory_resource.h>
|
25 |
-
#include <thrust/memory.h>
|
26 |
-
#include <thrust/detail/type_traits.h>
|
27 |
-
#include <thrust/mr/allocator.h>
|
28 |
-
#include <ostream>
|
29 |
-
|
30 |
-
namespace thrust
|
31 |
-
{
|
32 |
-
namespace cuda_cub {
|
33 |
-
|
34 |
-
/*! Allocates an area of memory available to Thrust's <tt>cuda</tt> system.
|
35 |
-
* \param n Number of bytes to allocate.
|
36 |
-
* \return A <tt>cuda::pointer<void></tt> pointing to the beginning of the newly
|
37 |
-
* allocated memory. A null <tt>cuda::pointer<void></tt> is returned if
|
38 |
-
* an error occurs.
|
39 |
-
* \note The <tt>cuda::pointer<void></tt> returned by this function must be
|
40 |
-
* deallocated with \p cuda::free.
|
41 |
-
* \see cuda::free
|
42 |
-
* \see std::malloc
|
43 |
-
*/
|
44 |
-
inline __host__ __device__ pointer<void> malloc(std::size_t n);
|
45 |
-
|
46 |
-
/*! Allocates a typed area of memory available to Thrust's <tt>cuda</tt> system.
|
47 |
-
* \param n Number of elements to allocate.
|
48 |
-
* \return A <tt>cuda::pointer<T></tt> pointing to the beginning of the newly
|
49 |
-
* allocated elements. A null <tt>cuda::pointer<T></tt> is returned if
|
50 |
-
* an error occurs.
|
51 |
-
* \note The <tt>cuda::pointer<T></tt> returned by this function must be
|
52 |
-
* deallocated with \p cuda::free.
|
53 |
-
* \see cuda::free
|
54 |
-
* \see std::malloc
|
55 |
-
*/
|
56 |
-
template <typename T>
|
57 |
-
inline __host__ __device__ pointer<T> malloc(std::size_t n);
|
58 |
-
|
59 |
-
/*! Deallocates an area of memory previously allocated by <tt>cuda::malloc</tt>.
|
60 |
-
* \param ptr A <tt>cuda::pointer<void></tt> pointing to the beginning of an area
|
61 |
-
* of memory previously allocated with <tt>cuda::malloc</tt>.
|
62 |
-
* \see cuda::malloc
|
63 |
-
* \see std::free
|
64 |
-
*/
|
65 |
-
inline __host__ __device__ void free(pointer<void> ptr);
|
66 |
-
|
67 |
-
/*! \p cuda::allocator is the default allocator used by the \p cuda system's containers such as
|
68 |
-
* <tt>cuda::vector</tt> if no user-specified allocator is provided. \p cuda::allocator allocates
|
69 |
-
* (deallocates) storage with \p cuda::malloc (\p cuda::free).
|
70 |
-
*/
|
71 |
-
template<typename T>
|
72 |
-
using allocator = thrust::mr::stateless_resource_allocator<T, system::cuda::memory_resource>;
|
73 |
-
|
74 |
-
} // namespace cuda_cub
|
75 |
-
|
76 |
-
namespace system {
|
77 |
-
namespace cuda {
|
78 |
-
using thrust::cuda_cub::malloc;
|
79 |
-
using thrust::cuda_cub::free;
|
80 |
-
using thrust::cuda_cub::allocator;
|
81 |
-
} // namespace cuda
|
82 |
-
} // namespace system
|
83 |
-
|
84 |
-
namespace cuda {
|
85 |
-
using thrust::cuda_cub::malloc;
|
86 |
-
using thrust::cuda_cub::free;
|
87 |
-
using thrust::cuda_cub::allocator;
|
88 |
-
} // end cuda
|
89 |
-
|
90 |
-
} // end namespace thrust
|
91 |
-
|
92 |
-
#include <thrust/system/cuda/detail/memory.inl>
|
93 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/CVPR/LIVE/thrust/thrust/system/omp/detail/reduce.h
DELETED
@@ -1,54 +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 |
-
|
18 |
-
/*! \file reduce.h
|
19 |
-
* \brief OpenMP implementation of reduce algorithms.
|
20 |
-
*/
|
21 |
-
|
22 |
-
#pragma once
|
23 |
-
|
24 |
-
#include <thrust/detail/config.h>
|
25 |
-
#include <thrust/system/omp/detail/execution_policy.h>
|
26 |
-
|
27 |
-
namespace thrust
|
28 |
-
{
|
29 |
-
namespace system
|
30 |
-
{
|
31 |
-
namespace omp
|
32 |
-
{
|
33 |
-
namespace detail
|
34 |
-
{
|
35 |
-
|
36 |
-
|
37 |
-
template<typename DerivedPolicy,
|
38 |
-
typename InputIterator,
|
39 |
-
typename OutputType,
|
40 |
-
typename BinaryFunction>
|
41 |
-
OutputType reduce(execution_policy<DerivedPolicy> &exec,
|
42 |
-
InputIterator first,
|
43 |
-
InputIterator last,
|
44 |
-
OutputType init,
|
45 |
-
BinaryFunction binary_op);
|
46 |
-
|
47 |
-
|
48 |
-
} // end namespace detail
|
49 |
-
} // end namespace omp
|
50 |
-
} // end namespace system
|
51 |
-
} // end namespace thrust
|
52 |
-
|
53 |
-
#include <thrust/system/omp/detail/reduce.inl>
|
54 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/CVPR/drawings-to-human/static/_app/immutable/error.svelte-d9523301.js
DELETED
@@ -1 +0,0 @@
|
|
1 |
-
import{S as w,i as y,s as z,e as E,t as v,c as d,a as b,h as P,d as o,g as u,J as R,j as N,k as S,l as C,m as j,E as H}from"./chunks/index-bcf2726a.js";function J(r){let l,t=r[1].frame+"",a;return{c(){l=E("pre"),a=v(t)},l(f){l=d(f,"PRE",{});var s=b(l);a=P(s,t),s.forEach(o)},m(f,s){u(f,l,s),R(l,a)},p(f,s){s&2&&t!==(t=f[1].frame+"")&&N(a,t)},d(f){f&&o(l)}}}function h(r){let l,t=r[1].stack+"",a;return{c(){l=E("pre"),a=v(t)},l(f){l=d(f,"PRE",{});var s=b(l);a=P(s,t),s.forEach(o)},m(f,s){u(f,l,s),R(l,a)},p(f,s){s&2&&t!==(t=f[1].stack+"")&&N(a,t)},d(f){f&&o(l)}}}function A(r){let l,t,a,f,s=r[1].message+"",c,k,n,p,i=r[1].frame&&J(r),_=r[1].stack&&h(r);return{c(){l=E("h1"),t=v(r[0]),a=S(),f=E("pre"),c=v(s),k=S(),i&&i.c(),n=S(),_&&_.c(),p=C()},l(e){l=d(e,"H1",{});var m=b(l);t=P(m,r[0]),m.forEach(o),a=j(e),f=d(e,"PRE",{});var q=b(f);c=P(q,s),q.forEach(o),k=j(e),i&&i.l(e),n=j(e),_&&_.l(e),p=C()},m(e,m){u(e,l,m),R(l,t),u(e,a,m),u(e,f,m),R(f,c),u(e,k,m),i&&i.m(e,m),u(e,n,m),_&&_.m(e,m),u(e,p,m)},p(e,[m]){m&1&&N(t,e[0]),m&2&&s!==(s=e[1].message+"")&&N(c,s),e[1].frame?i?i.p(e,m):(i=J(e),i.c(),i.m(n.parentNode,n)):i&&(i.d(1),i=null),e[1].stack?_?_.p(e,m):(_=h(e),_.c(),_.m(p.parentNode,p)):_&&(_.d(1),_=null)},i:H,o:H,d(e){e&&o(l),e&&o(a),e&&o(f),e&&o(k),i&&i.d(e),e&&o(n),_&&_.d(e),e&&o(p)}}}function F({error:r,status:l}){return{props:{error:r,status:l}}}function B(r,l,t){let{status:a}=l,{error:f}=l;return r.$$set=s=>{"status"in s&&t(0,a=s.status),"error"in s&&t(1,f=s.error)},[a,f]}class G extends w{constructor(l){super(),y(this,l,B,A,z,{status:0,error:1})}}export{G as default,F as load};
|
|
|
|