BLUR-45, BLUR-46

This commit is contained in:
markrz12 2024-01-16 01:07:20 +01:00
parent 032274d6a1
commit d9a1d61bfe
10 changed files with 38 additions and 28 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 38 KiB

BIN
assets/cooperation.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 126 KiB

BIN
assets/data-analysis.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 159 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

BIN
assets/innovation.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 112 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 442 KiB

After

Width:  |  Height:  |  Size: 760 KiB

View File

@ -46,22 +46,18 @@ def about() -> rx.Component:
rx.box( rx.box(
rx.text("Jesteśmy grupą studentek kierunku Przetwarzania i Analizy Danych, które postanowiły połączyć swoje różnorodne umiejętności w ramach wspólnego projektu. Zależy nam nie tylko na zdobywaniu wiedzy na uczelni, ale także na praktycznym wykorzystaniu naszych umiejętności w realnych projektach.", margin_right="5%", margin_left="5%", margin_bottom = "10px"), rx.text("Jesteśmy grupą studentek kierunku Przetwarzania i Analizy Danych, które postanowiły połączyć swoje różnorodne umiejętności w ramach wspólnego projektu. Zależy nam nie tylko na zdobywaniu wiedzy na uczelni, ale także na praktycznym wykorzystaniu naszych umiejętności w realnych projektach.", margin_right="5%", margin_left="5%", margin_bottom = "10px"),
rx.list(rx.hstack( rx.wrap(rx.hstack(
rx.list_item(rx.text("Współpraca",as_="b",font_size="1.3em"), rx.vstack(rx.image(src= "/cooperation.png", height = "8em", align = "center"),
rx.text("Współpraca",as_="b",font_size="1.3em"),
rx.text("W naszym zespole każda z nas wnosi unikalne perspektywy i pomysły, co sprawia, że nasza współpraca jest inspirująca.", text_align="center"),), rx.text("W naszym zespole każda z nas wnosi unikalne perspektywy i pomysły, co sprawia, że nasza współpraca jest inspirująca.", text_align="center"),),
rx.list_item(rx.text("Innowacyjność",as_="b",font_size="1.3em"), rx.vstack(rx.image(src= "/innovation.png", height = "8em", align = "center"),
rx.text("Innowacyjność",as_="b",font_size="1.3em"),
rx.text("Naszym głównym celem jest stworzenie innowacyjnego rozwiązania, które nie tylko będzie spełniać potrzeby dzisiejszych czasów, ale również przyczyni się do ochrony prywatności w kontekście współdzielenia zdjęć online.", text_align="center"),), rx.text("Naszym głównym celem jest stworzenie innowacyjnego rozwiązania, które nie tylko będzie spełniać potrzeby dzisiejszych czasów, ale również przyczyni się do ochrony prywatności w kontekście współdzielenia zdjęć online.", text_align="center"),),
rx.list_item(rx.text("Analiza danych", as_="b",font_size="1.3em"), rx.vstack(rx.image(src= "/data-analysis.png", height = "8em", align = "center"),
rx.text("Analiza danych", as_="b",font_size="1.3em"),
rx.text("Nasza pasja do analizy i zrozumienia dziedziny przetwarzania danych stanowią fundamenty naszego projektu.", text_align="center"),), rx.text("Nasza pasja do analizy i zrozumienia dziedziny przetwarzania danych stanowią fundamenty naszego projektu.", text_align="center"),),
style={"align-self": "center", "align-items": "flex-start"}),style={"align-self": "center", "align-items": "flex-start"}, margin_right = "5%", margin_left = "5%"), style={"align-self": "center", "align-items": "flex-start"}),style={"align-self": "center", "align-items": "flex-start"}, margin_right = "5%", margin_left = "5%"),
#rx.list(
# rx.list_item( rx.icon(tag="arrow_forward")," W naszym zespole każda z nas wnosi unikalne perspektywy i pomysły, co sprawia, że nasza współpraca jest inspirująca.",),
# rx.list_item(rx.icon(tag="arrow_forward"), " Nasza pasja do analizy danych oraz zrozumienie dziedziny przetwarzania danych stanowią fundamenty naszego projektu."),
# rx.list_item( rx.icon(tag="arrow_forward")," Naszym głównym celem jest stworzenie innowacyjnego rozwiązania, które nie tylko będzie spełniać potrzeby dzisiejszych czasów, ale również przyczyni się do ochrony prywatności w kontekście współdzielenia zdjęć online.",),
# margin_left = "18%", margin_right = "18%"),
rx.text("Dzięki zaufaniu naszych użytkowników oraz naszemu zangażowaniu, wierzymy, że nasz projekt przyczyni się do tworzenia bezpieczniejszej przestrzeni dla współdzielenia zdjęć w sieci. Cieszymy się, że możemy być częścią tej fascynującej podróży!", margin_right="5%", margin_left="5%", margin_top="10px"), text_align = "center",), rx.text("Dzięki zaufaniu naszych użytkowników oraz naszemu zangażowaniu, wierzymy, że nasz projekt przyczyni się do tworzenia bezpieczniejszej przestrzeni dla współdzielenia zdjęć w sieci. Cieszymy się, że możemy być częścią tej fascynującej podróży!", margin_right="5%", margin_left="5%", margin_top="10px"), text_align = "center",),
rx.list( rx.list(
rx.list_item(rx.text("Nasza Misja",padding = "10px", text_align="center",background_image="linear-gradient( 64.5deg, rgba(245,116,185,1) 14.7%, rgba(89,97,223,1) 88.7% )", background_clip="text", font_size="2em", font_weight="bold", margin_top="30px", margin_bottom="5px"), rx.list_item(rx.text("Nasza Misja",padding = "10px", text_align="center",background_image="linear-gradient( 64.5deg, rgba(245,116,185,1) 14.7%, rgba(89,97,223,1) 88.7% )", background_clip="text", font_size="2em", font_weight="bold", margin_top="30px", margin_bottom="5px"),

View File

@ -43,15 +43,18 @@ def dashboard() -> rx.Component:
icon_style = {"width": "20px", "height": "30px", "margin-right": "10px"} icon_style = {"width": "20px", "height": "30px", "margin-right": "10px"}
heading_style = {"font-weight": "bold", "font-family": "Arial, sans-serif"} heading_style = {"font-weight": "bold", "font-family": "Arial, sans-serif"}
return rx.fragment(
rx.heading("Kontakt", font_size="3em", margin_bottom="10px", background_image="linear-gradient( 64.5deg, rgba(245,116,185,1) 14.7%, rgba(89,97,223,1) 88.7% )", background_clip="text", padding = "10px", text_align = "center"), return rx.wrap(
rx.text("Witaj na stronie Kontaktowej w aplikacji BlurMe!", text_align = "center", margin_right = "15%", margin_left="15%"), rx.hstack(
rx.text( rx.vstack(rx.hstack(rx.image(src="/sparkle-left.png",height="3em"),
"Jesteśmy dostępni dla Ciebie na różnych platformach. " rx.heading("Skontaktuj się!", font_size="2.6em", margin_bottom="10px", background_image="linear-gradient( 64.5deg, rgba(245,116,185,1) 14.7%, rgba(89,97,223,1) 88.7% )", background_clip="text", padding = "5px", text_align = "center"),
rx.image(src="/sparkle-right.png",height="3em"), style={"align-self": "center"}),
rx.text("Witaj na stronie Kontaktowej w aplikacji BlurMe!", font_size="1.2em", text_align = "center"),
rx.text("Jesteśmy dostępni dla Ciebie na różnych platformach. "
"Skontaktuj się z nami, gdy tylko masz pytania, sugestie lub " "Skontaktuj się z nami, gdy tylko masz pytania, sugestie lub "
"po prostu chcesz porozmawiać o naszej aplikacji.", text_align = "center", margin_right = "15%", margin_left="15%" "po prostu chcesz porozmawiać o naszej aplikacji.", margin_bottom="25px", text_align = "center"),
), style={"align-self": "flex-start","margin-left": "50px", "margin-top": "50px", "align-self": "flex-start", "margin-bottom": "25px"}, width = "50%"),
rx.wrap(rx.hstack(rx.vstack(rx.fragment( rx.wrap(rx.vstack(rx.vstack(rx.fragment(
rx.hstack(rx.icon(tag="email",style=icon_style), rx.hstack(rx.icon(tag="email",style=icon_style),
rx.heading("E-mail", level=3, style=heading_style), margin_top="20px"), rx.heading("E-mail", level=3, style=heading_style), margin_top="20px"),
rx.text("Zapraszamy do napisania do nas na adres: contact@blurme.com"), rx.text("Zapraszamy do napisania do nas na adres: contact@blurme.com"),
@ -60,4 +63,7 @@ def dashboard() -> rx.Component:
rx.hstack(rx.icon(tag="phone", style=icon_style),rx.heading("Telefon", level=3, style=heading_style), margin_top="20px"), rx.hstack(rx.icon(tag="phone", style=icon_style),rx.heading("Telefon", level=3, style=heading_style), margin_top="20px"),
rx.text("Możesz także zadzwonić pod numer: +48 123 456 789"), rx.text("Możesz także zadzwonić pod numer: +48 123 456 789"),
style=container_style, text_align = "center"),), style=container_style, text_align = "center"),),
),style={"align-self": "flex-center"}),) ),style={"align-self": "flex-center"}),))

View File

@ -19,7 +19,7 @@ def index() -> rx.Component:
rx.text("", pading = "25px"), rx.text("", pading = "25px"),
rx.link(rx.button("Zacznij anonimizować"), href="settings",align="center",color="rgba(117,102,254,255)",button=True,padding="50xp",font_size="1.2em"), rx.link(rx.button("Zacznij anonimizować"), href="settings",align="center",color="rgba(117,102,254,255)",button=True,padding="50xp",font_size="1.2em"),
style={"align-self": "flex-start","margin-left": "50px", "margin-top": "50px", "align-self": "flex-start", "margin-bottom": "25px"}, width = "50%"), style={"align-self": "flex-start","margin-left": "50px", "margin-top": "50px", "align-self": "flex-start", "margin-bottom": "25px"}, width = "50%"),
rx.image(src="obraz1.png",height="25em",padding="0.5em",style={"margin-right": "60px"}), rx.image(src="obraz1.png",height="28em",padding="0.5em",style={"margin-right": "60px"}),
style={"align-self": "flex-start"}),), style={"align-self": "flex-start"}),),
rx.text(" ", height = "20px"), rx.text(" ", height = "20px"),

