wkentaro / labelme

Image Polygonal Annotation with Python (polygon, rectangle, circle, line, point and image-level flag annotation).
https://labelme.io
Other
13.63k stars 3.42k forks source link

When I click on Create AI-polygon the program crashes and flashes back #1300

Open jaycecd opened 1 year ago

jaycecd commented 1 year ago

Provide environment information

I'm using version v5.3.0a0 (Labelme.exe) in releases on windows, which should be able to run standalone without the python environment

What OS are you using?

Windows 10 22H2 19042.3086

Describe the Bug

When I click on Create AI-polygon the program crashes and flashes back. But I don't get any error message, how can I troubleshoot and solve this problem? image

Expected Behavior

SAM generates AI annotations like https://github.com/wkentaro/labelme/pull/1262

To Reproduce

No response

CakeT3q commented 1 year ago

Hi, I have same problem when using AI-Polygon. I tryed three ways using labelme, including standalone file, python environment, and conda environment. When I using labelme in the python environment and conda environment, after clicking “Create AI-Polygon”, an error message appear below requests.exceptions.SSLError: HTTPSConnectionPool(host='github.com', port=443): Max retries exceeded with url: /wkentaro/labelme/releases/download/sam-20230416/sam_vit_l_0b3195.quantized.encoder.onnx (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:997)')))

jaycecd commented 1 year ago

@CakeT3q Well, thank you very much for the error message, I may know what triggered the error, it should be that there is no corresponding SAM weights file. The problem you're having now should be a network issue but how does a standalone exe file configure the SAM weights file?

zacario-li commented 1 year ago

macos is ok, windows10 will crash

sipie800 commented 1 year ago

crash all the way, no message

cosimo17 commented 1 year ago

I also meet this problem, it worked well after I set some network proxy. This is a network issue. The weight file can not be downloaded without proxy.

LuisC2802 commented 1 year ago

Hi, is there any update related to this issue?

sipie800 commented 1 year ago

Just edit code to avoid downloading. Do downloading manually. The weights shall be assighed manually rather than downloading. In many countries (if not most of countries), auto downloading through http is still a very difficult thing. Very slow or impossible. Don't assume everyone can hold auto downloading smoothly just like in areas with advanced internet, please.

LuisC2802 commented 1 year ago

Bug: labelme.exe crash (on windows) when the create AI polygon option is selected. Solution: Add quite=True in lines 145 and 149 of the /widgets/canvas.py file, to avoid the use of tqdm when downloading the weights.

miandui-WuBo commented 8 months ago

if you can't download the ai model by exe file, you can download it by yourself. https://github.com/labelmeai/labelme/releases/tag/sam-20230416

KDeser commented 8 months ago

@miandui-WuBo

if you can't download the ai model by exe file, you can download it by yourself. https://github.com/labelmeai/labelme/releases/tag/sam-20230416

Is there a mapping of the 6 ONNX files to the 5 models listed in the menu of Labelme.exe (version 5.4.1 downloaded today 3/20/2024)? Where should the downloaded .onnx files be saved, next to the .exe?

EDIT: I went through the source code and it appears that the onnx files should be saved to "C:\Users\your_username.cache\gdown", (the directory had already been created but was empty) however that didn't work either. The executable still crashes.

miandui-WuBo commented 8 months ago

@miandui-WuBo

if you can't download the ai model by exe file, you can download it by yourself. https://github.com/labelmeai/labelme/releases/tag/sam-20230416

Is there a mapping of the 6 ONNX files to the 5 models listed in the menu of Labelme.exe (version 5.4.1 downloaded today 3/20/2024)? Where should the downloaded .onnx files be saved, next to the .exe?

EDIT: I went through the source code and it appears that the onnx files should be saved to "C:\Users\your_username.cache\gdown", (the directory had already been created but was empty) however that didn't work either. The executable still crashes.

Everything about the model is in this file: "labelme/ai/init.py". I also tried to move the onnx file in gdown but I found every time I run the labelme.exe, it creates a new temporary folder, so I guess that's why it doesn't work. Maybe we can only download the source code to modify the download file path in init.py .

Vergissmeinnic commented 3 months ago

放在这里:C:\Users\xxx.cache\gdown\下,模型名称手动下载后,在模型前面添加"https-COLON--SLASH--SLASH-github.com-SLASH-wkentaro-SLASH-labelme-SLASH-releases-SLASH-download-SLASH-sam-20230416-SLASH-",如下图所示

8c3963d7e83c57086cafeb7db328237

solsylph commented 2 months ago

i have a solution (at least for the windows10 issues with this app):

just download conda, create a 'labelme' venv and download labelme natively.

image

image

and then when you have your image just WAIT for the SAM to automatically download and track its progress from the terminal you'd opened your venv from. this also solved my problems with file size! i hope this solution helps.

VeyDlin commented 4 weeks ago

I solved this problem by running it from the console. For convenience, I created a batch file for Windows.

This might help someone:

  1. Create a folder named labelme.
  2. In this folder, create a file called labelme.bat with the following content and run it.
  3. You will need to have Python installed on your system.
@echo off
PUSHD "%~dp0"
setlocal

if not exist ".venv\" (
    call python -m venv .venv
    call .venv\Scripts\activate.bat & pip install labelme
)

call .venv\Scripts\activate.bat & labelme

pause
exit /b
Nekopop commented 3 weeks ago

In a Windows 11 environment, I successfully installed labelme and its dependencies with the following commands:

conda install labelme -c conda-forge
pip install -U labelme
pip install -U pyqt5_tools
pip install -U scikit-image

This setup worked well!