Spaces:
Running
Running
phyloforfun
commited on
Commit
•
7a02b0a
1
Parent(s):
c6639d6
updates
Browse files- VoucherVision_Reference.yaml +0 -103
- create_desktop_shortcut.py +0 -69
- install_dependencies.sh +0 -85
- requirements_conda.txt +0 -0
- requirements_with_versions.txt +0 -0
VoucherVision_Reference.yaml
DELETED
@@ -1,103 +0,0 @@
|
|
1 |
-
# To use default value, set to null
|
2 |
-
leafmachine:
|
3 |
-
|
4 |
-
use_RGB_label_images: True
|
5 |
-
|
6 |
-
do:
|
7 |
-
check_for_illegal_filenames: False
|
8 |
-
check_for_corrupt_images_make_vertical: False
|
9 |
-
print:
|
10 |
-
verbose: True
|
11 |
-
optional_warnings: True
|
12 |
-
|
13 |
-
logging:
|
14 |
-
log_level: null
|
15 |
-
|
16 |
-
|
17 |
-
# Overall Project Input Settings
|
18 |
-
project:
|
19 |
-
# Image to Process
|
20 |
-
dir_images_local: 'D:\Dropbox\LM2_Env\VoucherVision_Datasets\2022_09_07_thru12_S3_jacortez_AllAsia' # 'D:/Dropbox/LM2_Env/VoucherVision_Datasets/Compare_Set_Easy_10imgs/imgs' #'D:\D_Desktop\Richie\Imgs' #'D:/Dropbox/LM2_Env/Image_Datasets/Acacia/Acacia_prickles_4-26-23_LANCZOS/images/short' #'D:\D_Desktop\Richie\Imgs' #'home/brlab/Dropbox/LM2_Env/Image_Datasets/Manuscript_Images' # 'D:\Dropbox\LM2_Env\Image_Datasets\SET_FieldPrism_Test\TESTING_OUTPUT\Images_Processed\REU_Field_QR-Code-Images\Cannon_Corrected\Images_Corrected' # 'F:\temp_3sppFamily' # 'D:/Dropbox/LM2_Env/Image_Datasets/GBIF_BroadSample_3SppPerFamily' # SET_Diospyros/images_short' # 'D:/Dropbox/LM2_Env/Image_Datasets/SET_Diospyros/images_short' #'D:\Dropbox\LM2_Env\Image_Datasets\GBIF_BroadSample_Herbarium' #'D:/Dropbox/LM2_Env/Image_Datasets/SET_Diospyros/images_short' # str | only for image_location:local | full path for directory containing images
|
21 |
-
# dir_images_local: 'D:/Dropbox/LM2_Env/VoucherVision_Datasets/Compare_Set_Easy_10imgs/imgs' #'D:\D_Desktop\Richie\Imgs' #'D:/Dropbox/LM2_Env/Image_Datasets/Acacia/Acacia_prickles_4-26-23_LANCZOS/images/short' #'D:\D_Desktop\Richie\Imgs' #'home/brlab/Dropbox/LM2_Env/Image_Datasets/Manuscript_Images' # 'D:\Dropbox\LM2_Env\Image_Datasets\SET_FieldPrism_Test\TESTING_OUTPUT\Images_Processed\REU_Field_QR-Code-Images\Cannon_Corrected\Images_Corrected' # 'F:\temp_3sppFamily' # 'D:/Dropbox/LM2_Env/Image_Datasets/GBIF_BroadSample_3SppPerFamily' # SET_Diospyros/images_short' # 'D:/Dropbox/LM2_Env/Image_Datasets/SET_Diospyros/images_short' #'D:\Dropbox\LM2_Env\Image_Datasets\GBIF_BroadSample_Herbarium' #'D:/Dropbox/LM2_Env/Image_Datasets/SET_Diospyros/images_short' # str | only for image_location:local | full path for directory containing images
|
22 |
-
image_location: 'local'
|
23 |
-
|
24 |
-
continue_run_from_partial_xlsx: 'D:\Dropbox\LM2_Env\VoucherVision_Datasets\POC_chatGPT__2022_09_07_thru12_S3_jacortez_AllAsia\2022_09_07_thru12_S3_jacortez_AllAsia\Transcription\transcribed.xlsx'
|
25 |
-
# continue_run_from_partial_xlsx: null
|
26 |
-
|
27 |
-
# Project Output Dir
|
28 |
-
dir_output: 'D:/Dropbox/LM2_Env/VoucherVision_Datasets/POC_chatGPT__2022_09_07_thru12_S3_jacortez_AllAsia' # 'D:/Dropbox/LM2_Env/Image_Datasets/TEST_LM2' # 'D:\D_Desktop\Richie\Richie_Out'
|
29 |
-
run_name: 'POC_chatGPT' #'images_short_TEST' #'images_short_landmark'
|
30 |
-
|
31 |
-
prefix_removal: 'MICH-V-'
|
32 |
-
suffix_removal: ''
|
33 |
-
catalog_numerical_only: True
|
34 |
-
|
35 |
-
# Embeddings and LLM
|
36 |
-
use_domain_knowledge: True
|
37 |
-
embeddings_database_name: 'EmbeddingsDB_all_asia_minimal_InRegion'
|
38 |
-
build_new_embeddings_database: False
|
39 |
-
path_to_domain_knowledge_xlsx: 'D:\Dropbox\LeafMachine2\leafmachine2\transcription\domain_knowledge/AllAsiaMinimalasof25May2023_2__InRegion.xlsx' #'D:/Dropbox/LeafMachine2/leafmachine2/transcription/domain_knowledge/AllAsiaMinimalasof25May2023_2__TRIMMEDtiny.xlsx'
|
40 |
-
|
41 |
-
batch_size: 500 #null # null = all
|
42 |
-
num_workers: 1 # int |DEFAULT| 4 # More is not always better. Most hardware loses performance after 4
|
43 |
-
|
44 |
-
modules:
|
45 |
-
specimen_crop: True
|
46 |
-
|
47 |
-
LLM_version: 'chatGPT' # from 'chatGPT' OR 'PaLM'
|
48 |
-
|
49 |
-
cropped_components:
|
50 |
-
# empty list for all, add to list to IGNORE, lowercase, comma seperated
|
51 |
-
# archival |FROM|
|
52 |
-
# ruler, barcode, colorcard, label, map, envelope, photo, attached_item, weights
|
53 |
-
# plant |FROM|
|
54 |
-
# leaf_whole, leaf_partial, leaflet, seed_fruit_one, seed_fruit_many, flower_one, flower_many, bud, specimen, roots, wood
|
55 |
-
do_save_cropped_annotations: True
|
56 |
-
save_cropped_annotations: ['label','barcode'] # 'save_all' to save all classes
|
57 |
-
save_per_image: False # creates a folder for each image, saves crops into class-names folders # TODO
|
58 |
-
save_per_annotation_class: True # saves crops into class-names folders
|
59 |
-
binarize_labels: False
|
60 |
-
binarize_labels_skeletonize: False
|
61 |
-
|
62 |
-
data:
|
63 |
-
save_json_rulers: False
|
64 |
-
save_json_measurements: False
|
65 |
-
save_individual_csv_files_rulers: False
|
66 |
-
save_individual_csv_files_measurements: False
|
67 |
-
include_darwin_core_data_from_combined_file: False
|
68 |
-
do_apply_conversion_factor: False ###########################
|
69 |
-
|
70 |
-
overlay:
|
71 |
-
save_overlay_to_pdf: True
|
72 |
-
save_overlay_to_jpgs: True
|
73 |
-
overlay_dpi: 300 # int |FROM| 100 to 300
|
74 |
-
overlay_background_color: 'black' # str |FROM| 'white' or 'black'
|
75 |
-
|
76 |
-
show_archival_detections: True
|
77 |
-
ignore_archival_detections_classes: []
|
78 |
-
show_plant_detections: True
|
79 |
-
ignore_plant_detections_classes: ['leaf_whole', 'specimen'] #['leaf_whole', 'leaf_partial', 'specimen']
|
80 |
-
show_segmentations: True
|
81 |
-
show_landmarks: True
|
82 |
-
ignore_landmark_classes: []
|
83 |
-
|
84 |
-
line_width_archival: 2 # int
|
85 |
-
line_width_plant: 6 # int
|
86 |
-
line_width_seg: 12 # int # thick = 12
|
87 |
-
line_width_efd: 6 # int # thick = 3
|
88 |
-
alpha_transparency_archival: 0.3 # float between 0 and 1
|
89 |
-
alpha_transparency_plant: 0
|
90 |
-
alpha_transparency_seg_whole_leaf: 0.4
|
91 |
-
alpha_transparency_seg_partial_leaf: 0.3
|
92 |
-
|
93 |
-
# Configure Archival Component Detector
|
94 |
-
archival_component_detector:
|
95 |
-
# ./leafmachine2/component_detector/runs/train/detector_type/detector_version/detector_iteration/weights/detector_weights
|
96 |
-
detector_type: 'Archival_Detector'
|
97 |
-
detector_version: 'PREP_final'
|
98 |
-
detector_iteration: 'PREP_final'
|
99 |
-
detector_weights: 'best.pt'
|
100 |
-
minimum_confidence_threshold: 0.5
|
101 |
-
do_save_prediction_overlay_images: True
|
102 |
-
ignore_objects_for_overlay: [] # list[str] # list of objects that can be excluded from the overlay # all = null
|
103 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
create_desktop_shortcut.py
DELETED
@@ -1,69 +0,0 @@
|
|
1 |
-
import os, sys
|
2 |
-
import win32com.client
|
3 |
-
import tkinter as tk
|
4 |
-
from tkinter import filedialog
|
5 |
-
from PIL import Image, ImageEnhance
|
6 |
-
|
7 |
-
def create_shortcut():
|
8 |
-
# Request user's confirmation
|
9 |
-
confirmation = input("Do you want to create a shortcut for the VoucherVision? (y/n): ")
|
10 |
-
|
11 |
-
if confirmation.lower() != "y":
|
12 |
-
print("Okay, no shortcut will be created.")
|
13 |
-
return
|
14 |
-
|
15 |
-
# Get the script path
|
16 |
-
script_path = os.path.abspath(__file__)
|
17 |
-
# Get the directory of the script
|
18 |
-
script_dir = os.path.dirname(script_path)
|
19 |
-
|
20 |
-
# Path to the icon file
|
21 |
-
icon_path = os.path.join(script_dir, 'img', 'icon.jpg')
|
22 |
-
img = Image.open(icon_path)
|
23 |
-
enhancer = ImageEnhance.Color(img)
|
24 |
-
img_enhanced = enhancer.enhance(1.5)
|
25 |
-
img_enhanced.save(os.path.join(script_dir, 'img', 'icon.ico'), format='ICO', sizes=[(256,256)])
|
26 |
-
icon_path_ico = os.path.join(script_dir, 'img', 'icon.ico')
|
27 |
-
|
28 |
-
# Construct the path to the static folder
|
29 |
-
static_dir = os.path.join(script_dir, "static")
|
30 |
-
|
31 |
-
# Ask for the name of the shortcut
|
32 |
-
shortcut_name = "Voucher Vision"
|
33 |
-
|
34 |
-
root = tk.Tk()
|
35 |
-
root.withdraw() # Hide the main window
|
36 |
-
|
37 |
-
root.update() # Ensures that the dialog appears on top
|
38 |
-
folder_path = filedialog.askdirectory(title="Choose location to save the shortcut")
|
39 |
-
print(f"Shortcut will be saved to {folder_path}")
|
40 |
-
|
41 |
-
venv_path = filedialog.askdirectory(title="Choose the location of your Python virtual environment")
|
42 |
-
print(f"Using virtual environment located at {venv_path}")
|
43 |
-
|
44 |
-
# Path to the activate script in the venv
|
45 |
-
activate_path = os.path.join(venv_path, "Scripts")
|
46 |
-
|
47 |
-
shortcut_path = os.path.join(folder_path, f'{shortcut_name}.lnk')
|
48 |
-
|
49 |
-
shell = win32com.client.Dispatch("WScript.Shell")
|
50 |
-
shortcut = shell.CreateShortCut(shortcut_path)
|
51 |
-
shortcut.Targetpath = "%windir%\System32\cmd.exe"
|
52 |
-
# The command activates the venv, navigates to the script's directory, then runs the script
|
53 |
-
# shortcut.Arguments = f'/K "{activate_path} & cd /D {os.path.dirname(script_path)} & streamlit run VoucherVisionEditor.py"'
|
54 |
-
# shortcut.Arguments = f'/K "{activate_path} & cd /D {static_dir} & start cmd /c python -m http.server & cd /D {script_dir} & streamlit run VoucherVisionEditor.py"'
|
55 |
-
streamlit_exe = os.path.join(venv_path, "Scripts","streamlit")
|
56 |
-
print(script_dir)
|
57 |
-
print(streamlit_exe)
|
58 |
-
activate_path = os.path.join(script_dir,"venv_VV","Scripts")
|
59 |
-
print(activate_path)
|
60 |
-
shortcut.Arguments = f'/K cd /D ""{activate_path}"" && activate && cd /D ""{script_dir}"" && python run_VoucherVision.py'
|
61 |
-
# Set the icon of the shortcut
|
62 |
-
shortcut.IconLocation = icon_path_ico
|
63 |
-
|
64 |
-
shortcut.save()
|
65 |
-
|
66 |
-
print(f"Shortcut created with the name '{shortcut_name}' in the chosen directory.")
|
67 |
-
|
68 |
-
if __name__ == "__main__":
|
69 |
-
create_shortcut()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
install_dependencies.sh
DELETED
@@ -1,85 +0,0 @@
|
|
1 |
-
#!/bin/bash
|
2 |
-
|
3 |
-
# List of packages to be installed
|
4 |
-
packages=(
|
5 |
-
wheel
|
6 |
-
gputil
|
7 |
-
streamlit
|
8 |
-
streamlit-extras
|
9 |
-
streamlit-elements==0.1.*
|
10 |
-
plotly
|
11 |
-
google-api-python-client
|
12 |
-
wikipedia
|
13 |
-
PyMuPDF
|
14 |
-
craft-text-detector
|
15 |
-
pyyaml
|
16 |
-
Pillow
|
17 |
-
bitsandbytes
|
18 |
-
accelerate
|
19 |
-
mapboxgl
|
20 |
-
pandas
|
21 |
-
matplotlib
|
22 |
-
matplotlib-inline
|
23 |
-
tqdm
|
24 |
-
openai
|
25 |
-
langchain
|
26 |
-
langchain-community
|
27 |
-
langchain-core
|
28 |
-
langchain_mistralai
|
29 |
-
langchain_openai
|
30 |
-
langchain_google_genai
|
31 |
-
langchain_experimental
|
32 |
-
jsonformer
|
33 |
-
vertexai
|
34 |
-
ctransformers
|
35 |
-
google-cloud-aiplatform
|
36 |
-
tiktoken
|
37 |
-
llama-cpp-python
|
38 |
-
openpyxl
|
39 |
-
google-generativeai
|
40 |
-
google-cloud-storage
|
41 |
-
google-cloud-vision
|
42 |
-
opencv-python
|
43 |
-
chromadb
|
44 |
-
chroma-migrate
|
45 |
-
InstructorEmbedding
|
46 |
-
transformers
|
47 |
-
sentence-transformers
|
48 |
-
seaborn
|
49 |
-
dask
|
50 |
-
psutil
|
51 |
-
py-cpuinfo
|
52 |
-
Levenshtein
|
53 |
-
fuzzywuzzy
|
54 |
-
opencage
|
55 |
-
geocoder
|
56 |
-
pycountry_convert
|
57 |
-
)
|
58 |
-
|
59 |
-
# Function to install a single package
|
60 |
-
install_package() {
|
61 |
-
package=$1
|
62 |
-
echo "Installing $package..."
|
63 |
-
pip3 install $package
|
64 |
-
if [ $? -ne 0 ]; then
|
65 |
-
echo "Failed to install $package"
|
66 |
-
exit 1
|
67 |
-
fi
|
68 |
-
}
|
69 |
-
|
70 |
-
# Install each package individually
|
71 |
-
for package in "${packages[@]}"; do
|
72 |
-
install_package $package
|
73 |
-
done
|
74 |
-
|
75 |
-
echo "All packages installed successfully."
|
76 |
-
echo "Cloning and installing LLaVA..."
|
77 |
-
|
78 |
-
|
79 |
-
cd vouchervision
|
80 |
-
git clone https://github.com/haotian-liu/LLaVA.git
|
81 |
-
cd LLaVA # Assuming you want to run pip install in the LLaVA directory
|
82 |
-
pip install -e .
|
83 |
-
git pull
|
84 |
-
pip install -e .
|
85 |
-
echo "LLaVA ready"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
requirements_conda.txt
DELETED
Binary file (1.97 kB)
|
|
requirements_with_versions.txt
DELETED
Binary file (11.1 kB)
|
|