█

AI/TLDR

मुझे पिलाएं कॉफ़ी
मुझे एक कॉफ़ी पिलाएँ

Edit Banana

स्थिर डायग्राम इमेज को एडिट करने योग्य draw.io (DrawIO XML) फ़ाइलों में बदलता है

Office Documents & Spreadsheetsओपन सोर्स
भाषा
Python
लाइसेंस
AGPL-3.0
संक्षेप में

Edit Banana क्या है?

Edit Banana स्थिर डायग्राम इमेज को एडिट करने योग्य draw.io (DrawIO XML) फ़ाइलों में बदलता है. यह AI Productivity & Writing टूल्स की Office Documents & Spreadsheets श्रेणी में आता है; ओपन सोर्स है, Python में लिखा गया है और AGPL-3.0 लाइसेंस के तहत है। शुरू करने के लिए: clone करें और dependencies इंस्टॉल करें.

सारांश

Edit Banana एक ऐसा diagram लेता है जो सिर्फ़ तस्वीर के रूप में मौजूद है — flowchart का screenshot, किसी paper की architecture figure, कोई तकनीकी schematic, या कोई scientific formula — और उसे एक editable draw.io फ़ाइल के रूप में फिर से बनाता है। आउटपुट DrawIO XML होता है, जिसमें हर shape, arrow और text label एक अलग element होता है, जिसे आप select, drag, restyle या दोबारा लिख सकते हैं, न कि एक सपाट bitmap जिसे आपको हाथ से दोबारा बनाना पड़े। इसे BIT-DataLab ने बनाया है, जो Beijing Institute of Technology की एक data lab है।

The original static image of a multi-level architecture figure titled Proposed Siamese VGGNet Framework for Cow Face Verification, with preprocessing, feature extraction and similarity-learning stages
The input: a flat image of a multi-level architecture figure.Edit Banana README ↗

पर्दे के पीछे यह pipeline एक fine-tuned SAM 3 (Segment Anything Model 3) mask decoder से इमेज को segment करती है, एक multimodal LLM द्वारा निर्देशित fixed multi-round scan चलाती है, और साथ-साथ text निकालती है: local OCR (Tesseract, या वैकल्पिक रूप से PaddleOCR) text boxes ढूँढता है, और text तथा formula regions के high-resolution crops LaTeX conversion के लिए Pix2Text के पास जाते हैं। Segmentation और OCR से मिला spatial डेटा फिर DrawIO XML में merge किया जाता है। README के अनुसार reconstruction का लक्ष्य original layout, colours, element hierarchy, stroke और fill styles, और dashed lines व thickness जैसे arrow styles को बनाए रखना है।

A three-stage Siamese VGGNet architecture figure rebuilt in draw.io, with every label, box, arrow and cow photo outlined by a dashed selection frame on the editor's grid
The same figure after conversion: each label, block, arrow and embedded photo is now a separate draw.io element.Edit Banana README ↗

यह repository locally Python CLI के रूप में या /convert endpoint वाले FastAPI server के रूप में चलती है; CUDA GPU की सख़्त सिफ़ारिश है। वही team editbanana.net पर एक hosted web version चलाती है, जहाँ आप image upload करके editable result download करते हैं, और README बताता है कि GitHub का code features और performance में उस web service से पीछे रहता है।

यह क्या करता है

  • Diagram images (PNG, JPG, BMP, TIFF, WebP) को DrawIO XML में फिर से बनाता है, जिसमें हर shape, arrow और label अलग से editable होता है
  • fine-tuned SAM 3 mask decoder से diagram elements को segment करता है, उसके बाद multimodal LLM द्वारा निर्देशित fixed multi-round scan चलता है
  • Local Tesseract OCR (PaddleOCR वैकल्पिक) से text पहचानता है, और high-resolution crops के ज़रिए formula regions को LaTeX में बदलने के लिए Pix2Text
The original image of a diffusion-model diagram with an M-UNet block, encoder boxes, forward and back render arrows and a noise-schedule formula
Input: a figure mixing boxes, photos and a formula.
The same diffusion-model diagram reconstructed in draw.io, with the formula and labels as separate text elements and blue handles on every shape and connector
Output: the formula and labels come back as editable elements.
  • साफ़ shape extraction के लिए वैकल्पिक background removal (RMBG)
  • CLI के रूप में single-image या batch mode में चलता है, या FastAPI backend के रूप में, जिसमें /convert upload endpoint और interactive docs होते हैं
  • config.yaml से configurable: SAM 3 score और NMS thresholds, maximum iteration loops, input/output paths और dominant-colour sensitivity

शुरू करें

Edit Banana को Python 3.10+ चाहिए और, आदर्श रूप से, एक CUDA-capable GPU। SAM 3 weights (sam3.pt) ModelScope या Hugging Face (facebook/sam3) से अलग से download किए जाते हैं और models/ के अंदर रखे जाते हैं। अगर आप इसे बस आज़माना चाहते हैं, तो editbanana.net वाले hosted version को कोई सेटअप नहीं चाहिए।

