Cyber security

Photo Location Finder: Using Google Cloud Vision API to Detect Landmarks and Labels in Images

This is a Python code to detect landmarks, labels and web entities in a set of images using Google Cloud Vision API. The code takes a JSON configuration file that contains the API key and credentials file path for the Google Cloud Vision API, as well as other optional parameters, such as the directory for image files.

The code processes each image file and extracts landmark, label, and web entity information from it using the aforementioned API. The results are stored in a JSON file in the following structure:

Prerequisites

Before running the program, the user needs to have:

  • A valid Google Cloud API key
  • Google Cloud credentials file
  • A Directory with Images for landmark detection
  • All required libraries and packages

Installation

  1. To clone the repository onto your local machine, open a terminal or command prompt and enter the following command:

git clone https://github.com/PierrunoYT/photo-location-finder

Alternatively, you can download the zip file from GitHub by clicking on the green “Code” button and selecting “Download ZIP”.

  1. To ensure that you have Python 3.7 or later installed on your local machine, enter the following command in your terminal or command prompt:

python --version

If you don’t have Python 3.7 or later installed, you can download it from the official Python website.

  1. Next, navigate to the root directory of the project where the requirements.txt file is located, and run the following command to install all the required packages:

pip install -r requirements.txt

  1. Obtain API keys for Google Cloud Vision API and Google Maps API by following the documentation provided by each respective API.
  2. Set up the authentication credentials for Google Cloud Vision API by creating a service account and storing the private key JSON file in a secure location. Follow the instructions provided in the Google Cloud Vision Official Documentation

Open the config.json and replace the YOUR_API_KEY_HERE placeholder with your actual Google Maps API key, and the PATH_TO_YOUR_CREDENTIALS_FILE placeholder with the path to the private key JSON file you created earlier. Update other parameters in the configuration file if necessary.

  1. Store the images you want to analyze in the directory mentioned in the image_dir parameter specified in the config.json file.
  2. To run the script, navigate to the root directory of the project in your terminal or command prompt, and type in the following command:

python main.py

The detection process will start, and you will see output in the terminal or command prompt indicating the status of each image being processed. When the process is complete, you will find a result.json file in the current working directory containing the results of the object detection.

Tamil S

Tamil has a great interest in the fields of Cyber Security, OSINT, and CTF projects. Currently, he is deeply involved in researching and publishing various security tools with Kali Linux Tutorials, which is quite fascinating.

Recent Posts

Shadow-rs : Harnessing Rust’s Power For Kernel-Level Security Research

shadow-rs is a Windows kernel rootkit written in Rust, demonstrating advanced techniques for kernel manipulation…

2 weeks ago

ExecutePeFromPngViaLNK – Advanced Execution Of Embedded PE Files via PNG And LNK

Extract and execute a PE embedded within a PNG file using an LNK file. The…

3 weeks ago

Red Team Certification – A Comprehensive Guide To Advancing In Cybersecurity Operations

Embark on the journey of becoming a certified Red Team professional with our definitive guide.…

3 weeks ago

CVE-2024-5836 / CVE-2024-6778 : Chromium Sandbox Escape via Extension Exploits

This repository contains proof of concept exploits for CVE-2024-5836 and CVE-2024-6778, which are vulnerabilities within…

4 weeks ago

Rust BOFs – Unlocking New Potentials In Cobalt Strike

This took me like 4 days (+2 days for an update), but I got it…

4 weeks ago

MaLDAPtive – Pioneering LDAP SearchFilter Parsing And Security Framework

MaLDAPtive is a framework for LDAP SearchFilter parsing, obfuscation, deobfuscation and detection. Its foundation is…

4 weeks ago