Upload 3 files
Browse files- character.json +1 -0
- fighting-character.py +76 -0
- images.tar.gz +3 -0
character.json
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
{"Agent.png": "black agent with bared teeth wearing sunglasses and a black suit, character", "Alien.png": "an alien, character", "Amazon.png": "Amazon woman with black curly hair, character", "Ambulance.png": "asian female ambulance with short hair, character", "Android.png": "a white andriod, character", "Angel.png": "short white hair, brown skin angel, character", "Astronaut.png": "an astronaut in white equipment, character", "Baby.png": "a naked baby in diapers, character", "Bacteria.png": "a green bacteria, character", "Baker.png": "a baker with brown hair, character", "Bat.png": "a bat with a white tie, character", "Belly Dancer.png": "Belly dancer in a gold bikini with blue hair, character", "Bigfoot.png": "bigfoot with white hair, character", "Biker.png": "biker in a pirate suit and a red mask, character", "Bounty Hunter.png": "a cyberpunk bounty hunter, character", "Bride.png": "a bride, character", "Buddha.png": "a laughing buddha, character", "Builder.png": "Builder with headphones and a yellow helmet, character", "Bunny.png": "a dark blue bunny, character", "Cat.png": "The cat wearing a pink love T-shirt, character", "Chef.png": "a chef wearing glasses and has a huge beard, character", "Clown.png": "a clown with green hair, character", "Cyborg.png": "a bald Cyborg, character", "Devil.png": "a red female devil, character", "Dino.png": "a green dino, character", "Diver.png": "a diver, character", "Doctor.png": "a male docter with beard, character", "Dog.png": "a dog wearing black shirt, character", "Druid.png": "an old bald Druid, character", "Duck.png": "a green monster duck, character", "Dwarf.png": "a dwarf warrior with red beard and hair, character", "Elephant.png": "an elephant in an orange shirt, character", "Elf.png": "a female dark elf with purple hair, character", "Emo.png": "an Emo guy, character", "Farmer.png": "a brown skin female farmer, character", "Flower.png": "a white and orange flower, character", "Gargoyle.png": "a black Gargoyle, character", "Geisha.png": "Geisha dressed in pink, character", "Ghoul.png": "a Ghoul, character", "Ginger Kid.png": "Ginger Kid, character", "Giraffe.png": "a giraffe in a blue sweater, character", "Go-Go Dancer.png": "a male go-go dancer wearing sunglasses, character", "Golem.png": "a Golem, character", "Gorilla.png": "a smiling Gorilla, character", "Goth.png": "a female Goth wearing sunglasses, character", "Grandma.png": "an old lady in red wearing glasses, character", "Grandpa.png": "a bald old man wearing glasses, character", "Groom.png": "a groom wearing a dark blue suit and glasses, character", "Hillbilly.png": "Hillbilly, character", "Hippo.png": "a hippo with lipstick and pink dress, character", "Iron Maiden.png": "iron maiden, character", "Jesus.png": "Jesus, character", "Judge.png": "an old bald male judge with an upset face, character", "King.png": "an old bald king wearing a golden crown, character", "Knight.png": "fully armed knight, character", "Leprechaun.png": "Leprechaun, character", "Lion.png": "a lion in a red shirt, character", "Madman.png": "a bald madman in white, character", "Model.png": "brown skin model wearing sunglasses and red dress, character", "Monk.png": "an old Chinese monk with bucket hat and white beard, character", "Nerd.png": "a male nerd with orange hair and acne wearing a white shirt, character", "Ninja.png": "a ninja, character", "Officer.png": "a female officer in blue, character", "Orc.png": "an Orc, character", "Painter.png": "a fat male painter wearing a white hat, character", "Patient.png": "A patient with a bandage being transfused with blood, character", "Plant.png": "a man-eating flower, character", "Popstar.png": "a female popstar with pink sunglasses, green hair, and green dress, character", "Priest.png": "a male bald priest, character", "Princess.png": "a Princess with golden hair and blue dress , character", "Queen.png": "Snow White, character", "Rabbi.png": "Rabbi, character", "Ranger.png": "a Ranger with mustache, character", "Reaper.png": "a reaper, character", "Robot.png": "an old fashion orange robot, character", "Rocker.png": "a rocker wearing sunglasses with mustache, character", "Samurai.png": "a Samurai in a red armor, character", "Santa.png": "Santa Claus, character", "Scientist.png": "a female scientist with red hair, character", "Shaman.png": "a scary Shaman, character", "Shiva.png": "female Shiva with four arms, character", "Skater.png": "a male skater wearing an orange hat and a yellow shirt, character", "Skeleton.png": "an armored skeleton, character", "Soldier.png": "a smoking soldier wearing green equipment, character", "Soviet.png": "a male Soviet with huge beard, character", "Spaceling.png": "a space traveler in an orange suit, character", "Spagettimon.png": "a Spagetti monster, character", "Squirrel.png": "a squirrel wearing a blue t-shirt, character", "Steampunk.png": "a steampunk robot, character", "Stylist.png": "a male stylist or fashion icon with red sunglasses and white hair, character", "Tiger.png": "a tiger in a blue shirt, character", "Tourist.png": "a fat female tourist with a camera and wearing a hat with sunglasses, character", "Tree.png": "an angry tree, character", "Vacationer.png": "a fat male vacationer wearing sunglasses and hat, character", "Vampire.png": "a male Vampire, character", "Viking.png": "a male Viking, character", "Werewolf.png": "a werewolf wearing red shirt and blue pants, character", "Wizard.png": "an old male Wizard, character", "Zombie.png": "a zombie wearing a white shirt, character"}
|
fighting-character.py
ADDED
@@ -0,0 +1,76 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# coding=utf-8
|
2 |
+
# Copyright 2020 The HuggingFace Datasets Authors and the current dataset script contributor.
|
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.Wikipedia
|
15 |
+
|
16 |
+
# Lint as: python3
|
17 |
+
"""Dream!n character datasets"""
|
18 |
+
|
19 |
+
import datasets
|
20 |
+
import json
|
21 |
+
import urllib
|
22 |
+
|
23 |
+
_CITATION = """
|
24 |
+
"""
|
25 |
+
|
26 |
+
_DESCRIPTION = "Dream!n character datasets"
|
27 |
+
|
28 |
+
|
29 |
+
_DATASET_URL = "https://huggingface.co/datasets/JAWCF/fighting-characters/resolve/main/images.tar.gz"
|
30 |
+
|
31 |
+
json_url = urllib.request.urlopen("https://huggingface.co/datasets/JAWCF/fighting-characters/resolve/main/character.json")
|
32 |
+
DICT_DESC = json.loads(json_url.read())
|
33 |
+
|
34 |
+
class Characters(datasets.GeneratorBasedBuilder):
|
35 |
+
|
36 |
+
def _info(self):
|
37 |
+
features = datasets.Features({
|
38 |
+
'image': datasets.Image(),
|
39 |
+
'text': datasets.Value('string')
|
40 |
+
})
|
41 |
+
return datasets.DatasetInfo(
|
42 |
+
# This is the description that will appear on the datasets page.
|
43 |
+
description=_DESCRIPTION,
|
44 |
+
# This defines the different columns of the dataset and their types
|
45 |
+
features=features, # Here we define them above because they are different between the two configurations
|
46 |
+
supervised_keys=None,
|
47 |
+
# Homepage of the dataset for documentation
|
48 |
+
homepage="",
|
49 |
+
# License for the dataset if available
|
50 |
+
license="",
|
51 |
+
# Citation for the dataset
|
52 |
+
citation=_CITATION,
|
53 |
+
)
|
54 |
+
|
55 |
+
def _split_generators(self, dl_manager):
|
56 |
+
path = dl_manager.download(_DATASET_URL)
|
57 |
+
image_iters = dl_manager.iter_archive(path)
|
58 |
+
splits = [
|
59 |
+
datasets.SplitGenerator(
|
60 |
+
name=datasets.Split.TRAIN,
|
61 |
+
gen_kwargs={
|
62 |
+
"images": image_iters
|
63 |
+
}
|
64 |
+
),
|
65 |
+
]
|
66 |
+
return splits
|
67 |
+
|
68 |
+
def _generate_examples(self, images):
|
69 |
+
"""Yields examples."""
|
70 |
+
idx = 0
|
71 |
+
for filepath, image in images:
|
72 |
+
yield idx, {
|
73 |
+
"image": {"path": filepath, "bytes": image.read()},
|
74 |
+
"text" : DICT_DESC[filepath.split("/")[-1]],
|
75 |
+
}
|
76 |
+
idx+=1
|
images.tar.gz
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:e794f1901f6cd77ea87896c9761ffaca0f77d2b1dd6684d226d1bfb26ea127d1
|
3 |
+
size 34710483
|