0% found this document useful (0 votes)
4 views

GDrive and API setup

This document outlines the steps to set up Google Drive and its API for storing face images in a Python server application. It includes creating two folders for authorized and unknown faces, enabling the Google Drive API, creating OAuth 2.0 credentials, and installing necessary Python packages. The instructions provide detailed guidance on folder creation, obtaining folder IDs, and configuring the API for use in a project.

Uploaded by

Aman Kumar Jha
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

GDrive and API setup

This document outlines the steps to set up Google Drive and its API for storing face images in a Python server application. It includes creating two folders for authorized and unknown faces, enabling the Google Drive API, creating OAuth 2.0 credentials, and installing necessary Python packages. The instructions provide detailed guidance on folder creation, obtaining folder IDs, and configuring the API for use in a project.

Uploaded by

Aman Kumar Jha
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Perfect!

Let's start with Google Drive and API setup


This is essential for storing face images (both authorized and unknown) and accessing them in real-
time from your Python server.

Step-by-Step: Google Drive and API Setup

Step 1: Create Google Drive Folders

You’ll need two folders in your Google Drive:

Folder Name Purpose

Authorized_Faces For storing known face images.

Unknown_Faces For temporarily storing unrecognized faces from ESP32.

How to create:

1. Open Google Drive.

2. Click “+ New” → Folder → Name it Authorized_Faces.

3. Do the same to create Unknown_Faces.

Get their Folder IDs:

1. Open the folder.

2. Check the URL:

3. https://drive.google.com/drive/folders/1abcDxyzAbCDeFghIJklMNopQRsTuvWx

4. Copy the part after folders/


Example:

5. Folder ID = 1abcDxyzAbCDeFghIJklMNopQRsTuvWx

Save both Folder IDs somewhere — you'll need them in your Python script.

Step 2: Enable Google Drive API

1. Go to Google Cloud Console.

2. Click on “Select a project” → New Project.

3. Name your project (e.g., “Smart Door Project”) → Click Create.

Enable Google Drive API:

4. In the left menu, go to “APIs & Services” → “Library”.

5. Search for Google Drive API → Click it → Click Enable.


Step 3: Create OAuth 2.0 Credentials

1. In Cloud Console, go to “APIs & Services” → “Credentials”.

2. Click “+ Create Credentials” → OAuth client ID.

3. For first-time setup, click “Configure consent screen”:

o Choose External

o Fill in App name and support email

o Save and Continue until done

4. Go back to Create Credentials → OAuth client ID.

o Application Type: Desktop App

o Name: SmartDoorClient

o Click Create

5. Download the credentials file:

o You'll see the option to Download JSON.

o Save it as:

o credentials.json

o This file will go in the same folder as your Python code (server.py).

Step 4: Install Python Packages

In your Python environment (e.g., using terminal or Anaconda):

pip install google-auth google-auth-oauthlib google-auth-httplib2 google-api-python-client

This lets your Python code interact with Google Drive using the credentials.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy