Hard Hat Sample Computer Vision Model

byNortheastern University - ChinaTask:
Object Detection
License:Public Domain234 views24 downloads

How to use the Hard Hat Sample Detection API

Try This Model

Drop an image here or click to upload

Or try a test image 

Code Snippets

from inference_sdk import InferenceHTTPClient

CLIENT = InferenceHTTPClient(
    api_url="https://serverless.roboflow.com",
    api_key="API_KEY"
)

result = CLIENT.infer("YOUR_IMAGE.jpg", model_id="hard-hat-sample-p7hbr/1")
Give your agent everything it needs

Or, Use Free Head, Helmet and Person Detection API

Powered by general detection model

Code
pip install inference-sdk
# 1. Import the library
from inference_sdk import InferenceHTTPClient

# 2. Connect to your workspace
client = InferenceHTTPClient(
  api_url="https://serverless.roboflow.com",
  api_key="API_KEY"
)

# 3. Run your workflow on an image
result = client.run_workflow(
  workspace_name="<YOUR_WORKSPACE>",
  workflow_id="<YOUR_WORKFLOW_ID>",
  images={
    "image": "YOUR_IMAGE.jpg"  # Path to your image file
  },
  parameters={
    "classes": "head, helmet, person"
  },
  use_cache=True  # cache workflow definition for 15 minutes
)

# 4. Get your results
print(result)

Run on custom image

Drop an image here or click to upload

Detecting classes:
Or try a test image 

About Hard Hat Sample Model

Overview

The Hard Hat dataset is an object detection dataset of workers in workplace settings that require a hard hat. Annotations also include examples of just "person" and "head," for when an individual may be present without a hard hart.

Example Image: Example Image

Use Cases

One could use this dataset to, for example, build a classifier of workers that are abiding safety code within a workplace versus those that may not be. It is also a good general dataset for practice.

Using this Dataset

Use the fork button to copy this dataset to your own Roboflow account and export it with new preprocessing settings (perhaps resized for your model's desired format or converted to grayscale), or additional augmentations to make your model generalize better. This particular dataset would be very well suited for Roboflow's new advanced Bounding Box Only Augmentations.

About Roboflow

Roboflow makes managing, preprocessing, augmenting, and versioning datasets for computer vision seamless.

Developers reduce 50% of their code when using Roboflow's workflow, automate annotation quality assurance, save training time, and increase model reproducibility.

Roboflow Workmark

Cite This Project

LicensePublic Domain

If you use this dataset in a research paper, please cite it using the following BibTeX:

@misc{ hard-hat-sample-p7hbr_dataset,
  title = { Hard Hat Sample Dataset },
  type = { Open Source Dataset },
  author = { Northeastern University - China },
  howpublished = { \url{ https://universe.roboflow.com/zhonggoogle/hard-hat-sample-p7hbr } },
  url = { https://universe.roboflow.com/zhonggoogle/hard-hat-sample-p7hbr },
  journal = { Roboflow Universe },
  publisher = { Roboflow },
  year = { 2023 },
  month = { sep },
  note = { visited on 2026-07-29 },
}

Similar Projects

See More