!pip install matplotlib==3.7.3
!git clone https://github.com/CASIA-IVA-Lab/FastSAM.git
!pip -q install -r FastSAM/requirements.txt
# install CLIP ----------
#!pip -q install git+https://github.com/openai/CLIP.git
!pip -q install openai-clip
!wget -P {HOME}/FastSAM/weights -q https://huggingface.co/spaces/An-
619/FastSAM/resolve/main/weights/FastSAM.pt
FAST_SAM_CHECKPOINT_PATH = f"{HOME}/FastSAM/weights/FastSAM.pt"
DOGImage_PATH = f"{HOME}/FastSAM/images/dogs.jpg"
%cd {HOME}/FastSAM
import os
import cv2
import torch
import numpy as np
import matplotlib
import clip
from fastsam import FastSAM, FastSAMPrompt
model = FastSAM(FAST_SAM_CHECKPOINT_PATH)
everything_results = model(DOGImage_PATH, device=DEVICE, retina_masks=True, imgsz=1024,
conf=0.4, iou=0.9,)
prompt_process = FastSAMPrompt(DOGImage_PATH, everything_results, device=DEVICE)
ann = prompt_process.everything_prompt()
prompt_process.plot(annotations=ann,output_path='./output/dogSegmented.jpg',)
ann = prompt_process.text_prompt(text='a photo of a dog')
prompt_process.plot(annotations=ann,output_path='./output/dogPromptPhoto.jpg',)
< /code>
Alles_Prompt funktioniert gut, und ich sehe das generierte Bild im Ordner. Der text_prompt verursacht jedoch Fehler < /p>
NameError Traceback (most recent call last)
in ()
1 # text prompt
----> 2 ann = prompt_process.text_prompt(text='a photo of a dog')
3 prompt_process.plot(annotations=ann,output_path='./output/dogPromptPhoto.jpg',)
/content/drive/MyDrive/Vision/FastSAM/fastsam/prompt.py in text_prompt(self, text)
443 format_results = self._format_results(self.results[0], 0)
444 cropped_boxes, cropped_images, not_crop, filter_id, annotations =
self._crop_image(format_results)
--> 445 clip_model, preprocess = clip.load('ViT-B/32', device=self.device)
446 scores = self.retrieve(clip_model, preprocess, cropped_boxes, text,
device=self.device)
447 max_idx = scores.argsort()
NameError: name 'clip' is not defined
Anfangs habe ich! fährt fort. Ich prüfe
! Python -c "clip importieren; print ('clip ist installiert!')" < /P>
Und das Ergebnis ist in Ordnung. Jede Hilfe wird sehr geschätzt.
Ich verfolge einige Tutorials und habe den folgenden Code in Google Colab: < /p> [code]!pip install matplotlib==3.7.3 !git clone https://github.com/CASIA-IVA-Lab/FastSAM.git !pip -q install -r FastSAM/requirements.txt
ann = prompt_process.everything_prompt() prompt_process.plot(annotations=ann,output_path='./output/dogSegmented.jpg',)
ann = prompt_process.text_prompt(text='a photo of a dog') prompt_process.plot(annotations=ann,output_path='./output/dogPromptPhoto.jpg',) < /code> Alles_Prompt funktioniert gut, und ich sehe das generierte Bild im Ordner. Der text_prompt verursacht jedoch Fehler < /p> NameError Traceback (most recent call last) in () 1 # text prompt ----> 2 ann = prompt_process.text_prompt(text='a photo of a dog') 3 prompt_process.plot(annotations=ann,output_path='./output/dogPromptPhoto.jpg',)
NameError: name 'clip' is not defined [/code] Anfangs habe ich! fährt fort. Ich prüfe ! Python -c "clip importieren; print ('clip ist installiert!')" < /P> Und das Ergebnis ist in Ordnung. Jede Hilfe wird sehr geschätzt.
Ich habe also an einer Anwendung mit Python und TKinter gearbeitet, mit denen jemand eine Offline -LLM verwendet, um Fragen zu Dateien zu stellen, die sie hochladen können. Wir verwenden...
Dies ist die Fehlermeldung, die ich erhalte, wenn ich versuche, das SDK mit cmd zu installieren. Habe es schon oft versucht, kann es aber nicht installieren.
F:\Softwares\softs\Programming\android...
Dies ist die Fehlermeldung, die ich erhalte, wenn ich versuche, das SDK mit cmd zu installieren. Habe es schon oft versucht, kann es aber nicht installieren.
F:\Softwares\softs\Programming\android...
Ich habe versucht, Python verwalten.py Run -Server auszuführen, während ich mit Django gearbeitet habe, nachdem ich meine Einstellungen geändert habe. Py daraus:
DATABASES = {
'default': {
'ENGINE':...