import geopandas as gpd
shapefile1 = gpd.read_file(r"C:\shapefile1.shp")
shapefile2 = gpd.read_file(r"C:\shapefile2.shp")
clipped_shapefile = gpd.overlay(shapefile1, shapefile2, how="intersection")
clipped_shapefile.to_file(r"C:\clipped_shapefile.shp")
returns an error message of: OSError: exception: access violation reading 0xFFFFFFFFFFFFFFFF
I was hoping to get an output of a clipped polygon.
Related
I am trying to read some .shp file in geopandas using .read_file() function, but I am always get error:
DriverError: Failed to read all values for 158775 records in .shx file: No error.
My code:
import geopandas as gpd
path_shp = "./data/gis_osm_buildings_a_07_1.shp"
data_shx = gpd.read_file(path_shp, driver = "SHP")
Out:
DriverError: Failed to read all values for 158775 records in .shx file: No error.
How can I solve this problem?
i would like to use deepface algorithm for detection human's emotion from the image, here is my code :
import cv2
from deepface import DeepFace
import numpy as np
import json
image =cv2.imread('emotion.jpg')
#json.dumps(image)
analyze =DeepFace.analyze(image,actions='emotions',enforce_detection=False)
print(analyze)
but when i have run the code, got the following error
C:\Users\User\PycharmProjects\AI_Project\venv\Scripts\python.exe C:\Users\User\PycharmProjects\AI_Project\emotion_detection.py
Action: e: 0%| | 0/8 [00:00<?, ?it/s]
Traceback (most recent call last):
File "C:\Users\User\PycharmProjects\AI_Project\emotion_detection.py", line 7, in <module>
analyze =DeepFace.analyze(image,actions=('emotions'),enforce_detection=False)
File "C:\Users\User\PycharmProjects\AI_Project\venv\lib\site-packages\deepface\DeepFace.py", line 452, in analyze
resp_obj["region"][parameter] = int(region[i]) #int cast is for the exception - object of type 'float32' is not JSON serializable
IndexError: list index out of range
Process finished with exit code 1
i have searched a lot about this problem, for instance try the following code
json.dumps(image)
but when i run, got :
TypeError: Object of type ndarray is not JSON serializable
please tell me is there any solution? or it is just deepface's bug?
you have to pass the image directly. No need to read with opencv & then pass to Deepface.analyze. Read documentaion clearly.
backends = ['opencv', 'ssd', 'dlib', 'mtcnn', 'retinaface', 'mediapipe']
analyze = DeepFace.analyze(img_path = 'emotion.jpg', detector_backend =backends[4])
print(analyze)
While reading a geojson file using GeoPandas in jupyter notebook, I'm getting following error.
import geopandas as gpd
df = gpd.read_file(filepath)
Error:
CRSError: Invalid projection: epsg:4326: (Internal Proj Error: proj_create: SQLite error on SELECT name, type, coordinate_system_auth_name, coordinate_system_code, datum_auth_name, datum_code, area_of_use_auth_name, area_of_use_code, text_definition, deprecated FROM geodetic_crs WHERE auth_name = ? AND code = ?: no such column: area_of_use_auth_name)
I also got the warning while importing geopandas:
Warning:
PROJ: proj_create_from_database: SQLite error on SELECT name, type, coordinate_system_auth_name, coordinate_system_code, datum_auth_name, datum_code, area_of_use_auth_name, area_of_use_code, text_definition, deprecated FROM geodetic_crs WHERE auth_name = ? AND code = ?: no such column: area_of_use_auth_name
What does it mean?. I have been using 'geopandas' for a long time. Never saw these error and warning.
I am trying to import an image in python to later use it in a plot. I am using the following code:
import matplotlib.image as image
im = image.imread('image.png')
And I am having the following error:
SystemError: built-in method fileno of _io.FileIO object at 0x00000295A8277750 returned a result with an error set
The image exist in the current folder. I tried also the following with the same result:
from matplotlib._png import read_png
png_file = open('image.png')
Image = read_png(png_file)
Error output:
SystemError: built-in method fileno of _io.FileIO object at 0x00000295A8277828 returned a result with an error set
Why is this happening?
maybe your directory is wrong.
I tried this code and worked.
import matplotlib.image as image
imgg = image.imread('/home/ss/Desktop/1.jpg')
plt.imshow(imgg)
plt.show()
Using the following code:
from ctypes import *
test = WinDLL('My.dll')
test.My_API_call_fetch.argtypes = [POINTER(c_long)]
rtn = c_long()
test.My_API_call_fetch(byref(rtn))
I get the WindowsError: Exception: access violation reading 0x000000000 and have ran out of ideas. Can anyone offer some suggestions?
I can do any API calls that do not return anything without errors.