{"id":18538094,"url":"https://github.com/bigmb/mb_annotation","last_synced_at":"2025-10-12T07:42:56.986Z","repository":{"id":255943551,"uuid":"852467413","full_name":"bigmb/mb_annotation","owner":"bigmb","description":"Annotation pipeline using Prompts , SAM and other tools ","archived":false,"fork":false,"pushed_at":"2024-12-13T13:22:40.000Z","size":72645,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-15T02:11:24.415Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bigmb.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-09-04T21:23:51.000Z","updated_at":"2024-12-13T13:22:44.000Z","dependencies_parsed_at":null,"dependency_job_id":"ffba22b2-c2e6-43f1-9ead-00499f3164a6","html_url":"https://github.com/bigmb/mb_annotation","commit_stats":null,"previous_names":["bigmb/mb_annotation"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/bigmb/mb_annotation","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bigmb%2Fmb_annotation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bigmb%2Fmb_annotation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bigmb%2Fmb_annotation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bigmb%2Fmb_annotation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bigmb","download_url":"https://codeload.github.com/bigmb/mb_annotation/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bigmb%2Fmb_annotation/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279010671,"owners_count":26084785,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-12T02:00:06.719Z","response_time":53,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-06T19:42:19.518Z","updated_at":"2025-10-12T07:42:56.970Z","avatar_url":"https://github.com/bigmb.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MB LLM\n\nMB LLM is a Python package that provides tools for image and video annotation, segmentation, object detection and Fine tuning models. It integrates several powerful models and techniques including SAM2 (Segment Anything 2), Florence, and Molmo.\n\n## Features\n\n- **Florence Integration**: Advanced image understanding and processing capabilities\n- **Molmo Support**: Specialized molecular and material analysis features\n- **SAM2 Integration**: State-of-the-art segmentation capabilities including:\n  - Automatic mask generation\n  - Video segmentation\n  - Image prediction\n  - Custom model training\n\n## Installation\n\n```bash\npip install mb_llm\n```\n\n## Environment Setup\n\n1. Copy `.env.example` to `.env`\n2. Add your API keys and configurations to `.env`\n3. Load environment variables using the provided utility:\n\n```python\nfrom mb_llm.utils import load_env_file\nenv_vars = load_env_file()\n```\n\n## Usage Examples\n\n### Bounding Box Detection\n\n```python\nfrom mb_llm.bounding_box import google_model, generate_bounding_box, add_bounding_box\n\n# Initialize model\nmodel = google_model(api_key=\"your_api_key\")\n\n# Generate bounding boxes\nresult = generate_bounding_box(model, \"path/to/image.jpg\")\n\n# Add bounding box to image\nimage, box = add_bounding_box(\"path/to/image.jpg\", bounding_box, \"label\")\n```\n\n### Florence Model Usage\n\n```python\nfrom mb_llm.florencefile import florence_model\n\n# Initialize model\nmodel = florence_model(model_name=\"microsoft/Florence-2-base\")\n\n# Set image and generate text\nmodel.set_image(\"path/to/image.jpg\")\nresult = model.generate_text(prompt=\"Describe this image\")\n```\n\n### Molmo Model Usage\n\n```python\nfrom mb_llm.molmo import molmo_model\n\n# Initialize model\nmodel = molmo_model(model_name=\"allenai/Molmo-7B-D-0924\")\n\n# Run inference\nresult = model.run_inference(\"path/to/image.jpg\", \"text prompt\")\n```\n\n### SAM2 Segmentation\n\n```python\nfrom mb_llm.segsam2 import get_mask_generator, image_predictor\n\n# Get mask generator\nmask_generator = get_mask_generator(sam2_checkpoint=\"path/to/checkpoint.pt\")\n\n# Use image predictor\npredictor = image_predictor(model_cfg=\"config.yaml\", sam2_checkpoint=\"checkpoint.pt\")\npredictor.set_image(\"path/to/image.jpg\")\nmasks, scores, logits = predictor.predict_item(bbox=[x0, y0, x1, y1])\n```\n\n### Video Processing\n\n```python\nfrom mb_llm.utils import video_to_images\n\n# Convert video to image frames\nimage_list = video_to_images(\n    video_path=\"video.mp4\",\n    image_save_path=\"frames/\",\n    image_name=\"frame\",\n    frame_interval=1\n)\n```\n\n## Module Overview\n\n- `florencefile.py`: Integration with Florence model for image understanding\n- `molmo.py`: Specialized functions for molecular and material analysis\n- `segsam2.py`: SAM2 integration for advanced segmentation tasks\n- `utils.py`: Utility functions for environment setup and video processing\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbigmb%2Fmb_annotation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbigmb%2Fmb_annotation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbigmb%2Fmb_annotation/lists"}