File size: 1,865 Bytes
			
			| effd827 68cea8b 8fa1f84 effd827 c5b64a0 14e113a 8fa1f84 c5b64a0 8fa1f84 c5b64a0 8fa1f84 c5b64a0 8fa1f84 c5b64a0 8fa1f84 c5b64a0 8fa1f84 c5b64a0 8fa1f84 c5b64a0 a1b3bdd c5b64a0 8fa1f84 c5b64a0 a18d809 a1b3bdd ba35a1a 8fa1f84 a1b3bdd ba35a1a 8fa1f84 68cea8b 8fa1f84 68cea8b | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 | import os
        
if __name__ == '__main__':
    # Install the package in editable mode
    os.system("pip install -e .")
    os.system("pip install git+https://github.com/facebookresearch/segment-anything.git")
    from zipfile import ZipFile
    z = ZipFile("gradio.zip")
    z.extractall()
    os.chdir("gradio-bbox")
    os.system("pip install -e .")
    os.chdir("..")
    
    # Install NVM (Node Version Manager)
    # os.system("curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash")
    # # # Source the appropriate shell configuration file
    # os.system("source ~/.bashrc")  # You can change to ~/.zshrc based on your shell
    # # # Install Node.js version 18.16.0
    # os.system("nvm install v18.16.0")
    # print("nvm installed OK.")
    # # Install pnpm (package manager)
    # os.system("curl -fsSL https://get.pnpm.io/install.sh | sh -")
    # # Source the shell configuration file again (for pnpm)
    # os.system("source ~/.bashrc")  # You can change to ~/.zshrc based on your shell
    # # Verify if pnpm was installed correctly
    # os.system("pnpm --version")
    # print("pnpm installed OK.")
    # # Clone the Gradio BBox repository
    os.system("git clone https://github.com/chencn2020/gradio-bbox.git")
    # Build frontend
    os.system("bash gradio-bbox/scripts/build_frontend.sh")
    # Change back to the previous directory
    # os.system("cd ..")
    import argparse
    from demo.UI import Main_ui
    parser = argparse.ArgumentParser(description='SEAGULL', formatter_class=argparse.RawTextHelpFormatter)
    parser.add_argument('--model', help='path to seagull model', default='Zevin2023/SEAGULL-7B')
    parser.add_argument('--example_path', help='path to examples', default='./imgs/Examples')
    args = parser.parse_args()
    
    demo = Main_ui(args).load_demo()
    demo.launch() | 
