{"id":15158284,"url":"https://github.com/ravindramohith/find_me_out","last_synced_at":"2026-02-01T20:02:03.614Z","repository":{"id":252849214,"uuid":"841636373","full_name":"ravindramohith/find_me_out","owner":"ravindramohith","description":"Face recognition system using a Convolutional Neural Network (CNN) with TensorFlow and OpenCV","archived":false,"fork":false,"pushed_at":"2024-08-12T20:45:20.000Z","size":85,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-26T07:42:13.631Z","etag":null,"topics":["convolutional-neural-networks","deep-learning","face-recognition","keras","machine-learning","opencv","tensorflow"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ravindramohith.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-08-12T20:02:49.000Z","updated_at":"2024-08-12T23:04:59.000Z","dependencies_parsed_at":"2024-08-12T23:54:27.169Z","dependency_job_id":null,"html_url":"https://github.com/ravindramohith/find_me_out","commit_stats":null,"previous_names":["ravindramohith/find_me_out"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ravindramohith/find_me_out","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ravindramohith%2Ffind_me_out","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ravindramohith%2Ffind_me_out/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ravindramohith%2Ffind_me_out/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ravindramohith%2Ffind_me_out/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ravindramohith","download_url":"https://codeload.github.com/ravindramohith/find_me_out/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ravindramohith%2Ffind_me_out/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28988408,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-01T18:17:03.387Z","status":"ssl_error","status_checked_at":"2026-02-01T18:16:57.287Z","response_time":56,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["convolutional-neural-networks","deep-learning","face-recognition","keras","machine-learning","opencv","tensorflow"],"created_at":"2024-09-26T20:42:21.681Z","updated_at":"2026-02-01T20:02:03.597Z","avatar_url":"https://github.com/ravindramohith.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Find Me Out\n\n## Project Description\n\"Find Me Out\" is a face recognition system that uses a novel feature extractor and classifier to identify celebrities from a dataset of 400 images. This system achieves a high accuracy of 93%, making it robust and reliable for face recognition tasks.\n\n## Key Features\n- **High Accuracy**: Achieved 93% accuracy in recognizing faces using a Convolutional Neural Network (CNN).\n- **Enhanced Preprocessing**: Utilized OpenCV for data augmentation, grayscale conversion, and resizing to ensure consistent input quality.\n- **Advanced Training**: Leveraged TensorFlow with the Adam optimizer and Sparse Categorical Cross-Entropy loss function for effective multi-class face recognition.\n\n## Installation\nTo run this project, you'll need to set up a Python environment with the required dependencies. Here's how you can do it:\n\n1. Clone the repository:\n    ```bash\n    git clone https://github.com/yourusername/find_me_out.git\n    cd find_me_out\n    ```\n\n## Usage\n1. **Mount Google Drive**: Ensure your dataset is stored in Google Drive and mount it using the provided code snippet.\n    ```python\n    from google.colab import drive\n    drive.mount('/content/drive')\n    ```\n2. **Data Loading and Preprocessing**: The system loads and preprocesses images for training.\n    ```python\n    import os\n    import cv2\n    import numpy as np\n    from sklearn.model_selection import train_test_split\n    import tensorflow as tf\n    from tensorflow import keras\n    from tensorflow.keras import layers\n\n    directory = \"/content/drive/MyDrive/Colab Notebooks/Data/\"\n    celebrities = [\"Scarlett_Johansson\", \"Elizabeth_Olsen\", \"Christian_Bale\", \"Chris_Evans\"]\n\n    data = []\n    labels = []\n\n    for i, celebrity in enumerate(celebrities):\n        celebrity_dir = os.path.join(directory, celebrity)\n        for h in range(1, 101):\n            filename = f\"IMG_{h}.jpg\"\n            if filename.endswith(\".jpg\"):\n                file_path = os.path.join(celebrity_dir, filename)\n                print(file_path)\n                image = cv2.imread(file_path)\n                image = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)  # Convert to grayscale\n                image = cv2.resize(image, (224, 224))  # Resize the image to a desired size\n                data.append(image)\n                labels.append(i)\n\n    data = np.array(data)\n    labels = np.array(labels)\n    x_train, x_test, y_train, y_test = train_test_split(\n        data, labels, test_size=0.25\n    )\n\n    train_data = x_train.astype(\"float32\") / 255.0\n    test_data = x_test.astype(\"float32\") / 255.0\n\n    train_data = np.expand_dims(train_data, -1)\n    test_data = np.expand_dims(test_data, -1)\n    ```\n3. **Model Training**: Train the CNN model using the provided training code.\n    ```python\n    model = keras.Sequential(\n        [\n            keras.Input(shape=(224, 224, 1)),\n            layers.Conv2D(16, 3, activation=\"relu\"),\n            layers.MaxPool2D(),\n            layers.Conv2D(24, 3, activation=\"relu\"),\n            layers.Conv2D(32, 3, activation=\"relu\"),\n            layers.Conv2D(32, 3, activation=\"relu\"),\n            layers.MaxPool2D(),\n            layers.Conv2D(64, 3, activation=\"relu\"),\n            layers.MaxPool2D(),\n            layers.Flatten(),\n            layers.Dense(4, activation=\"softmax\"),\n        ]\n    )\n\n    print(model.summary())\n\n    # Compile and train the model\n    model.compile(\n        loss=keras.losses.SparseCategoricalCrossentropy(from_logits=False),\n        metrics=[\"accuracy\"],\n        optimizer=keras.optimizers.Adam(learning_rate=0.001),\n    )\n    model.fit(train_data, y_train, batch_size=300, epochs=200, verbose=2)\n\n    # Evaluate the model on the test set\n    model.evaluate(test_data, y_test, batch_size=300, verbose=2)\n    ```\n4. **Prediction**: Use the trained model to predict and identify the celebrity in a new image.\n    ```python\n    from google.colab.patches import cv2_imshow\n    test_image_path = (\n        directory+\"Chris_Evans/IMG_105.jpg\"  # Replace with the path to your test image\n    )\n    test_image = cv2.imread(test_image_path)\n    # cv2.imshow(\"Chris Evans\",test_image)\n    test_image = cv2.cvtColor(test_image, cv2.COLOR_BGR2GRAY)  # Convert to grayscale\n    test_image = cv2.resize(\n        test_image, (224, 224)\n    )  # Resize the image to match the model's input size\n    test_image = np.expand_dims(test_image, axis=0)  # Add a batch dimension\n    test_image = test_image.astype(\"float32\") / 255.0  # Normalize pixel values\n\n    # Make predictions on the test image\n    predictions = model.predict(test_image)\n    predicted_celebrity = celebrities[np.argmax(predictions[0])]\n    cv2_imshow(cv2.imread(test_image_path))\n    print(\"Predicted celebrity:\", predicted_celebrity)\n    ```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fravindramohith%2Ffind_me_out","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fravindramohith%2Ffind_me_out","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fravindramohith%2Ffind_me_out/lists"}