diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..594e96f --- /dev/null +++ b/Makefile @@ -0,0 +1,6 @@ +install: + #install commands + pip install --upgrade pip &&\ + pip install -r requirements.txt + + \ No newline at end of file diff --git a/README.md b/README.md index 9b6d271..c3b2e8d 100644 --- a/README.md +++ b/README.md @@ -118,3 +118,5 @@ Let your code shine — only the best get merged! 🌟 --- Let me know if you want a badge section, table of contents, or any visuals (like a logo or banner) added to this README as well! + + diff --git a/pixel_peep/db.sqlite3 b/pixel_peep/db.sqlite3 new file mode 100644 index 0000000..6ffd2b7 Binary files /dev/null and b/pixel_peep/db.sqlite3 differ diff --git a/pixel_peep/image_trace/__init__.py b/pixel_peep/image_trace/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/pixel_peep/image_trace/__pycache__/__init__.cpython-313.pyc b/pixel_peep/image_trace/__pycache__/__init__.cpython-313.pyc new file mode 100644 index 0000000..098fa3d Binary files /dev/null and b/pixel_peep/image_trace/__pycache__/__init__.cpython-313.pyc differ diff --git a/pixel_peep/image_trace/__pycache__/admin.cpython-313.pyc b/pixel_peep/image_trace/__pycache__/admin.cpython-313.pyc new file mode 100644 index 0000000..af7c8bb Binary files /dev/null and b/pixel_peep/image_trace/__pycache__/admin.cpython-313.pyc differ diff --git a/pixel_peep/image_trace/__pycache__/apps.cpython-313.pyc b/pixel_peep/image_trace/__pycache__/apps.cpython-313.pyc new file mode 100644 index 0000000..1e08d61 Binary files /dev/null and b/pixel_peep/image_trace/__pycache__/apps.cpython-313.pyc differ diff --git a/pixel_peep/image_trace/__pycache__/models.cpython-313.pyc b/pixel_peep/image_trace/__pycache__/models.cpython-313.pyc new file mode 100644 index 0000000..a282584 Binary files /dev/null and b/pixel_peep/image_trace/__pycache__/models.cpython-313.pyc differ diff --git a/pixel_peep/image_trace/__pycache__/urls.cpython-313.pyc b/pixel_peep/image_trace/__pycache__/urls.cpython-313.pyc new file mode 100644 index 0000000..7340b32 Binary files /dev/null and b/pixel_peep/image_trace/__pycache__/urls.cpython-313.pyc differ diff --git a/pixel_peep/image_trace/__pycache__/views.cpython-313.pyc b/pixel_peep/image_trace/__pycache__/views.cpython-313.pyc new file mode 100644 index 0000000..29f336c Binary files /dev/null and b/pixel_peep/image_trace/__pycache__/views.cpython-313.pyc differ diff --git a/pixel_peep/image_trace/admin.py b/pixel_peep/image_trace/admin.py new file mode 100644 index 0000000..5b234bf --- /dev/null +++ b/pixel_peep/image_trace/admin.py @@ -0,0 +1,6 @@ +from django.contrib import admin +from .models import OriginalImageModel +# Register your models here. + +admin.site.register(OriginalImageModel) + diff --git a/pixel_peep/image_trace/apps.py b/pixel_peep/image_trace/apps.py new file mode 100644 index 0000000..cb8312e --- /dev/null +++ b/pixel_peep/image_trace/apps.py @@ -0,0 +1,6 @@ +from django.apps import AppConfig + + +class ImageTraceConfig(AppConfig): + default_auto_field = 'django.db.models.BigAutoField' + name = 'image_trace' diff --git a/pixel_peep/image_trace/migrations/0001_initial.py b/pixel_peep/image_trace/migrations/0001_initial.py new file mode 100644 index 0000000..1fb0f62 --- /dev/null +++ b/pixel_peep/image_trace/migrations/0001_initial.py @@ -0,0 +1,21 @@ +# Generated by Django 5.2 on 2025-04-24 10:27 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + initial = True + + dependencies = [ + ] + + operations = [ + migrations.CreateModel( + name='OriginalImageModel', + fields=[ + ('id', models.AutoField(primary_key=True, serialize=False)), + ('image_uploaded', models.ImageField(upload_to='original_images')), + ], + ), + ] diff --git a/pixel_peep/image_trace/migrations/__init__.py b/pixel_peep/image_trace/migrations/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/pixel_peep/image_trace/migrations/__pycache__/0001_initial.cpython-313.pyc b/pixel_peep/image_trace/migrations/__pycache__/0001_initial.cpython-313.pyc new file mode 100644 index 0000000..a02ecab Binary files /dev/null and b/pixel_peep/image_trace/migrations/__pycache__/0001_initial.cpython-313.pyc differ diff --git a/pixel_peep/image_trace/migrations/__pycache__/__init__.cpython-313.pyc b/pixel_peep/image_trace/migrations/__pycache__/__init__.cpython-313.pyc new file mode 100644 index 0000000..d9fc448 Binary files /dev/null and b/pixel_peep/image_trace/migrations/__pycache__/__init__.cpython-313.pyc differ diff --git a/pixel_peep/image_trace/models.py b/pixel_peep/image_trace/models.py new file mode 100644 index 0000000..aa7246b --- /dev/null +++ b/pixel_peep/image_trace/models.py @@ -0,0 +1,10 @@ +from django.db import models + +# Create your models here. + +class OriginalImageModel(models.Model): + id = models.AutoField(primary_key= True) + image_uploaded = models.ImageField(upload_to= 'original_images') + + + diff --git a/pixel_peep/image_trace/tests.py b/pixel_peep/image_trace/tests.py new file mode 100644 index 0000000..7ce503c --- /dev/null +++ b/pixel_peep/image_trace/tests.py @@ -0,0 +1,3 @@ +from django.test import TestCase + +# Create your tests here. diff --git a/pixel_peep/image_trace/urls.py b/pixel_peep/image_trace/urls.py new file mode 100644 index 0000000..b0adb13 --- /dev/null +++ b/pixel_peep/image_trace/urls.py @@ -0,0 +1,15 @@ +from django.urls import path +from . import views +from django.conf import settings +from django.conf.urls.static import static + + +urlpatterns = [ + path('', views.image_similarity_upload, name='image-similarity'), + path('img-upload/', views.upload_image_to_db, name='image-upload'), + path('detect-org-img/', views.optimised_solution, name='detect-original-img'), + +] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) + + + diff --git a/pixel_peep/image_trace/views.py b/pixel_peep/image_trace/views.py new file mode 100644 index 0000000..3d02b33 --- /dev/null +++ b/pixel_peep/image_trace/views.py @@ -0,0 +1,86 @@ +from django.shortcuts import render +from .models import OriginalImageModel +import cv2 +from skimage.metrics import structural_similarity as ssim +import numpy as np + +# Create your views here. + + +def upload_image_to_db(request): + ''' upload original image into database''' + + if request.method == 'POST': + image_data = request.FILES['image-data'] + + image = OriginalImageModel(image_uploaded = image_data) + image.save() + return render(request,'images_upload.html', {'message':'Image successfully stored inside Db'}) + return render(request,'images_upload.html') + + +def image_similarity_upload(request): + return render(request, 'edited_img_upload.html') + + +def optimised_solution(request): + ''' > The uploaded image is fetched and compared with all original images stored in the database. + > Image comparison is performed pixel-by-pixel using openCV and the scikit-image library. + > Both images are read using OpenCV. + + > The comparison based on Structural Similarity Index (SSIM), which extracts 3 key features from an image: + Luminance, Contrast, Structure. + > Comparison between the two images is performed on the basis of these 3 features. + + > SSIM computes a similarity score between the two images, ranging from 0 to 1: + > score of 1 indicates the images are identical or highly similar. + > score of 0 indicates the images are completely different. + + > All images and their corresponding SSIM scores are stored in a list. From this list, + images with a similarity score of 0.9 or higher are selected. + > Among these, the image with highest score selected. Return the Image alongwith similarity score. + + ''' + + if request.method == 'POST': + duplicate_img = request.FILES['duplicate-image'] + img1 = cv2.imdecode(np.frombuffer(duplicate_img.read(), dtype= np.uint8), cv2.IMREAD_GRAYSCALE) + + # image resize + dimension = (2500, 2500) + img_1 = cv2.resize(img1, dimension) + + # fetch all original img from db + original_images = OriginalImageModel.objects.all() + + score = [] + for original in original_images: + with open(original.image_uploaded.path, 'rb') as db_img: + img2 = cv2.imdecode(np.frombuffer(db_img.read(), dtype= np.uint8), cv2.IMREAD_GRAYSCALE) + img_2 = cv2.resize(img2, dimension) + + ssim_score, dif = ssim(img_1, img_2, full= True) + score.append((ssim_score, original.image_uploaded.url)) + + filterd_score = [s for s in score if s[0]>= 0.9] + + if filterd_score: + high_similarity_image = max(filterd_score, key=lambda i: i[0]) + + return render(request, 'home_page.html', {'similarity_score':high_similarity_image[0], 'image': high_similarity_image[1]}) + + return render(request, 'home_page.html', {'message':'Matching Image Not found'}) + + return render(request, 'home_page.html') + + + + + + + + + + + + diff --git a/pixel_peep/manage.py b/pixel_peep/manage.py new file mode 100644 index 0000000..9e5386e --- /dev/null +++ b/pixel_peep/manage.py @@ -0,0 +1,22 @@ +#!/usr/bin/env python +"""Django's command-line utility for administrative tasks.""" +import os +import sys + + +def main(): + """Run administrative tasks.""" + os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'pixel_peep.settings') + try: + from django.core.management import execute_from_command_line + except ImportError as exc: + raise ImportError( + "Couldn't import Django. Are you sure it's installed and " + "available on your PYTHONPATH environment variable? Did you " + "forget to activate a virtual environment?" + ) from exc + execute_from_command_line(sys.argv) + + +if __name__ == '__main__': + main() diff --git a/pixel_peep/media/original_images/download_1.jpg b/pixel_peep/media/original_images/download_1.jpg new file mode 100644 index 0000000..8b826f9 Binary files /dev/null and b/pixel_peep/media/original_images/download_1.jpg differ diff --git a/pixel_peep/media/original_images/goat-life.jpg b/pixel_peep/media/original_images/goat-life.jpg new file mode 100644 index 0000000..152d207 Binary files /dev/null and b/pixel_peep/media/original_images/goat-life.jpg differ diff --git a/pixel_peep/media/original_images/goat-life_vvkwhLG.jpg b/pixel_peep/media/original_images/goat-life_vvkwhLG.jpg new file mode 100644 index 0000000..152d207 Binary files /dev/null and b/pixel_peep/media/original_images/goat-life_vvkwhLG.jpg differ diff --git a/pixel_peep/media/original_images/img1.jpg b/pixel_peep/media/original_images/img1.jpg new file mode 100644 index 0000000..96812ec Binary files /dev/null and b/pixel_peep/media/original_images/img1.jpg differ diff --git a/pixel_peep/media/original_images/jailer.jpg b/pixel_peep/media/original_images/jailer.jpg new file mode 100644 index 0000000..5080e66 Binary files /dev/null and b/pixel_peep/media/original_images/jailer.jpg differ diff --git a/pixel_peep/media/original_images/jailer_QPhMK0I.jpg b/pixel_peep/media/original_images/jailer_QPhMK0I.jpg new file mode 100644 index 0000000..5080e66 Binary files /dev/null and b/pixel_peep/media/original_images/jailer_QPhMK0I.jpg differ diff --git a/pixel_peep/media/original_images/jailer_XXKSNRy.jpg b/pixel_peep/media/original_images/jailer_XXKSNRy.jpg new file mode 100644 index 0000000..5080e66 Binary files /dev/null and b/pixel_peep/media/original_images/jailer_XXKSNRy.jpg differ diff --git a/pixel_peep/media/original_images/jailer_d9DA76b.jpg b/pixel_peep/media/original_images/jailer_d9DA76b.jpg new file mode 100644 index 0000000..5080e66 Binary files /dev/null and b/pixel_peep/media/original_images/jailer_d9DA76b.jpg differ diff --git a/pixel_peep/media/original_images/madhara.jpg b/pixel_peep/media/original_images/madhara.jpg new file mode 100644 index 0000000..bfd6fa7 Binary files /dev/null and b/pixel_peep/media/original_images/madhara.jpg differ diff --git a/pixel_peep/media/original_images/naruto.jpg b/pixel_peep/media/original_images/naruto.jpg new file mode 100644 index 0000000..60c81ee Binary files /dev/null and b/pixel_peep/media/original_images/naruto.jpg differ diff --git a/pixel_peep/media/original_images/onep.jpg b/pixel_peep/media/original_images/onep.jpg new file mode 100644 index 0000000..391f4ad Binary files /dev/null and b/pixel_peep/media/original_images/onep.jpg differ diff --git a/pixel_peep/media/original_images/porschesport.jpg b/pixel_peep/media/original_images/porschesport.jpg new file mode 100644 index 0000000..d345a32 Binary files /dev/null and b/pixel_peep/media/original_images/porschesport.jpg differ diff --git a/pixel_peep/media/original_images/severance.jpg b/pixel_peep/media/original_images/severance.jpg new file mode 100644 index 0000000..b45d4c5 Binary files /dev/null and b/pixel_peep/media/original_images/severance.jpg differ diff --git a/pixel_peep/pixel_peep/__init__.py b/pixel_peep/pixel_peep/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/pixel_peep/pixel_peep/__pycache__/__init__.cpython-313.pyc b/pixel_peep/pixel_peep/__pycache__/__init__.cpython-313.pyc new file mode 100644 index 0000000..e98790b Binary files /dev/null and b/pixel_peep/pixel_peep/__pycache__/__init__.cpython-313.pyc differ diff --git a/pixel_peep/pixel_peep/__pycache__/settings.cpython-313.pyc b/pixel_peep/pixel_peep/__pycache__/settings.cpython-313.pyc new file mode 100644 index 0000000..60366e6 Binary files /dev/null and b/pixel_peep/pixel_peep/__pycache__/settings.cpython-313.pyc differ diff --git a/pixel_peep/pixel_peep/__pycache__/urls.cpython-313.pyc b/pixel_peep/pixel_peep/__pycache__/urls.cpython-313.pyc new file mode 100644 index 0000000..deeda08 Binary files /dev/null and b/pixel_peep/pixel_peep/__pycache__/urls.cpython-313.pyc differ diff --git a/pixel_peep/pixel_peep/__pycache__/wsgi.cpython-313.pyc b/pixel_peep/pixel_peep/__pycache__/wsgi.cpython-313.pyc new file mode 100644 index 0000000..9ae537b Binary files /dev/null and b/pixel_peep/pixel_peep/__pycache__/wsgi.cpython-313.pyc differ diff --git a/pixel_peep/pixel_peep/asgi.py b/pixel_peep/pixel_peep/asgi.py new file mode 100644 index 0000000..77fcd5a --- /dev/null +++ b/pixel_peep/pixel_peep/asgi.py @@ -0,0 +1,16 @@ +""" +ASGI config for pixel_peep project. + +It exposes the ASGI callable as a module-level variable named ``application``. + +For more information on this file, see +https://docs.djangoproject.com/en/5.2/howto/deployment/asgi/ +""" + +import os + +from django.core.asgi import get_asgi_application + +os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'pixel_peep.settings') + +application = get_asgi_application() diff --git a/pixel_peep/pixel_peep/settings.py b/pixel_peep/pixel_peep/settings.py new file mode 100644 index 0000000..e216a15 --- /dev/null +++ b/pixel_peep/pixel_peep/settings.py @@ -0,0 +1,130 @@ +""" +Django settings for pixel_peep project. + +Generated by 'django-admin startproject' using Django 5.2. + +For more information on this file, see +https://docs.djangoproject.com/en/5.2/topics/settings/ + +For the full list of settings and their values, see +https://docs.djangoproject.com/en/5.2/ref/settings/ +""" + +from pathlib import Path +import os + +# Build paths inside the project like this: BASE_DIR / 'subdir'. +BASE_DIR = Path(__file__).resolve().parent.parent + + +# Quick-start development settings - unsuitable for production +# See https://docs.djangoproject.com/en/5.2/howto/deployment/checklist/ + +# SECURITY WARNING: keep the secret key used in production secret! +SECRET_KEY = 'django-insecure-)cnc-idn)2=$cyjogkemd*92i#^g%4s=75xm7bv8dfzjp__lvb' + +# SECURITY WARNING: don't run with debug turned on in production! +DEBUG = True + +ALLOWED_HOSTS = [] + +MEDIA_URL = '/media/' +MEDIA_ROOT = os.path.join(BASE_DIR, 'media') + + +# Application definition + +INSTALLED_APPS = [ + 'django.contrib.admin', + 'django.contrib.auth', + 'django.contrib.contenttypes', + 'django.contrib.sessions', + 'django.contrib.messages', + 'django.contrib.staticfiles', + 'image_trace', +] + +MIDDLEWARE = [ + 'django.middleware.security.SecurityMiddleware', + 'django.contrib.sessions.middleware.SessionMiddleware', + 'django.middleware.common.CommonMiddleware', + 'django.middleware.csrf.CsrfViewMiddleware', + 'django.contrib.auth.middleware.AuthenticationMiddleware', + 'django.contrib.messages.middleware.MessageMiddleware', + 'django.middleware.clickjacking.XFrameOptionsMiddleware', +] + +ROOT_URLCONF = 'pixel_peep.urls' + +TEMPLATES = [ + { + 'BACKEND': 'django.template.backends.django.DjangoTemplates', + 'DIRS': [os.path.join(BASE_DIR, 'templates')], + 'APP_DIRS': True, + 'OPTIONS': { + 'context_processors': [ + 'django.template.context_processors.request', + 'django.contrib.auth.context_processors.auth', + 'django.contrib.messages.context_processors.messages', + ], + }, + }, +] + +WSGI_APPLICATION = 'pixel_peep.wsgi.application' + + +# Database +# https://docs.djangoproject.com/en/5.2/ref/settings/#databases + +DATABASES = { + 'default': { + 'ENGINE': 'django.db.backends.sqlite3', + 'NAME': BASE_DIR / 'db.sqlite3', + } +} + + +# Password validation +# https://docs.djangoproject.com/en/5.2/ref/settings/#auth-password-validators + +AUTH_PASSWORD_VALIDATORS = [ + { + 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', + }, + { + 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', + }, + { + 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', + }, + { + 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', + }, +] + + +# Internationalization +# https://docs.djangoproject.com/en/5.2/topics/i18n/ + +LANGUAGE_CODE = 'en-us' + +TIME_ZONE = 'UTC' + +USE_I18N = True + +USE_TZ = True + + +# Static files (CSS, JavaScript, Images) +# https://docs.djangoproject.com/en/5.2/howto/static-files/ + +STATIC_URL = 'static/' + +STATICFILES_DIRS = [ + os.path.join(BASE_DIR, 'static') +] +# Default primary key field type +# https://docs.djangoproject.com/en/5.2/ref/settings/#default-auto-field + +DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField' diff --git a/pixel_peep/pixel_peep/urls.py b/pixel_peep/pixel_peep/urls.py new file mode 100644 index 0000000..bc39f55 --- /dev/null +++ b/pixel_peep/pixel_peep/urls.py @@ -0,0 +1,23 @@ +""" +URL configuration for pixel_peep project. + +The `urlpatterns` list routes URLs to views. For more information please see: + https://docs.djangoproject.com/en/5.2/topics/http/urls/ +Examples: +Function views + 1. Add an import: from my_app import views + 2. Add a URL to urlpatterns: path('', views.home, name='home') +Class-based views + 1. Add an import: from other_app.views import Home + 2. Add a URL to urlpatterns: path('', Home.as_view(), name='home') +Including another URLconf + 1. Import the include() function: from django.urls import include, path + 2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) +""" +from django.contrib import admin +from django.urls import path, include + +urlpatterns = [ + path('admin/', admin.site.urls), + path('', include("image_trace.urls")), +] diff --git a/pixel_peep/pixel_peep/wsgi.py b/pixel_peep/pixel_peep/wsgi.py new file mode 100644 index 0000000..03b7c57 --- /dev/null +++ b/pixel_peep/pixel_peep/wsgi.py @@ -0,0 +1,16 @@ +""" +WSGI config for pixel_peep project. + +It exposes the WSGI callable as a module-level variable named ``application``. + +For more information on this file, see +https://docs.djangoproject.com/en/5.2/howto/deployment/wsgi/ +""" + +import os + +from django.core.wsgi import get_wsgi_application + +os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'pixel_peep.settings') + +application = get_wsgi_application() diff --git a/pixel_peep/static/css/style1.css b/pixel_peep/static/css/style1.css new file mode 100644 index 0000000..22c7d97 --- /dev/null +++ b/pixel_peep/static/css/style1.css @@ -0,0 +1,173 @@ +body{ + font-family: "Roboto", sans-serif; + background-color: #F9FAFB; + min-height: 100vh; + display: flex; + align-items: center; + justify-content: center; + + position: relative; +} +.uploader-container { + width: 100%; + max-width: 600px; + background-color: white; + border-radius: 8px; + box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06); + padding: 2rem; +} + + +/* HEADER SECTION */ +.uploader-header { + text-align: center; + margin-bottom: 1.5rem; +} +.uploader-header h1 { + color: #111827; + font-size: 1.5rem; + font-weight: 600; + margin-bottom: 0.5rem; +} +.uploader-header p { + color: #4B5563; + font-size: 0.875rem; +} + + +/* MIDDLE SECTION */ +.upload-area { + border: 2px dashed #D1D5DB; + border-radius: 8px; + padding: 2rem 1rem; + text-align: center; + cursor: pointer; + transition: all 0.2s ease-in-out; + background-color: #F3F4F6; + position: relative; + overflow: hidden; +} + +.upload-area:hover { + border-color: #4F46E5; + background-color: rgba(79, 70, 229, 0.05); +} + +.upload-area.highlight { + border-color: #4F46E5; + background-color: rgba(79, 70, 229, 0.1); +} + +.upload-icon { + display: inline-block; + width: 60px; + height: 60px; + margin-bottom: 1rem; + border-radius: 50%; + background-color: rgba(79, 70, 229, 0.1); + display: flex; + align-items: center; + justify-content: center; + margin: 0 auto 1rem; +} + +.upload-icon svg { + width: 30px; + height: 30px; + color: #4F46E5; +} + +.upload-text h3 { + font-weight: 500; + margin-bottom: 0.5rem; + color: #111827; +} + +.upload-text p { + color: #4B5563; + font-size: 0.875rem; + margin-bottom: 1rem; +} +.file-input { + position: absolute; + left: 0; + top: 0; + width: 100%; + height: 100%; + opacity: 0; + cursor: pointer; +} +.browse-btn { + display: inline-block; + background-color: #4F46E5; + color: white; + padding: 0.5rem 1rem; + border-radius: 8px; + font-size: 0.875rem; + font-weight: 500; + transition: background-color 0.2s; +} + + +/* BOTTOM SECTION */ +.upload-actions { + margin-top: 1.5rem; + display: flex; + justify-content: flex-end; + gap: 0.75rem; +} +.cancel-btn, .upload-btn { + padding: 0.5rem 1rem; + border-radius: 8px; + font-size: 0.875rem; + font-weight: 500; + cursor: pointer; + transition: all 0.2s; +} +.cancel-btn { + background-color: white; + color: #4B5563; + border: 1px solid #D1D5DB; +} + +.cancel-btn:hover { + background-color: #F3F4F6; +} +.upload-btn { + background-color: #4F46E5; + color: white; + border: none; + display: flex; + align-items: center; + gap: 0.5rem; +} + +.upload-btn:hover { + background-color: #4338CA; +} + + +/* ORIGINAL IMG BUTTON */ +.upload-org-img-btn{ + position: absolute; + top: 5px; + right: 5px; +} +.org-img-btn { + background-color: rgb(79, 70, 229); + color: white; + padding: 5px 8px 5px 8px; + padding: 0.5rem 1rem; + border-radius: 8px; + font-size: 0.875rem; + font-weight: 500; + cursor: pointer; + transition: all 0.2s; + border: none; + + box-shadow: 0 5px 7px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06); +} + +.org-img-btn:hover { + background-color: #4338CA; +} \ No newline at end of file diff --git a/pixel_peep/static/css/style2.css b/pixel_peep/static/css/style2.css new file mode 100644 index 0000000..45f6629 --- /dev/null +++ b/pixel_peep/static/css/style2.css @@ -0,0 +1,157 @@ +body{ + font-family: "Roboto", sans-serif; + background-color: #F9FAFB; + min-height: 100vh; + display: flex; + align-items: center; + justify-content: center; +} +.uploader-container { + width: 100%; + max-width: 600px; + background-color: white; + border-radius: 8px; + box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06); + padding: 2rem; +} + + +/* HEADER SECTION */ +.uploader-header { + text-align: center; + margin-bottom: 1.5rem; +} +.uploader-header h1 { + color: #111827; + font-size: 1.5rem; + font-weight: 600; + margin-bottom: 0.5rem; +} +.uploader-header p { + color: #4B5563; + font-size: 0.875rem; +} + + +/* MIDDLE SECTION */ +.upload-area { + border: 2px dashed #D1D5DB; + border-radius: 8px; + padding: 2rem 1rem; + text-align: center; + cursor: pointer; + transition: all 0.2s ease-in-out; + background-color: #F3F4F6; + position: relative; + overflow: hidden; +} + +.upload-area:hover { + border-color: #4F46E5; + background-color: rgba(79, 70, 229, 0.05); +} + +.upload-area.highlight { + border-color: #4F46E5; + background-color: rgba(79, 70, 229, 0.1); +} + +.upload-icon { + display: inline-block; + width: 60px; + height: 60px; + margin-bottom: 1rem; + border-radius: 50%; + background-color: rgba(79, 70, 229, 0.1); + display: flex; + align-items: center; + justify-content: center; + margin: 0 auto 1rem; +} + +.upload-icon svg { + width: 30px; + height: 30px; + color: #4F46E5; +} + +.upload-text h3 { + font-weight: 500; + margin-bottom: 0.5rem; + color: #111827; +} + +.upload-text p { + color: #4B5563; + font-size: 0.875rem; + margin-bottom: 1rem; +} +.file-input { + position: absolute; + left: 0; + top: 0; + width: 100%; + height: 100%; + opacity: 0; + cursor: pointer; +} +.browse-btn { + display: inline-block; + background-color: #4F46E5; + color: white; + padding: 0.5rem 1rem; + border-radius: 8px; + font-size: 0.875rem; + font-weight: 500; + transition: background-color 0.2s; +} + + +/* BOTTOM SECTION */ +.upload-actions { + margin-top: 1.5rem; + display: flex; + justify-content: flex-end; + gap: 0.75rem; +} +.cancel-btn, .upload-btn { + padding: 0.5rem 1rem; + border-radius: 8px; + font-size: 0.875rem; + font-weight: 500; + cursor: pointer; + transition: all 0.2s; +} +.cancel-btn { + background-color: white; + color: #4B5563; + border: 1px solid #D1D5DB; +} + +.cancel-btn:hover { + background-color: #F3F4F6; +} +.upload-btn { + background-color: #4F46E5; + color: white; + border: none; + display: flex; + align-items: center; + gap: 0.5rem; +} + +.upload-btn:hover { + background-color: #4338CA; +} + +/* SUCCESS MESSAGE */ +.success-message { + /* display: none; */ + background-color: #e8f5e9; + border-left: 4px solid #4caf50; + padding: 16px; + margin-top: 24px; + text-align: left; + border-radius: 12px; + animation: fadeIn 0.5s ease; +} diff --git a/pixel_peep/static/css/style3.css b/pixel_peep/static/css/style3.css new file mode 100644 index 0000000..ff34d44 --- /dev/null +++ b/pixel_peep/static/css/style3.css @@ -0,0 +1,37 @@ +body{ + font-family: "Roboto", sans-serif; +} +.content-main{ + display: flex; + flex-direction: column; + align-items: center; +} + +.header p { + color: #111827; + font-size: 2rem; + font-weight: 600; + margin-bottom: 0.5rem; +} +.image-display { + width: 650px; + height: 380px; + padding: 5px 10px 5px 10px; + + display: flex; + flex-direction: column; + align-items: center; + margin-top: 20px; +} +.image-display img{ + border-radius: 12px; + width: 500px; + +} +.image-display p { + color: #494d52; + font-size: 1rem; +} +.image-display-error{ + font-size: 1.3rem; +} \ No newline at end of file diff --git a/pixel_peep/templates/edited_img_upload.html b/pixel_peep/templates/edited_img_upload.html new file mode 100644 index 0000000..af7253f --- /dev/null +++ b/pixel_peep/templates/edited_img_upload.html @@ -0,0 +1,54 @@ +{% load static %} + + + + + + + Document + + + + +
+
+