View File

@ -4,7 +4,7 @@ import reflex as rx
import os import os
from blurme import styles from blurme import styles
import asyncio import asyncio
from datetime import datetime
from graphics.image_modification import blur_boxes_on_image from graphics.image_modification import blur_boxes_on_image
from graphics.image_modification import show_image_with_boxes from graphics.image_modification import show_image_with_boxes
from ml.element_detection import BoundBox, detect from ml.element_detection import BoundBox, detect
@ -27,6 +27,11 @@ class State(rx.State):
Args: Args:
files: The uploaded files. files: The uploaded files.
""" """
max_files_limit = 5
if len(self.img) + len(files) > max_files_limit:
print("You can't upload more than {} files.".format(max_files_limit))
return
for file in files: for file in files:
#if len(self.img) >= 5: #if len(self.img) >= 5:
@ -40,6 +45,7 @@ class State(rx.State):
# Update the img var. # Update the img var.
self.img.append(file.filename) self.img.append(file.filename)
self.img = self.img self.img = self.img
def delete_image(self, img_name: str): def delete_image(self, img_name: str):
if img_name in self.img: if img_name in self.img:
self.img.remove(img_name) self.img.remove(img_name)
@ -63,18 +69,20 @@ class State(rx.State):
async def image_anonymization(self, img_name: str): async def image_anonymization(self, img_name: str):
if img_name in self.img: if img_name in self.img:
stripped_image_name = str(img_name).lstrip("analysis-").lstrip("anonim-") image_path = rx.get_asset_path(img_name)
image_path = rx.get_asset_path(stripped_image_name) new_img_name = "anonim-" + img_name
#timestamp = datetime.now().strftime("%Y%m%d%H%M%S%f") new_image_path = rx.get_asset_path(new_img_name)
new_image_name = f"anonim-{stripped_image_name}"
new_image_path = rx.get_asset_path(new_image_name)
blur_boxes_on_image(image_path, detect(image_path), new_image_path) blur_boxes_on_image(image_path, detect(image_path), new_image_path)
upload_file = rx.UploadFile(file=open(new_image_path, 'rb'), filename=new_image_name) upload_file = rx.UploadFile(file=open(new_image_path, 'rb'), filename=new_img_name)
self.delete_image(img_name) self.delete_image(img_name)
await self.handle_upload([upload_file]) await self.handle_upload([upload_file])
self.img=self.img self.img=self.img
#async def toggle_dark_mode(self): #async def toggle_dark_mode(self):
# self.dark_mode = not self.dark_mode # self.dark_mode = not self.dark_mode
# print(f"Dark Mode State: {self.dark_mode}") # print(f"Dark Mode State: {self.dark_mode}")