File size: 1,783 Bytes
b27cd24
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68


import json

# Data to be saved in JSON format
annotation_data = {
    "image_id": "image_000.jpg",

    # Line shape details
    "line_shape": {
        "turns": 0,
        "description": "Straight line"  # Options: Curved, S-shaped, 90 degrees (angled)
    },

    "start_of_line": {
        "coordinates": [200, 400],  # in image pixels 

        # Options: Far left, center left, center, center right, far right
        "where_in_image_field_of_view": "center left",  

        "estimated_distance": 2.4  # in meters 
    },

    "end_of_line": {
        "coordinates": [200, 400],  # in image pixels 

        # Options: Far left, center left, center, center right, far right
        "where_in_image_field_of_view": "far right",

        "estimated_distance": 10,

        "person_at_the_end": "Male, blue jacket",  # Example: Gender, clothing colors

        "do_you_see_end": True,  # If False, check camera_rotation_suggestion

        "camera_rotation_suggestion": "Rotate right to view the end of the line"
    },

    "people": {
        "number_of_people": 10,

        # Options: front, center left, center, center right, far right
        "direction_they_are_facing": "center right"
    },

    "higher_level_info": {
        "line_purpose": "Theme park ride",
        "estimated_waiting_time_minutes": 30
    },

    "boundary": {
        "boundary_present": True,
        "boundary_types": ["cones", "rope dividers", "stanchions"]
    }
}

# Path to save the JSON file
file_path = '/Users/Jamila/Desktop/LineFinder/Annotations/image_000.json'  # Ensure the folder exists

# Write the data to a JSON file
with open(file_path, 'w') as file:
    json.dump(annotation_data, file, indent=4)

print("JSON file has been created and saved.")  # Confirm script execution