- .idea/.gitignore +8 -0
- .idea/22.iml +8 -0
- .idea/inspectionProfiles/profiles_settings.xml +6 -0
- .idea/misc.xml +4 -0
- .idea/modules.xml +8 -0
- .idea/vcs.xml +6 -0
- app.py +9 -9
- image (1).jpg +0 -0
- image (2).jpg +0 -0
- image (3).jpg +0 -0
- image (4).jpg +0 -0
- image (5).jpg +0 -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/22.iml
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
</module>
|
.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/misc.xml
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="UTF-8"?>
|
2 |
+
<project version="4">
|
3 |
+
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.9" project-jdk-type="Python SDK" />
|
4 |
+
</project>
|
.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/22.iml" filepath="$PROJECT_DIR$/.idea/22.iml" />
|
6 |
+
</modules>
|
7 |
+
</component>
|
8 |
+
</project>
|
.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>
|
app.py
CHANGED
@@ -13,14 +13,14 @@ import requests
|
|
13 |
feature_extractor = SegformerFeatureExtractor.from_pretrained("nvidia/segformer-b0-finetuned-cityscapes-640-1280")
|
14 |
model = SegformerForSemanticSegmentation.from_pretrained("nvidia/segformer-b0-finetuned-cityscapes-640-1280")
|
15 |
|
16 |
-
urls = ["http://farm3.staticflickr.com/2523/3705549787_79049b1b6d_z.jpg",
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
images = []
|
22 |
-
for i in urls:
|
23 |
-
|
24 |
|
25 |
|
26 |
# inputs = feature_extractor(images=image, return_tensors="pt")
|
@@ -120,6 +120,6 @@ iface = gr.Interface(
|
|
120 |
fn=greet,
|
121 |
inputs="image",
|
122 |
outputs=["plot"],
|
123 |
-
examples=
|
124 |
allow_flagging="never")
|
125 |
iface.launch(share=True)
|
|
|
13 |
feature_extractor = SegformerFeatureExtractor.from_pretrained("nvidia/segformer-b0-finetuned-cityscapes-640-1280")
|
14 |
model = SegformerForSemanticSegmentation.from_pretrained("nvidia/segformer-b0-finetuned-cityscapes-640-1280")
|
15 |
|
16 |
+
# urls = ["http://farm3.staticflickr.com/2523/3705549787_79049b1b6d_z.jpg",
|
17 |
+
# "http://farm8.staticflickr.com/7012/6476201279_52db36af64_z.jpg",
|
18 |
+
# "http://farm8.staticflickr.com/7180/6967423255_a3d65d5f6b_z.jpg",
|
19 |
+
# "http://farm4.staticflickr.com/3563/3470840644_3378804bea_z.jpg",
|
20 |
+
# "http://farm9.staticflickr.com/8388/8516454091_0ebdc1130a_z.jpg"]
|
21 |
+
# images = []
|
22 |
+
# for i in urls:
|
23 |
+
# images.append(Image.open(requests.get(i, stream=True).raw))
|
24 |
|
25 |
|
26 |
# inputs = feature_extractor(images=image, return_tensors="pt")
|
|
|
120 |
fn=greet,
|
121 |
inputs="image",
|
122 |
outputs=["plot"],
|
123 |
+
examples=["image (1)", "image (2)", "image (3)", "image (4)", "image (5)"],
|
124 |
allow_flagging="never")
|
125 |
iface.launch(share=True)
|
image (1).jpg
ADDED
![]() |
image (2).jpg
ADDED
![]() |
image (3).jpg
ADDED
![]() |
image (4).jpg
ADDED
![]() |
image (5).jpg
ADDED
![]() |