Giter VIP home page Giter VIP logo

Comments (8)

NipunaChh avatar NipunaChh commented on May 22, 2024 2

Screenshot from 2023-12-04 15-26-54
So how do I import LangSam, I seem to be running into a similar error, "NameError: name 'SLConfig' is not defined"

from segment-geospatial.

vxi214 avatar vxi214 commented on May 22, 2024 2

图片1,Boss, I also encountered this problem, how to solve it?

from segment-geospatial.

giswqs avatar giswqs commented on May 22, 2024

groundingdino is not yet available on conda-forge. It can't be added to requirements.txt as the conda-forge package will fail to build if it is included.

huggingface_hub can potentially be added. I will look into it.

from segment-geospatial.

lukesteinbicker avatar lukesteinbicker commented on May 22, 2024

I looked in the package files and found that there is only one class, name "SamGeo". If you write "from samgeo import SamGeo", your issues should be resolved. I assume that there may have been a seperate class named "LangSAM" that was deprecated.

from segment-geospatial.

giswqs avatar giswqs commented on May 22, 2024

huggingface_hub has been added to requirements.txt. #87

GroundingDINO and supervision are being added to conda-forge (conda-forge/staged-recipes#22907). It can be added to requirements.txt once they become available on conda-forge.

from segment-geospatial.

p-vdp avatar p-vdp commented on May 22, 2024

@lukesteinbicker

I looked in the package files and found that there is only one class, name "SamGeo". If you write "from samgeo import SamGeo", your issues should be resolved. I assume that there may have been a seperate class named "LangSAM" that was deprecated.

I like how you're thinking but LangSAM is a class in samgeo/text_sam.py, thus the import statement in text_prompts.ipynb:

from samgeo.text_sam import LangSAM

I updated to 0.8.1 and now get an OSError thrown by GroundingDINO:

File C:\Users\username\AppData\Local\ESRI\conda\envs\arcgispro-py3-samgeo\lib\site-packages\groundingdino\util\slconfig.py, in _file2dict:

Line 104: raise IOError("Only py/yml/yaml/json type are supported now!")

OSError: Only py/yml/yaml/json type are supported now!

Looks to be something with what LangSAM is using as cache_config_file in SLConfig.fromfile(cache_config_file)

image

from segment-geospatial.

p-vdp avatar p-vdp commented on May 22, 2024

I think I found the source of the problem with text_sam.load_model_hf()

When I run the huggingface_hub.hf_hub_download function in the ArcGIS Pro notebook, the cached file path is something like this:

C:\\Users\\username/.cache\\huggingface\\hub\\c593cfe8389419176fe6d2a7b3fb5f2a87fb4a45a7c780ef37813742c4910f49.3b220b33a5e67bbef5a685c9dd805f05aa7f36bc592cf143628033f6f6c7e61b

Not sure why this is in a hashed/hex(?) form but obviously that's why SLConfig doesn't see a .py file.

If we use the force_filename parameter with hf_hub_download() we can ensure the output filename is the same as the input. Applicable here and here.

from segment-geospatial.

icekang avatar icekang commented on May 22, 2024

Screenshot from 2023-12-04 15-26-54 So how do I import LangSam, I seem to be running into a similar error, "NameError: name 'SLConfig' is not defined"

I solved SLConfig is not defined by directly cloning GroundingDINO repo and install it directly.

# uninstall groundingdino-py
pip uninstall groundingdino-py

# install GroundingDINO from github
git clone https://github.com/IDEA-Research/GroundingDINO.git
cd GroundingDINO/
pip install -e .

from segment-geospatial.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.