init
Browse files- .idea/.gitignore +8 -0
- .idea/inspectionProfiles/profiles_settings.xml +6 -0
- .idea/modules.xml +8 -0
- .idea/please.iml +12 -0
- .idea/vcs.xml +6 -0
- README.md +1 -1
- app.py +250 -0
- edittxt.py +153 -0
- initcolor.py +8 -0
- labels.txt +150 -0
- requirements.txt +6 -0
.idea/.gitignore
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Default ignored files
|
| 2 |
+
/shelf/
|
| 3 |
+
/workspace.xml
|
| 4 |
+
# Editor-based HTTP Client requests
|
| 5 |
+
/httpRequests/
|
| 6 |
+
# Datasource local storage ignored files
|
| 7 |
+
/dataSources/
|
| 8 |
+
/dataSources.local.xml
|
.idea/inspectionProfiles/profiles_settings.xml
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<component name="InspectionProjectProfileManager">
|
| 2 |
+
<settings>
|
| 3 |
+
<option name="USE_PROJECT_PROFILE" value="false" />
|
| 4 |
+
<version value="1.0" />
|
| 5 |
+
</settings>
|
| 6 |
+
</component>
|
.idea/modules.xml
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?xml version="1.0" encoding="UTF-8"?>
|
| 2 |
+
<project version="4">
|
| 3 |
+
<component name="ProjectModuleManager">
|
| 4 |
+
<modules>
|
| 5 |
+
<module fileurl="file://$PROJECT_DIR$/.idea/please.iml" filepath="$PROJECT_DIR$/.idea/please.iml" />
|
| 6 |
+
</modules>
|
| 7 |
+
</component>
|
| 8 |
+
</project>
|
.idea/please.iml
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?xml version="1.0" encoding="UTF-8"?>
|
| 2 |
+
<module type="PYTHON_MODULE" version="4">
|
| 3 |
+
<component name="NewModuleRootManager">
|
| 4 |
+
<content url="file://$MODULE_DIR$" />
|
| 5 |
+
<orderEntry type="inheritedJdk" />
|
| 6 |
+
<orderEntry type="sourceFolder" forTests="false" />
|
| 7 |
+
</component>
|
| 8 |
+
<component name="PyDocumentationSettings">
|
| 9 |
+
<option name="format" value="PLAIN" />
|
| 10 |
+
<option name="myDocStringFormat" value="Plain" />
|
| 11 |
+
</component>
|
| 12 |
+
</module>
|
.idea/vcs.xml
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?xml version="1.0" encoding="UTF-8"?>
|
| 2 |
+
<project version="4">
|
| 3 |
+
<component name="VcsDirectoryMappings">
|
| 4 |
+
<mapping directory="" vcs="Git" />
|
| 5 |
+
</component>
|
| 6 |
+
</project>
|
README.md
CHANGED
|
@@ -4,7 +4,7 @@ emoji: 🏆
|
|
| 4 |
colorFrom: gray
|
| 5 |
colorTo: yellow
|
| 6 |
sdk: gradio
|
| 7 |
-
sdk_version:
|
| 8 |
app_file: app.py
|
| 9 |
pinned: false
|
| 10 |
---
|
|
|
|
| 4 |
colorFrom: gray
|
| 5 |
colorTo: yellow
|
| 6 |
sdk: gradio
|
| 7 |
+
sdk_version: 3.44.4
|
| 8 |
app_file: app.py
|
| 9 |
pinned: false
|
| 10 |
---
|
app.py
ADDED
|
@@ -0,0 +1,250 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import gradio as gr
|
| 2 |
+
|
| 3 |
+
from matplotlib import gridspec
|
| 4 |
+
import matplotlib.pyplot as plt
|
| 5 |
+
import numpy as np
|
| 6 |
+
from PIL import Image
|
| 7 |
+
import tensorflow as tf
|
| 8 |
+
from transformers import SegformerFeatureExtractor, TFSegformerForSemanticSegmentation
|
| 9 |
+
|
| 10 |
+
feature_extractor = SegformerFeatureExtractor.from_pretrained(
|
| 11 |
+
"nvidia/segformer-b0-finetuned-ade-512-512"
|
| 12 |
+
)
|
| 13 |
+
model = TFSegformerForSemanticSegmentation.from_pretrained(
|
| 14 |
+
"nvidia/segformer-b0-finetuned-ade-512-512"
|
| 15 |
+
)
|
| 16 |
+
|
| 17 |
+
|
| 18 |
+
def ade_palette():
|
| 19 |
+
"""ADE20K palette that maps each class to RGB values."""
|
| 20 |
+
return [
|
| 21 |
+
[111, 214, 93],
|
| 22 |
+
[18, 181, 57],
|
| 23 |
+
[72, 152, 135],
|
| 24 |
+
[240, 74, 253],
|
| 25 |
+
[211, 22, 184],
|
| 26 |
+
[68, 111, 215],
|
| 27 |
+
[120, 212, 135],
|
| 28 |
+
[185, 244, 20],
|
| 29 |
+
[190, 90, 92],
|
| 30 |
+
[53, 18, 220],
|
| 31 |
+
[251, 56, 67],
|
| 32 |
+
[141, 248, 248],
|
| 33 |
+
[226, 38, 196],
|
| 34 |
+
[153, 75, 248],
|
| 35 |
+
[158, 166, 127],
|
| 36 |
+
[240, 254, 73],
|
| 37 |
+
[157, 99, 218],
|
| 38 |
+
[85, 243, 54],
|
| 39 |
+
[38, 71, 123],
|
| 40 |
+
[207, 188, 66],
|
| 41 |
+
[145, 24, 6],
|
| 42 |
+
[187, 252, 239],
|
| 43 |
+
[240, 181, 229],
|
| 44 |
+
[137, 187, 112],
|
| 45 |
+
[104, 219, 158],
|
| 46 |
+
[234, 56, 176],
|
| 47 |
+
[23, 141, 13],
|
| 48 |
+
[28, 22, 88],
|
| 49 |
+
[83, 169, 127],
|
| 50 |
+
[1, 236, 221],
|
| 51 |
+
[61, 88, 81],
|
| 52 |
+
[102, 94, 10],
|
| 53 |
+
[116, 233, 66],
|
| 54 |
+
[147, 247, 143],
|
| 55 |
+
[241, 72, 39],
|
| 56 |
+
[229, 165, 195],
|
| 57 |
+
[22, 247, 217],
|
| 58 |
+
[110, 208, 164],
|
| 59 |
+
[236, 236, 6],
|
| 60 |
+
[163, 31, 15],
|
| 61 |
+
[78, 148, 190],
|
| 62 |
+
[92, 222, 66],
|
| 63 |
+
[198, 120, 99],
|
| 64 |
+
[161, 201, 28],
|
| 65 |
+
[235, 88, 53],
|
| 66 |
+
[249, 233, 102],
|
| 67 |
+
[235, 115, 89],
|
| 68 |
+
[51, 135, 171],
|
| 69 |
+
[37, 162, 46],
|
| 70 |
+
[11, 200, 171],
|
| 71 |
+
[192, 186, 65],
|
| 72 |
+
[173, 208, 139],
|
| 73 |
+
[240, 124, 1],
|
| 74 |
+
[106, 209, 96],
|
| 75 |
+
[174, 126, 239],
|
| 76 |
+
[221, 234, 164],
|
| 77 |
+
[140, 46, 109],
|
| 78 |
+
[135, 62, 174],
|
| 79 |
+
[130, 51, 242],
|
| 80 |
+
[229, 28, 133],
|
| 81 |
+
[30, 157, 217],
|
| 82 |
+
[154, 195, 123],
|
| 83 |
+
[157, 115, 35],
|
| 84 |
+
[199, 218, 59],
|
| 85 |
+
[144, 47, 157],
|
| 86 |
+
[253, 185, 226],
|
| 87 |
+
[8, 62, 238],
|
| 88 |
+
[71, 191, 146],
|
| 89 |
+
[217, 227, 170],
|
| 90 |
+
[169, 195, 73],
|
| 91 |
+
[253, 60, 179],
|
| 92 |
+
[42, 239, 174],
|
| 93 |
+
[67, 221, 248],
|
| 94 |
+
[163, 179, 218],
|
| 95 |
+
[250, 30, 153],
|
| 96 |
+
[154, 66, 181],
|
| 97 |
+
[109, 228, 192],
|
| 98 |
+
[213, 212, 73],
|
| 99 |
+
[125, 186, 185],
|
| 100 |
+
[12, 80, 88],
|
| 101 |
+
[188, 90, 227],
|
| 102 |
+
[38, 131, 95],
|
| 103 |
+
[105, 56, 175],
|
| 104 |
+
[230, 72, 244],
|
| 105 |
+
[212, 98, 68],
|
| 106 |
+
[5, 14, 131],
|
| 107 |
+
[136, 150, 164],
|
| 108 |
+
[72, 70, 198],
|
| 109 |
+
[160, 124, 189],
|
| 110 |
+
[255, 132, 160],
|
| 111 |
+
[199, 71, 86],
|
| 112 |
+
[32, 209, 66],
|
| 113 |
+
[167, 50, 228],
|
| 114 |
+
[163, 72, 61],
|
| 115 |
+
[53, 24, 145],
|
| 116 |
+
[132, 27, 124],
|
| 117 |
+
[72, 143, 166],
|
| 118 |
+
[54, 156, 177],
|
| 119 |
+
[197, 26, 37],
|
| 120 |
+
[230, 92, 201],
|
| 121 |
+
[31, 47, 165],
|
| 122 |
+
[133, 215, 89],
|
| 123 |
+
[190, 51, 145],
|
| 124 |
+
[162, 3, 41],
|
| 125 |
+
[37, 197, 236],
|
| 126 |
+
[247, 19, 29],
|
| 127 |
+
[105, 12, 99],
|
| 128 |
+
[130, 235, 57],
|
| 129 |
+
[112, 224, 59],
|
| 130 |
+
[6, 253, 14],
|
| 131 |
+
[205, 176, 152],
|
| 132 |
+
[110, 202, 51],
|
| 133 |
+
[94, 74, 61],
|
| 134 |
+
[108, 86, 56],
|
| 135 |
+
[148, 184, 162],
|
| 136 |
+
[125, 0, 195],
|
| 137 |
+
[143, 211, 60],
|
| 138 |
+
[108, 240, 95],
|
| 139 |
+
[106, 211, 59],
|
| 140 |
+
[12, 1, 158],
|
| 141 |
+
[46, 53, 36],
|
| 142 |
+
[130, 192, 113],
|
| 143 |
+
[204, 224, 85],
|
| 144 |
+
[162, 86, 98],
|
| 145 |
+
[10, 155, 230],
|
| 146 |
+
[76, 105, 166],
|
| 147 |
+
[157, 34, 206],
|
| 148 |
+
[3, 230, 115],
|
| 149 |
+
[115, 172, 117],
|
| 150 |
+
[98, 2, 191],
|
| 151 |
+
[173, 132, 102],
|
| 152 |
+
[3, 47, 51],
|
| 153 |
+
[60, 7, 102],
|
| 154 |
+
[70, 47, 237],
|
| 155 |
+
[10, 145, 167],
|
| 156 |
+
[235, 156, 244],
|
| 157 |
+
[142, 188, 86],
|
| 158 |
+
[137, 45, 182],
|
| 159 |
+
[110, 37, 249],
|
| 160 |
+
[21, 108, 156],
|
| 161 |
+
[51, 19, 187],
|
| 162 |
+
[66, 99, 230],
|
| 163 |
+
[249, 153, 221],
|
| 164 |
+
[231, 146, 194],
|
| 165 |
+
[153, 115, 50],
|
| 166 |
+
[25, 15, 226],
|
| 167 |
+
[126, 9, 119],
|
| 168 |
+
[241, 114, 28],
|
| 169 |
+
[134, 156, 64],
|
| 170 |
+
[111, 215, 120],
|
| 171 |
+
]
|
| 172 |
+
|
| 173 |
+
|
| 174 |
+
labels_list = []
|
| 175 |
+
|
| 176 |
+
with open(r"labels.txt", "r") as fp:
|
| 177 |
+
for line in fp:
|
| 178 |
+
labels_list.append(line[:-1])
|
| 179 |
+
|
| 180 |
+
colormap = np.asarray(ade_palette())
|
| 181 |
+
|
| 182 |
+
|
| 183 |
+
def label_to_color_image(label):
|
| 184 |
+
if label.ndim != 2:
|
| 185 |
+
raise ValueError("Expect 2-D input label")
|
| 186 |
+
|
| 187 |
+
if np.max(label) >= len(colormap):
|
| 188 |
+
raise ValueError("label value too large.")
|
| 189 |
+
return colormap[label]
|
| 190 |
+
|
| 191 |
+
|
| 192 |
+
def draw_plot(pred_img, seg):
|
| 193 |
+
fig = plt.figure(figsize=(20, 15))
|
| 194 |
+
|
| 195 |
+
grid_spec = gridspec.GridSpec(1, 2, width_ratios=[6, 1])
|
| 196 |
+
|
| 197 |
+
plt.subplot(grid_spec[0])
|
| 198 |
+
plt.imshow(pred_img)
|
| 199 |
+
plt.axis("off")
|
| 200 |
+
LABEL_NAMES = np.asarray(labels_list)
|
| 201 |
+
FULL_LABEL_MAP = np.arange(len(LABEL_NAMES)).reshape(len(LABEL_NAMES), 1)
|
| 202 |
+
FULL_COLOR_MAP = label_to_color_image(FULL_LABEL_MAP)
|
| 203 |
+
|
| 204 |
+
unique_labels = np.unique(seg.numpy().astype("uint8"))
|
| 205 |
+
ax = plt.subplot(grid_spec[1])
|
| 206 |
+
plt.imshow(FULL_COLOR_MAP[unique_labels].astype(np.uint8), interpolation="nearest")
|
| 207 |
+
ax.yaxis.tick_right()
|
| 208 |
+
plt.yticks(range(len(unique_labels)), LABEL_NAMES[unique_labels])
|
| 209 |
+
plt.xticks([], [])
|
| 210 |
+
ax.tick_params(width=0.0, labelsize=25)
|
| 211 |
+
return fig
|
| 212 |
+
|
| 213 |
+
|
| 214 |
+
def sepia(input_img):
|
| 215 |
+
input_img = Image.fromarray(input_img)
|
| 216 |
+
|
| 217 |
+
inputs = feature_extractor(images=input_img, return_tensors="tf")
|
| 218 |
+
outputs = model(**inputs)
|
| 219 |
+
logits = outputs.logits
|
| 220 |
+
|
| 221 |
+
logits = tf.transpose(logits, [0, 2, 3, 1])
|
| 222 |
+
logits = tf.image.resize(
|
| 223 |
+
logits, input_img.size[::-1]
|
| 224 |
+
) # We reverse the shape of `image` because `image.size` returns width and height.
|
| 225 |
+
seg = tf.math.argmax(logits, axis=-1)[0]
|
| 226 |
+
|
| 227 |
+
color_seg = np.zeros(
|
| 228 |
+
(seg.shape[0], seg.shape[1], 3), dtype=np.uint8
|
| 229 |
+
) # height, width, 3
|
| 230 |
+
for label, color in enumerate(colormap):
|
| 231 |
+
color_seg[seg.numpy() == label, :] = color
|
| 232 |
+
|
| 233 |
+
# Show image + mask
|
| 234 |
+
pred_img = np.array(input_img) * 0.5 + color_seg * 0.5
|
| 235 |
+
pred_img = pred_img.astype(np.uint8)
|
| 236 |
+
|
| 237 |
+
fig = draw_plot(pred_img, seg)
|
| 238 |
+
return fig
|
| 239 |
+
|
| 240 |
+
|
| 241 |
+
demo = gr.Interface(
|
| 242 |
+
fn=sepia,
|
| 243 |
+
inputs=gr.Image(shape=(800, 600)),
|
| 244 |
+
outputs=["plot"],
|
| 245 |
+
examples=[
|
| 246 |
+
"image (1).jpg"],
|
| 247 |
+
allow_flagging="never",
|
| 248 |
+
)
|
| 249 |
+
|
| 250 |
+
demo.launch()
|
edittxt.py
ADDED
|
@@ -0,0 +1,153 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
dic = {"0": "wall",
|
| 2 |
+
"1": "building",
|
| 3 |
+
"2": "sky",
|
| 4 |
+
"3": "floor",
|
| 5 |
+
"4": "tree",
|
| 6 |
+
"5": "ceiling",
|
| 7 |
+
"6": "road",
|
| 8 |
+
"7": "bed ",
|
| 9 |
+
"8": "windowpane",
|
| 10 |
+
"9": "grass",
|
| 11 |
+
"10": "cabinet",
|
| 12 |
+
"11": "sidewalk",
|
| 13 |
+
"12": "person",
|
| 14 |
+
"13": "earth",
|
| 15 |
+
"14": "door",
|
| 16 |
+
"15": "table",
|
| 17 |
+
"16": "mountain",
|
| 18 |
+
"17": "plant",
|
| 19 |
+
"18": "curtain",
|
| 20 |
+
"19": "chair",
|
| 21 |
+
"20": "car",
|
| 22 |
+
"21": "water",
|
| 23 |
+
"22": "painting",
|
| 24 |
+
"23": "sofa",
|
| 25 |
+
"24": "shelf",
|
| 26 |
+
"25": "house",
|
| 27 |
+
"26": "sea",
|
| 28 |
+
"27": "mirror",
|
| 29 |
+
"28": "rug",
|
| 30 |
+
"29": "field",
|
| 31 |
+
"30": "armchair",
|
| 32 |
+
"31": "seat",
|
| 33 |
+
"32": "fence",
|
| 34 |
+
"33": "desk",
|
| 35 |
+
"34": "rock",
|
| 36 |
+
"35": "wardrobe",
|
| 37 |
+
"36": "lamp",
|
| 38 |
+
"37": "bathtub",
|
| 39 |
+
"38": "railing",
|
| 40 |
+
"39": "cushion",
|
| 41 |
+
"40": "base",
|
| 42 |
+
"41": "box",
|
| 43 |
+
"42": "column",
|
| 44 |
+
"43": "signboard",
|
| 45 |
+
"44": "chest of drawers",
|
| 46 |
+
"45": "counter",
|
| 47 |
+
"46": "sand",
|
| 48 |
+
"47": "sink",
|
| 49 |
+
"48": "skyscraper",
|
| 50 |
+
"49": "fireplace",
|
| 51 |
+
"50": "refrigerator",
|
| 52 |
+
"51": "grandstand",
|
| 53 |
+
"52": "path",
|
| 54 |
+
"53": "stairs",
|
| 55 |
+
"54": "runway",
|
| 56 |
+
"55": "case",
|
| 57 |
+
"56": "pool table",
|
| 58 |
+
"57": "pillow",
|
| 59 |
+
"58": "screen door",
|
| 60 |
+
"59": "stairway",
|
| 61 |
+
"60": "river",
|
| 62 |
+
"61": "bridge",
|
| 63 |
+
"62": "bookcase",
|
| 64 |
+
"63": "blind",
|
| 65 |
+
"64": "coffee table",
|
| 66 |
+
"65": "toilet",
|
| 67 |
+
"66": "flower",
|
| 68 |
+
"67": "book",
|
| 69 |
+
"68": "hill",
|
| 70 |
+
"69": "bench",
|
| 71 |
+
"70": "countertop",
|
| 72 |
+
"71": "stove",
|
| 73 |
+
"72": "palm",
|
| 74 |
+
"73": "kitchen island",
|
| 75 |
+
"74": "computer",
|
| 76 |
+
"75": "swivel chair",
|
| 77 |
+
"76": "boat",
|
| 78 |
+
"77": "bar",
|
| 79 |
+
"78": "arcade machine",
|
| 80 |
+
"79": "hovel",
|
| 81 |
+
"80": "bus",
|
| 82 |
+
"81": "towel",
|
| 83 |
+
"82": "light",
|
| 84 |
+
"83": "truck",
|
| 85 |
+
"84": "tower",
|
| 86 |
+
"85": "chandelier",
|
| 87 |
+
"86": "awning",
|
| 88 |
+
"87": "streetlight",
|
| 89 |
+
"88": "booth",
|
| 90 |
+
"89": "television receiver",
|
| 91 |
+
"90": "airplane",
|
| 92 |
+
"91": "dirt track",
|
| 93 |
+
"92": "apparel",
|
| 94 |
+
"93": "pole",
|
| 95 |
+
"94": "land",
|
| 96 |
+
"95": "bannister",
|
| 97 |
+
"96": "escalator",
|
| 98 |
+
"97": "ottoman",
|
| 99 |
+
"98": "bottle",
|
| 100 |
+
"99": "buffet",
|
| 101 |
+
"100": "poster",
|
| 102 |
+
"101": "stage",
|
| 103 |
+
"102": "van",
|
| 104 |
+
"103": "ship",
|
| 105 |
+
"104": "fountain",
|
| 106 |
+
"105": "conveyer belt",
|
| 107 |
+
"106": "canopy",
|
| 108 |
+
"107": "washer",
|
| 109 |
+
"108": "plaything",
|
| 110 |
+
"109": "swimming pool",
|
| 111 |
+
"110": "stool",
|
| 112 |
+
"111": "barrel",
|
| 113 |
+
"112": "basket",
|
| 114 |
+
"113": "waterfall",
|
| 115 |
+
"114": "tent",
|
| 116 |
+
"115": "bag",
|
| 117 |
+
"116": "minibike",
|
| 118 |
+
"117": "cradle",
|
| 119 |
+
"118": "oven",
|
| 120 |
+
"119": "ball",
|
| 121 |
+
"120": "food",
|
| 122 |
+
"121": "step",
|
| 123 |
+
"122": "tank",
|
| 124 |
+
"123": "trade name",
|
| 125 |
+
"124": "microwave",
|
| 126 |
+
"125": "pot",
|
| 127 |
+
"126": "animal",
|
| 128 |
+
"127": "bicycle",
|
| 129 |
+
"128": "lake",
|
| 130 |
+
"129": "dishwasher",
|
| 131 |
+
"130": "screen",
|
| 132 |
+
"131": "blanket",
|
| 133 |
+
"132": "sculpture",
|
| 134 |
+
"133": "hood",
|
| 135 |
+
"134": "sconce",
|
| 136 |
+
"135": "vase",
|
| 137 |
+
"136": "traffic light",
|
| 138 |
+
"137": "tray",
|
| 139 |
+
"138": "ashcan",
|
| 140 |
+
"139": "fan",
|
| 141 |
+
"140": "pier",
|
| 142 |
+
"141": "crt screen",
|
| 143 |
+
"142": "plate",
|
| 144 |
+
"143": "monitor",
|
| 145 |
+
"144": "bulletin board",
|
| 146 |
+
"145": "shower",
|
| 147 |
+
"146": "radiator",
|
| 148 |
+
"147": "glass",
|
| 149 |
+
"148": "clock",
|
| 150 |
+
"149": "flag"}
|
| 151 |
+
|
| 152 |
+
for i in dic.values():
|
| 153 |
+
print(i)
|
initcolor.py
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import random
|
| 2 |
+
|
| 3 |
+
print(random.randint(0, 255))
|
| 4 |
+
|
| 5 |
+
for i in list(range(150)):
|
| 6 |
+
print("[" + str(random.randint(0, 255)) + ", "
|
| 7 |
+
+ str(random.randint(0, 255)) + ", "
|
| 8 |
+
+ str(random.randint(0, 255)) + "], ")
|
labels.txt
ADDED
|
@@ -0,0 +1,150 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
wall
|
| 2 |
+
building
|
| 3 |
+
sky
|
| 4 |
+
floor
|
| 5 |
+
tree
|
| 6 |
+
ceiling
|
| 7 |
+
road
|
| 8 |
+
bed
|
| 9 |
+
windowpane
|
| 10 |
+
grass
|
| 11 |
+
cabinet
|
| 12 |
+
sidewalk
|
| 13 |
+
person
|
| 14 |
+
earth
|
| 15 |
+
door
|
| 16 |
+
table
|
| 17 |
+
mountain
|
| 18 |
+
plant
|
| 19 |
+
curtain
|
| 20 |
+
chair
|
| 21 |
+
car
|
| 22 |
+
water
|
| 23 |
+
painting
|
| 24 |
+
sofa
|
| 25 |
+
shelf
|
| 26 |
+
house
|
| 27 |
+
sea
|
| 28 |
+
mirror
|
| 29 |
+
rug
|
| 30 |
+
field
|
| 31 |
+
armchair
|
| 32 |
+
seat
|
| 33 |
+
fence
|
| 34 |
+
desk
|
| 35 |
+
rock
|
| 36 |
+
wardrobe
|
| 37 |
+
lamp
|
| 38 |
+
bathtub
|
| 39 |
+
railing
|
| 40 |
+
cushion
|
| 41 |
+
base
|
| 42 |
+
box
|
| 43 |
+
column
|
| 44 |
+
signboard
|
| 45 |
+
chest of drawers
|
| 46 |
+
counter
|
| 47 |
+
sand
|
| 48 |
+
sink
|
| 49 |
+
skyscraper
|
| 50 |
+
fireplace
|
| 51 |
+
refrigerator
|
| 52 |
+
grandstand
|
| 53 |
+
path
|
| 54 |
+
stairs
|
| 55 |
+
runway
|
| 56 |
+
case
|
| 57 |
+
pool table
|
| 58 |
+
pillow
|
| 59 |
+
screen door
|
| 60 |
+
stairway
|
| 61 |
+
river
|
| 62 |
+
bridge
|
| 63 |
+
bookcase
|
| 64 |
+
blind
|
| 65 |
+
coffee table
|
| 66 |
+
toilet
|
| 67 |
+
flower
|
| 68 |
+
book
|
| 69 |
+
hill
|
| 70 |
+
bench
|
| 71 |
+
countertop
|
| 72 |
+
stove
|
| 73 |
+
palm
|
| 74 |
+
kitchen island
|
| 75 |
+
computer
|
| 76 |
+
swivel chair
|
| 77 |
+
boat
|
| 78 |
+
bar
|
| 79 |
+
arcade machine
|
| 80 |
+
hovel
|
| 81 |
+
bus
|
| 82 |
+
towel
|
| 83 |
+
light
|
| 84 |
+
truck
|
| 85 |
+
tower
|
| 86 |
+
chandelier
|
| 87 |
+
awning
|
| 88 |
+
streetlight
|
| 89 |
+
booth
|
| 90 |
+
television receiver
|
| 91 |
+
airplane
|
| 92 |
+
dirt track
|
| 93 |
+
apparel
|
| 94 |
+
pole
|
| 95 |
+
land
|
| 96 |
+
bannister
|
| 97 |
+
escalator
|
| 98 |
+
ottoman
|
| 99 |
+
bottle
|
| 100 |
+
buffet
|
| 101 |
+
poster
|
| 102 |
+
stage
|
| 103 |
+
van
|
| 104 |
+
ship
|
| 105 |
+
fountain
|
| 106 |
+
conveyer belt
|
| 107 |
+
canopy
|
| 108 |
+
washer
|
| 109 |
+
plaything
|
| 110 |
+
swimming pool
|
| 111 |
+
stool
|
| 112 |
+
barrel
|
| 113 |
+
basket
|
| 114 |
+
waterfall
|
| 115 |
+
tent
|
| 116 |
+
bag
|
| 117 |
+
minibike
|
| 118 |
+
cradle
|
| 119 |
+
oven
|
| 120 |
+
ball
|
| 121 |
+
food
|
| 122 |
+
step
|
| 123 |
+
tank
|
| 124 |
+
trade name
|
| 125 |
+
microwave
|
| 126 |
+
pot
|
| 127 |
+
animal
|
| 128 |
+
bicycle
|
| 129 |
+
lake
|
| 130 |
+
dishwasher
|
| 131 |
+
screen
|
| 132 |
+
blanket
|
| 133 |
+
sculpture
|
| 134 |
+
hood
|
| 135 |
+
sconce
|
| 136 |
+
vase
|
| 137 |
+
traffic light
|
| 138 |
+
tray
|
| 139 |
+
ashcan
|
| 140 |
+
fan
|
| 141 |
+
pier
|
| 142 |
+
crt screen
|
| 143 |
+
plate
|
| 144 |
+
monitor
|
| 145 |
+
bulletin board
|
| 146 |
+
shower
|
| 147 |
+
radiator
|
| 148 |
+
glass
|
| 149 |
+
clock
|
| 150 |
+
flag
|
requirements.txt
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
torch
|
| 2 |
+
transformers
|
| 3 |
+
tensorflow
|
| 4 |
+
numpy
|
| 5 |
+
Image
|
| 6 |
+
matplotlib
|