Find Original Image

+

Upload your edited image to find it's original image

+
+
+ {% csrf_token %} + +
+ +
+ + + +
+
+

Drag and drop files here

+

Or click to browse your device

+ Browse Files +
+ + + +
+
+ + +
+
+ +
+
+ +
+ + + + + + diff --git a/pixel_peep/templates/home_page.html b/pixel_peep/templates/home_page.html new file mode 100644 index 0000000..44a6cd0 --- /dev/null +++ b/pixel_peep/templates/home_page.html @@ -0,0 +1,34 @@ +{% load static %} + + + + + + Landing Page + + + + + + + + +
+
+

Matching Original Image

+
+ +
+ {% if image and similarity_score %} + Matching image +

Similarity Score : {{ similarity_score}}

+ + {% else %} +

Matching Image not found

+ {% endif %} +
+
+ + + + diff --git a/pixel_peep/templates/images_upload.html b/pixel_peep/templates/images_upload.html new file mode 100644 index 0000000..a9f32c0 --- /dev/null +++ b/pixel_peep/templates/images_upload.html @@ -0,0 +1,61 @@ +{% load static %} + + + + + + + Document + + + + + + + + +
+
+

Upload Images

+

Upload your original images to the database

+
+
+ {% csrf_token %} + +
+ +
+ + + +
+
+

Drag and drop files here

+

Or click to browse your device

+ Browse Files +
+ + + +
+
+ + +
+
+ + {% if message %} +
+
Image uploaded successfully!
+
+ {% endif %} + +
+ + + + + + diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..7bdee8c --- /dev/null +++ b/requirements.txt @@ -0,0 +1,4 @@ +Django==5.2 +pillow==11.2.1 +opencv-python==4.11.0.86 +scikit-image==0.25.2 \ No newline at end of file