All Examples¶
Content¶
- 1 single-image inference
- 2 batch image inference
- 3 chat for data analysis
- 4 plot the final GeoDataFrame results
Import dataset class
from urbanworm import UrbanDataSet
1 single-image inference¶
1.1 one image input¶
Initialize dataset object
data = UrbanDataSet(image = './data/test1.jpg')
To let the model understand the task, we need to specify what information we want to know from the input image and the format it should follow to structure the response. In some cases, giving more contexts such as the definition of terminology/concept and criteria for decision making may enhance the inference ability of model.
system = '''
Given a top view image, you are going to roughly estimate house conditions. Your answer should be based only on your observation.
The format of your response must include question, answer (yes or no), explaination (within 50 words)
'''
prompt = '''
Is there any damage on the roof?
'''
res = data.oneImgChat(system=system, prompt=prompt)
Inference starts ...
The default format of schema for the output includes:
- question
- answer
- explanation
When saveImg=True, image will be save in the base64 format.
res.keys()
dict_keys(['question', 'answer', 'explanation', 'img'])
res['question'], res['answer'], res['explanation']
('Is there any damage on the roof?', 'No', 'Based on the image, the roof appears to be intact and without any visible signs of damage like missing shingles or significant discoloration. It looks generally well-maintained.')
data.plotBase64(res['img'])
1.2 customize the format for output¶
For different research purposes, you can customize the format of responses from the model
from urbanworm.format_creation import create_format
The response format can be customized. In the example below, "explanation" is replaced by "confidence", which measures how the model is confident with its answer.
# specify the new schema in a dictionary
schema = {
"question": (str, ...),
"answer": (str, ...),
"confidence": (float, ...),
}
# define a new Response class
CustomResponse = create_format(schema)
data = UrbanDataSet(image = './data/test2.jpg', format=CustomResponse)
system = '''
Given a top view image, you are going to roughly estimate house conditions. Your answer should be based only on your observation.
The format of your response must include question, answer (yes or no), confidence (0-1)
'''
prompt = '''
Is there any damage on the roof?
'''
res = data.oneImgChat(system=system, prompt=prompt)
res.keys()
Inference starts ...
dict_keys(['question', 'answer', 'confidence', 'img'])
data.plotBase64(res['img'])
res['question'], res['answer'], res['confidence']
('Is there any damage on the roof?', 'no', 0.8)
2 batch images inference¶
2.1 batch images input¶
imgs = ['./data/test1.jpg', './data/test2.jpg', './data/test3.jpg',]
data = UrbanDataSet(images = imgs)
system = '''
Given a top view image, you are going to roughly estimate house conditions. Your answer should be based only on your observation.
The format of your response must include question, answer (yes or no), explaination (within 50 words)
'''
prompt = '''
Is there any damage on the roof?
Is there solar panel on the roof?
'''
res = data.loopImgChat(system=system, prompt=prompt, output_df=True)
res
Processing...: 100%|█████████████████████████| 3/3 [00:06<00:00, 2.23s/it]
question1 | answer1 | explanation1 | img | |
---|---|---|---|---|
0 | Is there any damage on the roof? | No | Based on the image, the roof appears intact wi... | ./data/test1.jpg |
1 | Is there any damage on the roof? | No | Based on the image, the roof appears intact wi... | ./data/test1.jpg |
2 | Is there any damage on the roof? | No | The roof appears intact and uniform in color a... | ./data/test2.jpg |
3 | Is there any damage on the roof? | No | The roof appears intact and uniform in color a... | ./data/test2.jpg |
4 | Is there any damage on the roof? | No | The roof appears relatively uniform in color a... | ./data/test3.jpg |
5 | Is there any damage on the roof? | No | The roof appears relatively uniform in color a... | ./data/test3.jpg |
2.2 Open-source building footprints¶
bbox = (-83.235572,42.348092,-83.235154,42.348806)
data = UrbanDataSet()
data.bbox2Buildings(bbox, source='osm')
'5 buildings found in the bounding box.'
data.units
geometry | |
---|---|
0 | POLYGON ((-83.23534 42.3488, -83.23523 42.3488... |
1 | POLYGON ((-83.23533 42.34865, -83.23522 42.348... |
2 | POLYGON ((-83.23533 42.3485, -83.23522 42.3485... |
3 | POLYGON ((-83.23533 42.34835, -83.23521 42.348... |
4 | POLYGON ((-83.23532 42.34821, -83.23521 42.348... |
data.units.plot()
<Axes: >
The output can be assigned to a new variable. It is also automatically stored in the data structure and can be called.
system = '''
Given a top view image, you are going to roughly estimate house conditions. Your answer should be based only on your observation.
The format of your response must include question, answer (yes or no), explaination (within 50 words)
'''
prompt = {
'top':'''
Is there any damage on the roof?
'''
}
# inspect the aerial images only (with type='top')
res = data.loopUnitChat(system=system, prompt=prompt, type='top', epsg=2253)
Processing...: 100%|█████████████████████████| 5/5 [00:08<00:00, 1.64s/it]
data.to_gdf()
geometry | top_view_question1 | top_view_answer1 | top_view_explanation1 | top_view_base64 | |
---|---|---|---|---|---|
0 | POINT (-83.23528 42.34875) | Is there any damage on the roof? | No | Based on the top-down view, the roof appears i... | /9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAgGBgcGBQgHBw... |
1 | POINT (-83.23528 42.3486) | Is there any damage on the roof? | No | Based on the image, the roof appears to be int... | /9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAgGBgcGBQgHBw... |
2 | POINT (-83.23527 42.34845) | Is there any damage on the roof? | No | Based on the image, the roof appears intact an... | /9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAgGBgcGBQgHBw... |
3 | POINT (-83.23527 42.34831) | Is there any damage on the roof? | No | The roof appears to be flat and uniform. There... | /9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAgGBgcGBQgHBw... |
4 | POINT (-83.23526 42.34816) | Is there any damage on the roof? | No | The roof appears intact and smooth from this t... | /9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAgGBgcGBQgHBw... |
With type = 'both'
(The default is top
.), the method loopUnitChat
can inspect both aerial and street view images.
With multi = True
(The default is False
), for each unit, three closest street views will be collected for inference. This will take longer time to process the data.
In this case, the instruction and prompt will be little bit different and more detailed for specifying questions for each type of image.
system = '''
Given a top view image or street view images, you are going to roughly estimate house conditions.
Your answer should be based only on your observation.
The format of your response must include question, answer (yes or no), explaination (within 50 words) for each question.
'''
prompt = {
'top': '''
Is there any damage on the roof?
''',
'street': '''
Is the house occupied?
Is any window broken or boarded?
Is the door missing or boarded?
Is the wall missing or damaged?
Is the yard maintained well?
'''
}
# add the Mapillary key
data.mapillary_key = 'MLY|6978895318888980|51c1e224ebaf1cab65b17c91b612bac9'
# inspect both the aerial and street view images (with type='both')
res = data.loopUnitChat(system=system, prompt=prompt, type='both', epsg=2253, multi=True)
Processing...: 100%|████████████████████████| 5/5 [08:22<00:00, 100.58s/it]
data.to_gdf()
geometry | top_view_question1 | top_view_answer1 | top_view_explanation1 | street_view_question1 | street_view_answer1 | street_view_explanation1 | street_view_question2 | street_view_answer2 | street_view_explanation2 | ... | street_view_answer3 | street_view_explanation3 | street_view_question4 | street_view_answer4 | street_view_explanation4 | street_view_question5 | street_view_answer5 | street_view_explanation5 | top_view_base64 | street_view_base64 | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | POINT (-83.23528 42.34875) | Is there any damage on the roof? | No | The roof appears intact and doesn's show any v... | Is the house occupied? | Is the house occupied... | no | no | no | No lights are on, and the overall appearance s... | Is any window broken or boarded? | Is any wind... | no | no | no | All windows appear intact. There are no visibl... | ... | no | no | no | The front doors are present and appear undamag... | Is the wall missing or damaged? | Is the wall ... | no | no | no | The visible walls of the houses appear to be i... | Is the yard maintained well? | Is the yard mai... | no | no | no | The yards appear somewhat overgrown with falle... | /9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAgGBgcGBQgHBw... | [iVBORw0KGgoAAAANSUhEUgAAAZAAAAEsCAIAAABi1XKVA... |
1 | POINT (-83.23528 42.3486) | Is there any damage on the roof? | No | The roof appears to be intact and without any ... | Is the house occupied? | Is the house occupied... | no | no | no | There are no signs of activity, like cars in t... | Is any window broken or boarded? | Is any wind... | no | no | no | All windows appear intact and clear. There are... | ... | no | no | no | The front door is present and appears undamage... | Is the wall missing or damaged? | Is the wall ... | no | no | no | The visible walls of the house appear to be in... | Is the yard maintained well? | Is the yard mai... | yes | no | no | The lawn is neatly trimmed, and the landscapin... | /9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAgGBgcGBQgHBw... | [iVBORw0KGgoAAAANSUhEUgAAAZAAAAEsCAIAAABi1XKVA... |
2 | POINT (-83.23527 42.34845) | Is there any damage on the roof? | No | The roof appears intact and flat. There are no... | Is the house occupied? | Is the house occupied... | no | no | no | There are abandoned cars in the yard, and the ... | Is any window broken or boarded? | Is any wind... | no | no | no | All windows appear intact, and there are no vi... | ... | no | no | no | The front door is present and appears undamage... | Is the wall missing or damaged? | Is the wall ... | no | no | no | The visible walls of the house appear intact, ... | Is the yard maintained well? | Is the yard mai... | no | no | no | The yard is overgrown with weeds, and the land... | /9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAgGBgcGBQgHBw... | [iVBORw0KGgoAAAANSUhEUgAAAZAAAAEsCAIAAABi1XKVA... |
3 | POINT (-83.23527 42.34831) | Is there any damage on the roof? | No | The roof appears to be flat and intact. There ... | Is the house occupied? | Is the house occupied... | no | no | no | There is a car parked in front of the house, b... | Is any window broken or boarded? | Is any wind... | no | no | no | All windows appear intact and are not boarded ... | ... | no | no | no | The front door is present and appears to be in... | Is the wall missing or damaged? | Is the wall ... | no | no | no | The visible walls of the house appear to be in... | Is the yard maintained well? | Is the yard mai... | no | no | no | The yard appears overgrown with weeds and the ... | /9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAgGBgcGBQgHBw... | [iVBORw0KGgoAAAANSUhEUgAAAZAAAAEsCAIAAABi1XKVA... |
4 | POINT (-83.23526 42.34816) | Is there any damage on the roof? | No | The roof appears intact and doesn't show any v... | Is the house occupied? | Is the house occupied... | no | yes | no | There are no signs of recent activity, and the... | Is any window broken or boarded? | Is any wind... | no | no | no | All windows appear intact and clear. There are... | ... | no | no | no | The front door is present and appears to be in... | Is the wall missing or damaged? | Is the wall ... | no | no | no | The visible walls of the house appear to be in... | Is the yard maintained well? | Is the yard mai... | no | yes | no | The yard shows some overgrowth and lack of rec... | /9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAgGBgcGBQgHBw... | [iVBORw0KGgoAAAANSUhEUgAAAZAAAAEsCAIAAABi1XKVA... |
5 rows × 21 columns
3 Chat for data analysis/interpretation¶
data.dataAnalyst(prompt='please summarize the results')
Okay, let's analyze the provided data and synthesize a comprehensive understanding of the responses. **Overall Observations:** * **Dominant Response:** The overwhelmingly dominant response across all questions is “no”. This is particularly true for questions related to damage (roof, windows, doors, walls) and occupancy. * **Consistent Question Structure:** The questions are consistently framed with a repeated phrasing ("Is there any...?", "Is the house occupied?"). This suggests a standardized data collection process. * **Multiple Question Sets:** The data includes multiple sets of questions, likely representing different observations or assessments of the same property. **Detailed Analysis of Response Types & Distributions:** * **`top_view_answer1` (Roof Damage):** String. Value distribution: “no” (3), “yes” (1). This indicates that in the majority of observations, the roof was assessed as undamaged. * **`street_view_answer1` (Occupancy):** String. Value distribution: “no” (3), “no” (1), “yes” (1). The vast majority of assessments indicate the house is unoccupied. * **`street_view_answer2` (Window Damage):** String. Value distribution: “no” (3), “no” (1), “yes” (1). Similar to the previous question, the windows are consistently reported as undamaged. * **`street_view_answer3` (Door Damage):** String. Value distribution: “no” (3), “no” (1), “yes” (1). Again, the doors are consistently reported as intact. * **`street_view_answer4` (Wall Damage):** String. Value distribution: “no” (3), “no” (1), “yes” (1). Walls are consistently reported as undamaged. * **`street_view_answer5` (Yard Maintenance):** String. Value distribution: “no” (2), “no” (1), “yes” (1). This field shows a slightly more varied response, with two instances of “no” (indicating a neglected yard) and one instance of “yes” (a well-maintained yard). **Key Insights & Potential Implications:** * **Property Condition:** The data strongly suggests that the properties being assessed are in relatively good condition, with minimal damage observed. * **Standardized Assessment:** The repeated question phrasing indicates a structured assessment process, likely designed to ensure consistency across observations. * **Potential for Further Investigation:** The single “yes” response for yard maintenance suggests that there might be a small subset of properties with different characteristics or maintenance practices. **Summary Table:** | Question Category | Response | Frequency | | ---------------------------- | -------- | --------- | | Roof Damage | no | 3 | | Occupancy | no | 3 | | Window Damage | no | 3 | | Door Damage | no | 3 | | Wall Damage | no | 3 | | Yard Maintenance | no | 2 | | Yard Maintenance | no | 1 | | Yard Maintenance | yes | 1 | Do you want me to delve deeper into any specific aspect of this analysis, such as: * Comparing the responses across different question categories? * Discussing potential biases in the data collection process? * Suggesting further analysis that could be performed with this data?
data.messageHistory
[{'role': 'system', 'content': 'You are a spatial data analyst.'}, {'role': 'user', 'content': 'Please analyze and summarize the main patterns found in the answer columns of this dataset.\n Consider the value types (e.g., numeric or categorical), and also consider the relationship between question and answer fields when interpreting the values.\n\n Dataset summary:\n - Number of spatial units: 3\n- Bounding box: lon [-83.2353, -83.2353], lat [42.3483, 42.3487]\n- Number of data fields (excluding geometry and large fields): 18\n- Field names: top_view_question1, top_view_answer1, top_view_explanation1, street_view_question1, street_view_answer1, street_view_explanation1, street_view_question2, street_view_answer2, street_view_explanation2, street_view_question3, street_view_answer3, street_view_explanation3, street_view_question4, street_view_answer4, street_view_explanation4, street_view_question5, street_view_answer5, street_view_explanation5\n Sample 1: {\'top_view_question1\': \'Is there any damage on the roof?\', \'top_view_answer1\': \'No\', \'top_view_explanation1\': \'The roof appears intact and smooth from this aerial view. There are no visible signs of missing shingles, holes, or other structural damage.\', \'street_view_question1\': \'Is the house occupied? | Is the house occupied? | Is the house occupied?\', \'street_view_answer1\': \'no | no | no\', \'street_view_explanation1\': \'There are no signs of activity, like cars in the driveway or lights on. The overall appearance suggests vacancy. | There is a car parked in front of the house, but no visible signs of recent activity or maintenance, suggesting potential vacancy. | The house appears deserted with no visible signs of activity, such as cars or people. The yard is overgrown, suggesting a lack of maintenance.\', \'street_view_question2\': \'Is any window broken or boarded? | Is any window broken or boarded? | Is any window broken or boarded?\', \'street_view_answer2\': \'no | no | no\', \'street_view_explanation2\': \'All windows appear intact and are not boarded up. There are no visible signs of damage or obstructions on the windows. | All windows appear intact and clear, with no visible signs of damage or boarding. | All windows appear intact and are not boarded up. There are no visible signs of damage or breakage on any of the windows.\', \'street_view_question3\': \'Is the door missing or boarded? | Is the door missing or boarded? | Is the door missing or boarded?\', \'street_view_answer3\': \'no | no | no\', \'street_view_explanation3\': "The front doors are present and appear to be in good condition. There are no signs of boarding or missing doors. | The front door is present and appears undamaged, indicating it\'s not missing or boarded up. | The front door is present and appears to be in good condition. It is not missing or boarded up, suggesting it\'s accessible.", \'street_view_question4\': \'Is the wall missing or damaged? | Is the wall missing or damaged? | Is the wall missing or damaged?\', \'street_view_answer4\': \'no | no | no\', \'street_view_explanation4\': \'The walls of the houses appear to be intact and without any visible signs of damage or missing sections. | The visible walls of the house appear to be intact, with no obvious signs of missing sections or significant damage. | The visible walls of the house appear to be intact and undamaged. There are no obvious signs of structural issues or deterioration.\', \'street_view_question5\': \'Is the yard maintained well? | Is the yard maintained well? | Is the yard maintained well?\', \'street_view_answer5\': \'no | no | no\', \'street_view_explanation5\': "The yards appear somewhat overgrown with fallen leaves and debris. There\'s a lack of visible landscaping or upkeep. | The yard appears overgrown with weeds and unkempt, suggesting it\'s not being regularly maintained. | The yard is overgrown with weeds and leaves, indicating a lack of regular maintenance. The grass is long and unkempt."}\n Sample 2: {\'top_view_question1\': \'Is there any damage on the roof?\', \'top_view_answer1\': \'No\', \'top_view_explanation1\': \'The roof appears to be intact and without any visible signs of damage like missing shingles, holes, or sagging. The image quality is a bit grainy, but no obvious issues are apparent.\', \'street_view_question1\': \'Is the house occupied? | Is the house occupied? | Is the house occupied?\', \'street_view_answer1\': \'no | no | no\', \'street_view_explanation1\': \'There are no signs of activity, like cars in the driveway or visible people. The overall appearance suggests vacancy. | There are no signs of activity, like cars in the driveway or visible people. The overall appearance suggests vacancy. | There are no signs of activity, like cars in the driveway or visible people. The overall appearance suggests vacancy.\', \'street_view_question2\': \'Is any window broken or boarded? | Is any window broken or boarded? | Is any window broken or boarded?\', \'street_view_answer2\': \'no | no | no\', \'street_view_explanation2\': \'All windows appear intact and clear. There are no visible signs of boarding or damage to any of the windows. | All windows appear intact and clear. There are no visible signs of boarding or damage to any of the windows. | All windows appear intact and clear. There are no visible signs of boarding or damage to any of the windows.\', \'street_view_question3\': \'Is the door missing or boarded? | Is the door missing or boarded? | Is the door missing or boarded?\', \'street_view_answer3\': \'no | no | no\', \'street_view_explanation3\': \'The front door is present and appears to be in good condition. There are no signs of it being missing or boarded up. | The front door is present and appears undamaged. There are no signs of boarding or any missing parts. | The front door is present and appears undamaged. There are no signs of boarding or any missing parts.\', \'street_view_question4\': \'Is the wall missing or damaged? | Is the wall missing or damaged? | Is the wall missing or damaged?\', \'street_view_answer4\': \'no | no | no\', \'street_view_explanation4\': \'The visible walls of the house appear to be intact and undamaged. There are no obvious signs of structural issues or deterioration. | The visible walls of the house appear to be intact and undamaged. There are no obvious signs of structural issues. | The visible walls of the house appear to be intact and undamaged. There are no obvious signs of structural issues.\', \'street_view_question5\': \'Is the yard maintained well? | Is the yard maintained well? | Is the yard maintained well?\', \'street_view_answer5\': \'no | no | yes\', \'street_view_explanation5\': "The yard appears somewhat overgrown with fallen leaves and debris. It doesn\'t show signs of recent landscaping or maintenance. | The grass appears overgrown, and there are some weeds visible. The yard doesn\'t show signs of recent maintenance. | The lawn is neatly trimmed, and the landscaping appears well-kept. There are no signs of overgrowth or neglect."}\n- Field \'top_view_answer1\' type: string\n Value distribution: no: 3\n- Field \'street_view_answer1\' type: string\n Value distribution: no | no | no: 3\n- Field \'street_view_answer2\' type: string\n Value distribution: no | no | no: 3\n- Field \'street_view_answer3\' type: string\n Value distribution: no | no | no: 3\n- Field \'street_view_answer4\' type: string\n Value distribution: no | no | no: 3\n- Field \'street_view_answer5\' type: string\n Value distribution: no | no | no: 2, no | no | yes: 1\n- Example Q&A Pairs:\n * Q: \'Is there any damage on the roof?\' → A: \'No\'\n * Q: \'Is the house occupied? | Is the house occupied? | Is the house occupied?\' → A: \'no | no | no\'\n * Q: \'Is any window broken or boarded? | Is any window broken or boarded? | Is any window broken or boarded?\' → A: \'no | no | no\'\n * Q: \'Is the door missing or boarded? | Is the door missing or boarded? | Is the door missing or boarded?\' → A: \'no | no | no\'\n * Q: \'Is the wall missing or damaged? | Is the wall missing or damaged? | Is the wall missing or damaged?\' → A: \'no | no | no\'\n * Q: \'Is the yard maintained well? | Is the yard maintained well? | Is the yard maintained well?\' → A: \'no | no | no\'\n\n Use the information above to complete the analysis.'}, {'role': 'assistant', 'content': 'Okay, let\'s analyze the provided data and synthesize a comprehensive understanding of the responses.\n\n**Overall Observations:**\n\n* **Dominant Response:** The overwhelmingly dominant response across all questions is “no”. This is particularly true for questions related to damage (roof, windows, doors, walls) and occupancy.\n* **Consistent Question Structure:** The questions are consistently framed with a repeated phrasing ("Is there any...?", "Is the house occupied?"). This suggests a standardized data collection process.\n* **Multiple Question Sets:** The data includes multiple sets of questions, likely representing different observations or assessments of the same property.\n\n**Detailed Analysis of Response Types & Distributions:**\n\n* **`top_view_answer1` (Roof Damage):** String. Value distribution: “no” (3), “yes” (1). This indicates that in the majority of observations, the roof was assessed as undamaged.\n* **`street_view_answer1` (Occupancy):** String. Value distribution: “no” (3), “no” (1), “yes” (1). The vast majority of assessments indicate the house is unoccupied.\n* **`street_view_answer2` (Window Damage):** String. Value distribution: “no” (3), “no” (1), “yes” (1). Similar to the previous question, the windows are consistently reported as undamaged.\n* **`street_view_answer3` (Door Damage):** String. Value distribution: “no” (3), “no” (1), “yes” (1). Again, the doors are consistently reported as intact.\n* **`street_view_answer4` (Wall Damage):** String. Value distribution: “no” (3), “no” (1), “yes” (1). Walls are consistently reported as undamaged.\n* **`street_view_answer5` (Yard Maintenance):** String. Value distribution: “no” (2), “no” (1), “yes” (1). This field shows a slightly more varied response, with two instances of “no” (indicating a neglected yard) and one instance of “yes” (a well-maintained yard).\n\n**Key Insights & Potential Implications:**\n\n* **Property Condition:** The data strongly suggests that the properties being assessed are in relatively good condition, with minimal damage observed.\n* **Standardized Assessment:** The repeated question phrasing indicates a structured assessment process, likely designed to ensure consistency across observations.\n* **Potential for Further Investigation:** The single “yes” response for yard maintenance suggests that there might be a small subset of properties with different characteristics or maintenance practices.\n\n**Summary Table:**\n\n| Question Category | Response | Frequency |\n| ---------------------------- | -------- | --------- |\n| Roof Damage | no | 3 |\n| Occupancy | no | 3 |\n| Window Damage | no | 3 |\n| Door Damage | no | 3 |\n| Wall Damage | no | 3 |\n| Yard Maintenance | no | 2 |\n| Yard Maintenance | no | 1 |\n| Yard Maintenance | yes | 1 |\n\nDo you want me to delve deeper into any specific aspect of this analysis, such as:\n\n* Comparing the responses across different question categories?\n* Discussing potential biases in the data collection process?\n* Suggesting further analysis that could be performed with this data?'}]
Summarize key characteristics of the GeoDataFrame
summary, example_rows = data._UrbanDataSet__summarize_geo_df()
print(summary)
- Number of spatial units: 3 - Bounding box: lon [-83.2353, -83.2353], lat [42.3483, 42.3487] - Number of data fields (excluding geometry and large fields): 18 - Field names: top_view_question1, top_view_answer1, top_view_explanation1, street_view_question1, street_view_answer1, street_view_explanation1, street_view_question2, street_view_answer2, street_view_explanation2, street_view_question3, street_view_answer3, street_view_explanation3, street_view_question4, street_view_answer4, street_view_explanation4, street_view_question5, street_view_answer5, street_view_explanation5 Sample 1: {'top_view_question1': 'Is there any damage on the roof?', 'top_view_answer1': 'No', 'top_view_explanation1': 'The roof appears intact and smooth from this aerial view. There are no visible signs of missing shingles, holes, or other structural damage.', 'street_view_question1': 'Is the house occupied? | Is the house occupied? | Is the house occupied?', 'street_view_answer1': 'no | no | no', 'street_view_explanation1': 'There are no signs of activity, like cars in the driveway or lights on. The overall appearance suggests vacancy. | There is a car parked in front of the house, but no visible signs of recent activity or maintenance, suggesting potential vacancy. | The house appears deserted with no visible signs of activity, such as cars or people. The yard is overgrown, suggesting a lack of maintenance.', 'street_view_question2': 'Is any window broken or boarded? | Is any window broken or boarded? | Is any window broken or boarded?', 'street_view_answer2': 'no | no | no', 'street_view_explanation2': 'All windows appear intact and are not boarded up. There are no visible signs of damage or obstructions on the windows. | All windows appear intact and clear, with no visible signs of damage or boarding. | All windows appear intact and are not boarded up. There are no visible signs of damage or breakage on any of the windows.', 'street_view_question3': 'Is the door missing or boarded? | Is the door missing or boarded? | Is the door missing or boarded?', 'street_view_answer3': 'no | no | no', 'street_view_explanation3': "The front doors are present and appear to be in good condition. There are no signs of boarding or missing doors. | The front door is present and appears undamaged, indicating it's not missing or boarded up. | The front door is present and appears to be in good condition. It is not missing or boarded up, suggesting it's accessible.", 'street_view_question4': 'Is the wall missing or damaged? | Is the wall missing or damaged? | Is the wall missing or damaged?', 'street_view_answer4': 'no | no | no', 'street_view_explanation4': 'The walls of the houses appear to be intact and without any visible signs of damage or missing sections. | The visible walls of the house appear to be intact, with no obvious signs of missing sections or significant damage. | The visible walls of the house appear to be intact and undamaged. There are no obvious signs of structural issues or deterioration.', 'street_view_question5': 'Is the yard maintained well? | Is the yard maintained well? | Is the yard maintained well?', 'street_view_answer5': 'no | no | no', 'street_view_explanation5': "The yards appear somewhat overgrown with fallen leaves and debris. There's a lack of visible landscaping or upkeep. | The yard appears overgrown with weeds and unkempt, suggesting it's not being regularly maintained. | The yard is overgrown with weeds and leaves, indicating a lack of regular maintenance. The grass is long and unkempt."} Sample 2: {'top_view_question1': 'Is there any damage on the roof?', 'top_view_answer1': 'No', 'top_view_explanation1': 'The roof appears to be intact and without any visible signs of damage like missing shingles, holes, or sagging. The image quality is a bit grainy, but no obvious issues are apparent.', 'street_view_question1': 'Is the house occupied? | Is the house occupied? | Is the house occupied?', 'street_view_answer1': 'no | no | no', 'street_view_explanation1': 'There are no signs of activity, like cars in the driveway or visible people. The overall appearance suggests vacancy. | There are no signs of activity, like cars in the driveway or visible people. The overall appearance suggests vacancy. | There are no signs of activity, like cars in the driveway or visible people. The overall appearance suggests vacancy.', 'street_view_question2': 'Is any window broken or boarded? | Is any window broken or boarded? | Is any window broken or boarded?', 'street_view_answer2': 'no | no | no', 'street_view_explanation2': 'All windows appear intact and clear. There are no visible signs of boarding or damage to any of the windows. | All windows appear intact and clear. There are no visible signs of boarding or damage to any of the windows. | All windows appear intact and clear. There are no visible signs of boarding or damage to any of the windows.', 'street_view_question3': 'Is the door missing or boarded? | Is the door missing or boarded? | Is the door missing or boarded?', 'street_view_answer3': 'no | no | no', 'street_view_explanation3': 'The front door is present and appears to be in good condition. There are no signs of it being missing or boarded up. | The front door is present and appears undamaged. There are no signs of boarding or any missing parts. | The front door is present and appears undamaged. There are no signs of boarding or any missing parts.', 'street_view_question4': 'Is the wall missing or damaged? | Is the wall missing or damaged? | Is the wall missing or damaged?', 'street_view_answer4': 'no | no | no', 'street_view_explanation4': 'The visible walls of the house appear to be intact and undamaged. There are no obvious signs of structural issues or deterioration. | The visible walls of the house appear to be intact and undamaged. There are no obvious signs of structural issues. | The visible walls of the house appear to be intact and undamaged. There are no obvious signs of structural issues.', 'street_view_question5': 'Is the yard maintained well? | Is the yard maintained well? | Is the yard maintained well?', 'street_view_answer5': 'no | no | yes', 'street_view_explanation5': "The yard appears somewhat overgrown with fallen leaves and debris. It doesn't show signs of recent landscaping or maintenance. | The grass appears overgrown, and there are some weeds visible. The yard doesn't show signs of recent maintenance. | The lawn is neatly trimmed, and the landscaping appears well-kept. There are no signs of overgrowth or neglect."} - Field 'top_view_answer1' type: string Value distribution: no: 3 - Field 'street_view_answer1' type: string Value distribution: no | no | no: 3 - Field 'street_view_answer2' type: string Value distribution: no | no | no: 3 - Field 'street_view_answer3' type: string Value distribution: no | no | no: 3 - Field 'street_view_answer4' type: string Value distribution: no | no | no: 3 - Field 'street_view_answer5' type: string Value distribution: no | no | no: 2, no | no | yes: 1 - Example Q&A Pairs: * Q: 'Is there any damage on the roof?' → A: 'No' * Q: 'Is the house occupied? | Is the house occupied? | Is the house occupied?' → A: 'no | no | no' * Q: 'Is any window broken or boarded? | Is any window broken or boarded? | Is any window broken or boarded?' → A: 'no | no | no' * Q: 'Is the door missing or boarded? | Is the door missing or boarded? | Is the door missing or boarded?' → A: 'no | no | no' * Q: 'Is the wall missing or damaged? | Is the wall missing or damaged? | Is the wall missing or damaged?' → A: 'no | no | no' * Q: 'Is the yard maintained well? | Is the yard maintained well? | Is the yard maintained well?' → A: 'no | no | no'
4 Plot the final GeoDataFrame results (with answer color-coded)¶
data.plot_gdf()