Spaces:
Runtime error
Runtime error
fix image scope
Browse files
app.py
CHANGED
|
@@ -43,6 +43,10 @@ image = None
|
|
| 43 |
if uploaded_image_zero_file is not None:
|
| 44 |
image = Image.open(uploaded_image_zero_file)
|
| 45 |
outputImage = np.array(image)
|
|
|
|
|
|
|
|
|
|
|
|
|
| 46 |
st.image(outputImage)
|
| 47 |
|
| 48 |
if st.button('apply tag'):
|
|
@@ -51,10 +55,6 @@ if st.button('apply tag'):
|
|
| 51 |
#outputs = model(**inputs)
|
| 52 |
#target_sizes = torch.Tensor([image.size[::-1]])
|
| 53 |
#results = processor.post_process_object_detection(outputs=outputs, threshold=0.1, target_sizes=target_sizes)
|
| 54 |
-
predictions = detector(
|
| 55 |
-
image,
|
| 56 |
-
candidate_labels=['eggs', 'apple', 'pear']
|
| 57 |
-
)
|
| 58 |
|
| 59 |
draw = ImageDraw.Draw(image)
|
| 60 |
|
|
|
|
| 43 |
if uploaded_image_zero_file is not None:
|
| 44 |
image = Image.open(uploaded_image_zero_file)
|
| 45 |
outputImage = np.array(image)
|
| 46 |
+
predictions = detector(
|
| 47 |
+
image,
|
| 48 |
+
candidate_labels=['eggs', 'apple', 'pear']
|
| 49 |
+
)
|
| 50 |
st.image(outputImage)
|
| 51 |
|
| 52 |
if st.button('apply tag'):
|
|
|
|
| 55 |
#outputs = model(**inputs)
|
| 56 |
#target_sizes = torch.Tensor([image.size[::-1]])
|
| 57 |
#results = processor.post_process_object_detection(outputs=outputs, threshold=0.1, target_sizes=target_sizes)
|
|
|
|
|
|
|
|
|
|
|
|
|
| 58 |
|
| 59 |
draw = ImageDraw.Draw(image)
|
| 60 |
|