Clone करें और dependencies इंस्टॉल करें

एक virtual environment बनाएँ, PyTorch इंस्टॉल करें (यहाँ दिखाया गया CUDA 11.8 build, या CPU build), Python requirements और OCR के लिए Tesseract।

bashbash
git clone https://github.com/BIT-DataLab/Edit-Banana.git && cd Edit-Banana
python3 -m venv .venv && source .venv/bin/activate
pip install torch torchvision --index-url https://download.pytorch.org/whl/cu118
pip install -r requirements.txt
sudo apt install tesseract-ocr tesseract-ocr-chi-sim

SAM 3 इंस्टॉल करें और जाँचें कि यह लोड होता है

Setup script SAM 3 library इंस्टॉल करती है और BPE vocabulary को models/ में कॉपी करती है। डाउनलोड किए गए sam3.pt weights को models/sam3_ms के अंदर रखें।

bashbash
bash scripts/setup_sam3.sh
python -c "from sam3.model_builder import build_sam3_image_model; print('OK')"

कॉन्फ़िगर करें

Example config कॉपी करें, फिर config/config.yaml में बदलाव करें ताकि sam3.checkpoint_path और sam3.bpe_path आपकी models/ फ़ाइलों की ओर इशारा करें। GPU architecture mismatch होने पर README sam3.device को "cpu" सेट करने का सुझाव देता है।

bashbash
mkdir -p input output
cp config/config.yaml.example config/config.yaml

एक diagram convert करें

CLI को एक image की ओर इंगित करें; DrawIO XML और intermediate files output/<image_stem>/ में बनती हैं। input/ में मौजूद सब कुछ batch-process करने के लिए बिना -i के python main.py चलाएँ।

bashbash
python main.py -i input/test.png

या इसे API के रूप में चलाएँ

FastAPI backend शुरू करें और /convert पर एक image POST करें, या interactive docs से upload करने के लिए http://localhost:8000/docs खोलें।

bashbash
python server_pa.py
# in another terminal:
curl -X POST http://localhost:8000/convert -F "file=@input/test.png"

कमांड और कोड प्रोजेक्ट के अपने दस्तावेज़ों से लिए गए हैं — हमेशा जांचें आधिकारिक repo ताज़ा जानकारी के लिए।

कब इस्तेमाल करें

  • जब आपको flowchart या architecture diagram में संशोधन करना हो और आपके पास सिर्फ़ screenshot या export किया हुआ PNG हो, तब इसका इस्तेमाल करें
  • papers और slides से figures निकालकर draw.io में लाने के लिए इसका इस्तेमाल करें, ताकि आप उन्हें restyle, relabel या दोबारा इस्तेमाल कर सकें
  • जब किसी diagram में formulas हों और आप उन्हें pixels के बजाय editable LaTeX के रूप में वापस चाहते हों, तब इसका इस्तेमाल करें
  • CLI या /convert API के ज़रिए legacy diagram images के पूरे folder को editable DrawIO फ़ाइलों में batch-convert करने के लिए इसका इस्तेमाल करें

How Edit Banana compares

Edit Banana alongside other open-source office documents & spreadsheets tools AI/TLDR tracks, ranked by GitHub stars.

टूलस्टारयह क्या करता है
Next AI Draw.io★ 37.3kAI से चैट करके असली draw.io डायग्राम बनाएं और एडिट करें
OfficeCLI★ 33.7kएक single-binary CLI, जो AI agents को बिना Office इंस्टॉल किए Word, Excel और PowerPoint फ़ाइलें पढ़ने, edit करने और render करने देता है
Univer★ 32.4kएक ओपन सोर्स SDK जो आपके ऐप में स्प्रेडशीट, डॉक्स, स्लाइड, बोर्ड और बेस जोड़ता है — और AI SDK के साथ एजेंट इन्हें भी एडिट कर सकते हैं
GenOffice★ 13.3kदस्तावेज़ के बगल में AI पैनल की मदद से असली .docx, .xlsx और .pptx फ़ाइलें एडिट करें
Jantt★ 6.2kसादी अंग्रेज़ी में ड्राफ़्ट किए जाने वाले Gantt चार्ट, अपनी API key वाले AI कोपायलट के साथ
Edit Banana★ 5.5kस्थिर डायग्राम इमेज को एडिट करने योग्य draw.io (DrawIO XML) फ़ाइलों में बदलता है
MR Office★ 5kAI copilot और एजेंट्स के लिए MCP server के साथ ओपन सोर्स ब्राउज़र ऑफ़िस एडिटर्स
Doory★ 3.1kCanva जैसा सेल्फ-होस्ट होने योग्य डिज़ाइन एडिटर, जिसे AI असिस्टेंट MCP के ज़रिए चला सकते हैं