Spaces:
Sleeping
Sleeping
Commit
·
aa1932e
1
Parent(s):
266b77d
Subindo arquivos33
Browse files
app.py
CHANGED
@@ -8,16 +8,16 @@ import collections
|
|
8 |
import json
|
9 |
import glob
|
10 |
|
11 |
-
# Padrões de IA
|
12 |
ai_patterns = [
|
13 |
-
"PIC*", "PersonalImageClassifier*", "Look*", "LookExtension*", "ChatBot", "ImageBot", "TMIC",
|
14 |
-
"TeachableMachineImageClassifier*", "SpeechRecognizer*", "FaceExtension*",
|
15 |
]
|
16 |
|
17 |
# Padrões para cada categoria
|
18 |
drawing_and_animation_patterns = ["Ball", "Canvas", "ImageSprite"]
|
19 |
-
maps_patterns = ["Map", "Marker", "Circle", "FeatureCollection", "LineString", "Navigation",
|
20 |
-
sensors_patterns = ["AccelerometerSensor", "BarcodeScanner", "Barometer", "Clock", "GyroscopeSensor", "Hygrometer", "LightSensor", "LocationSensor", "MagneticFieldSensor", "NearField",
|
21 |
social_patterns = ["ContactPicker", "EmailPicker", "PhoneCall", "PhoneNumberPicker", "Texting", "Twitter"]
|
22 |
storage_patterns = ["File", "CloudDB", "DataFile", "Spreadsheet", "FusiontablesControl", "TinyDB", "TinyWebDB"]
|
23 |
connectivity_patterns = ["BluetoothClient", "ActivityStarter", "Serial", "BluetoothServer", "Web"]
|
@@ -110,9 +110,12 @@ def extract_project_info_from_properties(file_path):
|
|
110 |
|
111 |
# Complementary method for extracting the app name from .scm files
|
112 |
if app_name == "N/A":
|
113 |
-
|
114 |
-
|
115 |
-
|
|
|
|
|
|
|
116 |
|
117 |
return {
|
118 |
'timestamp': timestamp,
|
@@ -257,12 +260,14 @@ def analyze_aia(uploaded_files):
|
|
257 |
html_result = combined_results_df.to_html(escape=False, classes="output-html")
|
258 |
return output_style + f'<div class="output-container">{html_result}</div>'
|
259 |
|
260 |
-
#
|
|
|
|
|
261 |
iface = gr.Interface(
|
262 |
fn=analyze_aia,
|
263 |
inputs=gr.Files(label="Upload .aia Files"),
|
264 |
outputs=gr.HTML(),
|
265 |
-
examples=[[
|
266 |
title="AIA-Scope",
|
267 |
description="Upload .aia (or multiples .aia) files to analyze/dissect their components. An .aia file from MIT App Inventor is a project file format that contains all the necessary information for an App Inventor project.",
|
268 |
live=False
|
|
|
8 |
import json
|
9 |
import glob
|
10 |
|
11 |
+
# Padrões de IA...
|
12 |
ai_patterns = [
|
13 |
+
"PIC*", "PersonalImageClassifier*", "Look*", "LookExtension*", "ChatBot", "ImageBot", "TMIC","Gemini*", "Llama*","TeachableMachine*",
|
14 |
+
"TeachableMachineImageClassifier*", "SpeechRecognizer*", "FaceExtension*","Pose*","Posenet","PosenetExtension", "Eliza*", "Alexa*"
|
15 |
]
|
16 |
|
17 |
# Padrões para cada categoria
|
18 |
drawing_and_animation_patterns = ["Ball", "Canvas", "ImageSprite"]
|
19 |
+
maps_patterns = ["Map", "Marker", "Circle", "FeatureCollection", "LineString", "Navigation","Polygon", "Retangle" ]
|
20 |
+
sensors_patterns = ["AccelerometerSensor", "BarcodeScanner", "Barometer", "Clock", "GyroscopeSensor", "Hygrometer", "LightSensor", "LocationSensor", "MagneticFieldSensor", "NearField","OrientationSensor", "ProximitySensor","Thermometer", "Pedometer"]
|
21 |
social_patterns = ["ContactPicker", "EmailPicker", "PhoneCall", "PhoneNumberPicker", "Texting", "Twitter"]
|
22 |
storage_patterns = ["File", "CloudDB", "DataFile", "Spreadsheet", "FusiontablesControl", "TinyDB", "TinyWebDB"]
|
23 |
connectivity_patterns = ["BluetoothClient", "ActivityStarter", "Serial", "BluetoothServer", "Web"]
|
|
|
110 |
|
111 |
# Complementary method for extracting the app name from .scm files
|
112 |
if app_name == "N/A":
|
113 |
+
print("O campo App Name não foi encontrado em project.properties. Tentando encontrar em arquivos .scm...")
|
114 |
+
app_name = extract_app_name_from_scm_files(temp_dir)
|
115 |
+
print(f"Nome do App encontrado nos arquivos .scm: {app_name}")
|
116 |
+
|
117 |
+
# ...
|
118 |
+
|
119 |
|
120 |
return {
|
121 |
'timestamp': timestamp,
|
|
|
260 |
html_result = combined_results_df.to_html(escape=False, classes="output-html")
|
261 |
return output_style + f'<div class="output-container">{html_result}</div>'
|
262 |
|
263 |
+
# Caminho do exemplo fornecido
|
264 |
+
example_file_path = "/mnt/data/example1.aia"
|
265 |
+
|
266 |
iface = gr.Interface(
|
267 |
fn=analyze_aia,
|
268 |
inputs=gr.Files(label="Upload .aia Files"),
|
269 |
outputs=gr.HTML(),
|
270 |
+
examples=[[example_file_path]], # Use o caminho absoluto fornecido
|
271 |
title="AIA-Scope",
|
272 |
description="Upload .aia (or multiples .aia) files to analyze/dissect their components. An .aia file from MIT App Inventor is a project file format that contains all the necessary information for an App Inventor project.",
|
273 |
live=False
|