Skip to content

Commit fca396b

Browse files
Merge pull request #9 from Mars-Zero/temp-branch
Temp branch
2 parents f562757 + 5090afd commit fca396b

File tree

5 files changed

+22
-24
lines changed

5 files changed

+22
-24
lines changed

backend/server.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
11
import os
22
import sys
33
from flask import Flask, request, jsonify
4-
import uuid
54
import cv2
6-
75
import importlib.util
8-
import sys
96
from pathlib import Path
107

118
module_path = Path(__file__).resolve().parent.parent / 'AI' / 'main.py'
@@ -26,12 +23,14 @@
2623
app.config['UPLOAD_FOLDER'] = UPLOAD_FOLDER
2724
app.config['ALLOWED_EXTENSIONS'] = ['jpg', 'png', 'jpeg']
2825

26+
cod_counter = 1
2927
def check_filename(filename):
3028
return '.' in filename and filename.rsplit('.', 1)[1].lower() in app.config['ALLOWED_EXTENSIONS']
3129

3230

3331
@app.route('/upload', methods=['POST'])
3432
def upload_file():
33+
global cod_counter
3534
# verific daca in cerere exista un fisier.
3635
if 'file' not in request.files:
3736
return jsonify({'error': 'No file part'}), 400
@@ -43,14 +42,14 @@ def upload_file():
4342
return jsonify({'error': 'No selected file'}), 400
4443

4544
if file and check_filename(file.filename):
46-
cod_unic = uuid.uuid4().hex
4745
# am creat un hash unic pe care sa il apenduiesc in fata numelui fisierului, pentru
4846
# ca daca il lasam fara, fisierele nu mai aveau denumiri distincte, si folderul
4947
# ramanea mereu doar cu o poza, la fiecare incarcare a camerei din flutter.
50-
filename = f"{cod_unic}{file.filename}"
48+
filename = f"{cod_counter}_{file.filename}"
5149
# concatenez cu un contor pentru ca altfel, imi punea pozele
5250
# distincte ca acelasi obiect file in folder.
5351
file.save(os.path.join(app.config['UPLOAD_FOLDER'], filename))
52+
cod_counter += 1
5453
return jsonify({'message': 'File uploaded successfully!'}), 200
5554
else:
5655
return jsonify({'error': 'File type not allowed'}), 400

sign_language_translator/android/app/build.gradle

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,19 @@ android {
1111
ndkVersion = flutter.ndkVersion
1212

1313
compileOptions {
14-
sourceCompatibility = JavaVersion.VERSION_1_8
15-
targetCompatibility = JavaVersion.VERSION_1_8
14+
// Actualizează la Java 20 sau Java 21
15+
sourceCompatibility = JavaVersion.VERSION_21
16+
targetCompatibility = JavaVersion.VERSION_21
1617
}
1718

1819
kotlinOptions {
19-
jvmTarget = JavaVersion.VERSION_1_8
20+
// Configurare Kotlin pentru Java 20
21+
jvmTarget = "20"
2022
}
2123

2224
defaultConfig {
23-
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
25+
// Setează applicationId și configurațiile SDK
2426
applicationId = "com.example.sign_language_translator"
25-
// You can update the following values to match your application needs.
26-
// For more information, see: https://flutter.dev/to/review-gradle-config.
2727
minSdk = flutter.minSdkVersion
2828
targetSdk = flutter.targetSdkVersion
2929
versionCode = flutter.versionCode
@@ -32,13 +32,12 @@ android {
3232

3333
buildTypes {
3434
release {
35-
// TODO: Add your own signing config for the release build.
36-
// Signing with the debug keys for now, so `flutter run --release` works.
35+
// TODO: Adaugă propria ta configurare de semnătura pentru build-ul de release
3736
signingConfig = signingConfigs.debug
3837
}
3938
}
4039
}
4140

4241
flutter {
4342
source = "../.."
44-
}
43+
}

sign_language_translator/android/gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
33
zipStoreBase=GRADLE_USER_HOME
44
zipStorePath=wrapper/dists
5-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.3-all.zip
5+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-all.zip

sign_language_translator/pubspec.lock

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@ packages:
2929
dependency: transitive
3030
description:
3131
name: camera_android_camerax
32-
sha256: e3627fdc2132d89212b8a8676679f5b07008c7e3d8ae00cea775c3397f9e742b
32+
sha256: "2985b8e5fca62709ebb2150962b1dae0444ba0a112be888ccf21e8371a1406d9"
3333
url: "https://pub.dev"
3434
source: hosted
35-
version: "0.6.10"
35+
version: "0.6.10+1"
3636
camera_avfoundation:
3737
dependency: transitive
3838
description:
@@ -122,10 +122,10 @@ packages:
122122
dependency: "direct dev"
123123
description:
124124
name: flutter_lints
125-
sha256: "3f41d009ba7172d5ff9be5f6e6e6abb4300e263aab8866d2a0842ed2a70f8f0c"
125+
sha256: "5398f14efa795ffb7a33e9b6a08798b26a180edac4ad7db3f231e40f82ce11e1"
126126
url: "https://pub.dev"
127127
source: hosted
128-
version: "4.0.0"
128+
version: "5.0.0"
129129
flutter_plugin_android_lifecycle:
130130
dependency: transitive
131131
description:
@@ -188,10 +188,10 @@ packages:
188188
dependency: transitive
189189
description:
190190
name: lints
191-
sha256: "976c774dd944a42e83e2467f4cc670daef7eed6295b10b36ae8c85bcbf828235"
191+
sha256: "3315600f3fb3b135be672bf4a178c55f274bebe368325ae18462c89ac1e3b413"
192192
url: "https://pub.dev"
193193
source: hosted
194-
version: "4.0.0"
194+
version: "5.0.0"
195195
matcher:
196196
dependency: transitive
197197
description:
@@ -313,10 +313,10 @@ packages:
313313
dependency: transitive
314314
description:
315315
name: vm_service
316-
sha256: f652077d0bdf60abe4c1f6377448e8655008eef28f128bc023f7b5e8dfeb48fc
316+
sha256: "5c5f338a667b4c644744b661f309fb8080bb94b18a7e91ef1dbd343bed00ed6d"
317317
url: "https://pub.dev"
318318
source: hosted
319-
version: "14.2.4"
319+
version: "14.2.5"
320320
web:
321321
dependency: transitive
322322
description:

sign_language_translator/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ dev_dependencies:
4848
# activated in the `analysis_options.yaml` file located at the root of your
4949
# package. See that file for information about deactivating specific lint
5050
# rules and activating additional ones.
51-
flutter_lints: ^4.0.0
51+
flutter_lints: ^5.0.0
5252

5353
# For information on the generic Dart part of this file, see the
5454
# following page: https://dart.dev/tools/pub/pubspec

0 commit comments

Comments
 (0)