tersekmatija / lwcc Goto Github PK
View Code? Open in Web Editor NEWLWCC: A LightWeight Crowd Counting library for Python that includes several pretrained state-of-the-art models.
License: MIT License
LWCC: A LightWeight Crowd Counting library for Python that includes several pretrained state-of-the-art models.
License: MIT License
Hi,
when I first tried out the package, I got always following exception
Traceback (most recent call last):
File "/usr/lib/python3.8/pathlib.py", line 1288, in mkdir
self._accessor.mkdir(self, mode)
FileNotFoundError: [Errno 2] No such file or directory: '/.lwcc/weights'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "./crowd_counting.py", line 53, in <module>
results = count(args.img_path)
File "./crowd_counting.py", line 38, in count
count, density = LWCC.get_count(
File "/home/jmkrieger/.local/lib/python3.8/site-packages/lwcc/LWCC.py", line 65, in get_count
model = load_model(model_name, model_weights)
File "/home/jmkrieger/.local/lib/python3.8/site-packages/lwcc/LWCC.py", line 31, in load_model
model = model.make_model(model_weights)
File "/home/jmkrieger/.local/lib/python3.8/site-packages/lwcc/models/CSRNet.py", line 13, in make_model
output = weights_check("CSRNet", model_weights)
File "/home/jmkrieger/.local/lib/python3.8/site-packages/lwcc/util/functions.py", line 17, in weights_check
Path("/.lwcc/weights").mkdir(parents=True, exist_ok=True)
File "/usr/lib/python3.8/pathlib.py", line 1292, in mkdir
self.parent.mkdir(parents=True, exist_ok=True)
File "/usr/lib/python3.8/pathlib.py", line 1288, in mkdir
self._accessor.mkdir(self, mode)
PermissionError: [Errno 13] Permission denied: '/.lwcc'
I traced the error and found that the function weights_check
in lwcc/util/functions.py
tried to create the folder designated for the downloaded weights in the root folder, and not the home directory.
I could easily fixed it for me by changing the function to
def weights_check(model_name, model_weights):
home = str(Path.home())
# create dir if does not exists
Path(os.path.join(home, ".lwcc/weights")).mkdir(parents=True, exist_ok=True)
# download weights if not available
file_name = "{}_{}.pth".format(model_name, model_weights)
url = build_url(file_name)
output = os.path.join(home, ".lwcc/weights/", file_name)
# [...]
Thank you for creating this package - it's quite mindblowing what today's neural networks can achieve!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.