capradeepgujaran commited on
Commit
065c045
β€’
1 Parent(s): 2a172dc

Upload README.md

Browse files
Files changed (1) hide show
  1. README.md +29 -79
README.md CHANGED
@@ -1,100 +1,50 @@
1
- ---
2
- license: mit
3
- title: Construction Site Safety Analyzer
4
- sdk: gradio
5
- emoji: 🏒
6
- colorFrom: green
7
- colorTo: blue
8
- short_description: AI Tool to enhance safety compliance
9
- sdk_version: 5.1.0
10
- ---
11
- # πŸ—οΈ Construction Site Safety Analyzer
12
-
13
- ## Overview
14
-
15
- The **Construction Site Safety Analyzer** is a powerful tool designed to enhance workplace safety and compliance through AI-powered image and video analysis. Leveraging the capabilities of Llama 3.2 90B Vision and expert chat assistance, this application helps identify safety issues, categorize them, provide detailed descriptions, and suggest steps to resolve them.
16
-
17
- ## Features
18
 
19
- ### 1. Image Analysis
20
- - **Upload Multiple Images**: Easily upload multiple construction site images for comprehensive analysis.
21
- - **Automatic Image Resizing**: Ensures that images do not exceed API size limits while maintaining quality.
22
- - **Safety Hazard Identification**: Identifies potential safety hazards, categorizes them, and provides detailed descriptions.
23
- - **Resolution Suggestions**: Offers actionable steps to mitigate identified risks.
24
 
25
- ### 2. Video Analysis
26
- - **Upload Videos**: Upload videos to analyze specific frames for safety hazard identification.
27
- - **Key Frame Extraction**: Extracts key frames from videos at specified time points (default: start, middle, end).
28
- - **Detailed Analysis**: Provides detailed analysis for each extracted frame, similar to image analysis.
29
 
30
- ### 3. Expert Chat Assistance
31
- - **Interactive Chat**: Engage in real-time conversations with an AI assistant specializing in construction site safety.
32
- - **Question-Based Analysis**: Ask questions about specific safety measures or regulations related to the analyzed hazards.
33
- - **Comprehensive Insights**: Receive detailed answers based on the initial analysis, enhancing understanding and decision-making.
34
-
35
- ## Getting Started
36
-
37
- ### Prerequisites
38
- - Python 3.8+
39
- - `pip` (Python package installer)
40
 
41
  ### Installation
42
- 1. Clone the repository:
43
- ```bash
44
- git clone https://github.com/your-repo/construction-site-safety-analyzer.git
45
- cd construction-site-safety-analyzer
46
- ```
47
 
48
- 2. Install dependencies:
49
- ```bash
50
- pip install -r requirements.txt
51
- ```
52
-
53
- 3. Set up environment variables:
54
- ```bash
55
- export GROQ_API_KEY="your-groq-api-key"
56
- ```
57
 
58
- ### Running the Application
59
- To launch the application, simply run the main script:
60
  ```bash
61
- python app.py
62
  ```
63
 
64
- This will start a local server, and you can access the application via your web browser at `http://localhost:7860`.
65
-
66
- ## Usage
67
 
68
- 1. **Upload Images/Videos**: Navigate to the "Upload Construction Site Images" or "Upload Construction Site Video" sections and select the appropriate files.
69
- 2. **Analyze Safety Hazards**: Click the "πŸ” Analyze Safety Hazards" button to initiate the analysis process.
70
- 3. **View Analysis Results**: The safety analysis results will be displayed in the "Safety Analysis Results and Expert Chat" section.
71
- 4. **Chat with the Assistant**: Engage in interactive conversations with the AI assistant to get more insights or ask questions about specific safety measures.
72
 
73
- ## Requirements
 
 
 
 
 
 
 
 
74
 
75
- The application requires the following Python packages:
76
- - `os`
77
- - `base64`
78
- - `gradio`
79
- - `PIL`
80
- - `io`
81
- - `json`
82
- - `groq`
83
- - `logging`
84
- - `cv2`
85
- - `numpy`
86
- - `traceback`
87
 
88
- These dependencies can be installed using `pip` as shown in the installation instructions.
89
 
90
- ## Contributing
91
 
92
- Contributions are welcome! Feel free to submit pull requests, report bugs, or suggest improvements.
93
 
94
- ## License
95
 
96
- This project is licensed under the MIT License - see the MIT file for details.
97
 
98
  ---
99
 
100
- Built with ❀️ by CA Pradeep Gujaran
 
1
+ ## Construction Site Safety Analyzer
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
 
3
+ **Description:**
4
+ The Construction Site Safety Analyzer is a powerful tool designed to enhance workplace safety and compliance through advanced image and video analysis. Utilizing cutting-edge technologies like Llama 3.2 90B Vision and expert chat assistance, this application helps identify potential hazards, ensure adherence to safety standards, and recommend actionable steps.
 
 
 
5
 
6
+ ### Features
 
 
 
7
 
8
+ 1. **Multi-file Upload**: Supports uploading multiple construction site images and videos simultaneously.
9
+ 2. **Real-time Analysis**: Instantly analyzes each uploaded file to detect safety issues, categorize them, and provide detailed descriptions.
10
+ 3. **Expert Chat Assistance**: Engages in real-time conversations to answer specific safety-related questions and provide additional insights.
11
+ 4. **Summary Reports**: Generates comprehensive reports summarizing all analyzed files and chat interactions.
12
+ 5. **User-friendly Interface**: Designed with ease of use in mind, featuring a clean and intuitive design.
 
 
 
 
 
13
 
14
  ### Installation
 
 
 
 
 
15
 
16
+ To run the Construction Site Safety Analyzer, you need to have Python installed on your system. Follow these steps to install the required dependencies:
 
 
 
 
 
 
 
 
17
 
 
 
18
  ```bash
19
+ pip install gradio opencv-python-headless pillow numpy groq-sdk
20
  ```
21
 
22
+ Additionally, ensure you have a valid `GROQ_API_KEY` set in your environment variables. This key is necessary for interacting with the Groq API.
 
 
23
 
24
+ ### Usage
 
 
 
25
 
26
+ 1. **Launch the Application**: Run the script to start the Gradio interface.
27
+ ```bash
28
+ python your_script_name.py
29
+ ```
30
+
31
+ 2. **Upload Files**: Navigate to the web interface and upload one or more construction site images or videos.
32
+ 3. **Initiate Analysis**: Click the "πŸ” Analyze Safety Hazards" button to start the analysis.
33
+ 4. **View Results**: The safety analysis results will be displayed in the chat interface, along with any expert chat responses.
34
+ 5. **Download Reports**: After completing your analysis, click the "πŸ“₯ Download Report" button to save a summary report of all interactions.
35
 
36
+ ### Customization
 
 
 
 
 
 
 
 
 
 
 
37
 
38
+ The application includes custom CSS for enhanced styling. You can modify the `custom_css` variable to customize the appearance according to your preferences.
39
 
40
+ ### Error Handling
41
 
42
+ The application includes robust error handling mechanisms to log and display errors encountered during file analysis, chat sessions, and report generation. Detailed logs can be found in the application's output console.
43
 
44
+ ### Contact
45
 
46
+ For further support or inquiries, please contact us at [support@example.com](mailto:[email protected]).
47
 
48
  ---
49
 
50
+ This README provides a comprehensive overview of the Construction Site Safety Analyzer, its features, installation instructions, usage guide, customization options, and error handling mechanisms.